Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

serach help for field in alv

*&---------------------------------------------------------------------*

*& Report  ZQC_R_WO_TRACK

*& AUTHOR : NARENDRA SINGH SISODIYA

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

REPORT  ZQC_R_WO_TRACK.

TYPE-POOLS: SLIS.

**************EXTERNAL TABLE DECLARATION***********

TABLES : AUFK, AFPO, AFKO, RESB, MSKA, MARM, MARD.

**********************************************************************

*************STRUCTURE DEFINE*********

**********************************************************************

TYPES : BEGIN OF ST_AUFK,

         AUFNR TYPE AUFK-AUFNR,

         AUART TYPE AUFK-AUART,

         WERKS TYPE AUFK-WERKS,

         KDAUF TYPE AUFK-KDAUF,"SALES ORDER

         KDPOS TYPE AUFK-KDPOS,"LINE ITEM

         MWONO TYPE AUFK-MWONO,"MANAUAL WORK ORDER

         IHEATNO TYPE AUFK-IHEATNO,"HEAT NO

         IDTNO TYPE AUFK-IDTNO,"ID NO

         IDAT2 TYPE AUFK-IDAT2,"TECO WORK ORDER DATE......WHOSE SALES ORDERED R BLOCKED.

         END OF ST_AUFK,

         BEGIN OF ST_AFPO,

         AUFNR TYPE AFPO-AUFNR,

         POSNR TYPE AFPO-POSNR,

         KDAUF TYPE AFPO-KDAUF,

         KDPOS TYPE AFPO-KDPOS,

         MATNR TYPE AFPO-MATNR,

         PGMNG TYPE AFPO-PGMNG,

         WEMNG TYPE AFPO-WEMNG,"QtY of goods recve or deliverd QuantitY.

         AMEIN TYPE AFPO-AMEIN,

         END OF ST_AFPO,

         BEGIN OF ST_AFKO,

         AUFNR TYPE AFKO-AUFNR,

         RSNUM TYPE AFKO-RSNUM,

         GAMNG TYPE AFKO-GAMNG,"TARGET QUANTITY

         GMEIN TYPE AFKO-GMEIN,"UNIT

         PLNBEZ TYPE AFKO-PLNBEZ,

         END OF ST_AFKO,

         BEGIN OF ST_RESB,

         RSNUM TYPE RESB-RSNUM,

         RSPOS TYPE RESB-RSPOS,

         XLOEK TYPE RESB-XLOEK,"DELETED MATERIAL

         MATNR TYPE RESB-MATNR,"COMPONENT MATERIAL

         CHARG TYPE RESB-CHARG,

         AUFNR TYPE RESB-AUFNR,

         KDAUF TYPE RESB-KDAUF,

         KDPOS TYPE RESB-KDPOS,

         END OF ST_RESB,

         BEGIN OF ST_MAKT,

         MATNR TYPE MAKT-MATNR,

         MAKTX TYPE MAKT-MAKTX,

         END OF ST_MAKT,

         BEGIN OF ST_MSKA,

         MATNR TYPE MSKA-MATNR,

         WERKS TYPE MSKA-WERKS,

         VBELN TYPE MSKA-VBELN,

         POSNR TYPE MSKA-POSNR,

         CHARG TYPE MSKA-CHARG,

         SOBKZ TYPE MSKA-SOBKZ,

         KALAB TYPE MSKA-KALAB,"unrestricted USE STOCK

         UMREN TYPE P DECIMALS 3,

         TOTKG TYPE MSKA-KALAB,

         END OF ST_MSKA,

         BEGIN OF T_MARM,

         MATNR TYPE MARM-MATNR,"Material Number

         MEINH TYPE MARM-MEINH,"Alternative Unit of Measure for Stockkeeping Unit

         UMREN TYPE P DECIMALS 3,"Denominator for conversion to base units of measure

         UMREZ TYPE P DECIMALS 3,"Numerator for Conversion to Base Units of Measure

         END OF T_MARM,

         BEGIN OF T_MARD,

         MATNR TYPE MARD-MATNR,

         WERKS TYPE MARD-WERKS,

         LABST TYPE MARD-LABST,"UNRESTRICED STOCK

         END OF T_MARD,

         BEGIN OF ST_FINAL,

         AUFNR TYPE AUFK-AUFNR,

         AUART TYPE AUFK-AUART,

         WERKS TYPE AUFK-WERKS,

         KDAUF TYPE AUFK-KDAUF,

         KDPOS TYPE AUFK-KDPOS,

         MWONO TYPE AUFK-MWONO,

         IHEATNO TYPE AUFK-IHEATNO,

         IDTNO TYPE AUFK-IDTNO,

         IDAT2 TYPE AUFK-IDAT2,

         WEMNG TYPE AFPO-WEMNG,"DEL QTY

         AMEIN TYPE AFPO-AMEIN," UNIT

         MATNR TYPE MAKT-MATNR,

         MAKTX TYPE MAKT-MAKTX,

         RSNUM TYPE AFKO-RSNUM,

         GAMNG TYPE AFKO-GAMNG,

         GMEIN TYPE AFKO-GMEIN,

         PLNBEZ TYPE AFKO-PLNBEZ,

         RSPOS TYPE RESB-RSPOS,

         XLOEK TYPE RESB-XLOEK,

         CHARG TYPE RESB-CHARG,

         VBELN TYPE MSKA-VBELN,

         POSNR TYPE MSKA-POSNR,

         SOBKZ TYPE MSKA-SOBKZ,

         KALAB TYPE MSKA-KALAB,

         TOTKG TYPE MSKA-KALAB,

         MEINH TYPE MARM-MEINH,

         UMREN TYPE P DECIMALS 3,

         UMREZ TYPE P DECIMALS 3,

         LABST TYPE MARD-LABST,

         END OF ST_FINAL.

