Skip to Content

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

check box.

Hello Frnds,

i need check box in my hierarchial alv list display.

i am produing my code.pls specify the changes.

&----


*& Report ZCASE9_ORDERSLISTREPORT

*&

&----


*&

*&

&----


REPORT ZCASE9_ORDERSLISTREPORT.

TYPE-POOLS: VRM,SLIS.

TABLES:VBAK,

VBAP,

VBKD,

VBEP,

KNA1,

VBPA,

MAKT,

VBUP,

TVBST.

TYPES:BEGIN OF ST_VBAK,

VBELN TYPE VBAK-VBELN,

ERDAT TYPE VBAK-ERDAT,

ERZET TYPE VBAK-ERZET,

ERNAM TYPE VBAK-ERNAM,

AUDAT TYPE VBAK-AUDAT,

LIFSK TYPE VBAK-LIFSK,

VDATU TYPE VBAK-VDATU,

VSBED TYPE VBAK-VSBED,

BSTNK TYPE VBAK-BSTNK,

BNAME TYPE VBAK-BNAME,

AEDAT TYPE VBAK-AEDAT,

END OF ST_VBAK,

BEGIN OF ST_VBAP,

VBELN1 TYPE VBAP-VBELN,

MATNR TYPE VBAP-MATNR,

CHARG TYPE VBAP-CHARG,

PSTYV TYPE VBAP-PSTYV,

ABGRU TYPE VBAP-ABGRU,

MEINS TYPE VBAP-MEINS,

VKAUS TYPE VBAP-VKAUS,

KWMENG TYPE VBAP-KWMENG,

LPRIO TYPE VBAP-LPRIO,

WERKS TYPE VBAP-WERKS,

LGORT TYPE VBAP-LGORT,

VSTEL TYPE VBAP-VSTEL,

ROUTE TYPE VBAP-ROUTE,

MVGR5 TYPE VBAP-MVGR5,

END OF ST_VBAP,

BEGIN OF ST_VBPA,

VBELN TYPE VBPA-VBELN,

KUNNR TYPE VBPA-KUNNR,

END OF ST_VBPA,

BEGIN OF ST_KNA1,

KUNNR TYPE KNA1-KUNNR,

NAME1 TYPE KNA1-NAME1,

TELF1 TYPE KNA1-TELF1,

END OF ST_KNA1,

BEGIN OF ST_MAKT,

MATNR TYPE MAKT-MATNR,

MAKTX TYPE MAKT-MAKTX,

END OF ST_MAKT,

BEGIN OF ST_VBEP,

VBELN TYPE VBEP-VBELN,

ETENR TYPE VBEP-ETENR,

WADAT TYPE VBEP-WADAT,

END OF ST_VBEP,

BEGIN OF ST_VBUP,

VBELN TYPE VBUP-VBELN,

LFSTA TYPE VBUP-LFSTA,

GBSTA TYPE VBUP-GBSTA,

END OF ST_VBUP,

begin of st_finalHDR,

VBELN TYPE VBAK-VBELN,

ERDAT TYPE VBAK-ERDAT,

ERZET TYPE VBAK-ERZET,

ERNAM TYPE VBAK-ERNAM,

AUDAT TYPE VBAK-AUDAT,

LIFSK TYPE VBAK-LIFSK,

VDATU TYPE VBAK-VDATU,

VSBED TYPE VBAK-VSBED,

BSTNK TYPE VBAK-BSTNK,

BNAME TYPE VBAK-BNAME,

AEDAT TYPE VBAK-AEDAT,

KUNNR TYPE VBPA-KUNNR,

NAME1 TYPE KNA1-NAME1,

TELF1 TYPE KNA1-TELF1,

end of st_finalHDR,

BEGIN OF ST_FINALTEM,

VBELN1 TYPE VBAP-VBELN,

LPRIO TYPE VBAP-LPRIO,

WERKS TYPE VBAP-WERKS,

LGORT TYPE VBAP-LGORT,

VSTEL TYPE VBAP-VSTEL,

ROUTE TYPE VBAP-ROUTE,

MVGR5 TYPE VBAP-MVGR5,

MATNR TYPE VBAP-MATNR,

CHARG TYPE VBAP-CHARG,

