cancel
Showing results for 
Search instead for 
Did you mean: 

how i pass parameters in url and how i will get that parameters

Former Member
0 Kudos

Hi Expert,

i want to pass parameter in url how i pass that one and how i get that passed parameter .

Please help me in this thing .

Regards,

Gurprit Bhatia

Message was edited by:

GURPRIT BHATIA

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member197348
Active Contributor
0 Kudos

Hi Gurprit Bhatia,,

Right click on Application-> Edit; Click on Application proprties tab, Click on New button.Selct Self defined, enter parameter name and values.

You can retrive the parameter in WD.

String value = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("PARAM1");

if (value != null && !value.equalsIgnoreCase(""))

{

//DO YOUR CODING

}

regards,

Siva

Former Member
0 Kudos

Thanks Shiva ,

But can u tell me example which name and values passed and how i will get in parameter.

Regards,

Gurprit Bhatia

former_member197348
Active Contributor
0 Kudos

Hi Gurprit Bhatia ,

I have 3 Applications with common parameter called <b>Go</b>, is defined in all three applications but with ddifferent values <i>go,List,disp</i>.

Depending on these values the view is redirected (fire the plug to corresponding view) and set the cotext attribute <b>Disp</b> to <i>true/false</i> for further use.

The is like the following:

IWDApplicationPropertyInfo prop=
wdComponentAPI.getComponent().getApplication().getApplicationInfo().findInApplicationProperties("Go");
		String value = prop.getValue();
	if(value.equalsIgnoreCase("go"))
		{
			wdThis.wdFirePlugQuit();
			wdThis.wdGetOTFController().wdGetContext().currentContextElement().setDisp(false);
		} 
	else if(value.equalsIgnoreCase("List"))
	{
		wdThis.wdFirePlugTolist();
		wdThis.wdGetOTFController().wdGetContext().currentContextElement().setDisp(false);
		} 
	else if(value.equalsIgnoreCase("disp"))
	{
		wdThis.wdFirePlugQuit();
		wdThis.wdGetOTFController().wdGetContext().currentContextElement().setDisp(true);
		}

regards,

Siva

Former Member
0 Kudos

Hi,

You can send URL parameters to a Web Dynpro page in the following ways:

&#9679; Add to the URL a parameter called DynamicParameter, whose value is a set of key-value pairs to send to the page.

The following is the format for the DynamicParameter parameter:

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

The value ("param1=value1&param2=value2&") must be URL encoded.

&#9679; Add to the URL parameters that start with sap-.

&#9679; Add parameters to the businessParameters parameter of the navigateAbsolute() or navigateRelative() method, as described in Absolute Navigation and Relative Navigation.

Regards

Ayyapparaj

Former Member
0 Kudos

Thanks Ayyapparaj KV,

Please send me this code with example.

I tried it but my web dynpro url link is not showing this.And at where i have to put this code.

Please help me in that.

Regards,

Gurprit Bhatia

Message was edited by:

GURPRIT BHATIA

former_member197348
Active Contributor
0 Kudos

Hi Gurprit ,

In wdDoInit() of Component Controller or default View you can use this code. You can define the parameter (any name you like) of type String.

Once you deploy the application you can see this in your applicationURL in the browser.

Try to explain what is your objective, then we can give some more specific answer.

Best regards,

Siva

Former Member
0 Kudos

Sorry my url link can not be updated,

http://epd:50000/webdynpro/dispatcher/local/DynPro6/DynPro6?SAPtestId=15

It is showing like that. Why i dont get pass parameter name and value on that.

Please help me in that.

Regars,

Gurprit Bhatia

vikas_saxena3
Participant
0 Kudos

Hi,

You can pass like this..

strURL = http://server:port?DynamicParameter=Guid="+value;

and access the Guid as.

request.getParameter("Guid");

Hope It ll solve ur problem.

- Vikas

former_member197348
Active Contributor
0 Kudos

HI Gurprit Bhatia,

I have been working this scenario for last one year successfully. This is the most convenient and controlled manner to pass parameters to iViews.

Create One more Application Dynpro7App in Dynpro project [ We can have more than one application in a project for same component].

1.Right click on Dynpro7App -> select Edit.

2.Click on Application proprties tab, Click on New button.

3.Select Self defined radio button, enter parameter [param1] name and value [test] Click Finish.

4. Select Dynpro7App ,Right click select deploy and Run (See whether any change in URL).

5. If Yes (Most cases), Go with coding as in my previous post to obtain param1 in wdDoInit() of component controller.

6.If No(Hope this couldn't be the case), Try with new project.

Note:Your URL should be

http://epd:50000/webdynpro/dispatcher/local/DynPro6/DynPro6 Leave this part <b>?SAPtestId=15</b>.

regards,

Siva

Former Member
0 Kudos

Hi,

String paramValue = "Test";

String url = WDURLGenerator.getWorkloadBalancedApplicationURL(wdComponentAPI.getApplication().getDeployableObjectPart());

// append parameters

url = url.concat("?myParameter="+ paramValue);

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

To access parameter

IWDProtocolAdapter protocolAdapter = WDProtocolAdapter.getProtocolAdapter();

IWDRequest request = protocolAdapter.getRequestObject();

String paramValue = request.getParameter("key");

Regards

Ayyapparaj

Former Member
0 Kudos

Hi

Thanks for help but can u tell me how i pass paramenter in url..

Reagrds,

Gurprit Bhatia