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

Select Options

Former Member
0 Likes
1,008

Hi,

Can some one provide me a sample code on how to pass a select-option as parameter to a sub-routine?

Thanks,

Sandeep

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
969

Hi,

TABLES: mara.

SELECT-OPTIONS: so_matnr FOR mara-matnr.

PERFORM form1 USING so_matnr[].

FORM form1 using lo_matnr LIKE so_matnr[].

ENDFORM.

Thanks,

Naren

6 REPLIES 6
Read only

Former Member
0 Likes
970

Hi,

TABLES: mara.

SELECT-OPTIONS: so_matnr FOR mara-matnr.

PERFORM form1 USING so_matnr[].

FORM form1 using lo_matnr LIKE so_matnr[].

ENDFORM.

Thanks,

Naren

Read only

Former Member
0 Likes
969

for parameter

perform f_get_data using p_matnr.

FORM F_GET_DATA USING P_MATNR TYP MARA-MATNR.

ENDFORM.

For SELECT-OPTIONS:

Perform f_get_data using s_matnr[].

FORM F_GET_DATA USING S_MATNR TYPE ANY.

ENDFORM.

regards

Srikanth

Read only

rcvalluri
Explorer
0 Likes
969

hi!

i didn't understand ur actual requirement but i got an idea.check this..

select-options: s_matnr for mara matnr.

u can send parameters s_matnr-low & s_matnr-high

Read only

Former Member
0 Likes
969

SELECT-OPTIONS: s_werks FOR marc-werks.

START-OF-SELECTION.

PERFORM process_plants TABLES s_werks.

FORM process_plants TABLES p_werks STRUCTURE s_werks.

LOOP AT p_werks.

"do something here

ENDLOOP.

ENDFORM. " process_plants

Read only

Former Member
0 Likes
969

Hi Sandeep,

if you mean an Perform / Form try this:

REPORT ZGRO_TEST.

*

TABLES: MARA.

*

SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.

*

START-OF-SELECTION.

*

PERFORM AUSGABE TABLES S_MATNR.

*

END-OF-SELECTION.

*

FORM AUSGABE TABLES X_MATNR.

*

SELECT * FROM MARA WHERE MATNR IN X_MATNR.

*

WRITE: / MARA-MATNR.

*

ENDSELECT.

*

ENDFORM.

If you mean an submit, i can give you an example.

Regards, Dieter

Read only

0 Likes
969

Hi Sandeep,

here an example with submit:

REPORT ZGRO_TEST.

*

TABLES: MARA.

*

SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.

*

START-OF-SELECTION.

*

SUBMIT ZGRO_TESTT

WITH S_MATNR IN S_MATNR

AND RETURN.

*

END-OF-SELECTION.

REPORT ZGRO_TESTT.

*

TABLES: MARA.

*

SELECT-OPTIONS: S_MATNR FOR MARA-MATNR NO-DISPLAY.

*

START-OF-SELECTION.

*

BREAK-POINT.

*

SELECT * FROM MARA WHERE MATNR IN S_MATNR.

*

WRITE: / MARA-MATNR.

*

ENDSELECT.

*

END-OF-SELECTION.

regards, Dieter