PSTYV TYPE VBAP-PSTYV,

ABGRU TYPE VBAP-ABGRU,

MEINS TYPE VBAP-MEINS,

VKAUS TYPE VBAP-VKAUS,

KWMENG TYPE VBAP-KWMENG,

MAKTX TYPE MAKT-MAKTX,

ETENR TYPE VBEP-ETENR,

WADAT TYPE VBEP-WADAT,

LFSTA TYPE VBUP-LFSTA,

GBSTA TYPE VBUP-GBSTA,

END OF ST_FINALTEM.

DATA:IT_VBAK TYPE STANDARD TABLE OF ST_VBAK,

IT_VBAP TYPE STANDARD TABLE OF ST_VBAP,

IT_VBPA TYPE STANDARD TABLE OF ST_VBPA,

IT_KNA1 TYPE STANDARD TABLE OF ST_KNA1,

IT_MAKT TYPE STANDARD TABLE OF ST_MAKT,

IT_VBEP TYPE STANDARD TABLE OF ST_VBEP,

IT_VBUP TYPE STANDARD TABLE OF ST_VBUP,

IT_FINALHDR TYPE STANDARD TABLE OF ST_FINALHDR,

IT_FINALTEM TYPE STANDARD TABLE OF ST_FINALTEM,

WA_VBAK TYPE ST_VBAK,

WA_VBAP TYPE ST_VBAP,

WA_VBPA TYPE ST_VBPA,

WA_KNA1 TYPE ST_KNA1,

WA_MAKT TYPE ST_MAKT,

WA_VBEP TYPE ST_VBEP,

WA_VBUP TYPE ST_VBUP,

WA_FINALHDR TYPE ST_FINALHDR,

WA_FINALTEM TYPE ST_FINALTEM.

DATA: NAME TYPE VRM_ID,

LIST TYPE VRM_VALUES,

VALUE LIKE LINE OF LIST,

REPID TYPE SY-REPID,

TY_KEYINFO TYPE SLIS_KEYINFO_ALV, " key information type.

IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,

WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV, " field catalog type

IT_HEADER TYPE SLIS_TABNAME, " table to store header data

IT_ITEM TYPE SLIS_TABNAME. " table to store item data

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

PARAMETERS:OPEN_ORD RADIOBUTTON GROUP g1 DEFAULT 'X', " DOWNLOAD TO APPLICATION SERVER

ALL_ORD RADIOBUTTON GROUP g1,

MY_ORD AS CHECKBOX.

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.

PARAMETERS:PF(25) AS LISTBOX VISIBLE LENGTH 20, P_KUNNR TYPE VBAK-KUNNR,

P_MATNR TYPE VBAP-MATNR,

P_BSTNK TYPE VBAK-BSTNK.

SELECTION-SCREEN END OF BLOCK B2.

SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.

SELECT-OPTIONS:S_AUDAT FOR VBAK-AUDAT,

S_VBELN FOR VBAK-VBELN,

S_AUART FOR VBAK-AUART,

S_LPRIO FOR VBAP-LPRIO,

S_PRSDT FOR VBKD-PRSDT,

S_WADAT FOR VBEP-WADAT,

S_VSBED FOR VBAK-VSBED,

S_EDATU FOR VBEP-EDATU,

S_LIFSK FOR VBAK-LIFSK,

S_ERNAM FOR VBAK-ERNAM.

SELECTION-SCREEN END OF BLOCK B3.

SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-004.

SELECT-OPTIONS:S_VKORG FOR VBAK-VKORG,

S_VTWEG FOR VBAK-VTWEG,

S_SPART FOR VBAP-SPART,

S_VKGRP FOR VBAK-VKGRP,

S_VKBUR FOR VBAK-VKBUR,

S_WERKS FOR VBAP-WERKS.

SELECTION-SCREEN END OF BLOCK B4.

INITIALIZATION.

NAME = 'PF'.

VALUE-KEY = '1'.

VALUE-TEXT = 'SHIP TO'.

APPEND VALUE TO LIST.

NAME = 'PF'.

VALUE-KEY = '2'.

VALUE-TEXT = 'SOLD TO'.

APPEND VALUE TO LIST.

NAME = 'PF'.

