cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with handling cookies

former_member758419
Active Participant
0 Kudos

Hi,

I am working on a application where i'll get the personnel number of an employee from BSP as a cookie, and in webdynpro i need to catch that cookie and display the details of that particular employee using personnel table.

Can u please tell me how to get the cookie in webdynpro which was set in the Bsp application.

Thanks,

Sachi

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sachidanand,

You plan to Show personnel information based on content of a cookie.

I assume it is an SSO2 cookie ?

Did you check this approach with your security group ?

Is there another way of indentifying user.?

eg If the User has a unique logon onto the system, you can use server side tools

such as shared memory objects, rather than browser cookies.

just an idea to add to cookie approach.

Cheers

Phil.

former_member758419
Active Participant
0 Kudos

Hi Rainer,

I'm facing some problems in posting questions, Even though the checkbox to mark a post as a question is checked, my post are not appearing as a question, I've sent a mail to sdn@sap.com regarding this...

Thanks,

Sachi

Former Member
0 Kudos

Hi,

when you are writing your cookie, you give it certain option-parameters such as session id, login name,....

make sure you pass them in the call of the webdynpro url:

http:// url webdynpro ?par1=x&par2=y&par3=z..

in your default inboundplug, you should define these parameters as importing (same name syntax) and there you can call your cookie with the exact same criteria, so you can fetch it,

also have a look at <a href="/people/koen.labie2/blog/2006/11/29/eating-cookies-with-webdynpro-and-bsp:///people/koen.labie2/blog/2006/11/29/eating-cookies-with-webdynpro-and-bsp

for the guidance, you can ofcourse use a structure instead of the class.

If you are just passing the username and maybe one or two extra parameters,

it's simpler to pass them via url, and use the same fetching technique as with the cookie-parameters

grtz

Koen

former_member758419
Active Participant
0 Kudos

Hi Koen,

Thanks for ur reply,

Since i need to get only the personnel number, I've used the Url to pass the parameters from the calling application, In HandleDefault method i checked it by debugging that i'm getting those parameters. But my problem is: I need those attributes in the context of my view(Employee_view).

Please tell me how to get those parameters in the view context.

Thanks,

Sachi

Former Member
0 Kudos

Hi,

if you use an assistance class for your component, you can call it from your

dohandledefault wd_assist->... and you can store the attributes over there,

from which they become accessible throughout the entire component

another option is binding it to context of the component controller

press controller usage on context of the window and select

component controller, that way you can map the attributes to the comp controller.

grtz

Koen

Message was edited by:

Koen Labie

former_member215843
Active Participant
0 Kudos

Hi Sachi,

An alternative to using the component controller is: Use the context of the window, put the parameters there, and map the window context in your view. You have to declare the window controller as a used controller in your view before using it.

Regina

former_member758419
Active Participant
0 Kudos

Hi Regina,

I created the context node and 2 attributes under it in the Window context and mapped the same in the view context.

I've also declared the window controller as a used controller in your view.

In window handledefault method i've used the code wizard to read the context and set the Url parameters to the context.

elem_demo->set_attribute(

EXPORTING

name = `NAME`

value = NAME ).

I've assigned a UI element Text View to the attribute Name under the mapped context in the view. When i execute the application its showing the error,

Access over 'ZERO' object reference not possible.

Hi Koen: Can u please give me a link to any of the material or weblog related to using Assistance class for a webdynpro component.

Thanks,

Sachi

former_member215843
Active Participant
0 Kudos

Hi Sachi,

It seems that elem_demo i a null-pointer. Either there is not coding

elem_demo =  ... 

or the node is empty.

I assume that the node is empty (has no elements). Either set the cardinality to "1..1" (then this element is automatically created) or you have to create the element by yourself. Use

node_demo->bind_structure(  my_structure )

. In this structure you cann pass the name value.

Please have a look at the first tutorials on how to set the context attributes.

Regina

former_member758419
Active Participant
0 Kudos

Hi Regina,

Thanks a lot,

Earlier i was using a cardinality of 0....n, so its was showing zero object reference error.

Now i corrected it to 1....1 or 1...n and its working fine..

Thanks for ur help, Since this thread is not marked as question, i cant award u any points..

Please make a reply for the below thread regarding the same problem, so that i can award points and close the question..

Thanks,

Sachi