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 values in the second program after submit

0 Kudos
829

Hello All

i am using the statement SUBMIT (PROG2 ) WITH SELECTION-TABLE rsparams AND RETURN. in PROG1

in PROG2 how can i access these in rsparams.

Thank you for your valuable responses.

1 ACCEPTED SOLUTION

thkolz
Contributor
778
DATA: t_sel_par TYPE STANDARD TABLE OF rsparams WITH DEFAULT KEY.

APPEND VALUE #( selname = 'P_DATE' " Name Parameter or select option in submitted program
kind = 'P' " P - Parameter, S - Select options
sign = 'I'
option = 'EQ'
low = sy-datum ) TO t_sel_par. SUBMIT ztest WITH SELECTION-TABLE t_sel_par AND RETURN.

In this case the parameter P_DATE must also exist in called report ZTEST:

REPORT ztest.

PARAMETERS: p_date TYPE d.
...
8 REPLIES 8

Tomas_Buryanek
Active Contributor
778

Values will be accessible in selection screen = PARAMETERs + SELECT-OPTIONs of PROG2. But is it really what are you trying to figure out?

-- Tomas --

0 Kudos
778

Hi tomas.buryanek ,
Thank you for your response

do i need to declare all the parameters+select-options in PROG2 or is there any way to access the rsparams directly in PROG2 as a table?

FredericGirod
Active Contributor
778

The second program will be call like if you are doing it manually.

You cannot specify additionnal parameters, variable, tables, ... you cannot access the memory of program 1 to get additional information.

If you need additional information, you will have to use SingleTon design pattern (or function group, memory shared, SHMA)

0 Kudos
778

Hi Frederic Girod,

i didnt get you actually.
what i want is to transfer these data using the above statement to PROG2 and access it in PROG2.

FredericGirod
Active Contributor
778

basicaly you have to use the parameters / select-options to retrieve informations of program 1

but, you could by pass this using some technical tips & trick

thkolz
Contributor
779
DATA: t_sel_par TYPE STANDARD TABLE OF rsparams WITH DEFAULT KEY.

APPEND VALUE #( selname = 'P_DATE' " Name Parameter or select option in submitted program
kind = 'P' " P - Parameter, S - Select options
sign = 'I'
option = 'EQ'
low = sy-datum ) TO t_sel_par. SUBMIT ztest WITH SELECTION-TABLE t_sel_par AND RETURN.

In this case the parameter P_DATE must also exist in called report ZTEST:

REPORT ztest.

PARAMETERS: p_date TYPE d.
...

778

Thank you so much

Sandra_Rossi
Active Contributor
778
SUBMIT PROG2 WITH SELECTION-TABLE rsparams ...

Is to pass values to existing parameters of PROG2.

Parameters must exist in PROG2.

If you just want to pass data but not declare anything in PROG2, then maybe you should look at other ways than just the old SUBMIT.