VALUE-KEY = '3'.

VALUE-TEXT = 'BILL TO'.

APPEND VALUE TO LIST.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = NAME

VALUES = LIST.

REPID = SY-REPID. " variable having the program name

IT_HEADER = 'IT_FINALHDR'.

IT_ITEM = 'IT_FINALTEM'.

CLEAR TY_KEYINFO.

TY_KEYINFO-HEADER01 = 'VBELN'." comparing the keys and relating the header and item internal tables

TY_KEYINFO-ITEM01 = 'VBELN1'.

START-OF-SELECTION.

IF OPEN_ORD ='X'.

PERFORM RETRIEVE_VBAK.

PERFORM RETRIEVE_VBAP.

PERFORM RETRIEVE_VBPA.

PERFORM RETRIEVE_KNA1.

PERFORM RETRIEVE_MAKT.

PERFORM RETRIEVE_VBEP.

PERFORM RETRIEVE_VBUP1.

ELSE.

PERFORM RETRIEVE_VBAK.

PERFORM RETRIEVE_VBAP.

PERFORM RETRIEVE_VBPA.

PERFORM RETRIEVE_KNA1.

PERFORM RETRIEVE_MAKT.

PERFORM RETRIEVE_VBEP.

PERFORM RETRIEVE_VBUP.

ENDIF.

IF IT_VBAK IS NOT INITIAL.

LOOP AT IT_VBAK INTO WA_VBAK.

READ TABLE IT_VBAP INTO WA_VBAP WITH KEY VBELN1 = WA_VBAK-VBELN.

CHECK SY-SUBRC EQ 0.

READ TABLE IT_VBPA INTO WA_VBPA WITH KEY VBELN = WA_VBAP-VBELN1.

CHECK SY-SUBRC EQ 0.

READ TABLE IT_KNA1 INTO WA_KNA1 WITH KEY KUNNR = WA_VBPA-KUNNR.

CHECK SY-SUBRC EQ 0.

READ TABLE IT_MAKT INTO WA_MAKT WITH KEY MATNR = WA_VBAP-MATNR.

CHECK SY-SUBRC EQ 0.

READ TABLE IT_VBEP INTO WA_VBEP WITH KEY VBELN = WA_VBAP-VBELN1.

CHECK SY-SUBRC EQ 0.

READ TABLE IT_VBUP INTO WA_VBUP WITH KEY VBELN = WA_VBAP-VBELN1.

CHECK SY-SUBRC EQ 0.

WA_FINALHDR-VBELN = WA_VBAK-VBELN.

WA_FINALHDR-ERNAM = WA_VBAK-ERNAM.

WA_FINALHDR-ERDAT = WA_VBAK-ERDAT.

WA_FINALHDR-ERZET = WA_VBAK-ERZET.

WA_FINALHDR-AEDAT = WA_VBAK-AEDAT.

WA_FINALHDR-AUDAT = WA_VBAK-AUDAT.

WA_FINALHDR-LIFSK = WA_VBAK-LIFSK.

WA_FINALHDR-VDATU = WA_VBAK-VDATU.

WA_FINALHDR-VSBED = WA_VBAK-VSBED.

WA_FINALHDR-BNAME = WA_VBAK-BNAME.

WA_FINALHDR-BSTNK = WA_VBAK-BSTNK.

WA_FINALHDR-TELF1 = WA_KNA1-TELF1.

WA_FINALHDR-NAME1 = WA_KNA1-NAME1.

WA_FINALHDR-KUNNR = WA_VBPA-KUNNR.

WA_FINALTEM-VBELN1 = WA_VBAP-VBELN1.

WA_FINALTEM-LPRIO = WA_VBAP-LPRIO.

WA_FINALTEM-MATNR = WA_VBAP-MATNR.

WA_FINALTEM-CHARG = WA_VBAP-CHARG.

WA_FINALTEM-MAKTX = WA_MAKT-MAKTX.

WA_FINALTEM-LGORT = WA_VBAP-LGORT.

WA_FINALTEM-MVGR5 = WA_VBAP-MVGR5.

WA_FINALTEM-ETENR = WA_VBEP-ETENR.

WA_FINALTEM-KWMENG = WA_VBAP-KWMENG.

