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: 

set the parameter in the selection screen of a program from another program

Former Member
0 Kudos

Hi ALL,

I need to call the program RHALESMD from another program and the program RHALESMD takes from date as one of the input parameter.how do i set the from date from the calling program and call RHALESMD

Thanks

Bala Duvvuri

5 REPLIES 5

Former Member
0 Kudos

i got the answer

Program accessed

REPORT report1.

DATA text TYPE c LENGTH 10.

SELECTION-SCREEN BEGIN OF SCREEN 1100.

SELECT-OPTIONS: selcrit1 FOR text,

selcrit2 FOR text.

SELECTION-SCREEN END OF SCREEN 1100.

...

Calling program

REPORT report2.

DATA: text TYPE c LENGTH 10,

rspar_tab TYPE TABLE OF rsparams,

rspar_line LIKE LINE OF rspar_tab,

range_tab LIKE RANGE OF text,

range_line LIKE LINE OF range_tab.

...

rspar_line-selname = 'SELCRIT1'.

rspar_line-kind = 'S'.

rspar_line-sign = 'I'.

rspar_line-option = 'EQ'.

rspar_line-low = 'ABAP'.

APPEND rspar_line TO rspar_tab.

range_line-sign = 'E'.

range_line-option = 'EQ'.

range_line-low = 'H'.

APPEND range_line TO range_tab.

range_line-sign = 'E'.

range_line-option = 'EQ'.

range_line-low = 'K'.

APPEND range_line TO range_tab.

SUBMIT report1 USING SELECTION-SCREEN '1100'

WITH SELECTION-TABLE rspar_tab

WITH selcrit2 BETWEEN 'H' AND 'K'

WITH selcrit2 IN range_tab

AND RETURN.

Thanks

Bala Duvvuri

Former Member
0 Kudos

oops didn't find the solution because in RHALESMD we dont have select option we have parameters so how do we fill them from another program

0 Kudos

Hi, Bala

Please Check the following Code hope this will help you to solve out your problem

DATA: it_bdcdata TYPE TABLE OF bdcdata,
      wa_it_bdcdata LIKE LINE OF it_bdcdata.

DATA opt TYPE ctu_params.

START-OF-SELECTION.

  CLEAR wa_it_bdcdata.
  wa_it_bdcdata-program = 'RHALESMD'.
  wa_it_bdcdata-dynpro = '1000'.
  wa_it_bdcdata-dynbegin = 'X'.
  APPEND wa_it_bdcdata TO it_bdcdata.

  CLEAR wa_it_bdcdata.
  wa_it_bdcdata-fnam = 'BDC_CURSOR'.
  wa_it_bdcdata-fval = 'CHP_DATE'.
  APPEND wa_it_bdcdata TO it_bdcdata.

  CLEAR wa_it_bdcdata.
  wa_it_bdcdata-fnam = 'CHP_DATE'.
  WRITE: '01.01.2010' TO wa_it_bdcdata-fval. " Date
  APPEND wa_it_bdcdata TO it_bdcdata.

  CLEAR wa_it_bdcdata.
  wa_it_bdcdata-fnam = 'BDC_CURSOR'.
  wa_it_bdcdata-fval = 'CHP_TIME'.
  APPEND wa_it_bdcdata TO it_bdcdata.

  CLEAR wa_it_bdcdata.
  wa_it_bdcdata-fnam = 'CHP_TIME'.
  WRITE: '12:12:12' TO wa_it_bdcdata-fval. " Time
  APPEND wa_it_bdcdata TO it_bdcdata.

  opt-dismode = 'E'.

  CALL TRANSACTION 'RE_RHALESMD' USING it_bdcdata OPTIONS FROM opt.

Thanks and Regards,

Faisal

0 Kudos

HI Bala ,

you need to pass the value as 'P' for the field rspar_line-kind.

for Example :



rspar_line-selname = 'SELCRIT1'. 
rspar_line-kind = 'P'. 
rspar_line-sign = 'I'. 
rspar_line-option = 'EQ'. 
rspar_line-low = 'ABAP'. 
APPEND rspar_line TO rspar_tab. 

0 Kudos

A simple statement worked

SUBMIT RHALESMD

*WITH SELECTION-TABLE rspar_tab

WITH chp_date = '20100522'

AND RETURN.

Thanks

Bala Duvvuri