on 08-14-2014 8:51 AM
Hi
I want to create a Change Language button on an webdynpro Application. I know that the parameter is determined during url creation, but i need the to give the user the posibility of changing the language without closing the browser and logging out etc.
My idea is to us an Outbound plug assigned to lets say a Button. The plug is connected to an Inbound plug og the very same Window. So actually the Application will reload.
The action on the button is like this
data: l_language type sy-langu.
l_language = cl_wd_runtime_services=>get_url_parameter( name = 'sap-language' ).
wd_this->fire_language_plg( ).
Then i read the current language - i.ex: E
But of course i will need to change the parameter sap-language to the new language - lets say: K
But how?
Hi,
Use Exit plug and get the WDA application url and concatenate the sap-language to the value you want to change and then pass the final url to the Exit plug.
you can refere this document: Exit plug in WDA
hope this helps,
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use method CONSTRUCT_WD_URL of class CL_WD_UTILITIES and pass the Web Dynpro Component to get the complete URL.
CALL METHOD cl_wd_utilities=>construct_wd_url
EXPORTING
application_name = 'APPL_NAME' " your WDA appl name
IMPORTING
out_absolute_url = lv_url.
Now, you can concatenate language parameter to lv_url and pass this to Exit plug.
hope this helps,
Regards,
Kiran
@Nanreshsing
Well i know how to get er certain paramter - i need the FULL url.
@Kiran
The problem with that method is that i only gives me the Default url of the application. The reason why i need the actually used url, is because i have some Custom parameters in the url.
Would be nice if there was a method to just read the actual url of the call?
Hi,
As far I know, there is no way to get the current url in browser. Alternately, you can get the url parameters and then construct the url with the parameters.
write the below code in HANDLEDEFAULT method of Window:
DATA: lt_parameters TYPE tihttpnvp.
*Get URL params
Wdevent->get_data(
EXPORTING name = if_wd_application=>all_url_parameters
IMPORTING value = lt_parameters ).
*Construct URL
CALL METHOD cl_wd_utilities=>construct_wd_url
EXPORTING
application_name = 'APPL_NAME' " your appl name
it_parameters = lt_parameters " to this params itself you can append the sap-language
IMPORTING
out_absolute_url = lv_url.
Regards,
Kiran
Hi
Yes it´s a solution - but gives me a need to Hardcode something. Your solution would do allright when you are on the Inside of the Company-Network. But if you will allow the users to call the application from the outside world using a public domain it´s not good:
The proposed solution will create an url like this http://sapserver.locdom.local:8000/sap/bc/webdy......
But in my case the url called are: http://app.company.com/sap/bc/webdy...
And even more different if we set up an Alias in SICF.
So i will have to hardcode these server names. Again it would have been much easier if one could just ask the Application: hi - which url have you called me with?
Hi,
There is no other way. There is an internal API which builds the URL, and you can get the public domain by reading the table WDR_TASK=>CLIENT_WINDOW->IF_WDR_CLIENT_INFO_OBJECT~HEADER_FIELDS with key name = 'host'.
But this is an internal api and should not be used, SAP may change it at any time and if it works use it at your own risk considering the future effects.
Regards,
Kiran
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.