WA_FINALTEM-GBSTA = WA_VBUP-GBSTA.

WA_FINALTEM-LFSTA = WA_VBUP-LFSTA.

WA_FINALTEM-VSTEL = WA_VBAP-VSTEL.

WA_FINALTEM-PSTYV = WA_VBAP-PSTYV.

WA_FINALTEM-ABGRU = WA_VBAP-ABGRU.

WA_FINALTEM-MEINS = WA_VBAP-MEINS.

WA_FINALTEM-VKAUS = WA_VBAP-VKAUS.

WA_FINALTEM-WERKS = WA_VBAP-WERKS.

WA_FINALTEM-ROUTE = WA_VBAP-ROUTE.

WA_FINALTEM-WADAT = WA_VBEP-WADAT.

APPEND WA_FINALHDR TO IT_FINALHDR.

APPEND WA_FINALTEM TO IT_FINALTEM.

ENDLOOP.

ENDIF.

SORT iT_FINALHDR.

DELETE ADJACENT DUPLICATES FROM iT_FINALHDR COMPARING ALL FIELDS.

SORT iT_FINALTEM.

DELETE ADJACENT DUPLICATES FROM iT_FINALTEM COMPARING ALL FIELDS.

*wa_fieldcat-d = 'X'.

WA_FIELDCAT-TABNAME = 'IT_FINALHDR'.

WA_FIELDCAT-FIELDNAME = 'VBELN'.

WA_FIELDCAT-SELTEXT_L = 'SALES DOC NO'.

WA_FIELDCAT-COL_POS = 1.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALHDR'.

WA_FIELDCAT-FIELDNAME = 'ERNAM'.

WA_FIELDCAT-SELTEXT_L = 'CREATED BY'.

WA_FIELDCAT-COL_POS = 2.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALHDR'.

WA_FIELDCAT-FIELDNAME = 'ERDAT'.

WA_FIELDCAT-SELTEXT_L = 'CREATED ON'.

WA_FIELDCAT-COL_POS = 3.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALHDR'.

WA_FIELDCAT-FIELDNAME = 'ERZET'.

WA_FIELDCAT-SELTEXT_L = 'CREATED TIME'.

WA_FIELDCAT-COL_POS = 4.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALHDR'.

WA_FIELDCAT-FIELDNAME = 'AEDAT'.

WA_FIELDCAT-SELTEXT_L = 'CHANGED ON'.

WA_FIELDCAT-COL_POS = 5.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALHDR'.

WA_FIELDCAT-FIELDNAME = 'AUDAT'.

WA_FIELDCAT-SELTEXT_L = 'DOCUMENT DATE'.

WA_FIELDCAT-COL_POS = 6.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALHDR'.

WA_FIELDCAT-FIELDNAME = 'LIFSK'.

WA_FIELDCAT-SELTEXT_L = 'DELIVERY BLOCK'.

WA_FIELDCAT-COL_POS = 7.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALHDR'.

WA_FIELDCAT-FIELDNAME = 'VDATU'.

WA_FIELDCAT-SELTEXT_L = 'REQ DEL. DATE'.

WA_FIELDCAT-COL_POS = 8.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALHDR'.

WA_FIELDCAT-FIELDNAME = 'VSBED'.

WA_FIELDCAT-SELTEXT_L = 'SHIPPING CONDITION'.

WA_FIELDCAT-COL_POS = 9.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALHDR'.

WA_FIELDCAT-FIELDNAME = 'BNAME'.

WA_FIELDCAT-SELTEXT_L = 'NAME OF THE ORDERER'.

WA_FIELDCAT-COL_POS = 10.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALHDR'.

WA_FIELDCAT-FIELDNAME = 'TELF1'.

WA_FIELDCAT-SELTEXT_L = 'SHIP 2 PARTY TELEPHONE'.

WA_FIELDCAT-COL_POS = 11.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALHDR'.

WA_FIELDCAT-FIELDNAME = 'BSTNK'.

WA_FIELDCAT-SELTEXT_L = 'PURCHASE ORDER NO'.

WA_FIELDCAT-COL_POS = 12.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALHDR'.

WA_FIELDCAT-FIELDNAME = 'KUNNR'.

