Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the internal table data from one page to another page in bsp application

Former Member
0 Kudos

Hi All,

         I am developing the BSP Application. I want to move the internal table data from one page to another page. how can I get this data in another page. Please let me Know about it.

Thanks,

Santhosh

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi All,

        Thank you all,

        I solved the above question.

Thanks,

Santhosh

9 REPLIES 9

Former Member
0 Kudos

See this link..hope u'll get some help

SAP Library - Business Server Pages

0 Kudos

Hi Farid,

       Thanks farid, Can u send me the example of how to use this?

Thanks,
Santhosh

0 Kudos

Hi Santhosh,

Try below.

1. first page :- it_table is internal table

call method cl_bsp_server_side_cookie=>set_server_cookie
             exporting
               name                  = 'it_table'
               application_name      = runtime->application_name
               application_namespace = runtime->application_namespace
               username              = sy-uname
               session_id            = sy-uname " runtime->session_id
               data_name             = 'it_table'
               data_value            =  it_table
               expiry_time_rel       = 1800.


2.second page ( oninitialization event)



call method cl_bsp_server_side_cookie=>get_server_cookie
   exporting
     name                  = '
it_table'
     application_name      = runtime->application_name
     application_namespace = runtime->application_namespace
     username              = sy-uname
     session_id            = sy-uname
     data_name             = '
it_table'
   changing
     data_value            =
it_table.


Regards,

Venkat





0 Kudos

Use serverside cookies.

data: l_cdata type xstring.

EXPORT itab FROM itab

TO DATA BUFFER l_cdata.

“”store in serverside cookie

CALL METHOD cl_bsp_server_side_cookie=>set_server_cookie

  EXPORTING

name = 'myItab'

application_name      = runtime->application_name

application_namespace = runtime->application_namespace

username = sy-uname

session_id            = runtime->session_id

data_value            = l_cdata

data_name = 'l_cdata'

expiry_time_rel       = 600.

On the following bsp you can get the data back using:

  • get server-side cookie with itab for actual session-id

CALL METHOD cl_bsp_server_side_cookie=>get_server_cookie

  EXPORTING

name = 'myItab'

application_name      = runtime->application_name

application_namespace = runtime->application_namespace

username = sy-uname

session_id            = runtime->session_id

data_name = 'l_cdata'

  CHANGING

data_value            = l_cdata.

  • if data has been read

IF l_cdata IS NOT INITIAL.

  IMPORT itab = ltab_itab

FROM DATA BUFFER l_cdata.

  1. ENDIF.

0 Kudos

Hi Farid,

          I am not getting the values. Refreshing the data in cookies also when I clicked on button.

Please can u provide me the step by step procedure?

Thanks,
Santhosh

0 Kudos

Hi Venkat,

  I am not getting the values. Refreshing the data in cookies also when I clicked on button.

Please can u provide me the step by step procedure?

Thanks,
Santhosh

Former Member
0 Kudos

Hi All,

        Thank you all,

        I solved the above question.

Thanks,

Santhosh

0 Kudos

Hi Santosh,

can you please specify how you have solved this,

let people know ,any one can get benifited with this in future.

0 Kudos

Hi All,

           While going to another page with internal table data in that page itself we need to write below      code by this code itself holds the previous data.

           RUNTIME->KEEP_CONTEXT = 1.

Thanks,

Santhosh