**********************************************************************

***********INTERNAL TABLE OR WORK AREA DEFINE************

**********************************************************************

DATA : T_AUFK TYPE TABLE OF ST_AUFK,

        WA_AUFK TYPE ST_AUFK,

        T_AFPO TYPE STANDARD TABLE OF ST_AFPO,

        WA_AFPO TYPE ST_AFPO,

        T_AFKO TYPE STANDARD TABLE OF ST_AFKO,

        WA_AFKO TYPE ST_AFKO,

        T_MAKT TYPE STANDARD TABLE OF ST_MAKT,

        WA_MAKT TYPE ST_MAKT,

        T_RESB TYPE STANDARD TABLE OF ST_RESB,

        WA_RESB TYPE ST_RESB,

        T_MSKA TYPE STANDARD TABLE OF ST_MSKA,

        WA_MSKA TYPE ST_MSKA,

        T_MARM TYPE TABLE OF T_MARM,

        WA_MARM TYPE T_MARM,

        T_MARD TYPE TABLE OF T_MARD,

        WA_MARD TYPE T_MARD,

        IT_FINAL TYPE STANDARD TABLE OF ST_FINAL,

        WA_FINAL TYPE ST_FINAL.

DATA : SY_IND TYPE SY-TABIX.

*       TOTKG  TYPE KALAB.

**********************************************************************

*****DECLERATION OF FIELD CATALOG**********

**********************************************************************

DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,

        WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,

        GS_LAYOUT   TYPE SLIS_LAYOUT_ALV,

        WA_LAYOUT   TYPE SLIS_LAYOUT_ALV,

        IT_SORTCAT TYPE SLIS_T_SORTINFO_ALV,

        WA_SORTCAT TYPE SLIS_SORTINFO_ALV.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS : S_MWONO FOR AUFK-MWONO,

                  S_KDAUF FOR AUFK-KDAUF MATCHCODE OBJECT VMVA,

                  S_KDPOS FOR AUFK-KDPOS.

SELECTION-SCREEN END OF BLOCK B1.

START-OF-SELECTION.

   PERFORM FETCH_AUFK.

   PERFORM FETCH_AFPO.

   PERFORM FETCH_AFKO.

   PERFORM GET_COMPONENT.

   PERFORM FETCH_MAKT.

   PERFORM FETCH_MSKA.

   PERFORM FETCH_MARM.

   PERFORM FETCH_MARD.

   PERFORM FETCH_FINAL.

   PERFORM DATA_FINAL.

   PERFORM FIELDCATALOG.

