cancel
Showing results for 
Search instead for 
Did you mean: 

WebDynpro - Read URL attributes via ABAP (no JAVA)

Former Member
0 Kudos

Hello everybody,

I've done a little research by now but did not find a solution for my issue,

though I guess I'm not the first person having this issue

What I want to do is read multiple parameters from the URL just by using ABAP, no JAVA!

In BSP this is quite simple as u just declare a site attribute with the same name and give it the option 'auto'.

But in the WebDynpro environment this seems to work in a different way.

Is it even possible to do this without using JAVA, maybe this is why I didn't find anything...!?!?

It would be great if you get back to me in this matter.

Answers are kindly appreciated, as usual.

Thanks in advance and regards,

Marc

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

try this out :

DATA: lt_url_parameters TYPE tihttpnvp.

wdevent->get_data(

EXPORTING name = if_wd_application=>all_url_parameters

IMPORTING value = lt_url_parameters ).

hope this will surely help you!!!

Thanks & Regards,

Punit Raval.

Former Member
0 Kudos

Hello Punit and thank you for the quick response!

I tried as you said, but when I'm in debugging mode after the coding, the table lt_url_parameters is empty.

The Attribute all_url_parameters of the interface if_wd_application just holds the default value '_ALL_URL_PARAMETERS'

at that point, so thats why there is no useful exporting parameters of the method get_data I guess.

Maybe I did not get the logic right, do I have to take care, that the attribute all_url_parameters contains all the parameters,

or does the runtime environment take care of that by itself?

What would the data in this attribute normally look like, is it like '?parameter1=111&parameter2=222&parameter3=333...' ?

Thank you for your help and regards,

Marc

Former Member
0 Kudos

Hi,

Yes, if you pass the constant '_ALL_URL_PARAMETERS' for the method wdevent->get_data, as said above it will return you an internal table of type 'TIHTTPNVP'.

'TIHTTPNVP' is a table type having the structure 'IHTTPNVP', which has name-value pair. This will have ALL PARAMETER NAMES and their VALUES.

If the values are not returned, check in debugging mode whether WDEVENT is properly initialized before usage.

If you are not looking for all the parameters and only specific parameter name & value, then you can try other methods of the class CL_WD_CUSTOM_EVENT, get_string ->to get value of parameter as string, get_int->param value as int..etc.

Regards,

Manne.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Are you performing this logic from within the Startup Plug of the Window? Here is the online help document on this topic:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/45/2233b60c21072ce10000000a155369/frameset.htm

Former Member
0 Kudos

Hello Punit, Manne, Thomas,

thank you very much for your support, you were totally right with your suggestions, I just did a little mistake.

Now it's working just the way it should.

Thanks again and regards,

Marc

Answers (0)