Download Android App of sapabap-vamsi

sapabap-vamsi : Download Android App for Mobiles

Friday, September 23, 2011

Export Quantity


*&---------------------------------------------------------------------*
*& Report  ZEXPORT_QTY
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZEXPORT_QTY.

TYPE-POOLS : SLIS.


TABLES : zbrc,zbrc_item , zcomminv_item , zinvoice1,zship , zadvance_master , ZSION.

types : BEGIN OF itab  ,
      advno     like zbrc-advno,
      advdate   like zbrc-advdate,
      vbeln     like zbrc-vbeln,
      comm_date like zbrc-comm_date,
      TOTFOBUSD LIKE ZBRC-TOTFOBUSD,
      EXRATE    LIKE ZBRC-EXRATE,
      TOTFOBRS  LIKE ZBRC-TOTFOBRS,

      sbillno   like zbrc_item-sbillno,
      sbilldate like zbrc_item-sbilldate,

      thickness like zcomminv_item-thickness,
      gross_qty like zcomminv_item-gross_qty,
      netqty    like zcomminv_item-netqty,
      gsm       like zcomminv_item-gsm,

      fobvalfc like zship-fobvalfc,
      exchangerate like zship-exchangerate,
      fobvalrs like zship-fobvalrs,
      desp_goods like zship-desp_goods,

      exportfcval   like Zadvance_master-exportfcval,
      SIONNO LIKE zadvance_master-SIONNO,
      PRCODE1 LIKE ZADVANCE_MASTER-PRCODE,

      SIONNO1 LIKE ZSION-SIONNO,
       ITEMQTY LIKE ZSION-ITEMQTY,

        ITEMQTY1 LIKE ZSION-ITEMQTY,
         ITEMQTY2 LIKE ZSION-ITEMQTY,
          ITEMQTY3 LIKE ZSION-ITEMQTY,
           ITEMQTY4 LIKE ZSION-ITEMQTY,
            ITEMQTY5 LIKE ZSION-ITEMQTY,
             ITEMQTY6 LIKE ZSION-ITEMQTY,
              ITEMQTY7 LIKE ZSION-ITEMQTY,
               ITEMQTY8 LIKE ZSION-ITEMQTY,
                ITEMQTY9 LIKE ZSION-ITEMQTY,
                ITEMQTY10 LIKE ZSION-ITEMQTY,

        ITEMNAME LIKE ZSION-ITEMNAME,
           PRCODE LIKE ZSION-PRCODE,
          SRNO LIKE ZSION-SRNO,
      END OF itab,

      BEGIN OF t_brc ,
      advno     like zbrc-advno,
      advdate   like zbrc-advdate,
      vbeln     like zbrc-vbeln,
      comm_date like zbrc-comm_date,
      TOTFOBUSD LIKE ZBRC-TOTFOBUSD,
      EXRATE    LIKE ZBRC-EXRATE,
      TOTFOBRS  LIKE ZBRC-TOTFOBRS,
        END OF t_brc,

     BEGIN OF t_brcitem ,
      vbeln    like zbrc_item-vbeln,
      sbillno   like zbrc_item-sbillno,
      sbilldate like zbrc_item-sbilldate,
     END OF t_brcitem,

     BEGIN OF t_comminvitem ,
      vbeln     like zcomminv_item-vbeln,
      thickness like zcomminv_item-thickness,
      gross_qty like zcomminv_item-gross_qty,
      netqty    like zcomminv_item-netqty,
      gsm       like zcomminv_item-gsm,
     END OF t_comminvitem,

     BEGIN OF t_zship,
       vbeln like zship-vbeln,
       sbdate like zship-sbdate,
       fobvalfc like zship-fobvalfc,
       exchangerate like zship-exchangerate,
       fobvalrs like zship-fobvalrs,
       desp_goods like zship-desp_goods,
     end of t_zship,

     begin of t_zadvance_master,
       exportfcval like Zadvance_master-exportfcval,
       SIONNO LIKE Zadvance_master-SIONNO,
       PRCODE1 LIKE ZADVANCE_MASTER-PRCODE,
       end of t_zadvance_master,

        begin of T_ZSION,
           SIONNO1 LIKE ZSION-SIONNO,
          ITEMQTY LIKE ZSION-ITEMQTY,
           ITEMNAME LIKE ZSION-ITEMNAME,
          PRCODE LIKE ZSION-PRCODE,
          SRNO LIKE ZSION-SRNO,

           ITEMQTY1 LIKE ZSION-ITEMQTY,
         ITEMQTY2 LIKE ZSION-ITEMQTY,
          ITEMQTY3 LIKE ZSION-ITEMQTY,
           ITEMQTY4 LIKE ZSION-ITEMQTY,
            ITEMQTY5 LIKE ZSION-ITEMQTY,
             ITEMQTY6 LIKE ZSION-ITEMQTY,
              ITEMQTY7 LIKE ZSION-ITEMQTY,
               ITEMQTY8 LIKE ZSION-ITEMQTY,
                ITEMQTY9 LIKE ZSION-ITEMQTY,
                ITEMQTY10 LIKE ZSION-ITEMQTY,
       end of t_ZSION.