*  PERFORM CREAT_FC.

*  PERFORM SORTCATALOG.

   PERFORM CALL_ALV.

*&---------------------------------------------------------------------*

*&      Form  FETCH_AUFK

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM FETCH_AUFK .

   SELECT AUFNR

          AUART

          WERKS

          KDAUF

          KDPOS

          MWONO

          IHEATNO

          IDTNO

          IDAT2

                FROM AUFK INTO TABLE T_AUFK

                WHERE KDAUF IN S_KDAUF

                   AND KDPOS IN S_KDPOS

                   AND MWONO IN S_MWONO

                   AND IDAT2 = '00000000'.

   " IDAT2 IS NULL OR IDAT2 = ''.

   "IDAT2 IS INNITIAL IS NOT CORRECT

   IF T_AUFK[] IS INITIAL.

     MESSAGE E000(38) WITH ' NO DATA FOUND FOR SELECTED CRITERIA '(001).

   ENDIF.

ENDFORM.                    " FETCH_AUFK

*&---------------------------------------------------------------------*

*&      Form  FETCH_AFKO

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM FETCH_AFKO .

   IF T_AUFK[] IS NOT INITIAL.

     SELECT  AUFNR

             RSNUM

             GAMNG

             GMEIN

             PLNBEZ FROM AFKO INTO TABLE T_AFKO

                    FOR ALL ENTRIES IN T_AUFK

                    WHERE AUFNR = T_AUFK-AUFNR.

   ENDIF.

ENDFORM.                    " FETCH_AFKO

*&---------------------------------------------------------------------*

*&      Form  FETCH_AFPO

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM FETCH_AFPO .

   IF T_AUFK[] IS NOT INITIAL.

     SELECT : AUFNR

              POSNR

              KDAUF

              KDPOS

              MATNR

              PGMNG

              WEMNG "DEL QTY

              AMEIN FROM AFPO INTO TABLE T_AFPO

                    FOR ALL ENTRIES IN T_AUFK

                    WHERE AUFNR = T_AUFK-AUFNR

                      AND KDAUF = T_AUFK-KDAUF

                      AND KDPOS = T_AUFK-KDPOS.

   ENDIF.

ENDFORM.                    " FETCH_AFPO

*&---------------------------------------------------------------------*

*&      Form  GET_COMPONENT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM GET_COMPONENT .

   IF T_AFKO[] IS NOT INITIAL.

     SELECT : RSNUM

              RSPOS

              XLOEK

              MATNR

              CHARG

              AUFNR

              KDAUF

              KDPOS FROM RESB INTO TABLE T_RESB

                    FOR ALL ENTRIES IN T_AFKO

                    WHERE RSNUM = T_AFKO-RSNUM

                      AND AUFNR = T_AFKO-AUFNR.

*                     AND XLOEK NE 'X'.

   ENDIF.

ENDFORM.                    " GET_COMPONENT

*&---------------------------------------------------------------------*

*&      Form  FETCH_MAKT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM FETCH_MAKT .

   IF T_RESB[] IS NOT INITIAL.

     SELECT : MATNR

              MAKTX FROM MAKT INTO TABLE T_MAKT

                    FOR ALL ENTRIES IN T_RESB

                    WHERE MATNR = T_RESB-MATNR.

   ENDIF.

ENDFORM.                    " FETCH_MAKT

*&---------------------------------------------------------------------*

*&      Form  FETCH_MSKA

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM FETCH_MSKA .

   IF T_RESB[] IS NOT INITIAL.

     SELECT : MATNR

              WERKS

              VBELN

              POSNR

              CHARG

              SOBKZ

              KALAB FROM MSKA INTO TABLE T_MSKA

                    FOR ALL ENTRIES IN T_RESB

                    WHERE MATNR = T_RESB-MATNR

                      AND VBELN = T_RESB-KDAUF

                      AND POSNR = T_RESB-KDPOS

                      AND SOBKZ ='E'

                      AND KALAB GT 0.

   ENDIF.

ENDFORM.                    " FETCH_MSKA

