cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Form Posted Variables in Web Templates

Former Member
0 Kudos

Is there any way in a Web Template to receive the variables sent by "Post" method from a page. For example, I call the BEx URL from a page that's not from a Web Template, and now I want to receive the variables I send through posting the form.

<form action="http://myhost/sap/BEx2">

<input type="hidden" name="somevar" value="somevalue">

<input type="hidden" name="CMD" value="LDOC">

.

.

All hidden fields needed to execute my web template

.

.

</form>

Now, I want to get somevar in the template. Javascript cannot get "post" variables, only "get" variables. Another question is will I be able to keep sending this variable throughout all actions of the Web Template (user clicks on a drilldown, it passes the variable, they filter, it passes the variable to the next page, etc.)

Maybe there's a way to enable ASP in a Web Template so I can use session variables?

Thanks,

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Again any ideas on this one??

Former Member
0 Kudos

Hi Deepu,

I tried as you have suggested. But, I am not able to get the cookie value in table interface. Please find below the things I have done.

function makeCookie(){

var cookieStr = "testCookie=12";

if (makeCookie.arguments.length > 2){

cookieStr += "; expires=" + getCookieExpireDate(3);

}

document.cookie = cookieStr;

}

This function is called when a button is pressed and before form enclosing it is submitted. In the interface I am reading the cookie value as you have said.

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

Is there anything else I need to do?

Many thanks for your help.

Pappu

Former Member
0 Kudos

Any ideas????

Former Member
0 Kudos

All the HTTP header information (cookies and posted values) will be accessible from the table interface class 'CL_RSR_WWW_MODIFY_TABLE'. You can write a cookie using Java Script for the required values and in the table interface class you will be able to access it using the method 'N_R_CREATION_PARAMETERS->GET' and assign it to a table cell as hidden value and then access it on the client side using Java Script.

Sample given below.

L_COOKIE = N_R_CREATION_PARAMETERS->GET( I_ID =

'COOKIENAME' I_INDEX = 0 ).

Thanks.