*CLEAR wa_sortcat.




data : it_final TYPE itab OCCURS 0 WITH HEADER LINE.
data : it_brc TYPE t_brc OCCURS 0 WITH HEADER LINE.

data : it_brcitem TYPE t_brcitem occurs 0 WITH HEADER LINE.

data : it_comminvitem TYPE t_comminvitem OCCURs 0 WITH HEADER LINE.

data : it_zship TYPE t_zship OCCURS 0 WITH HEADER LINE.

data : it_zadvance_master type t_zadvance_master OCCURS 0 WITH HEADER LINE.

data : it_zsion type t_zsion OCCURS 0 WITH HEADER LINE.

data : wa_final TYPE itab,
      wa_it_brc TYPE t_brc,
      wa_it_brcitem TYPE t_brcitem,
      wa_it_comminvitem TYPE t_comminvitem,
      wa_it_zship type t_zship,
      wa_it_zadvance_master type t_zadvance_master,
        wa_it_zsion type t_zsion.


 sELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-100.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS : advno1 FOR zbrc-advno DEFAULT '3110032732'.
SELECTION-SCREEN SKIP 1.
selection-screen END OF BLOCK B1.
data: rslt   type i.

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

DATA: I_SORT TYPE SLIS_t_SORTINFO_ALV .


DATA: REPID LIKE SY-REPID,
      FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
      LAYOUT   TYPE SLIS_LAYOUT_ALV,
      EVENT    TYPE SLIS_T_EVENT.




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

  select * from zbrc into CORRESPONDING FIELDS OF TABLE it_brc
    where advno in advno1 .
    sort it_brc by vbeln.

loop at it_brc.
  wa_final-advno = it_brc-advno.
  wa_final-advdate = it_brc-advdate.
  wa_final-vbeln = it_brc-vbeln.
  wa_final-comm_date = it_brc-comm_date.
  wa_final-TOTFOBUSD = it_brc-TOTFOBUSD.
  wa_final-EXRATE = it_brc-EXRATE.
  wa_final-TOTFOBRS = it_brc-TOTFOBRS.
* ENDLOOP.

 select * from zbrc_item into CORRESPONDING FIELDS OF TABLE it_brcitem
    where vbeln = it_brc-vbeln.

loop at it_brcitem.
  wa_final-sbillno = it_brcitem-sbillno.
  wa_final-sbilldate = it_brcitem-sbilldate.
ENDLOOP.


 select * from zcomminv_item into CORRESPONDING FIELDS OF TABLE it_comminvitem
    where vbeln = it_brc-vbeln.

  loop at it_comminvitem.
   wa_final-thickness = it_comminvitem-thickness.
   wa_final-gross_qty = it_comminvitem-gross_qty.
   wa_final-netqty = it_comminvitem-netqty.
   wa_final-gsm = it_comminvitem-gsm.
   endloop.

   select * from zship into CORRESPONDING FIELDS OF TABLE it_zship
    where vbeln = it_brcitem-sbillno.
loop at it_zship.
  wa_final-fobvalfc = it_zship-fobvalfc.
  wa_final-EXCHANGERATE = it_zship-EXCHANGERATE.
  wa_final-fobvalrs = it_zship-fobvalrs.
  wa_final-desp_goods = it_zship-desp_goods.
  ENDLOOP.

select * from zadvance_master INTO CORRESPONDING FIELDS OF TABLE it_zadvance_master
    WHERE
*  WAERS1 = 'USD' AND
  advno = it_brc-advno  .