*&---------------------------------------------------------------------*

*&      Form  FETCH_MARM

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM FETCH_MARM .

   IF T_MSKA[] IS NOT INITIAL.

     SELECT

      MATNR

      MEINH

      UMREZ

      UMREN

    FROM MARM INTO CORRESPONDING FIELDS OF TABLE T_MARM

    FOR ALL ENTRIES IN T_MSKA

    WHERE MATNR = T_MSKA-MATNR

    AND MEINH = 'KG'     .

   ENDIF.

ENDFORM.                    " FETCH_MARM

*&---------------------------------------------------------------------*

*&      Form  FETCH_FINAL

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

*&---------------------------------------------------------------------*

*&      Form  FETCH_MARD

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM FETCH_MARD .

   IF T_MARM[] IS NOT INITIAL.

     SELECT

      MATNR

      WERKS

      LABST

           FROM MARD INTO CORRESPONDING FIELDS OF TABLE T_MARM

           FOR ALL ENTRIES IN T_MARM

           WHERE MATNR = T_MARM-MATNR.

       ENDIF.

ENDFORM.                    " FETCH_MARD

FORM FETCH_FINAL .

   LOOP AT T_AUFK INTO WA_AUFK.

     WA_FINAL-AUFNR = WA_AUFK-AUFNR.

     WA_FINAL-AUART = WA_AUFK-AUART.

     WA_FINAL-WERKS = WA_AUFK-WERKS.

     WA_FINAL-KDAUF = WA_AUFK-KDAUF.

     WA_FINAL-KDPOS = WA_AUFK-KDPOS.

     WA_FINAL-MWONO = WA_AUFK-MWONO.

     WA_FINAL-IHEATNO = WA_AUFK-IHEATNO.

     WA_FINAL-IDTNO = WA_AUFK-IDTNO.

     CLEAR WA_AFKO.

     READ TABLE T_AFPO INTO WA_AFPO WITH KEY AUFNR = WA_AUFK-AUFNR.

     IF SY-SUBRC EQ 0.

       WA_FINAL-WEMNG = WA_AFPO-WEMNG.

       WA_FINAL-AMEIN = WA_AFPO-AMEIN.

     ENDIF.

     READ TABLE T_AFKO INTO WA_AFKO WITH KEY AUFNR = WA_AUFK-AUFNR.

     IF SY-SUBRC EQ 0.

       WA_FINAL-RSNUM = WA_AFKO-RSNUM.

       WA_FINAL-GAMNG = WA_AFKO-GAMNG.

       WA_FINAL-GMEIN = WA_AFKO-GMEIN.

       WA_FINAL-PLNBEZ = WA_AFKO-PLNBEZ.

     ENDIF.

     CLEAR WA_RESB.

     READ TABLE T_RESB INTO WA_RESB WITH KEY RSNUM  WA_AFKO-RSNUM

                                             AUFNR = WA_AFKO-AUFNR.

     IF SY-SUBRC EQ 0.

*      WA_FINAL-XLOEK = WA_RESB-XLOEK.

       WA_FINAL-MATNR = WA_RESB-MATNR.

       WA_FINAL-CHARG = WA_RESB-CHARG.

       WA_FINAL-RSPOS = WA_RESB-RSPOS.

     ENDIF.

     CLEAR WA_MAKT.

     READ TABLE T_MAKT INTO WA_MAKT WITH KEY MATNR = WA_RESB-MATNR.

     IF SY-SUBRC EQ 0.

       WA_FINAL-MAKTX = WA_MAKT-MAKTX.

     ENDIF.

     CLEAR WA_MSKA.

     READ TABLE T_MSKA INTO WA_MSKA WITH KEY VBELN = WA_AUFK-KDAUF

                                             POSNR = WA_AUFK-KDPOS.

     IF SY-SUBRC EQ 0.

       WA_FINAL-SOBKZ = WA_MSKA-SOBKZ.

