cancel
Showing results for 
Search instead for 
Did you mean: 

Tried but could not display photo on portal

udaykumar_kanike
Active Contributor
0 Kudos

Hi Experts,

I am trying to display a photo on portal. But I am getting "X" mark in the image window. I am using the following code.

Please correct me if i am wrong

image.setIm_Photo("X");

image.setPernr(wdContext.currentOutput_usernameElement().getEmployeenumber());

wdThis.wdGetZHR_P_Emp_Details_CompController().executeZhr_Fm_Ess_Photo_Input();

IWDResource resource = WDResourceFactory.createCachedResource(wdContext.currentZhr_Fm_Ess_Photo_InputElement().getIm_Photo(),"JPG",WDWebResourceType.JPG_IMAGE,true);

IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.toString(),"Image Window");

window.show();

The only limitation in my case is that RFC does not return any export parameters. once it is executed, it straightaway displays image.

Please someone help me.

Regards

Uday

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Uday, you are trying to load data from input class, you should load from output. There is always one class association with name Output. In case you have table in your RFC interface there are two relations are generated in the model: one in executable class and one the output class (Output relation). So after you execute the model class you should load data from the model class associated with output model class.

udaykumar_kanike
Active Contributor
0 Kudos

Hi Maksim ,

I have only imported the Input node of the Adaptive RFC. Do you mean that I have to do context binding for both input as well as output node as well. Or else, do you mean to say to bind with output node of my Input RFC node. If this is the case then I dont have any attribute under output node of either Input RFC node or output RFC node. Because, the person who created RFC dint maintain any export parameters.

Please help me in this regard.

Thanks

Uday

former_member182372
Active Contributor
0 Kudos

Do you mean that I have to do context binding for both input as well as output node as well. Or else, do you mean to say to bind with output node of my Input RFC node. If this is the case then I dont have any attribute under output node of either Input RFC node or output RFC node. Because, the person who created RFC dint maintain any export parameters.

If you have tables in your RFC there will be 2 relations: input and output. If you need to supply table parameters you have to use input relation, if you need to get table - you have to use output relation.

udaykumar_kanike
Active Contributor
0 Kudos

Hi All,

Someone please help me with WDJ code to display photo on portal. This photo I would be getting dynamically from RFC.

Please help me.

Early response would be much appreciated.

Thanks

Uday

former_member182372
Active Contributor
0 Kudos

image.setIm_Photo("X");
image.setPernr(wdContext.currentOutput_usernameElement().getEmployeenumber());
wdThis.wdGetZHR_P_Emp_Details_CompController().executeZhr_Fm_Ess_Photo_Input();

IWDResource resource = WDResourceFactory.createCachedResource(

wdContext.currentZhr_Fm_Ess_Photo_InputElement().getOutput().getIm_Photo(),
"JPG",
WDWebResourceType.JPG_IMAGE,
true);

IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.toString(),"Image Window");
window.show();
udaykumar_kanike
Active Contributor
0 Kudos

Hi Maksim ,

Please find the service controller suggestion in the below screen shot.

View Context - http://www.freeimagehosting.net/wxmvv

Service Controller suggestion - http://www.freeimagehosting.net/ajmpt

This is where i am struck. Please help me

Regards

Uday

former_member182372
Active Contributor
0 Kudos

Under zhr_fm_ess_photo_input should be an output node. Right click on zhr_fm_ess_photo_input (in original controller, not the mapped one on your screenshot, probably component controller) and select Edit model binding, select Output model class (rename if there is one already with the same name).

Every executable model class (zhr_fm_ess_photo_input in your case) must have Output relation.

Well, you can do it even without these steps:


wdContext.currentZhr_Fm_Ess_Photo_InputElement().modelClass().getOutput().getIm_Photo()

udaykumar_kanike
Active Contributor
0 Kudos

Hi Maksim,

I do agree that there should be atleast one attribute under Output node. But in my case, RFC is designed in such a way that it first creates a container and then displays the message directly into the container based on document class and document type (its usually JPG format). This RFC does get a document id from TOAHR table. So, the person who wrote RFC did not maintained any export parameters in the RFC, hence I cannot see any attribute under Output node.

http://www.freeimagehosting.net/yt69b

Please suggest me if any modifications to RFC would help resolve this issue.

Thanks

Uday

former_member182372
Active Contributor
0 Kudos

Uday, are you saying that RFC has no export and no tables parameters? How are parameters supposed to pass back to WD?

udaykumar_kanike
Active Contributor
0 Kudos

Hi Maksim,

I resolved this issue with the help of an ABAPer internally which is explained in the below thread of mine.

http://forums.sdn.sap.com/thread.jspa?threadID=2130257&tstart=0

Thanks for your help.

Regards

Uday

Answers (0)