loop at it_zadvance_master.
  wa_final-exportfcval = it_zadvance_master-exportfcval.
*  wa_final-SIONNO = it_zadvance_master-SIONNO.
  endloop.

select * FROM ZSION into CORRESPONDING FIELDS OF TABLE it_zsion
  WHERE SIONNO = it_zadvance_master-SIONNO .

loop at it_zsion.

      IF it_zsion-ITEMNAME = 'NON-ALLOY HOT ROLLED STEEL SHEETS/STRIPS/WIDE COILS'.
      MOVE it_zsion-ITEMQTY to wa_final-ITEMQTY1.
      ENDIF.

      IF it_zsion-ITEMNAME = 'ROLLING MILL ROLLS'.
      MOVE it_zsion-ITEMQTY to wa_final-ITEMQTY2.
      ENDIF.

      IF it_zsion-ITEMNAME = 'ROLLING OIL'.
      MOVE it_zsion-ITEMQTY to wa_final-ITEMQTY3.
      ENDIF.

      IF it_zsion-ITEMNAME = 'PICKLING OIL'.
      MOVE it_zsion-ITEMQTY to wa_final-ITEMQTY4.
      ENDIF.

      IF it_zsion-ITEMNAME = 'VCI RUSTO-PAPER'.
      MOVE it_zsion-ITEMQTY to wa_final-ITEMQTY5.
      ENDIF.

      IF it_zsion-ITEMNAME = 'ZINC'.
      MOVE it_zsion-ITEMQTY to wa_final-ITEMQTY6.
      ENDIF.

      IF it_zsion-ITEMNAME = 'STEEL STRAPPING'.
      MOVE it_zsion-ITEMQTY to wa_final-ITEMQTY7.
      ENDIF.

      IF it_zsion-ITEMNAME = 'GUARD FILM'.
      MOVE it_zsion-ITEMQTY to wa_final-ITEMQTY8.
      ENDIF.

      IF it_zsion-ITEMNAME = 'BACKER'.
      MOVE it_zsion-ITEMQTY to wa_final-ITEMQTY9.
      ENDIF.

      IF it_zsion-ITEMNAME = 'PRIMER'.
      MOVE it_zsion-ITEMQTY to wa_final-ITEMQTY10.
      ENDIF.
   APPEND wa_final to it_final.
endloop.



  loop at it_final.

    ENDLOOP.

    endloop.



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

PERFORM BUILD_LFIELDCAT CHANGING FIELDCAT.
PERFORM BUILD_LAYOUT.
PERFORM t_sort USING i_sort .
PERFORM BUILD_EVENT CHANGING EVENT.
PERFORM DISPLAY.

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

FORM BUILD_LFIELDCAT CHANGING P_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
  DATA:  LFIELDCAT TYPE SLIS_FIELDCAT_ALV.



  LFIELDCAT-FIELDNAME = 'VBELN' .
  LFIELDCAT-SELTEXT_M = 'Commercial invoice No.'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
*  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

  LFIELDCAT-FIELDNAME = 'COMM_DATE' .
  LFIELDCAT-SELTEXT_M = 'Commercial Invoice Date'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
*  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

  LFIELDCAT-FIELDNAME = 'SBILLNO' .
  LFIELDCAT-SELTEXT_M = 'Shipping Bill No.'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
*  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.


  LFIELDCAT-FIELDNAME = 'SBILLDATE' .
  LFIELDCAT-SELTEXT_M = 'Shipping Bill Date'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
*  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.


  LFIELDCAT-FIELDNAME = 'THICKNESS' .
  LFIELDCAT-SELTEXT_M = 'Thickness'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '10'.
*  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.


  LFIELDCAT-FIELDNAME = 'GROSS_QTY' .
  LFIELDCAT-SELTEXT_M = 'Thickness Quantity'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '10'.
*  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

   LFIELDCAT-FIELDNAME = 'NETQTY' .
  LFIELDCAT-SELTEXT_M = 'Total Quantity'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '10'.
  LFIELDCAT-DO_SUM    = 'X'.
   APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

   LFIELDCAT-FIELDNAME = 'GSM' .
  LFIELDCAT-SELTEXT_M = 'GSM'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '10'.
*  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

 LFIELDCAT-FIELDNAME = 'FOBVALFC' .
  LFIELDCAT-SELTEXT_M = 'IN EURO'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
