cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass and fetch multiple parameter in the URL of the Web Dynpro

p330068
Active Contributor
0 Kudos
592

Please help me to fetch parameter in runtime from the URL in web dynpro allication. Like

MyApplication?SAPtestId=Arun?SAPtestId=Kumar?Test2=Jaiswal;

I want to fetch the value of the SAPtestId, Test1 and Test2 in the web Dynpro Application.

Please help me on this asap. thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Arun,

You can use the following code to get parameters from an URL

IWDProtocolAdapter protocolAdapter = WDProtocolAdapter.getProtocolAdapter();

IWDRequest request = protocolAdapter.getRequestObject();

String paramValue1 = request.getParameter("SAPtestId");

String paramValue2 = request.getParameter("Test1");

String paramValue3 = request.getParameter("Test2");

And refer to the following link for more information.

http://help.sap.com/saphelp_nw2004s/helpdata/en/44/be65751c743959e10000000a1553f6/content.htm

Thanks n Regards,

Jhansi Miryala

Answers (12)

Answers (12)

p330068
Active Contributor
0 Kudos

Hi Amit,

I am still stuck on the same issue, I can see the option like

> Do not forward these parameters to Web Dynpro

>Property ID

>Inheritance Locked in Target ObjectsCan be Edited in Target Objects

>Property Description

Could you please let which option need to change?

thanks,

Arun

p330068
Active Contributor
0 Kudos

thanks to all of you!!!!!!!!

p330068
Active Contributor
0 Kudos

Thanks A lot Amit!

Ayyapparaj, Jhansi, snehal and Amit thanks a lot for all of you. I have awarded to you for good points.

Thanks,

Arun

Former Member
0 Kudos

Hi Arun,

You must be using some iview which is liinked to your application.When you will open the same iview,you will see properties of the iview.At the top you will see a dropdown .Select "Show all" from the dropdown...

Scroll down throug the properties and there is one property "Frward properties to WebDynpro."Set this propety to *.

Regards,

Amit Bagati

p330068
Active Contributor
0 Kudos

Hi Amit,

Where can i need to make property " Parameters Forwarded to Web Dynpro" in iview to *(set this value there).

Could you please guided me step-by-step.

I will very thankful to you.

Former Member
0 Kudos

Hi,

To resolve the problem of all paramters not getting paased to your application, you need to make one property " Parameters Forwarded to Web Dynpro" of your iview to *(set this value there).Hope this will resolve your problem of parameters not getting passed.

Regards,

Amit

p330068
Active Contributor
0 Kudos

Hi,

I am still facing problem in the getting the url parameter..

?SapTest=4&Test1=Arun&Test2=#Jaiswal..

I am not able to fetch the Test2 value

Please help me asap...

Former Member
0 Kudos

Hi,

Its because # has special meaning try to create url using the urlencode and urldecode methods

http://java.sun.com/j2se/1.4.2/docs/api/java/net/URLEncoder.html

Regards

Ayyapparaj

p330068
Active Contributor
0 Kudos

Hi Jhansi,

I got the clue of your earliar meassage link. I have tried the using & in place of ?. Is working for me now.

One more thing i would like to know.

Is it possibe ot get the default instance of the mail server without authentication.

I have coded like

Properties props = System.getProperties();

props.put("mail.smtp.host", host);

props.put("mail.smtp.auth", "true");

Authenticator auth = new Auth(); <----Class user for authenticate

Session session = Session.getInstance(props, auth);

But i want to use without authentication: ---

-


Properties props = System.getProperties();

props.put("mail.smtp.host", host);

Session session = Session.getDefaultInstance(props);

Please let me know asap if it is possibe ot get the deafult instace of the mail serer.

p330068
Active Contributor
0 Kudos

Hi Snehal,

Actually my requirement is different. I wanted to fetch the sub string parameter from the URl, this url will have to set in sap system. it will call the web dynpro application for sending the mail to sap system. But problem is i am not able to fetch those multiple parameter from the URL. Pease help!!!!!!!!1

Former Member
0 Kudos

Hi,

U have to change URI to some thing as follows

SAPtestId=Arun?SAPtestId=Kumar?Test2=Jaiswal

To

?SAPtestId=Arun&SAPtestId=Kumar&Test2=Jaiswal

Regards

Ayyapparaj

p330068
Active Contributor
0 Kudos

Hi Ayyapparaj and jhansi,

Thanks for the quick response!!

I am trying the same way as you have told but still i am not able to fetch the parameter. I am getting the null vaule for Test1 and Test2 and SAPtestId is blank.

Please advice for the other options!

Thanks,

Arun

Former Member
0 Kudos

Hi Arun,

Go through the link which specifies how to pass parameters to URL

DynamicParameter="param1=value1&param2=value2&"

They must be separated by "&" not "?".

Thanks n Regards,

Jhansi Miryala

snehal_kendre
Active Contributor
0 Kudos

Hi Arun,

Passing parameter to a wen dynpro application is done throught default inbound plug, which exist in interface viewcontroller

and you can access those parameter in implementaion of default inbound plug

To pass parameter

If MainWin is your main window of application then

1.in MainWininterfaceview controller add parameters in default inbound plug.

To access these parameter

1. In implementaion of MainWininterface view right a code to access these parameter

2.Store these parameters in controller context, so you will be access it from any screen

as

public void onPlugDefault(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String SAPtestId )
  {
    //@@begin onPlugDefault(ServerEvent)
set  your controler context with SAPtestId
//@@end
}

Former Member
0 Kudos

Hi,

Use



Ex:MyApplication?SAPtestId=Arun?SAPtestId=Kumar?Test2=Jaiswal;

WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("Key");
 
//:SAPtestId=Arun
String value = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("SAPtestId");

//Above code will return you Arun do the same for others too.

Regards

Ayyapparaj