How to read URL Parameters in ABAP WebDynpro ?
Hi,
How and where (which class, method) in ABAP WebDynpro we can read URL Parameters ? I found answers for WebDynpro JAVA but nothing for ABAP.
Thanks
Meenal
Hi Meenal,
Please see a post by Sanjay Agarwal titled 'Sequencing Problem in Web Dynpro ABAP'. I believe you will find your answer there.
Cheers,
Rich
Similar Messages
-
Reading URL parameters in ABAP webdynpro
I have a requirements to run my ABAP Webdynpro application view based on two parameters passed to it from portal. How can I read the parameters in ABAP webdynpro and use them to write my condition in the run time. I would appreciate it if someone has any code that would help me also.
Again your help and support is highly appreciated.
LilyHi Lily,
To read the URL parameters, you need to right the following code in the HANDLEDEFAULT method
of the your default window controller.
DATA : it_parameter TYPE tihttpnvp,
wa_parameter TYPE ihttpnvp.
DATA lo_nd_url_param TYPE REF TO if_wd_context_node.
DATA ls_url_param TYPE wd_this->element_url_param.
" Get all URL parameters
CALL METHOD wdevent->get_data
EXPORTING
name = if_wd_application=>all_url_parameters
IMPORTING
value = it_parameter.
" Get parameter values
CLEAR wa_parameter.
READ TABLE it_parameter WITH KEY name = 'PERNR' INTO wa_parameter.
IF sy-subrc EQ 0.
ls_url_param-pernr = wa_parameter-value.
ENDIF.
CLEAR wa_parameter.
READ TABLE it_parameter WITH KEY name = 'SUBTY' INTO wa_parameter.
IF sy-subrc EQ 0.
ls_url_param-subty = wa_parameter-value.
ENDIF.
CLEAR wa_parameter.
READ TABLE it_parameter WITH KEY name = 'BEGDA' INTO wa_parameter.
IF sy-subrc EQ 0.
ls_url_param-begda = wa_parameter-value.
ENDIF.
CLEAR wa_parameter.
READ TABLE it_parameter WITH KEY name = 'ZZPRNTOPT' INTO wa_parameter.
IF sy-subrc EQ 0.
ls_url_param-zzprntopt = wa_parameter-value.
ENDIF.
" Save URL parameter to context
lo_nd_url_param = wd_context->get_child_node( name = wd_this->wdctx_url_param ).
lo_nd_url_param->set_static_attributes(
static_attributes = ls_url_param ).
Regards,
Vikrant -
How to read URL parameters of one wdp component into other WDP component?
Dear Experts,
Can anyone let me know how to read URL parameters of one wdp component into other WDP component?
My requirement is i have one standard WDP component with 3 URL parameters and i needto
read that URL parameters along with their values in my Z-WDP component.
Thanks
SKHi Santosh,
You can read parameters send from one WebDynpro Component to another component by adding code in "HANDLEDEFAULT" Event Handler method ( Window )of your target Web Dynpro Component.
data: lt_parameter type tihttpnvp,
ls_parameter type ihttpnvp.
lo_api_controller ?= wd_this->wd_get_api( ).
call method lo_api_controller->get_message_manager
receiving
message_manager = lo_message_manager.
clear : ls_parameter.
refresh : lt_parameter[].
* Read all URL parameters
wdevent->get_data( exporting name = if_wd_application=>all_url_parameters importing value = lt_parameter ).
if not lt_parameter[] is initial.
clear : ls_parameter.
read table lt_parameter into ls_parameter index 1.
if ls_parameter-name = 'ACTION' and
ls_parameter-value is initial.
lv_flag = 'X'.
clear : lo_msg.
lo_msg = 'Action Parameter Missing in URL Link !'.
* report message
call method lo_message_manager->report_error_message
exporting
message_text = lo_msg.
else.
endif.
Best Regards
Priyesh Shah -
Hi All,
How to read URL parameters in another WDA.
Thanks in advancehere is the sample code.
you can write this code in HANDLEDEFAULT method of Default Window of Application being called.
DATA:
wa_url TYPE LINE OF tihttpnvp,
int_url TYPE tihttpnvp.
wdevent->get_data(
EXPORTING
name = if_wd_application=>all_url_parameters
IMPORTING
value = int_url ). -
How to read url parameters from a decoded string
Hi,
Normally if I pass on a url string
test.cfm?name=abc&num=8, I can do url.name and url.num
to get the url parameters. But what if the url string is decoded by
javascript escape() function? The above url string becomes
test.cfm%3Fname%3Dabc%26num%3D8
How can I read url.name and url.num from this string?
Thanks!
MinEscape is not really meant for urls because it encodes the
delimiters: ? &
http://www.w3schools.com/jsref/jsref_encodeURI.asp
http://www.w3schools.com/jsref/jsref_encodeURIComponent.asp -
How to read AL11 parameters in ABAP program
Hello SAP Masters,
I came across a requirement to read AL11 file parameters such as lastchanged day and lastchanged time of a particular file in directory. Can you guide me by providing either the function module name or any table where this information is stored, so that I can utilize something in ABAP program and get this information.
Your help is greatly appreciated!
Regards.Keshav provided the correct response, but since you asked me - this is what AL11 does:
PERFORM p6_to_date_time_tz(rstr0400) USING file-mtime
file-mod_time
file-mod_date.
BTW, that time/second value is the number of seconds since 1970. -
Hi guys!
Is posible read url parameters from a WD for Java?
e.g.: http://server/webdynpro/dispatcher/local/TestApp/TestApp?SAPtestId=1&myVariable=123
Then read value 123 from some code inside WD (controller, view, whatever).
Thanks!Hi,
You can do it, see this reference: Pass URL parameters to SAP Portal from an external application
Best regards -
Custom SICF handler read URL parameters
Hello,
I have written a custom SICF handler.In the SICF handler method of handle request,how do i read URL parameters.
regards
KaushikHi,
Using GET_HEADER_FIELD() / GET_HEADER_FIELDS(), the HTTP request handler can access all attributes of the HTTP header (name/value pairs).
Refer Accessing Header Fields (SAP Library - Components of SAP Communication Technology)
Regards,
Chandra -
Adding and reading the parameters from the WebDynpro Application URL
Hi,
I have a WebDynpro Application with two views. Based on the values populated by the user in the first view, I am pulling the data from database and populating the data in the second view. I do have a scenario where I have to skip the first screen and show the second screen directly. But, for the values that has to be populated in first screen, I am planning to append the parameters in the url and provide the link to the users via email.
Is it possible to add parameters to URL and read those Parameter values when user clicks on the URL.
Thanks & Regards
swetha.HI,
Code for accessing params in webdynpro java:
String urlParamVal = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("URL_PARAMETER");
if((urlParamVal != null) && (urlParamVal.trim().length() > 0))
<Write the code>
Reading parameters:
Re: Reading URL Parameter
How to pass and fetch multiple parameter in the URL of the Web Dynpro
Regards,
Lavanya.G -
How to read the excel file using webdynpro abap?
Hi,
how to read and modify excel file using webdynpro abap?
Regards,
PavaniFor reading excel file follow the steps :
1. Use a File upload UI element and bind it with xstring.
2. Now your excel will be uploaded and stored in Xstring.
3. Convert Xstring to String data using FM 'HR_KR_XSTRING_TO_STRING'.
4. Now split the string at new line so as to make an internal table .
Ex . SPLIT l_string AT cl_abap_char_utilities=>newline INTO TABLE it_table.
here it_table is type table of string.
5.now loop at the internal table and separate the content of this table separated by tab.
Ex. SPLIT wa_table AT cl_abap_char_utilities=>horizontal_tab INTO TABLE it_new.
it_new type string_table.
6. For more info , refer this thread :
Re: How to upload excel file in Webdynpro application using ABAP -
HTTP Sender - how to read URL Parameter USER id into Mapping
Hi,
My scenario is HTTP - XI - ABAP Proxy.
I wanted to capture USER id of the person who posted(HTTP) into XI(Mapping). How to read/evaluate the value of sap-user from querystring of URL ?
http://HOST:8008/sap/xi/adapter_plain?namespace=http%3A//abc.com/sales_oa&interface=MI_sales_OA&service=DEV_D&party=&agency=&scheme=&QOS=EO&<b>sap-user=SM9999</b>&sap-password=xxxxx&sap-client=001&sap-language=EN
please help.Mallik,
Try URL Parameters in HTTP sender communication channel.
In the sender communication channel set Adapter Specific Message Attributes. Click on Apply URL Parameters. In Parameter1 put sap-user (U can query any URL parameter by giving its name as in the HTTP URL).
Now in SXMB_MONI, in inbound payload SOAP Header, under Dynamic configuration u can see the value of the user. Query the same in Mapping using Dynamic Configuration using keyName as UrlParamOne.
Regards,
Sudharshan N A
Message was edited by:
Sudharshan Aravamudan -
Reading Task Container in ABAP Webdynpro
Hi All,
I have to read the task container in ABAP Webdynpro to show the details on a ABAP interactive form which is embedded in WDA. For this I have approached in the following way.
1) Task is configured in SWFVISU with DYNPARM = WI_ID=${item.externalId}
2) Workitem is obtained in UWL and ABAPWebDynpro is launched when Task is executed from UWL
3) START is the "startup" plug that triggers the HANDLESTART method
This method has WDEVENT as a standar parameter. Then the following code is for reading the URL parameters.
wdevent->get_data(
EXPORTING
name = if_wd_application=>all_url_parameters
IMPORTING
value = l_url_parameters ).
READ TABLE l_url_parameters WITH KEY name = 'WI_ID' INTO l_url_parameter.
4) Set the WI_ID to a componentcontroller attribute
5) This attirbute is now binded to the WDDOMODIFYVIEW method of the View
6) Finally set the form elements attributes of the VIEW by reading the container based on the WI_ID
Problems:
1) I am not getting the form populated
2) The form is getting populated if I hardcode the WI_ID and execute the application directly from backend.
Please tell me where I might have gone wrong.
Thanks
Debsolved by self
-
Read URL parameter of my webDynpro application ?
Hi,
How to read the URL parameter of my webDynpro application from within the webDynpro Application code ??
Example : My application URL is : "http://ldai99wdd:50000/webdynpro/dispatcher/local/target/TargetApp?SAPtestId=38
&sap-wd-resumeurl=http%3A%2F%2Fldai99wdd%3A50000%2Fwebdynpro%2Fdispatcher%2Flocal%2Fplugs%2FTest%3Fsap-wd-cltwndid%3D1c175200265c11ddc21900300571b288%26sap-wd-appwndid%3D1c175201265c11ddaa3a00300571b288%26sap-wd-resume%3Dtrue"
I want to read the Parameter sap-wd-resumeurl.
Regards,
MaheshHi,
You can use the following code to get parameters from an URL
IWDProtocolAdapter protocolAdapter = WDProtocolAdapter.getProtocolAdapter();
IWDRequest request = protocolAdapter.getRequestObject();
String paramValue1 = request.getParameter("<URL Parameter name>");
Re: Web Dynpro URL-Invocation with umlauts (like %FC) in the url
http://help.sap.com/saphelp_nw2004s/helpdata/en/44/be65751c743959e10000000a1553f6/content.htm
Thanks n Regards,
Jhansi Miryala -
How to display HTML files using ABAP Webdynpro?
Hi,
I have a html index file and a bunch of other files accessed by the index file in a specific directory on the SAP server. I'd like to display the index file via ABAP webdynpro and allow the users to click on what they need to see. How can I achieve this using utilizing the ABAP webdynpro technology ?
Thanks!Hi Thomas,
Thanks for taking the time to answer my question.
I have the main html file and all other files needed by the main file in one directory on the application layer of SAP. I'd like to provide the user with a link, by clicking on which they should be able to get to the main html file using the browser. This is just a standalone application.
I can try the approach using BSPs, however, I'm new to that area. Could you point me in the right direction to get started? -
How to get workitem id in ABAP-Webdynpro application
Hai All,
When a user clicks on a work item in universal worklist, a ABAP-Webdynpro screen is called. I want to pass the workitem number to this ABAP-Webdynpro application.
Please let me know how to pass this.
Thanks & Regards,
H.K.Hayath Basha.Hai Kari,
Thanks for the link, i am looking into it.
Hai Naresh,
Where should I give this link,
http://abc.com:8001/sap/bc/webdynpro/sap/ztest? param1= Val
What I have done is,
In SWFVISU transaction I maintained the following entry,
Task = TS99000208
Visualization Type = WD_ABAP
Visualization Parameter Visualization Parameter value
APPLICATION = ZWD_OFFICIAL_012
NAMESPACE = SAP
and registered this task in in universal worklist.
Where the specify the code you mentioned.
Thanks & Regards,
H.K.Hayath Basha.
Maybe you are looking for
-
Bit of a story but need help !!
right so the story is that one day i was walking and fell and my ipod flew out of my pocket and landed on the road , the bottom part of my headlhones broke off and now its stuck in the ipod - i think the part is called a jack im not so sure . also th
-
Hi All, I am new to XML Publisher reports. Is there any editor which can write XML code for XML Publisher reports designed for Oracle Application? Appreciate any help or pointer to the help. Thanks, - CAH
-
Just thought I!d post this . I recently bought a new mini . I am running an old 20 inch Cinema display. I bought all the relevant adapters, but the mini would not go to sleep. I could put it to sleep manually, but when trying to wake it by using the
-
Authentication on FMS 3.0.1
Ok, I have a windows server(2003) with FMS 3.01 and already installed Authentication Add-in (3)... Already open' up a command prompt and added users using users.exe ($ROOT/conf) and checking them after, but when i go and publish something with FMLE 3
-
Time Machine can't back up to Time Capsule because disk is not found
Hello all. I have been using TC as my router for a few years and backing up to it. I got a new router through my IP which I think might be faster so just want to use TC as backup. However, I'm not sure what I'm doing wrong. I connected the TC to the