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 variable .... ?

Former Member
0 Likes
576

Hi,

How to pass a select options variable to a perform statement? asl how to receive it in form .... endform subroutine?

thanks,

surya.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
521

Just pass as TABLES parameter.



report zrich_0001 .

select-options: s_datum for sy-datum.

perform check_datum tables s_datum.


*&---------------------------------------------------------------------*
*&      Form  check_datum
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form check_datum tables r_datum.

if r_datum is initial.
  message i001(00) with 'Datum checked'.
endif.

endform.                    " check_datum

Regards,

Rich Heilman

4 REPLIES 4
Read only

Former Member
0 Likes
521

Hi,

Check this example..

SELECT-OPTIONS SO_MATNR FOR MARA-MATNR.

PERFORM FORM1 USING SO_MATNR[].

FORM FORM1 USING LT_MATNR LIKE SO_MATNR[].

ENDFORM..

Thanks,

Naren

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
522

Just pass as TABLES parameter.



report zrich_0001 .

select-options: s_datum for sy-datum.

perform check_datum tables s_datum.


*&---------------------------------------------------------------------*
*&      Form  check_datum
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form check_datum tables r_datum.

if r_datum is initial.
  message i001(00) with 'Datum checked'.
endif.

endform.                    " check_datum

Regards,

Rich Heilman

Read only

Former Member
0 Likes
521

tables: mara.

select-options: s_matnr for mara-matnr.

perform test tables s_matnr.

&----


*& Form test

&----


  • text

----


  • -->P_S_MATNR text

----


FORM test TABLES P_S_MATNR structure s_matnr.

ENDFORM. " test

Regards,

ravi

Read only

Former Member
0 Likes
521

FORM form_name USING LT_MATNR TYPE RANGES.

ENDFORM.

Try the above one as RANGES is same as SELECT-OPTIONS.

Regards,

Ravi

Note : Please mark all the helpful answers