cancel
Showing results for 
Search instead for 
Did you mean: 

getting image(photo) in database to the view

Former Member
0 Kudos

hai all,

please help me in getting the image in the backend (database) (eg photo of employee)to my view.help me with codings and step by step procedure.Any help in this regard will be appreciated.

Regards

Sharanya.R

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Following blog explains this.

/people/anilkumar.vippagunta2/blog/2007/02/20/reading-and-writing-images-from-sqlserver-in-webdynpro

If your database is not the one mentioned, align your driver and datasource to that.

Regards

Ayyapparaj

nikhil_bose
Active Contributor
0 Kudos

you mean from R/3 or other databases?

R/3: you can have an RFC which returns the binary of picture and image can be constructed (from binary) with the same code as in the previous thread.

nikhil

Former Member
0 Kudos

hai Nikhil,

From r/3 only.I need to call an rfc which return the binary (image).Can i set the image in image UI with the coding you provided in previos thread.

Thanks n Regards

Sharanya.R

nikhil_bose
Active Contributor
0 Kudos

yea for sure. once you got the binary you can create cached resource out of it and with the URL of Resource you can get the image.

nikhil

Former Member
0 Kudos

hai Nikhil,

can u give me step by step procedure where Ui elements are created and regarding the context and mappings and then actions (if there) ..where to place ur codings.

Thanks n Regards

Sharanya.R

nikhil_bose
Active Contributor
0 Kudos

place ImageUI in the view and bind it to a context attribute of type string.

If you show only one record, this is enough you can use the code after executing the RFC(getting binary). And the whole thing you can use in the Action part or in DoInit().

If you are getting all the records in table and on lead select you want to show picture, onLeadSelect you execute the RFC which returns the binary.

in the Model Node, create a sub node and an attribute of string. bind that string attribute to Image. Make its property calculated true and read only true. In the get<attribute> method, execute the RFC and do all coding there itself. Thre return value is the URL of Resource.

hope you understand else be specific on requirement

nikhil

Former Member
0 Kudos

hai nikhil,

there is a property called alt for image UI element ...what should be binded there?

Thanks n Regards

Sharanya.R

nikhil_bose
Active Contributor
0 Kudos

you can use the same url string or set to any constant.

nikhil