*  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

  LFIELDCAT-FIELDNAME = 'EXCHANGERATE' .
  LFIELDCAT-SELTEXT_M = 'EURO EX.RATE'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '10'.
*  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

 LFIELDCAT-FIELDNAME = 'EXPORTFCVAL' .
  LFIELDCAT-SELTEXT_M = 'License Currency in USD'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '20'.
*  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

  LFIELDCAT-FIELDNAME = 'FOBVALRS' .
  LFIELDCAT-SELTEXT_M = 'VALUE IN RS'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
*  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

LFIELDCAT-FIELDNAME = 'TOTFOBUSD' .
  LFIELDCAT-SELTEXT_M = 'BRC VALUE IN EURO'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
*  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

  LFIELDCAT-FIELDNAME = 'EXRATE' .
  LFIELDCAT-SELTEXT_M = 'BRC EXT.RATE'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
*  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

  LFIELDCAT-FIELDNAME = 'TOTFOBRS' .
  LFIELDCAT-SELTEXT_M = 'BRC VALUE IN RS'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
*  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.


  LFIELDCAT-FIELDNAME = 'ITEMQTY1' .
  LFIELDCAT-SELTEXT_M = 'HOT ROLLED NON-ALLOY STEEL'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
*   LFIELDCAT-NO_OUT = ''.
  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

LFIELDCAT-FIELDNAME = 'ITEMQTY2' .
  LFIELDCAT-SELTEXT_M = 'ROLLING MILL ROLLS'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

  LFIELDCAT-FIELDNAME = 'ITEMQTY3' .
  LFIELDCAT-SELTEXT_M = 'ROLLING OIL'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

  LFIELDCAT-FIELDNAME = 'ITEMQTY4' .
  LFIELDCAT-SELTEXT_M = 'PICKING OIL'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

  LFIELDCAT-FIELDNAME = 'ITEMQTY5' .
  LFIELDCAT-SELTEXT_M = 'VCI RUSTO PAPER'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

  LFIELDCAT-FIELDNAME = 'ITEMQTY6' .
  LFIELDCAT-SELTEXT_M = 'ZINC'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
*   LFIELDCAT-HIDE = 'X'.
  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.


  LFIELDCAT-FIELDNAME = 'ITEMQTY7' .
  LFIELDCAT-SELTEXT_M = 'STEEL STRAPPING'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

  LFIELDCAT-FIELDNAME = 'ITEMQTY8' .
  LFIELDCAT-SELTEXT_M = 'GUARD FILM'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

  LFIELDCAT-FIELDNAME = 'ITEMQTY9' .
  LFIELDCAT-SELTEXT_M = 'BACKER'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

  LFIELDCAT-FIELDNAME = 'ITEMQTY10' .
  LFIELDCAT-SELTEXT_M = 'PRIMER'.
  LFIELDCAT-COL_POS   = '0'.
  LFIELDCAT-EMPHASIZE = 'C210'.
  LFIELDCAT-outputlen = '15'.
  LFIELDCAT-DO_SUM    = 'X'.
  APPEND LFIELDCAT TO FIELDCAT.
  CLEAR LFIELDCAT.

  ENDFORM.                    "BUILD_FIELDCAT

form alv_header using it_listheader type slis_t_listheader.

  data : wa_listheader  type slis_listheader.

ENDFORM.                    "alv_header


*&---------------------------------------------------------------------*
*&      Form  BUILD_LAYOUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM BUILD_LAYOUT.

  LAYOUT-f2code             = '&ETA'.
  LAYOUT-window_titlebar    = 'EXPORT STATEMENT'.
  LAYOUT-zebra              = 'X'.

ENDFORM.                    "BUILD_LAYOUT

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

FORM t_sort USING p_i_sort TYPE slis_t_sortinfo_alv .

  data: wa_sort TYPE slis_sortinfo_alv .
  REFRESH p_i_sort .

CLEAR wa_sort.

  wa_sort-spos = '01' .
  wa_sort-fieldname = 'VBELN'.
  wa_sort-tabname = 'itab'.
  wa_sort-up = 'X'.
  wa_sort-subtot = 'X'.
  APPEND wa_sort TO P_i_sort .

   wa_sort-spos = '01' .
  wa_sort-fieldname = 'SBILLNO'.
  wa_sort-tabname = 'itab'.
  wa_sort-up = 'X'.
  wa_sort-subtot = 'X'.
  APPEND wa_sort TO P_i_sort .

