Steps
To create function module
- Go to transaction code SE37.
- Enter the function group name.
- Enter the short description.
- Click on SAVE button
- Pop-up will appear. Click on continue.
To create select-option
- Go to Transaction code SE11.
- Enter the Data Type (Structure ) name : RSDSSELOPT.
- Click on Display button.
- Save -> Check -> Activate.
- Copy the newly created select-option structure name and go back to Transaction code SE37.
- Click on Tables Tab and enter the internal table name and it's type.
- Save -> Check -> Activate.
Usage of function module
- Go to transaction code SE38.
- Enter the Title.
- Select Attribute Type as Executable Program.
- Click on save button.
Source code
TABLES : MAKT.
DATA : IT_MAKT TYPE TABLE OF MAKT.
SELECT-OPTIONS : S_MATNR FOR MAKT-MATNR.
call function 'ZPASS_SELECT_INT_TAB'
exporting
s_matnr = S_MATNR
tables
it_makt = IT_MAKT
.
IF SY-SUBRC = 0.
LOOP AT IT_MAKT INTO MAKT.
WRITE : / MAKT-MATNR , MAKT-SPRAS , MAKT-MAKTX.
ENDLOOP.
ENDIF.
DATA : IT_MAKT TYPE TABLE OF MAKT.
SELECT-OPTIONS : S_MATNR FOR MAKT-MATNR.
call function 'ZPASS_SELECT_INT_TAB'
exporting
s_matnr = S_MATNR
tables
it_makt = IT_MAKT
.
IF SY-SUBRC = 0.
LOOP AT IT_MAKT INTO MAKT.
WRITE : / MAKT-MATNR , MAKT-SPRAS , MAKT-MAKTX.
ENDLOOP.
ENDIF.
- Save -> Check ->Activate.
- Execute.
thank you very much . Great help for beginners.
ReplyDeletevery nice explanation.
ReplyDeleteThanks for the properly explaining this. Could you also explain is there any alternate solution for this or is this the only solution. Thanks in advance!
ReplyDeleteThanks Good Share
ReplyDelete