WA_FIELDCAT-SELTEXT_L = 'SHIP 2 PARTY'.

WA_FIELDCAT-COL_POS = 13.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALHDR'.

WA_FIELDCAT-FIELDNAME = 'NAME1'.

WA_FIELDCAT-SELTEXT_L = 'SHIP 2 PARTY NAME'.

WA_FIELDCAT-COL_POS = 14.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'VBELN1'.

WA_FIELDCAT-SELTEXT_L = 'SALES DOC'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'LPRIO'.

WA_FIELDCAT-SELTEXT_L = 'DEL. PRIORITY'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'MATNR'.

WA_FIELDCAT-SELTEXT_L = 'MATERIAL'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'CHARG'.

WA_FIELDCAT-SELTEXT_L = 'BATCH'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'MAKTX'.

WA_FIELDCAT-SELTEXT_L = 'MAT DESC'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'LGORT'.

WA_FIELDCAT-SELTEXT_L = 'STORAGE LOC'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'MVGR5'.

WA_FIELDCAT-SELTEXT_L = 'MAT GROUP'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'ETENR'.

WA_FIELDCAT-SELTEXT_L = 'SCHED LINE NO'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'KWMENG'.

WA_FIELDCAT-SELTEXT_L = 'ORD QUANTITY'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'GBSTA'.

WA_FIELDCAT-SELTEXT_L = 'OVERALL STATUS'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'LFSTA'.

WA_FIELDCAT-SELTEXT_L = 'DEL. STATUS'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'VSTEL'.

WA_FIELDCAT-SELTEXT_L = 'SHIPPING POINT'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'PSTYV'.

WA_FIELDCAT-SELTEXT_L = 'ITEM CATEGORY'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'ABGRU'.

WA_FIELDCAT-SELTEXT_L = 'REASON 4 REJECTION'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'MEINS'.

WA_FIELDCAT-SELTEXT_L = 'BASE UOM'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'VKAUS'.

WA_FIELDCAT-SELTEXT_L = 'USAGE'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'WERKS'.

WA_FIELDCAT-SELTEXT_L = 'PLANT'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'ROUTE'.

WA_FIELDCAT-SELTEXT_L = 'ROUTE'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_FINALTEM'.

WA_FIELDCAT-FIELDNAME = 'WADAT'.

WA_FIELDCAT-SELTEXT_L = 'GOODS ISSUE DATE'.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

*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_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

  • IT_FIELDCAT = IT_FIELDCAT

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • 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

  • I_HTML_HEIGHT_TOP = 0

  • I_HTML_HEIGHT_END = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • IR_SALV_FULLSCREEN_ADAPTER =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

  • TABLES

  • t_outtab = IT_FINALHDR

  • 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.

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

I_CALLBACK_PROGRAM = REPID

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • IS_LAYOUT =

IT_FIELDCAT = IT_FIELDCAT

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

i_tabname_header = IT_HEADER

i_tabname_item = IT_ITEM

  • I_STRUCTURE_NAME_HEADER =

  • I_STRUCTURE_NAME_ITEM =

is_keyinfo = TY_KEYINFO

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

  • IR_SALV_HIERSEQ_ADAPTER =

  • IT_EXCEPT_QINFO =

  • I_SUPPRESS_EMPTY_DATA = ABAP_FALSE

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab_header = IT_FINALHDR

t_outtab_item = IT_FINALTEM.

  • 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.

&----


*& Form RETRIEVE_VBAK

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form RETRIEVE_VBAK .

SELECT VBELN

ERDAT

ERZET

ERNAM

AUDAT

LIFSK

VDATU

VSBED

BSTNK

BNAME

AEDAT INTO TABLE IT_VBAK FROM VBAK WHERE VBELN IN S_VBELN AND

ERNAM IN S_ERNAM AND

AUDAT IN S_AUDAT AND

AUART IN S_AUART AND

LIFSK IN S_LIFSK AND

VKORG IN S_VKORG AND

VTWEG IN S_VTWEG AND

VSBED IN S_VSBED AND

VKGRP IN S_VKGRP AND

VKBUR IN S_VKBUR.

IF SY-SUBRC NE 0.