ENDFORM.                    " sub_populate_sort


*----------------------------------------------------------------*
FORM BUILD_EVENT CHANGING P_EVENT TYPE SLIS_T_EVENT.
  DATA: LEVENT TYPE SLIS_ALV_EVENT.

  CLEAR LEVENT.
  LEVENT-NAME = 'TOP_OF_PAGE'.
  LEVENT-FORM = 'TOP_OF_PAGE'.
  APPEND LEVENT TO EVENT.
  CLEAR LEVENT.

  LEVENT-NAME = 'END_OF_LIST'.
  LEVENT-FORM = 'END_OF_LIST'.
  APPEND LEVENT TO EVENT.
  CLEAR LEVENT.

ENDFORM.                    "BUILD_EVENT

*-------------------------------------------------------------------*
FORM TOP_OF_PAGE.

  DATA:T_HEADER TYPE SLIS_T_LISTHEADER,
       WA_HEADER TYPE SLIS_LISTHEADER,
       T_LINE LIKE  WA_HEADER-INFO .

  wa_header-typ  = 'H'.
  wa_header-info = 'EXPORT STATEMENT'.
  APPEND wa_header TO T_HEADER.
  CLEAR WA_HEADER.

  wa_header-typ  = 'S'.
  wa_header-info = it_final-advno.
  WA_HEADER-KEY = 'License Number :'.
  APPEND wa_header TO T_HEADER.
  CLEAR WA_HEADER.

  wa_header-typ  = 'S'.
  wa_header-info = it_final-advdate.
  WA_HEADER-KEY = 'Date :'.
  APPEND wa_header TO T_HEADER.
  CLEAR WA_HEADER.

 wa_header-typ  = 'S'.
  wa_header-info = it_final-desp_goods.
  WA_HEADER-KEY = 'Product Discription :'.
  APPEND wa_header TO T_HEADER.
  CLEAR WA_HEADER.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      IT_LIST_COMMENTARY = T_HEADER.
*   I_LOGO                   =
*   I_END_OF_LIST_GRID       =
*   I_ALV_FORM               =


ENDFORM.                    "TOP_OF_PAGE
*-------------------------------------------------------------------*

FORM END_OF_LIST.

*  WRITE :/ ''.

ENDFORM.                    "END_OF_LIST

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

FORM DISPLAY.

  REPID = SY-REPID.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
*   I_INTERFACE_CHECK              = ' '
*   I_BYPASSING_BUFFER             =
*   I_BUFFER_ACTIVE                = ' '
      I_CALLBACK_PROGRAM           = REPID
*   I_CALLBACK_PF_STATUS_SET       = ' '
*   I_CALLBACK_USER_COMMAND        = ' '
*   I_STRUCTURE_NAME               =
      IS_LAYOUT                    = LAYOUT
      IT_FIELDCAT                  = FIELDCAT
*   IT_EXCLUDING                   =
*   IT_SPECIAL_GROUPS              =
   IT_SORT                         = I_SORT[]
*   IT_FILTER                      =
*   IS_SEL_HIDE                    =
*   I_DEFAULT                      = 'X'
*   I_SAVE                         = ' '
*   IS_VARIANT                     =
    IT_EVENTS                      = EVENT[]
*   IT_EVENT_EXIT                  =
*   IS_PRINT                       =
*   IS_REPREP_ID                   =
*   I_SCREEN_START_COLUMN          = 0
*   I_SCREEN_START_LINE            = 0
*   I_SCREEN_END_COLUMN            = 0
*   I_SCREEN_END_LINE              = 0
*   IR_SALV_LIST_ADAPTER           =
*   IT_EXCEPT_QINFO                =
*   I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
* IMPORTING
*   E_EXIT_CAUSED_BY_CALLER        =
*   E_EXIT_CAUSED_BY_CALLER        =
*   ES_EXIT_CAUSED_BY_USER         =
    TABLES
      T_OUTTAB                       = it_final[]
 EXCEPTIONS
   PROGRAM_ERROR                  = 1
   OTHERS                         = 2
            .
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

ENDFORM.                    "DISPLAY
"DISPLAY
*----------------------------------------------------------------------*

No comments:

Post a Comment