cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Parameter

Former Member
0 Kudos

Hi ,

I am trying to pass a parameter 'PERNR' to another Webdynpro Application .

Application1 : Has a table list of 'PERNR' and user selects one of the 'PERNR' and hits a 'GO' button which opens up a new browser 'APPLICATION2' which has the same list of 'PERNR' ( Table ) which should be highlited as the 'PERNR' of App1.

Code in Application 1 :

*Get the relevant values from the table .

call method lo_element->get_attribute

EXPORTING

NAME = 'PERNR'

IMPORTING

VALUE = LV_CHECK

DATA : W_FORM_ACTIONS TYPE STRING.

SELECT SINGLE APPLICATION FROM Z_ACTIONS

INTO W_FORM_ACTIONS

WHERE NOTESEQ = LT_VALUE.

IF SY-SUBRC EQ 0.

CALL METHOD CL_WD_UTILITIES=>CONSTRUCT_WD_URL

EXPORTING

APPLICATION_NAME = W_FORM_ACTIONS

IMPORTING

OUT_ABSOLUTE_URL = STR.

concatenate STR '?' 'PERNR=' LV_CHECK into STR.

l_cmp_api = wd_comp_controller->wd_get_api( ).

l_window1 = l_cmp_api->get_window_manager( ).

result = l_window1->create_external_window(

url = str ).

result->open( ).

ENDIF.

In the URL am passing the 'PERNR' , but not able to capture in Application2 . Any suggestions or sample code would be helpfull.

thanks,

kumar

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

issue closed

Former Member
0 Kudos

Hi,

In the target applicaiton, yuo need to use the WIndow handler (HNALDEDEFALUT) where you can declare the PERNR as Impoting.

Now, in that window defalut handle method

pass this pernr to globale variable.

wd_comp_controller->gv_pernr = pernr.

in the source application -

lv_url           TYPE        string. "URL that you get by passing the applicaiton2 name.

  CONCATENATE lv_url '?' 'PERNR='   lv_check  '&'
                          INTO lv_url.

"You might be missing the Ampersand .

Also check wether when you run the applicaiton, that that pernr value is there in URL or not.

Check out this-

https://www.sdn.sap.com/irj/scn/wiki?path=/display/wdabap/exampleforpassingvaluesfromoneApplicationtoanotherApplicationinWebDynproABAP.

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha ,

I am able to see the pernr in the URL , but in the target window i am getting an error that gv_pernr is not an data element though i declared .

kumar

Former Member
0 Kudos

Hi,

2nd application -

declare a global variable in the GV_PERNR type pernr_d (or as you have already given)

In the window handledefault event pass the URL paramater value to the global vairable.

The name of the URL parameter should be the same. Check it out.

For Other way -

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha ,

The Second application is going to dump , says that ' Inbound Plug DEFAULT Is Not a Startup Plug ' any idea why its giving me an error . Also i do have 2 Windows under the drop down of 'WINDOWS' .

Thanks,

Kumar

Former Member
0 Kudos

Hi,

When you have 2windos in the second application, then based on the requirement create two applications by for 2 windows. In the 1st application, use the application name that you wnat to have the PERNR value.

You can create 2 applications for two windows by giving the WINDOW name and the DEFAULT plug.

This is where it is going wrong.

while creating the application1, give the window name1 and default plug like wise create for 2nd one also.

Now pass the relevant application name for creating URL in source and handel parameters for this application.

Regards,

Lekha.