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: 

Submit program with parameters

former_member355261
Participant
0 Kudos

Hello,

I use the commande SUBMIT to call a program from another like this:

DATA: t_param TYPE TABLE OF rsparams,

            s_param TYPE rsparams.

       s_param-selname = 'P_VALUE'.

       s_param-kind = 'P'.

       s_param-low  = 'TEST'

       APPEND s_param TO t_param.

       SUBMIT ybctr_prog WITH SELECTION-TABLE t_param AND RETURN.


Now I want to pass some other parameters (my own variables, not SELECT OPTIONS or PARAMETERS  just normal values) from the first program to the other.


If this requirement is possible to achieve this way, please tell me how, if not, please give me tips on how to achieve it.


Thanks in advance.

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

You should add more parameters on the selection screen with NO-DISPLAY addition and use them while submitting the data.

If you have to pass the data in a table, You can use IMPORT/EXPORT to memory ID to pass the additional data.

Something like this:


REPORT znp_np_1.

data: v_Data type i.

v_Data = '123'.

export v_data = v_data to MEMORY id 'ZTEST'.

SUBMIT ztest_np_submit and RETURN.

write:'done'.




REPORT  ztest_np_submit.

  data: v_data type i.

START-OF-SELECTION.

  IMPORT v_Data from MEMORY id 'ZTEST'.

  writev_Data.

Regards,
Naimesh Patel

2 REPLIES 2

naimesh_patel
Active Contributor
0 Kudos

You should add more parameters on the selection screen with NO-DISPLAY addition and use them while submitting the data.

If you have to pass the data in a table, You can use IMPORT/EXPORT to memory ID to pass the additional data.

Something like this:


REPORT znp_np_1.

data: v_Data type i.

v_Data = '123'.

export v_data = v_data to MEMORY id 'ZTEST'.

SUBMIT ztest_np_submit and RETURN.

write:'done'.




REPORT  ztest_np_submit.

  data: v_data type i.

START-OF-SELECTION.

  IMPORT v_Data from MEMORY id 'ZTEST'.

  writev_Data.

Regards,
Naimesh Patel

Former Member
0 Kudos

HI,

You can make use of ABAP MEMORY i.e,(IMPORT AND EXPORT)

REPORT ZSAPN_ABAP_MEMORY1.

DATA:A TYPE I VALUE 10.

START-OF-SELECTION.

  EXPORT A TO MEMORY ID 'TEST' .

  SUBMIT ZSAPN_ABAP_MEMORY2 AND RETURN .

  IF SY-SUBRC EQ 0.

  WRITE:/ 'Only trigger when submit and return'.

  ENDIF.

____________________________________________________

REPORT ZSAPN_ABAP_MEMORY2.

DATA A TYPE I.

IMPORT A FROM MEMORY ID 'TEST'.

WRITE 😕 A .

Note: Structure or Attribute which you are making use should be same type in both the programs.

Regards,

Quddus.