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.
Lily
Hi 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
Similar Messages
-
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
MeenalHi 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 -
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 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 -
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 ). -
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 -
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 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 -
Need Read URL parameters from Adobe from
Hi all,
I have a specific application where in i need to read the parameters of the iview URL from an adobe form. The adobe form is a stand alone adobe form in KM. Its not developed using netweaver developer studio.
It would of very major help if some one can help me in this regard. Any javascript or formcalc to read iview URL parameters from an adobe form would be of great help.
Thanks in advance.
regards,
Deepthi lakshmi.A.See http://forums.adobe.com/thread/1279496
-
Read URL Parameters programmatically
Hi
I wish to read the URL parameters in the WDDOINIT method of the component controller before the default plug is hit on the entry window and therefore the parameters are passed into the method automatically.
Is there a way this can be done programatically?
Basically I wish to replicate this WDJ method calll in WDA:
WDWebContextAdapter.getWebContextAdapter().getRequestParameter().
Cheers
Ian*Thanks for your replies gents, but the WDDOINIT method does not have WDEVENT parameter for me to read.*
*I got around it by moving the code to the entry window and calling the method on the comp controller with the parameters that were passed in automatically.*
BY
*Ian*
Hi Can any body tell me how to call Default startup method of window in component controller .
As I am having the same problem . I want to set url pyrometer in the context and then read the same context in
WDDoinit method of component controller . But sequence is like bellow
WDdoint component -> Wddoinit View -> Default startup method.
Hence I am not able to read the context variable in wddoinit which I set up in the satartup method of view.
Kindly let me know any wayout for this.
Thanks in advance
Abhay -
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. -
Reading URL Parameters from within PDF
Is there a way to capture data appended to a PDF's URL for use by the Acrobat Javascript? Anyone have an example of this type of implementation?
ThanksHi Harry,
You may find useful the following two articles dealing with portlets and parameters:
[list]
[*]A Primer on Portlet Parameters and Events
[*]Adding Parameters and Events to Portlets
[list]
Peter -
I'm trying to read a value passed in the url parameter from my xdo file. What are the steps? I'm using XML Publisher Enterprise 5.6.2. Thanks...
as Ive understood Ive worked with it in this way :
sql param : select 'http://www.xxx.com/image.gif' PARAM from dual
url param : url:{PARAM}
it seems working but I'm trying with the 10.1.3.3.3 version and in the same way is not working....
Gian
Maybe you are looking for
-
I have photoshop elements 13, It did open up till I had to un install it and re install it, now it is says I need windows 7 or later and I do have windows 7. Can you please help me?
-
Photos in a project have just disappeared!
Not sure if this problem was there before or after I installed Aperture 3.4.2 (about two hours ago) but in one of my projects a large number of photos have just disappeared. The ratings remain but all you can see is a black space and the size of the
-
Use of Logbook in SAP Plant Maintenance
Hi Experts, Can anybody tell me the use of Logbook in SAP PM module. How can we activate this ? Is there any specefied procudure for the same? Thanks in advanve VT
-
Get current logged portal user information
Hi, I need to get information about current user logged to the portal from a J2EE application. I developed an Enterprise application project with a java servlet and I integrated it into the portal as an URL iView. This in the code of servlet: import
-
Disabling attributes or operations using StandardMBean
In the Best Practices document at http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/best-practices.jsp I find the following advice: If you need some particular abilities of Dynamic MBeans, for example the ability to supply descrip