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

Problem with passing parameter to submit program

Former Member
0 Likes
4,106

Dear All,

I am facing a problem with submit program from a calling program while passing the parameters. My called program is using restrict ranges to single multiple in the initialization event and it does not have any at selection-screen event.

I have to pass parameters from calling program to the called program. I have tried converting the parameters to ranges and then submit.

Can you please help me in solving this problem?

SUBMIT ZMMU_PDR_MM_COPY_RENT_PDQ

WITH S_MATNR = R_MATNR

WITH S_WERKS = R_WERKS

Thanks,

Amit

8 REPLIES 8
Read only

Former Member
0 Likes
2,308

Hello,

Sy if u r using s_matnr as select-options and the user has enetred 1 as low ad 100 as high then u do these:-

1, Make a select query and get all the records between 1 and 100.

2, Build the single ranges table and pass the retreived data to this.

3, Pass this range data to the s_matnr.

Ur problem will be solved .

If not plz let me know .

Reward if helpful.

Regards,

Deepu.K

Read only

0 Likes
2,308

I have already done this but still it is not working. I do not have select-options but instead i have pass parameters converting it into ranges.

Read only

0 Likes
2,308

Problem is coming from the called program, it is using select_options_restrict function module to convert the select-options to single multiple, it is not accepting the parameters passed

Amit

Read only

0 Likes
2,308

Hello,

Then u do this.

1, Build select-options for ur parameters by passing SIGN I , OPTION EQ,LOW = P_MATNR , HIGH = SPACE.

2, Use the function module select_options_restrict and get the data into one varaiable .

3, pass this to the called Program.

Regards,

Deepu.K

If not post ur code ..I'll try in my sys and give u the modified code.

Message was edited by:

deepu k

Read only

suresh_datti
Active Contributor
0 Likes
2,308

shouldn't it be

SUBMIT ZMMU_PDR_MM_COPY_RENT_PDQ

WITH S_MATNR IN R_MATNR

WITH S_WERKS IN R_WERKS.

~Suresh

Read only

Former Member
0 Likes
2,308

Hi,

If u have parameters for matnr and werks then what's the problem.

Build the ranges and pass it as :-

SUBMIT ZMMU_PDR_MM_COPY_RENT_PDQ 
WITH S_MATNR in R_MATNR
WITH S_WERKS in R_WERKS

Regards,

Deepu.K

Read only

Former Member
0 Likes
2,308

Hi,

Check the syntax and example:

Syntax:

SUBMIT... [VIA SELECTION-SCREEN]

[USING SELECTION-SET <var>]

[WITH <sel> <criterion>]

[WITH FREE SELECTIONS <freesel>]

[WITH SELECTION-TABLE <rspar>].

These options have the following effects:

VIA SELECTION-SCREEN

The selection screen of the called executable program (report) appears. If you transfer values to the program using one or more of the other options, the corresponding input fields in the selections screen are filled. The user can change these values. By default, the system does not display a selection screen after SUBMIT.

USING SELECTION-SET <var>

This option tells the system to start the called program with the variant <var>.

WITH <sel> <criterion>

Use this option to fill individual elements <sel> of the selection screen (selection tables and parameters). Use one of the elements <criterion>:

– <op> <f> [SIGN <s>], for single value selection

If <sel> is a selection criterion, use <op> to fill the OPTION field, <f> to fill the LOW field, and <s> to fill the SIGN field of the selection table <sel> in the called program.

If <sel> is a parameter, you can use any operator for <op>. The parameter <sel> is always filled with <f>.

– [NOT] BETWEEN <f1> AND <f2> [SIGN <s>], for interval selection

<f1> is transferred into the LOW field, <f2> into the HIGH field, and <s> into the

SIGN field of the selection table <sel> in the called program. If you omit the NOT

option, the system places the value BT into the OPTION field; if you use NOT, the

system fills OPTION with NB.

– IN <seltab>, transferring a selection table

This addition fills the selection table <sel> in the called program with the values of

the table <seltab> in the calling program. Table <seltab> must have the structure of a selection table. Use the RANGES statement to create selection tables.

WITH FREE SELECTION <freesel>, user dialog for dynamic selections

To use this option, both calling and called programs must be connected to a logical database that supports dynamic selections. In the calling program, use the function modules FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG. They allow the user to enter dynamic selections on a selection screen. One export parameter of these function modules has structure RSDS_TEXPR from the RSDS type group. Transfer the values of this export parameter by means of the internal table <freesel> of the same structure to the called report.

Exmp:

SUBMIT REP1 VIA SELECTION-SCREEN

WITH PARAMET EQ 'Selection 1'

WITH SELECTO IN SELTAB

WITH SELECTO NE 3

AND RETURN.

Regards,

Bhaskar

Read only

former_member219399
Active Participant
0 Likes
2,308

Hi,

Export the parameters in calling program and import them in the called program. Hope this will solve ur problem. or can use set and get parameters also.

With regards,

Vamsi

in calling program set parameter....

GET PARAMETER ID 'xyz' FIELD l_uplnr.

if sy-subrc = 0.

if l_uplnr is not initial.

sr_uplnr-low = l_uplnr.

sr_uplnr-sign = 'I'.

sr_uplnr-option = 'EQ'.

append sr_uplnr.

clear sr_uplnr.

endif.