Function Module
Execute T-code se37
Output Parameter
Input parameter
Data Base Table
Code in Function Module
Then Execute T-code se38
*&---------------------------------------------------------------------*
*& Report ZFUNMOD3 *
*&Author tech.sap29@gmail.com *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
REPORT ZFUNMOD3 .
TABLES: MARA.
DATA: IT_MARD LIKE MARD OCCURS 1 WITH HEADER LINE.
PARAMETERS: P1 LIKE MARA-MATNR.
CALL FUNCTION 'ZFUNMOD3'
EXPORTING
P_MATNR = P1
IMPORTING
X_MARA = MARA
TABLES
I_MARD = IT_MARD.
IF NOT MARA IS INITIAL.
WRITE:/ 'MARA DETAILS'.
WRITE:/ MARA-MATNR, MARA-MTART, MARA-MATKL.
ENDIF.
IF NOT IT_MARD[] IS INITIAL.
WRITE:/ 'MARD DETAILS'.
LOOP AT IT_MARD.
WRITE:/ IT_MARD-MATNR, IT_MARD-WERKS, IT_MARD-LGORT,IT_MARD-LABST.
ENDLOOP.
ENDIF.
No comments:
Post a Comment