*&---------------------------------------------------------------------*
*& Report ZINTDEMO
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZINTDEMO.
DATA : IT_MARA TYPE TABLE OF MARA,
WA_MARA TYPE MARA,
IT_MAKT TYPE TABLE OF MAKT,
WA_MAKT TYPE MAKT.
DATA : FNAM(20), FVAL(30).
SELECT-OPTIONS : S_MATNR FOR WA_MARA-MATNR.
INITIALIZATION.
AT SELECTION-SCREEN.
PERFORM VALIDATE_INPUT.
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM DISPLAY_DATA.
TOP-OF-PAGE.
PERFORM DISPLAY_TOPOFPAGE.
AT LINE-SELECTION.
PERFORM DISPLAY_SECONDLIST.
TOP-OF-PAGE DURING LINE-SELECTION.
PERFORM LINE_TOPOFPAGE.
FORM VALIDATE_INPUT .
IF S_MATNR IS INITIAL.
MESSAGE 'Enter material' TYPE 'E'.
ENDIF.
ENDFORM.
FORM GET_DATA .
SELECT * FROM MARA INTO TABLE IT_MARA WHERE MATNR IN S_MATNR.
ENDFORM.
FORM DISPLAY_DATA .
LOOP AT IT_MARA INTO WA_MARA.
WRITE:/ WA_MARA-MATNR, WA_MARA-MTART, WA_MARA-MATKL, WA_MARA-MEINS.
ENDLOOP.
ENDFORM.
FORM DISPLAY_SECONDLIST.
GET CURSOR FIELD FNAM VALUE FVAL.
CONDENSE FNAM.
CONDENSE FVAL.
IF FNAM = 'WA_MARA-MATNR'.
SELECT SINGLE * FROM MARA INTO WA_MARA WHERE MATNR = FVAL .
WRITE:/ WA_MARA-MATNR, WA_MARA-MBRSH, WA_MARA-MTART, WA_MARA-MATKL, WA_MARA-MEINS, WA_MARA-ERSDA, WA_MARA-ERNAM.
ENDIF.
ENDFORM.
FORM DISPLAY_TOPOFPAGE .
WRITE:/ 'Material Details' COLOR 4.
ULINE .
ENDFORM.
FORM LINE_TOPOFPAGE .
IF FNAM = 'WA_MARA-MATNR'.
WRITE:/ 'Material details ', WA_MARA-MATNR COLOR 5.
ULINE.
ENDIF.
ENDFORM.
*& Report ZINTDEMO
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZINTDEMO.
DATA : IT_MARA TYPE TABLE OF MARA,
WA_MARA TYPE MARA,
IT_MAKT TYPE TABLE OF MAKT,
WA_MAKT TYPE MAKT.
DATA : FNAM(20), FVAL(30).
SELECT-OPTIONS : S_MATNR FOR WA_MARA-MATNR.
INITIALIZATION.
AT SELECTION-SCREEN.
PERFORM VALIDATE_INPUT.
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM DISPLAY_DATA.
TOP-OF-PAGE.
PERFORM DISPLAY_TOPOFPAGE.
AT LINE-SELECTION.
PERFORM DISPLAY_SECONDLIST.
TOP-OF-PAGE DURING LINE-SELECTION.
PERFORM LINE_TOPOFPAGE.
FORM VALIDATE_INPUT .
IF S_MATNR IS INITIAL.
MESSAGE 'Enter material' TYPE 'E'.
ENDIF.
ENDFORM.
FORM GET_DATA .
SELECT * FROM MARA INTO TABLE IT_MARA WHERE MATNR IN S_MATNR.
ENDFORM.
FORM DISPLAY_DATA .
LOOP AT IT_MARA INTO WA_MARA.
WRITE:/ WA_MARA-MATNR, WA_MARA-MTART, WA_MARA-MATKL, WA_MARA-MEINS.
ENDLOOP.
ENDFORM.
FORM DISPLAY_SECONDLIST.
GET CURSOR FIELD FNAM VALUE FVAL.
CONDENSE FNAM.
CONDENSE FVAL.
IF FNAM = 'WA_MARA-MATNR'.
SELECT SINGLE * FROM MARA INTO WA_MARA WHERE MATNR = FVAL .
WRITE:/ WA_MARA-MATNR, WA_MARA-MBRSH, WA_MARA-MTART, WA_MARA-MATKL, WA_MARA-MEINS, WA_MARA-ERSDA, WA_MARA-ERNAM.
ENDIF.
ENDFORM.
FORM DISPLAY_TOPOFPAGE .
WRITE:/ 'Material Details' COLOR 4.
ULINE .
ENDFORM.
FORM LINE_TOPOFPAGE .
IF FNAM = 'WA_MARA-MATNR'.
WRITE:/ 'Material details ', WA_MARA-MATNR COLOR 5.
ULINE.
ENDIF.
ENDFORM.