cancel
Showing results for 
Search instead for 
Did you mean: 

Pass Values between 2 web dynpro applications

Former Member
0 Kudos

Hey,

I have a created an application which display data from table 1, I am capturing the value ON_LEAD_SELECT

and calling another application2,

I wanna be able to export the value selected from applciation1 into

applciation2.

This what I tried to export selected value, it didn't work through:

in application 1:

    • construct a URL

CALL METHOD cl_wd_utilities=>construct_wd_url

EXPORTING

application_name = 'APPLICATION2'

IMPORTING

out_absolute_url = str.

concatenate str '?' 'carrid =' ls_sflight-carrid into str.

  • get reference of window from component

l_cmp_api = wd_comp_controller->wd_get_api( ).

l_window = l_cmp_api->get_window_manager( ).

  • get reference of window of target component

result = l_window->create_external_window(

url = str ).

result->open( ).

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Thomas,

Thanks for the quick reply. I used the method you recommended

call method cl_http_server=>append_field_url

exporting

name = 'carrid'

value = ls_sflight-carrid

changing

url = str.

but Im getting a not-compatible type error , since VALUE is expected to be string.

lets say hypothetically I successfully exported the value from application 1, how can I possibly

read it in application 2

for example:

  • read data

select * from sflight into table lt_data

WHERE carrid = ????.

Thanks

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Hi Thomas,

>

> Thanks for the quick reply. I used the method you recommended

>

> call method cl_http_server=>append_field_url

> exporting

> name = 'carrid'

> value = ls_sflight-carrid

> changing

> url = str.

>

> but Im getting a not-compatible type error , since VALUE is expected to be string.

> lets say hypothetically I successfully exported the value from application 1, how can I possibly

> read it in application 2

> for example:

>

> * read data

> select * from sflight into table lt_data

> WHERE carrid = ????.

>

> Thanks

Whatever value you have, you need to put into string format anyway.

Just declare a temporary string field and move yoru carrid value to it before calling the append_field_url method.

From application 2 you read the URL parameters using the start plug of the window.

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/48/ca3351508f04e7e10000000a42189c/frameset.htm

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/48/b44e6ae8603095e10000000a421937/frameset.htm

Answers (2)

Answers (2)

Former Member
0 Kudos

problem solved, I just forgot to add a parameter in the inbound window to receive the value from appilication2.

Thanks Thomas

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Don't assume that when building the query string that the parameter that you are appending needs a ?

concatenate str '?' 'carrid =' ls_sflight-carrid into str.

When building the URL via cl_wd_utilities=>construct_wd_url, url parameters like SAP-CLIENT are generally added to the query string already. Therefore you would need & instead:

concatenate str '&' 'carrid =' ls_sflight-carrid into str.

However there is an API that will query parameters to the URL for and not only account for & vs. ? but also safe encode the value. I would recommend using it instead:

call method cl_http_server=>append_field_url
          exporting
            name  = 'carrid'
            value = ls_sflight-carrid 
          changing
            url   = str.