MESSAGE E099(ZMMCASE) WITH 'NO VBAK HDR DATA FOUND'.

ENDIF.

endform. " RETRIEVE_VBAK

&----


*& Form RETRIEVE_VBAP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form RETRIEVE_VBAP .

SELECT VBELN

MATNR

CHARG

PSTYV

ABGRU

MEINS

VKAUS

KWMENG

LPRIO

WERKS

LGORT

VSTEL

ROUTE

MVGR5 INTO TABLE IT_VBAP FROM VBAP

FOR ALL ENTRIES IN IT_VBAK

WHERE VBELN = IT_VBAK-VBELN AND

SPART IN S_SPART AND

LPRIO IN S_LPRIO.

IF SY-SUBRC NE 0.

MESSAGE E098(ZMMCASE) WITH 'NO DATA FOUND IN TABLE VBAP'.

ENDIF.

endform. " RETRIEVE_VBAP

&----


*& Form RETRIEVE_VBPA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form RETRIEVE_VBPA .

SELECT VBELN

KUNNR INTO TABLE IT_VBPA FROM VBPA

FOR ALL ENTRIES IN IT_VBAP

WHERE VBELN = IT_VBAP-VBELN1.

IF SY-SUBRC NE 0.

MESSAGE E097(ZMMCASE) WITH 'NO DATA FOUND IN TABLE VBPA'.

ENDIF.

endform. " RETRIEVE_VBPA

&----


*& Form RETRIEVE_KNA1

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form RETRIEVE_KNA1 .

SELECT KUNNR

NAME1

TELF1 INTO TABLE IT_KNA1 FROM KNA1

FOR ALL ENTRIES IN IT_VBPA

WHERE KUNNR = IT_VBPA-KUNNR.

IF SY-SUBRC NE 0.

MESSAGE E096(ZMMCASE) WITH 'NO DATA FOUND IN TABLE KNA1'.

ENDIF.

endform. " RETRIEVE_KNA1

&----


*& Form RETRIEVE_MAKT

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form RETRIEVE_MAKT .

SELECT MATNR

MAKTX INTO TABLE IT_MAKT FROM MAKT

FOR ALL ENTRIES IN IT_VBAP

WHERE MATNR = IT_VBAP-MATNR.

IF SY-SUBRC NE 0.

MESSAGE E095(ZMMCASE) WITH 'NO DATA FOUND IN TABLE MAKT'.

ENDIF.

endform. " RETRIEVE_MAKT

&----


*& Form RETRIEVE_VBEP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form RETRIEVE_VBEP .

SELECT VBELN

ETENR

WADAT INTO TABLE IT_VBEP FROM VBEP

FOR ALL ENTRIES IN IT_VBAP

WHERE VBELN = IT_VBAP-VBELN1 AND

EDATU IN S_EDATU AND

WADAT IN S_WADAT.

IF SY-SUBRC NE 0.

MESSAGE E094(ZMMCASE) WITH 'NO DATA FOUND IN TABLE VBEP'.

ENDIF.

endform. " RETRIEVE_VBEP

&----


*& Form RETRIEVE_VBUP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form RETRIEVE_VBUP .

SELECT VBELN

LFSTA

GBSTA INTO TABLE IT_VBUP FROM VBUP

FOR ALL ENTRIES IN IT_VBAP

WHERE VBELN = IT_VBAP-VBELN1.

IF SY-SUBRC NE 0.

MESSAGE E093(ZMMCASE) WITH 'NO DATA FOUND IN TABLE VBUP'.

ENDIF.

endform. " RETRIEVE_VBUP

&----


*& Form RETRIEVE_VBUP1

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form RETRIEVE_VBUP1 .

SELECT A~VBELN

A~LFSTA

AGBSTA FROM VBUP AS A INNER JOIN VBAP AS B ON AVBELN = B~VBELN INTO TABLE IT_VBUP

FOR ALL ENTRIES IN IT_VBAP

WHERE A~VBELN = IT_VBAP-VBELN1 AND

GBSTA IN ('A','B').

IF SY-SUBRC NE 0.

MESSAGE E093(ZMMCASE) WITH 'NO DATA FOUND IN TABLE VBUP'.

ENDIF.

endform. " RETRIEVE_VBUP1

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