Application Development and Automation 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: 
Read only

How to pass select options range value to another program?

Former Member
0 Likes
4,045

I need to submit program #2 from my program #1, I have no problem passing Parameter since they are single value. But when I pass the select-option data, let say company code 1000 to 2000, then the data range is incorrect.

I remember I have to assign the Sign and Option to the input value range.

Can someone give me an example code of how to define the Select Option field in program #2.

Thanks.

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
1,554

Hi Karen,

Suppose we have such screen parameters defined in program#1.


data: molga type t500l-molga.
select-options so for molga.
parameters pa type ...

..and such in program#1


data: molga type t500l-molga.
select-options so2 for molga.
parameters pa2 type ...

Too pass pa and so from program#1 to pa2 and so2 in program#2 use below procedure:

1) Define rsparams table


data: rsparams_tab type table of rsparams.
        rsparams_wa type rsparams.

2) Append parameters + select_options to this table


  "select options
Loop at so.
  rsparams_wa-selname = 'SO2'.
  rsparams_wa-kind = 'S'.  "select options to be passed
  rsparams_wa-sign = so-sign.    
  rsparams_wa-option = so-option.
  rsparams_wa-low = so-low.
  rsparams_wa-high = so-high.
  append rsparams_wa to rsparams_tab.
endloop.

  "parameters
  rsparams_wa-selname = 'PA2'.
  rsparams_wa-kind = 'P'.  "parameters to be passed
  rsparams_wa-sign = 'I'.    
  rsparams_wa-option = 'EQ'.
  rsparams_wa-low = pa.
  append rsparams_wa to rsparams_tab.

3) Now simply pass this table to program#2

 
SUBMIT program#2 WITH SELECTION-TABLE rsparams_tab AND RETURN.

Cheers

Marcin

I need to submit program #2 from my program #1, I have no problem passing Parameter since they are single value. But when I pass the select-option data, let say company code 1000 to 2000, then the data range is incorrect.

I remember I have to assign the Sign and Option to the input value range.

Can someone give me an example code of how to define the Select Option field in program #2.

Thanks.

3 REPLIES 3
Read only

Former Member
0 Likes
1,554

check the documentation for submit, you can use either

WITH p BETWEEN f1 AND f2 SIGN s if you want a simple single entry or

WITH SELECTION-TABLE seltab if you want the full possibilities

Read only

nkr1shna
Contributor
0 Likes
1,554

HI Karen,

Can you please try SUBMIT PROGRAM in following way

SUBMIT program VIA SELECTION-SCREEN

with parameter eq <any varaible>

with selecto in seltab

AND RETURN.

Seltab declaration is similar to select-options field in Program 1

( seltab can be declared as table-field or any standard data type as may be the case in Program 1)

for Example :

(select-options s_var1 for vbak-vbeln

s_var1 for i .. so on.

Add values to the select-options variables

You had to add values with below logic

seltab-sign = 'I'. seltab-option = 'BT'.

seltab-low = 1. seltab-high = 5.

APPEND seltab.

Try to implement logic similar to shown above. Let me know if you have any questions.

Best Regards,

Krishna

Read only

MarcinPciak
Active Contributor
0 Likes
1,555

Hi Karen,

Suppose we have such screen parameters defined in program#1.


data: molga type t500l-molga.
select-options so for molga.
parameters pa type ...

..and such in program#1


data: molga type t500l-molga.
select-options so2 for molga.
parameters pa2 type ...

Too pass pa and so from program#1 to pa2 and so2 in program#2 use below procedure:

1) Define rsparams table


data: rsparams_tab type table of rsparams.
        rsparams_wa type rsparams.

2) Append parameters + select_options to this table


  "select options
Loop at so.
  rsparams_wa-selname = 'SO2'.
  rsparams_wa-kind = 'S'.  "select options to be passed
  rsparams_wa-sign = so-sign.    
  rsparams_wa-option = so-option.
  rsparams_wa-low = so-low.
  rsparams_wa-high = so-high.
  append rsparams_wa to rsparams_tab.
endloop.

  "parameters
  rsparams_wa-selname = 'PA2'.
  rsparams_wa-kind = 'P'.  "parameters to be passed
  rsparams_wa-sign = 'I'.    
  rsparams_wa-option = 'EQ'.
  rsparams_wa-low = pa.
  append rsparams_wa to rsparams_tab.

3) Now simply pass this table to program#2

 
SUBMIT program#2 WITH SELECTION-TABLE rsparams_tab AND RETURN.

Cheers

Marcin