*      WA_FINAL-KALAB = WA_MSKA-KALAB.

     ENDIF.

     CLEAR WA_MARD.

     READ TABLE T_MARD INTO WA_MARD WITH KEY MATNR = WA_MARM-MATNR.

     IF SY-SUBRC EQ 0.

       WA_FINAL-LABST = WA_MARD-LABST.

     ENDIF.

     APPEND WA_FINAL TO IT_FINAL.

     CLEAR WA_FINAL.

   ENDLOOP.

ENDFORM. " FETCH_FINALFORM

*&---------------------------------------------------------------------*

*&      Form  DATA_FINAL

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

FORM DATA_FINAL.

   LOOP AT IT_FINAL INTO WA_FINAL.

     CLEAR SY_IND. MOVE SY-TABIX TO SY_IND.

     LOOP AT T_MSKA INTO WA_MSKA WHERE MATNR = WA_FINAL-MATNR

                                   AND VBELN = WA_FINAL-KDAUF

                                   AND POSNR = WA_FINAL-KDPOS.

       READ TABLE T_MARM INTO WA_MARM WITH KEY MATNR = WA_MSKA-MATNR.

       IF SY-SUBRC = 0 AND WA_MARM-MEINH = 'KG'.

         IF WA_MARM-UMREZ IS NOT INITIAL.

           WA_MSKA-UMREN = WA_MARM-UMREN / WA_MARM-UMREZ.

           WA_FINAL-TOTKG = WA_FINAL-TOTKG + ( WA_MSKA-KALAB * WA_MSKA-UMREN ).

           WA_FINAL-KALAB = WA_FINAL-KALAB + WA_MSKA-KALAB.

         ENDIF.

       ENDIF.

       MODIFY IT_FINAL FROM WA_FINAL INDEX SY_IND TRANSPORTING KALAB TOTKG.

       CLEAR WA_FINAL.

     ENDLOOP.

   ENDLOOP.

ENDFORM.                    "DATA_FINAL

*&---------------------------------------------------------------------*

*&      Form  FIELDCATALOG

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM FIELDCATALOG .

   PERFORM CREAT_FC USING 'AUFK' 'MWONO' 'M WO NO.' '10' 'X' '' 'C' 'C010' '' '' '' '' .

   PERFORM CREAT_FC USING 'AUFK' 'AUFNR' 'PROD ORDER NO.' '15' '' 'X' 'C' 'C010' '' '' '' ''.

   PERFORM CREAT_FC USING 'AUFK' 'KDAUF' 'SOC NO.' '15' '' '' 'C' 'C010' '' 'X' 'KDAUF' 'AUFK'.

   PERFORM CREAT_FC USING 'AUFK' 'KDPOS' 'LINE ITEM' '9' '' '' 'C' 'C010' '' '' '' ''.

   PERFORM CREAT_FC USING 'AUFK' 'IHEATNO' 'HEAT NO.' '15' '' '' 'C' 'C010' '' '' '' ''.

   PERFORM CREAT_FC USING 'AUFK' 'IDTNO' 'ID NO.' '15' '' '' 'C' 'C010' '' '' '' ''.

   PERFORM CREAT_FC USING 'AFKO' 'PLNBEZ' 'MATERIAL NO.' '20' '' '' 'C' 'C010' '' '' '' ''.

   PERFORM CREAT_FC USING 'AFKO' 'GAMNG' 'TARGET QTY.' '15' '' '' 'C' 'C010' 'X'  '' '' ''.

   PERFORM CREAT_FC USING 'AFKO' 'GMEIN' 'UNIT' '6' '' '' 'C' 'C010' '' '' '' ''.

   PERFORM CREAT_FC USING 'AFPO' 'WEMNG' 'DELIVERED QTY' '15' '' '' 'C' 'C010' 'X' '' '' ''.

   PERFORM CREAT_FC USING 'AFPO' 'AMEIN' 'UNIT' '6' '' '' 'C' 'C010' '' '' '' ''.

   PERFORM CREAT_FC USING 'RESB' 'MATNR' 'COMPONENT MATERIAL' '20' '' '' 'C' 'C010' '' '' '' ''.

   PERFORM CREAT_FC USING 'MAKT' 'MAKTX' 'MATERIAL DESCRIPTION' '20' '' '' 'C' 'C010' '' '' '' ''.

   PERFORM CREAT_FC USING 'MSKA' 'KALAB' 'TOTAL MTR' '10' '' '' 'C' 'C010' 'X' '' '' ''.

   PERFORM CREAT_FC USING 'TOTKG' 'TOTKG' 'TOTAL KG' '10' '' '' 'C' 'C010' 'X' '' '' ''.

   PERFORM CREAT_FC USING 'MARD' 'LABST' 'UNRESTRICTED STOCK' '10' '' '' 'C' 'C010' 'X' '' '' ''.

