cancel
Showing results for 
Search instead for 
Did you mean: 

Get URL Parameter Starting With underscore '_' (_sapwiid)

michael_umlauff
Explorer
0 Kudos

Hello all,

how can I read a URL parameter from the HTTP request starting with an underscore '_' in Web Dynpro for ABAP, e.g. '_sapwiid'?

I have the problem that business workflow generates a URL to start my Web Dynpro application, and the BW framework concatenates its workitem ID as a parameter named '_sapwiid' into the URL. I don't have any influence on this name.

In <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/2f/e7574174c58547e10000000a1550b0/frameset.htm">SAP help to Web Dynpro ABAP</a> it is outlined how to get a URL parameter with a more common name.

But it is not possible to define an importing parameter '_SAPWIID' in the handler method of the default inbound plug of the components window. It is an invalid name because it starts with an underscore. Consequently I can't define a parameter with this name in the WD application.

In BSP I would solve this problem by calling a method of the global object REQUEST (class CL_HTTP_ENTITY):

call method request->get_header_fields(... )

But in Web Dynpro I don't have a reference to this class.

Does anyone know how to solve this problem?

Kind regards

Michael

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Michael,

from the importing parameter WDEVENT of the startup plug event handler you can access all application relevant URL parameters (SP9 is prerequisit):

data: l_url_parameters type tihttpnvp.

wdevent->get_data(

exporting

name = if_wd_application=>all_url_parameters

importing

value = l_url_parameters ).

Best Regards, Ariane.

michael_umlauff
Explorer
0 Kudos

Hi Ariane,

now we have SP10, so I could implement your code - it works perfect.

I tried to give you 10pt, but I failed, probably because this thread is marked as answered

Thanks a lot

Michael

Answers (2)

Answers (2)

michael_umlauff
Explorer
0 Kudos

Hi Ariane and Alexander,

reading all the URL parameters was something I am searching for a long time without success, so I keep your code in mind!

Unfortunately my project has only SP8, and no chance to get on SP9 or SP10 in the next months.

The solution outlined in the blog could help indeed, but they are using the UWL. Unfortunately my project doesn't have the Enterprise Portal, so we don't have the UWL. We have recommended to implement the EP, but I don't know if we win.

In the meantime I found SAP note 978926 that describes it is possible to define prefixes like '~' for the WD application parameters. Aiga Uhrig assured to me it works with '_' too, but only in SP10

Many thanks for your help up to now.

Best regards

Michael

Former Member
0 Kudos

Hi Michael,

the solution provided in the blog should work without uwl, too.

As outlined in the blog you create your visualization task and provide the parameter e.g. "DYNPARAM" -> "WI_ID=${item.externalId}.

In the WebDynpro App you define a parameter WI_ID in the inbound plug of the window. I think that way the parameter will be transfered to your webdynpro application.

Regards,

Alex

michael_umlauff
Explorer
0 Kudos

Hello Ariane and Alexander,

I found a solution using BSP as a wrapper that reads the http-parameter with

request->if_http_entity~get_header_fields().

From the result I read the parameter

'~querystring'

It contains the parameter as substring

'_sap_wiid%3d<value of the wiid>%26'

I retrieve the parameter by some string operations. Then I construct a URL to call the WebDynpro and concatenate the parameter as

'&wiid='<value of the wiid>

into the URL (without the queer character '_'!). By

navigation->goto_page( <URL> )

the WD application starts, and the parameter WIID is passed properly.

Instead of the WD application of course I must start the BSP, so it no elegant solution at all, but it works.

Thank you all for your help

Kind regards

Michael

former_member215843
Active Participant
0 Kudos

Hi Michael,

As long as you do not try to run this in the portal and expect the session handling to run correctly, this solution may work for the time being.

But you should change it as soon as the solution pointed out by Ariane is available.

Ciao, Regina

michael_umlauff
Explorer
0 Kudos

Hi Regina,

you are right. If we had a portal I wouldn't implement this solution, but utilize the Universal Worklist.

I have tried Arianes Solution on an SP10 system, it works fine - so 10pt

There is another solution described in note 978926 by Aigo Uhrig. He states since SP10 such a parameter can be read by "extended parameter passing" in the WD application, though the parameter starting with '_' still can't be declared as a parameter in the default plug of the window. Do you know how this works, I can't find it anywhere in the WD application?

Best regards

Michael

Former Member
0 Kudos

Hi,

when you pass this sapwiid, you do this normally in your callback url (here we do it that way)

that way you can import your cburl and run that through this function:

wdy_parse_agr_url, the importing value parameters gives you a table with formfields

grtz

Koen

michael_umlauff
Explorer
0 Kudos

Hi Koen,

I have implemented your solution, it works fine.

Many thanks: 10pt.

Best regards

Michael

Former Member
0 Kudos

Hi Michael,

have you had a look at <a href="/people/ginger.gatling/blog/2005/12/14/create-new-uis-for-existing-workflow-tasks-with-abap-web-dynpro-and-universal-worklist weblog</a>?

The workitem id is passed via a special URL parameter defined in the workflow task.

Regards,

Alex