cancel
Showing results for 
Search instead for 
Did you mean: 

UI Element for display smartform

Former Member
0 Kudos

Hi All,

I have scenario where I am calling two rfc to display two different smartform. The requirement is that on the click of a link other smartform should be displayed. I have tried linktoaction but it is giving errors. please suggest me what to use and please provide me the code also.

Thanks

Shilpi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi all,

thanks for your responses.

please tell me the procedure for the link to action. Do i need to create and action or separate context element?

what is the procedure for that? no document is helping me

vdurgarao09
Contributor
0 Kudos

Hi,

You need to create action that time you need to pass the parameter data source node.

currElement is variable for data source node.

public  void onActionLinkClicked(..., I<DataSourceNode>Element currElement)

{

  /* do whatever with currelement */

}

After you need to add this code in wdDomodifyView.

wdDoModifyView(...)

{

  if (firstTime)

  {

    IWDLinkToAction link = (IWDLinkToAction) view.getElement("here you need to give the UI LinktoAction ID");

    link.mappingOfOnAction().addSourceMapping("nodeElement", "//currElement in action what you given same you need to pass here.");

  }

}

The above process is applicable to Table level link to action.

Former Member
0 Kudos

Hi Durga,

I tell you what I have done. I have called two RFCs: RFC1 and RFC2 via adaptive model to display two different smartforms, that is working fine. Now i have to display one smartform from RFC2 on a click of a link, for that I have used linktoaction. IS this UI is correct? after data I have set the link tooltip property with PDF1 file. This file needs to created to display smartform and it is string type. After that I used the below mentioned code:

public static void wdDoModifyView(IPrivateZtravel_acc_compView wdThis, IPrivateZtravel_acc_compView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

  {

    //@@begin wdDoModifyView

  if (firstTime)

  {

    IWDLinkToAction link = (IWDLinkToAction)Ztravel_acc_compView.getElement("LinkToAction");

    link.mappingOfOnAction().addSourceMapping("nodeElement", "");

  }

    //@@end

  }

It is incomplete because I dont know what will come in nodeElement and after that and I am getting error for getElement for which I have posted screenshot earlier. Here, there is no table for which i need to create another column.Now tell where I am lacking and a solution for that.

Please help me.

vdurgarao09
Contributor
0 Kudos

Hi,

Your using UI LinktoAction.Here you need to create Event under onAction ,check below code

public void onActiongetPDF(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

  {

     //Call your RFC2 here.

}

No need to use your code in wdDoModifyView.

Former Member
0 Kudos

HI,

I am doing this what about the link?

vdurgarao09
Contributor
0 Kudos

Hi,

May be link to action text and tool tip like two Properties having there you can give any name to be display.Other wise dynamically also display.Here you need to create one String type attribute and bind the text and tool tip.You need to set the attribute in before display of view.Means in comp level doinit()  method exulting first.There  you can set like

wdcontext.currentElement.set---("PDF File");

http://help.sap.com/saphelp_srm40/Helpdata/EN/dd/f7c3f8d5519e41bddbc708594f9479/content.htm

may be this one only way.

this one also not your requirement means.Tell me requirement that time only i can help you.

BR,

Durga.

Former Member
0 Kudos

Hi,

thanks alot now it is working fine. I created action for the linktoaction and in that i wrote for RFC2.

Answers (3)

Answers (3)

vdurgarao09
Contributor
0 Kudos

Hi,

Check this link.

http://help.sap.com/saphelp_nw70/helpdata/en/60/1f1f056f057d4d962375efd3c92ed0/content.htm

Check this  code may be helping for you.

wdDoModifyView(...)

{

  if (firstTime)

  {

    IWDLinkToAction link = (IWDLinkToAction) view.getElement("LinkID");

    link.mappingOfOnAction().addSourceMapping("nodeElement", "currElement");

  }

}

void onActionLinkClicked(..., I<DataSourceNode>Element currElement)

{

  /* do whatever with currelement */

}

vdurgarao09
Contributor
0 Kudos

Hi,

Check this thread may be help for you.

Regards,

Durga.

Former Member
0 Kudos

hi,

thanks for your instant response.

I am able to display smartform but i need code for link.

govardan_raj
Contributor
0 Kudos

hi shilpi ,

here you have done parameter mapping for the link to action , so here

in the action which is binded to the link should have parameter

public void onAction********(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sap.tc.webdynpro.progmodel.api.IWDNodeElement selectedElement )

{

   

}

and in wd modify view method

IWDLinkToAction link = (IWDLinkToAction) view.getElement("LinkToAction4");             

  link.mappingOfOnAction().addSourceMapping("nodeElement","selectedElement");

in your case the

iwdlinktoAction link = (iwdlink...) z...view.getElement("Previous Year");

here Previous Year is wrong , becuase no UI element names have space in between thier ids ,  so make sure that UI element linktoaction name might be Previous_Year or previousyear ...

Regards

Govardan

govardan_raj
Contributor
0 Kudos

hi shilpi ,

Please display the error so that we can know what issue you are facing.

Regards

Govardan

Former Member
0 Kudos

Hi Govardhan,

I am getting the below error.

What is the procedure for the link?