cancel
Showing results for 
Search instead for 
Did you mean: 

server side cookies in MVC model

Former Member
0 Kudos

Hi

I have designed a BSP for goods receipt using BAPI and MVC design paradigm.

i have given one ADD ITEM button for adding items in internal table one by one on pressing add item . For that i am using

CALL METHOD CL_BSP_SERVER_SIDE_COOKIE=>GET_SERVER_COOKIE

EXPORTING

NAME = 'my_page_data'

APPLICATION_NAME = runtime->application_name

APPLICATION_NAMESPACE = runtime-application_namespace

USERNAME = name

SESSION_ID = 'same_for_all'

DATA_NAME = 'page_data'

CHANGING

DATA_VALUE = page_data

.

in my MODEL class .

but it is giving syntax error : *Field "RUNTIME" is unknown. It is neither in one of the specified *

when i am trying to create this object it say :

u can not make a instance of this class form outside

please guide me on this.

Regards

Sachin

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member188685
Active Contributor
0 Kudos
CALL METHOD CL_BSP_SERVER_SIDE_COOKIE=>GET_SERVER_COOKIE
EXPORTING
NAME = 'my_page_data'
APPLICATION_NAME = runtime->application_name
APPLICATION_NAMESPACE = runtime->application_namespace
"its not runtime-application_namespace
former_member184111
Active Contributor
0 Kudos

Hi Sachin,

what method is that, where you use the code ?? be aware that Runtime is not available everywhere, but mostly in events DO_HANDLE_EVENT and ON_INPUT_PROCESSING.

Regards,

Anubhav.

Former Member
0 Kudos

Hi

i am not using it in any evet because , i am not using Page with Flow logic .

i am coding in the MODEL class i created for applicaltion with in that i defined ADDITEM method .

Regards

Sachin

Former Member
0 Kudos

Hi

u r this hint "Runtime is not available everywhere, but mostly in events DO_HANDLE_EVENT and ON_INPUT_PROCESSING.

"

help me what i did is i went to DO_HANDLE_EVENT the controller class and ther RUNTIME object was available and then from theere i pass the value to MODEL class.

Regards

Sachin

former_member188685
Active Contributor
0 Kudos

>but it is giving syntax error : *Field "RUNTIME" is unknown. It >is neither in one of the specified *

is it a method parameter or Model class attribute..?

Former Member
0 Kudos

sir

this was the error , i was getting .

RUNTIME is an object of CL_BSP_RUNTIME which have runtime details of an application. it is available automatically .

i was passing it to this mathod which i coded in MODEL class of my application.

CALL METHOD CL_BSP_SERVER_SIDE_COOKIE=>SET_SERVER_COOKIE

EXPORTING

NAME = 'my_page_data'

APPLICATION_NAME = runtime->application_name

APPLICATION_NAMESPACE = runtime->application_namespace

USERNAME = name

SESSION_ID = 'same_for_all'

DATA_NAME = 'page_data'

DATA_VALUE = page_data

EXPIRY_TIME_REL = 3600

.

so it was giving error :

runtime not found