on 03-31-2009 8:10 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>
> 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
problem solved, I just forgot to add a parameter in the inbound window to receive the value from appilication2.
Thanks Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.