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

regd : passing values from calling program to called program

Former Member
0 Likes
754

hi,

i have a requirement where in i need to pass values which is declared under selectoption in calling program screen to called program screen which is of type parameter in called program.

It has to accept range of values from calling program and populate one by one to called program .As in called program that particular variable is of type parameter

can u please help me in this..surely points will be rewarded

6 REPLIES 6
Read only

Former Member
0 Likes
726

Hi!

In you caller program write this coding:

SUBMIT z_called_program

WITH s_called IN s_caller

p_called = p_caller

AND RETURN.

Regards

Tamá

Read only

0 Likes
726

hi,

i tried this code..

it is not populating s_matnr-low the value to the standard screen which contains p_matnr of type parameter.

whenever i give range as 10 to 17.

it should give screen variant as 10 for matnr in called program.

Read only

0 Likes
726

Hi!

Try like this:

SUBMIT z_called

WITH p_matnr = s_matnr-low

AND RETURN.

It has to work.

Regards

Tamá

Read only

varma_narayana
Active Contributor
0 Likes
726

Hi Vinutha..

Here Calling program has a Select-option For Eg S_MATNR.

Called program has a PARAMETER For Eg P_MATNR.

To Call the Report with Selection criteria.

In the Calling program....

Loop at S_MATNR.

SUBMIT <REPORT>

WITH P_MATNR = S_MATNR-LOW.

ENDLOOP.

Reward if Helpful.

Read only

Former Member
0 Likes
726

There are a number of ways to do this - do a F1 on Submit - but here is one approach.

Firstly build your parameters/select-options:

  wa_params-selname = P_PARAM.
  wa_params-kind    = P_KIND.
  wa_params-sign    = P_SIGN.
  wa_params-option  = P_OPTION.
  wa_params-low     = P_LOW.
  wa_params-high    = P_HIGH.
  APPEND wa_params TO itab_params.

Then call you program passing in your selection table:

         SUBMIT [program name] AND RETURN 
                                        WITH SELECTION-TABLE itab_params
                                        VIA SELECTION-SCREEN.

Read only

Former Member
0 Likes
726

hi vinutha,

after the select-options in this calling program.

You have to create a variant first for the calling program.

use the SUBMIT statement linking the called program and the variant used in this program.

then validate the selection screen with the IF condition and a message class.

OR

there is a FUNCTION module, where we can give only multiple single value instead of ranges in the select-options.

I will give you the exact code by monday, since I am not in the desk now.

be in touch