ENDFORM.                    " FIELDCATALOG

*&---------------------------------------------------------------------*

*&      Form  CREATE_FC

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM CREAT_FC USING P_TAB P_FIELD P_TEXT P_LENTH P_KEY P_HOTSPOT P_JUST P_EMPHASIZE P_DO_SUM P_F4AVAILABL P_REF_FIELD P_REF_TABLE.

   WA_FIELDCAT-TABNAME = P_TAB.

   WA_FIELDCAT-FIELDNAME = P_FIELD.

   WA_FIELDCAT-SELTEXT_L = P_TEXT.

   WA_FIELDCAT-OUTPUTLEN = P_LENTH.

   WA_FIELDCAT-KEY = P_KEY.

   WA_FIELDCAT-HOTSPOT = P_HOTSPOT.

   WA_FIELDCAT-JUST = P_JUST.

   WA_FIELDCAT-EMPHASIZE = P_EMPHASIZE.

   WA_FIELDCAT-DO_SUM = P_DO_SUM.

   WA_FIELDCAT-F4AVAILABL = P_F4AVAILABL.

   WA_FIELDCAT-REF_FIELD  = P_REF_FIELD.

   WA_FIELDCAT-REF_TABLE = P_REF_TABLE.

*  WA_FIELDCAT-DATATYPE = P_DATATYPE.

*  WA_FIELDCAT-INTTYPE = P_INTTYPE.

   APPEND WA_FIELDCAT TO IT_FIELDCAT.

   CLEAR WA_FIELDCAT.

ENDFORM.                    " CREATE_FC

*&---------------------------------------------------------------------*

*&      Form  CALL_ALV

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM CALL_ALV .

   IF IT_FINAL[] IS NOT INITIAL.

     CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

       EXPORTING

         I_CALLBACK_PROGRAM     = SY-REPID

         I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'

         IT_FIELDCAT            = IT_FIELDCAT

           IT_FIELDCAT_LVC      = IT_FIELDCAT

           SLIS_LAYOUT_ALV       = GS_LAYOUT

*       IT_SORT                = IT_SORTCAT

         I_SAVE                 = 'A'

       TABLES

         T_OUTTAB               = IT_FINAL.

   ENDIF.

ENDFORM.                    " CALL_ALV

*&---------------------------------------------------------------------*

*&      Form  top-of-page

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

FORM TOP-OF-PAGE.

*ALV Header declarations

   DATA: IT_HEADER TYPE SLIS_T_LISTHEADER,

         WA_HEADER TYPE SLIS_LISTHEADER,

         T_LINE LIKE WA_HEADER-INFO,

         LD_LINES TYPE I,

         LD_LINESC(10) TYPE C,

         LOW TYPE STRING,

         HIGH TYPE STRING,

         PLANT TYPE STRING.

* Title

   WA_HEADER-TYP  = 'H'.

   WA_HEADER-KEY  = 'HEAD'.

   WA_HEADER-INFO = 'Prakash Steelage Ltd.'.

   APPEND WA_HEADER TO IT_HEADER.

   CLEAR WA_HEADER.

* Title

   WA_HEADER-TYP  = 'S'.

   WA_HEADER-KEY  = 'REPORT :'.

   WA_HEADER-INFO = 'PRDOUCTION REPORT BY MANAUAL WORK ORDER'.

   APPEND WA_HEADER TO IT_HEADER.

   CLEAR WA_HEADER.

   CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

     EXPORTING

       IT_LIST_COMMENTARY = IT_HEADER.

ENDFORM.                    "TOP-OF-PAGE

Former Member
Not what you were looking for? View more on this topic or Ask a question