cancel
Showing results for 
Search instead for 
Did you mean: 

how to access the current URL in table interface

Former Member
0 Kudos

Hi,

I've got an object of type CL_RSR_PARAMETER.

I need to get the last URL of a webtemplate to create context sensitive links (ascending, descending sorting)in the header line of the table.

Where (and how) do I have to create the object to get the last executed URL?

Thanks

Mike

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

You will be able to get the URL parameters using the method

URLVALUE = N_R_CREATION_PARAMETERS->GET( I_ID =

'URLPARAM' I_INDEX = 0 ).

Former Member
0 Kudos

Thank you,

but this I already tried and it doesn't work.

I dynamicaly create a link to sort (url-parameters: SORT_DIRECTION, SORT_TYPE, IOBJNM ...).

But with this method I don't get these parameters.

The thing I want to do is to modify the caption line of the table this way, that the user clicks on it to sort acending. The scond time he clicks on it it should sort descending.

But therefore I need SORT_DIRECTION from the former call.

cheers Mike

Former Member
0 Kudos

Hi Mike,

It may not be possible to get the previous url in the table interface. Request_no and pageno are generated at the server on a random basis( even though they seem to follow a particular pattern) . Hence, you may have to use javascript.

Cheers,

Kartheek

Message was edited by: Kartheek Kandikuppa

Former Member
0 Kudos

Hi Kartheek,

right now I am trying to get it via the HTTP Framework (HTTP Request).

Do you think this will work?

The only problem I have is, that the documentation (http://help.sap.com/saphelp_erp2004/helpdata/en/78/98527bc06b11d4ad310000e83539c3/content.htm) sais to that there is a server-object created for every incoming request.

But whats the name of it and how to access it.

currently I am trying to do it this way:

DATA: REF_IF_HTTP_REQUEST TYPE REF to IF_HTTP_REQUEST,

server type ref to CL_HTTP_SERVER.

create object server.

REF_IF_HTTP_REQUEST = server->IF_HTTP_SERVER~REQUEST.

call method REF_IF_HTTP_REQUEST->IF_HTTP_ENTITYGET_HEADER_FIELD( EXPORTING NAME = 'REQUEST_URI'

RECEIVING VALUE = test ).

But there I just get a empty object.

cu

Mike

Former Member
0 Kudos

Hi Mike,

You can do this way. You can add the previous url as a parameter to the current url using javascript and then access that parameter in the table interface as below. I mean ,

present url = present url&PARAMETER_NAME=<previous url>

N_R_CREATION_PARAMETERS->GET( I_ID = 'PARAMETER_NAME' I_INDEX = 0 ).

Cheers,

Kartheek

Former Member
0 Kudos

Hi,

thanks for your answer.

Do I really have to use javascript?

Isn't there a possibility to get the last executed url at the backend, because the server should know wich was the last command it got!

If I look at other parameters (like REQUEST_NO) it works.

Cheers

Mike

Former Member
0 Kudos

Hi,

try reading out the window.location object by JavaScript.

-> www.selfhtml.org gives you some tips.

Bye

Ralf

Former Member
0 Kudos

Sorry I didn't said, that I work in the ABAP-OO class of the table interface.

There must be a possibility to access the last executed URL.

Mike