SAP ABAP - Sample Report Giving Details Of Sales Order Value, Milestone Planned & Actual Dates Of Different Milestones.
This sample program generates a report giving details of Sales Order value, Milestone planned and actual dates of different milestones.
Sample Program With Screenshots:
REPORT zotc_milestone_report.
TYPE-POOLS:slis.
*****Tables To Be Used In The Program.
TABLES: prps, vbap, coep, vbak, kna1, afvc, mlst.
TYPES: BEGIN OF x_final,
pspnr TYPE prps-pspnr,
psphi TYPE prps-psphi,
vbeln TYPE vbap-vbeln,
objnr TYPE prps-objnr,
name1 TYPE kna1-name1,
matnr TYPE vbap-matnr,
posid TYPE prps-posid,
post1 TYPE prps-post1,
netwr TYPE vbap-netwr,
p_poreldate TYPE mlst-edatu,
a_poreldate TYPE mlst-lst_actdt,
p_mfgreldate TYPE mlst-edatu,
a_mfgreldate TYPE mlst-lst_actdt,
p_invoicedate TYPE mlst_edatu,
a_invoicedate TYPE mlst-lst_actdt,
ebeln TYPE coep-ebeln,
cellcolor TYPE lvc_t_scol, " Used To Store Row Color Attributes
END OF x_final.
TYPES: BEGIN OF x_vbap,
psphi TYPE prps-psphi,
vbeln TYPE vbap-vbeln,
posnr TYPE vbap-posnr,
matnr TYPE vbap-matnr,
posid TYPE prps-posid,
ps_psp_pnr TYPE vbap-ps_psp_pnr,
netwr TYPE vbap-netwr,
END OF x_vbap.
TYPES: BEGIN OF x_coep,
objnr TYPE coep-objnr,
matnr TYPE coep-objnr,
ebeln TYPE coep-objnr,
END OF x_coep.
TYPES : BEGIN OF x_kna1,
vbeln TYPE vbak-vbeln,
kunnr TYPE vbak-kunnr,
name1 TYPE kna1-name1,
END OF x_kna1.
TYPES: BEGIN OF x_mlst,
edatu TYPE mlst-edatu,
lst_actdt TYPE mlst-lst_actdt,
mlstn TYPE mlst-mlstn,
aufpl TYPE mlst-aufpl,
aplzl TYPE mlst-aplzl,
END OF x_mlst.
TYPES: BEGIN OF x_afvc,
posid TYPE prps-posid,
projn TYPE afvc-projn,
aufpl TYPE afvc-aufpl,
aplzl TYPE afvc-aplzl,
mlstn TYPE mlst-mlstn,
edatu TYPE mlst-edatu,
lst_actdt TYPE mlst-lst_actdt,
bukrs TYPE afvc-bukrs,
END OF x_afvc.
TYPES: BEGIN OF x_vbfa,
vbelv TYPE vbfa-vbelv,
posnv TYPE vbfa-posnv,
vbtyp_n TYPE vbfa-vbtyp_n,
vbeln TYPE vbfa-vbeln,
END OF x_vbfa.
TYPES : BEGIN OF x_sono,
posid TYPE prps-posid,
END OF x_sono.
DATA: it_final TYPE TABLE OF x_final,
wa_final TYPE x_final.
DATA: it_mlst TYPE TABLE OF x_mlst,
wa_mlst TYPE x_mlst.
DATA: it_vbap TYPE TABLE OF x_vbap,
wa_vbap TYPE x_vbap.
DATA: it_vbfa TYPE TABLE OF x_vbfa,
wa_vbfa TYPE x_vbfa.
DATA: it_coep TYPE TABLE OF x_coep,
wa_coep TYPE x_coep.
DATA: it_kna1 TYPE TABLE OF x_kna1,
wa_kna1 TYPE x_kna1.
DATA: it_afvc TYPE TABLE OF x_afvc,
wa_afvc TYPE x_afvc,
it_afvc1 TYPE TABLE OF x_afvc,
wa_afvc1 TYPE x_afvc.
DATA: it_sono TYPE TABLE OF x_sono,
wa_sono TYPE x_sono.
DATA: temp_tabix TYPE sy-tabix.
DATA: currdate TYPE sy-datum,
date_7 TYPE sy-datum,
date_15 TYPE sy-datum.
DATA: ld_index TYPE sy-tabix.
DATA: wa_cellcolor TYPE lvc_s_scol,
wa_cellcolor1 TYPE lvc_s_scol.
DATA: row_color(1) TYPE c.
****Declaration For ALV Grid Display
DATA: gd_layout TYPE slis_layout_alv,
fieldcatalog TYPE slis_t_fieldcat_alv,
wa_fieldcatalog TYPE slis_fieldcat_alv.
****Selection Screen For Group A Frame.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: p_projno FOR prps-psphi.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS: p_wbsno FOR prps-posid.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS: p_sono FOR vbap-vbeln.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN SKIP 1.
****Selection Screen For Group B Frame.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECT-OPTIONS: p_fxdate FOR mlst-edatu.
SELECTION-SCREEN COMMENT /1(50) text-003.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS: p_vrdate FOR mlst-edatu.
SELECTION-SCREEN COMMENT /1(50) text-004.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN SKIP 1.
****Parameter Field for Company Code
PARAMETERS: p_bukrs TYPE bukrs DEFAULT '4000'.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN COMMENT /1(50) text-005.
AT SELECTION-SCREEN.
********Allow User If He/She Enters At Least One Field.
IF p_projno IS NOT INITIAL OR ( p_wbsno IS NOT INITIAL ) OR ( p_sono IS NOT INITIAL ) OR ( p_fxdate IS NOT INITIAL ) OR ( p_vrdate IS NOT INITIAL ).
ELSE.
MESSAGE text-006 TYPE 'E'.
ENDIF.
START-OF-SELECTION.
PERFORM get_data.
PERFORM set_cell_colours.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM display_alv_report.
*&---------------------------------------------------------------------*
*& Form get_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM get_data.
********Fetch WBS Number In Case User Enters Project Number
IF p_projno IS NOT INITIAL.
SELECT posid FROM prps INTO TABLE it_sono
WHERE psphi IN p_projno.
SORT it_sono.
DELETE ADJACENT DUPLICATES FROM it_sono.
DELETE it_sono WHERE posid EQ '00000000'.
LOOP AT it_sono INTO wa_sono.
CLEAR:wa_final.
MOVE wa_sono-posid TO wa_final-posid.
APPEND wa_final TO it_final.
ENDLOOP.
********Fetch WBS Number In Case User Enters Sales Order Number
ELSEIF p_sono IS NOT INITIAL.
SELECT ps_psp_pnr FROM vbap
INTO TABLE it_sono
WHERE vbeln IN p_sono.
SORT it_sono.
DELETE ADJACENT DUPLICATES FROM it_sono.
DELETE it_sono WHERE posid EQ '00000000'.
LOOP AT it_sono INTO wa_sono.
CLEAR:wa_final.
CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT'
EXPORTING
input = wa_sono-posid
IMPORTING
output = wa_sono-posid.
MOVE wa_sono-posid TO wa_final-posid.
APPEND wa_final TO it_final.
ENDLOOP.
********Fetch WBS Number In Case User Enters Sales Order Number Invoicing/Dispatch Date (Fixed Or Variable Date Field).
ELSEIF p_fxdate IS NOT INITIAL OR p_vrdate IS NOT INITIAL.
IF p_fxdate IS NOT INITIAL.
SELECT edatu lst_actdt mlstn aufpl aplzl
FROM mlst INTO TABLE it_mlst
WHERE mlstn = 'CCN0E'
AND edatu IN p_fxdate.
SORT it_mlst.
DELETE ADJACENT DUPLICATES FROM it_mlst COMPARING ALL FIELDS.
ELSE.
SELECT edatu lst_actdt mlstn aufpl aplzl
FROM mlst INTO TABLE it_mlst
WHERE mlstn = 'CCN0E'
AND lst_actdt IN p_vrdate.
SORT it_mlst.
DELETE ADJACENT DUPLICATES FROM it_mlst COMPARING ALL FIELDS.
ENDIF.
IF it_mlst IS NOT INITIAL.
SELECT projn aufpl aplzl mlstn
FROM afvc INTO CORRESPONDING FIELDS OF TABLE it_afvc
FOR ALL ENTRIES IN it_mlst
WHERE aufpl = it_mlst-aufpl
AND aplzl = it_mlst-aplzl.
ENDIF.
LOOP AT it_afvc INTO wa_afvc.
READ TABLE it_mlst INTO wa_mlst WITH KEY aufpl = wa_afvc-aufpl
aplzl = wa_afvc-aplzl.
IF sy-subrc = 0.
MOVE wa_mlst-edatu TO wa_afvc-edatu.
MOVE wa_mlst-lst_actdt TO wa_afvc-lst_actdt.
MODIFY it_afvc FROM wa_afvc.
ENDIF.
ENDLOOP.
SORT it_afvc.
DELETE ADJACENT DUPLICATES FROM it_afvc COMPARING ALL FIELDS.
IF it_afvc IS NOT INITIAL.
LOOP AT it_afvc INTO wa_afvc.
MOVE wa_afvc-projn TO wa_final-pspnr.
APPEND wa_final TO it_final.
ENDLOOP.
ENDIF.
ENDIF.
CLEAR: wa_final, wa_mlst, wa_afvc, wa_sono.
REFRESH: it_mlst, it_sono.
**********Fetch Project Number, WBS number, WBS Subscription & Object Number From PRPS Table.
SORT it_final.
DELETE ADJACENT DUPLICATES FROM it_final COMPARING ALL FIELDS.
IF p_projno IS NOT INITIAL OR p_sono IS NOT INITIAL.
IF it_final IS NOT INITIAL.
SELECT pspnr posid psphi post1 objnr FROM prps
INTO CORRESPONDING FIELDS OF TABLE it_final
FOR ALL ENTRIES IN it_final
WHERE posid = it_final-posid.
ENDIF.
ELSEIF p_fxdate IS NOT INITIAL OR p_vrdate IS NOT INITIAL.
IF it_final IS NOT INITIAL.
SELECT pspnr posid psphi post1 objnr FROM prps
INTO CORRESPONDING FIELDS OF TABLE it_final
FOR ALL ENTRIES IN it_final
WHERE pspnr = it_final-pspnr.
LOOP AT it_final INTO wa_final.
READ TABLE it_afvc INTO wa_afvc WITH KEY projn = wa_final-pspnr.
IF sy-subrc = 0.
MOVE wa_afvc-edatu TO wa_final-p_invoicedate.
MOVE wa_afvc-lst_actdt TO wa_final-a_invoicedate.
MODIFY it_final FROM wa_final.
ENDIF.
ENDLOOP.
REFRESH it_afvc.
ENDIF.
ELSE.
SELECT pspnr posid psphi post1 objnr
FROM prps
INTO CORRESPONDING FIELDS OF TABLE it_final
WHERE posid IN p_wbsno.
ENDIF.
*************Fetch Sales Order Number, Line Item Material and Net value From VBAP Table.
IF p_sono[] IS INITIAL AND it_final IS NOT INITIAL.
SELECT vbeln posnr matnr ps_psp_pnr netwr FROM vbap
INTO CORRESPONDING FIELDS OF TABLE it_vbap
FOR ALL ENTRIES IN it_final
WHERE ps_psp_pnr = it_final-pspnr.
ELSEIF it_final IS NOT INITIAL.
SELECT vbeln posnr matnr ps_psp_pnr netwr FROM vbap
INTO CORRESPONDING FIELDS OF TABLE it_vbap
FOR ALL ENTRIES IN it_final
WHERE ps_psp_pnr = it_final-pspnr
AND vbeln IN p_sono.
ENDIF.
SORT it_vbap BY vbeln posnr matnr posid.
DELETE ADJACENT DUPLICATES FROM it_vbap COMPARING ALL FIELDS.
************** Only Un-billed Line Items Should Appear In Report.
IF it_vbap IS NOT INITIAL.
SELECT vbelv posnv vbtyp_n vbeln
FROM vbfa INTO TABLE it_vbfa
FOR ALL ENTRIES IN it_vbap
WHERE vbelv = it_vbap-vbeln
AND posnv = it_vbap-posnr
AND vbtyp_n = 'M'.
ENDIF.
SORT it_vbfa BY vbelv posnv.
DELETE ADJACENT DUPLICATES FROM it_vbfa COMPARING ALL FIELDS.
LOOP AT it_vbap INTO wa_vbap.
READ TABLE it_vbfa INTO wa_vbfa WITH KEY vbelv = wa_vbap-vbeln
posnv = wa_vbap-posnr.
IF sy-subrc = 0.
IF wa_vbfa-vbeln IS NOT INITIAL.
DELETE TABLE it_vbap FROM wa_vbap.
ENDIF.
ENDIF.
ENDLOOP.
************************************************************************
LOOP AT it_vbap INTO wa_vbap.
READ TABLE it_final INTO wa_final WITH KEY pspnr = wa_vbap-ps_psp_pnr.
IF sy-subrc = 0.
temp_tabix = temp_tabix + 1.
MOVE wa_vbap-vbeln TO wa_final-vbeln.
MOVE wa_vbap-matnr TO wa_final-matnr.
MOVE wa_vbap-netwr TO wa_final-netwr.
INSERT wa_final INTO it_final INDEX temp_tabix.
ENDIF.
ENDLOOP.
* BREAK-POINT.
SORT it_final BY vbeln.
DELETE it_final WHERE matnr IS INITIAL.
****Fetch Purchasing Document Number from COEP Table
IF it_final IS NOT INITIAL.
SELECT objnr matnr ebeln FROM coep
INTO CORRESPONDING FIELDS OF TABLE it_coep
FOR ALL ENTRIES IN it_final
WHERE objnr = it_final-objnr
AND matnr = it_final-matnr
AND ebeln <> ''.
ENDIF.
SORT it_coep BY matnr ebeln.
DELETE ADJACENT DUPLICATES FROM it_coep COMPARING ALL FIELDS.
LOOP AT it_final INTO wa_final WHERE objnr IS NOT INITIAL AND matnr IS NOT INITIAL.
READ TABLE it_coep INTO wa_coep WITH KEY objnr = wa_final-objnr
matnr = wa_final-matnr.
IF sy-subrc = 0.
MOVE wa_coep-ebeln TO wa_final-ebeln.
MODIFY it_final FROM wa_final.
ENDIF.
ENDLOOP.
*******Fetch Customer Name From KNA1 Table.
SELECT vbak~vbeln vbak~kunnr kna1~name1
INTO TABLE it_kna1 FROM kna1
INNER JOIN vbak ON kna1~kunnr = vbak~kunnr
FOR ALL entries IN it_final
WHERE vbak~vbeln = it_final-vbeln.
LOOP AT it_final INTO wa_final WHERE vbeln IS NOT INITIAL.
READ TABLE it_kna1 INTO wa_kna1 WITH KEY vbeln = wa_final-vbeln.
IF sy-subrc = 0.
MOVE wa_kna1-name1 TO wa_final-name1.
MODIFY it_final FROM wa_final.
ENDIF.
ENDLOOP.
*********Fetch The Planned & Actual Dates From MLST Table
IF it_vbap IS NOT INITIAL.
SELECT projn aufpl aplzl bukrs FROM afvc
INTO CORRESPONDING FIELDS OF TABLE it_afvc
FOR ALL ENTRIES IN it_vbap
WHERE projn = it_vbap-ps_psp_pnr
AND projn <> ''
AND bukrs = p_bukrs.
ENDIF.
LOOP AT it_afvc INTO wa_afvc.
CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT'
EXPORTING
input = wa_afvc-projn
IMPORTING
output = wa_afvc-posid.
MODIFY it_afvc FROM wa_afvc.
ENDLOOP.
SORT it_final BY posid.
DELETE ADJACENT DUPLICATES FROM it_final COMPARING ALL FIELDS.
SORT it_afvc BY posid.
LOOP AT it_final INTO wa_final.
READ TABLE it_afvc INTO wa_afvc WITH KEY posid = wa_final-posid.
IF sy-subrc <> 0.
DELETE it_final WHERE posid = wa_final-posid.
ENDIF.
ENDLOOP.
IF it_afvc IS NOT INITIAL.
SELECT mlstn aufpl aplzl edatu lst_actdt
FROM mlst INTO CORRESPONDING FIELDS OF TABLE it_afvc1
FOR ALL ENTRIES IN it_afvc
WHERE aufpl = it_afvc-aufpl
AND aplzl = it_afvc-aplzl.
ENDIF.
LOOP AT it_afvc1 INTO wa_afvc1.
READ TABLE it_afvc INTO wa_afvc WITH KEY aufpl = wa_afvc1-aufpl
aplzl = wa_afvc1-aplzl.
IF sy-subrc = 0.
MOVE wa_afvc-posid TO wa_afvc1-posid.
MOVE wa_afvc-projn TO wa_afvc1-projn.
MODIFY it_afvc1 FROM wa_afvc1.
ENDIF.
ENDLOOP.
IF p_fxdate IS NOT INITIAL.
DELETE it_afvc1 WHERE edatu NOT IN p_fxdate and mlstn = 'CCN0E'.
ELSEIF p_vrdate IS NOT INITIAL.
DELETE it_afvc1 WHERE lst_actdt NOT IN p_vrdate and mlstn = 'CCN0E'.
else.
delete it_afvc1 where ( edatu is initial ) and ( lst_actdt is initial ) and ( mlstn = 'CCN0E' ).
ENDIF.
SORT it_afvc1 BY posid.
DELETE ADJACENT DUPLICATES FROM it_afvc1 COMPARING ALL FIELDS.
LOOP AT it_final INTO wa_final.
LOOP AT it_afvc1 INTO wa_afvc1 WHERE posid = wa_final-posid.
IF wa_afvc1-mlstn = 'EMPOC' .
MOVE wa_afvc1-edatu TO wa_final-p_poreldate.
MOVE wa_afvc1-lst_actdt TO wa_final-a_poreldate.
ENDIF.
IF wa_afvc1-mlstn = 'CMFGC'.
MOVE wa_afvc1-edatu TO wa_final-p_mfgreldate.
MOVE wa_afvc1-lst_actdt TO wa_final-a_mfgreldate.
ENDIF.
IF wa_afvc1-mlstn = 'CCN0E' and ( wa_afvc1-edatu is not initial or wa_afvc1-lst_actdt is not initial ).
MOVE wa_afvc1-edatu TO wa_final-p_invoicedate.
MOVE wa_afvc1-lst_actdt TO wa_final-a_invoicedate.
ENDIF.
ENDLOOP.
MODIFY it_final FROM wa_final.
ENDLOOP.
ENDFORM. "get_data
*&---------------------------------------------------------------------*
*& Form set_cell_colours
*&---------------------------------------------------------------------*
* Coloring Cells Of ALV Grid Display.
*----------------------------------------------------------------------*
FORM set_cell_colours.
currdate = sy-datum.
date_7 = sy-datum + 7.
date_15 = sy-datum + 15.
LOOP AT it_final INTO wa_final.
ld_index = sy-tabix.
IF ( wa_final-p_poreldate LE date_7 AND wa_final-p_poreldate GT sy-datum ).
wa_cellcolor-fname = 'P_PORELDATE'.
wa_cellcolor-color-col = '6'. "color code 6 stands for red
wa_cellcolor-color-int = '1'. "1 = Intensified on, 0 = Intensified off
wa_cellcolor-color-inv = '0'. "1 = text colour, 0 = background colour
APPEND wa_cellcolor TO wa_final-cellcolor.
MODIFY it_final FROM wa_final INDEX ld_index TRANSPORTING cellcolor.
ELSEIF wa_final-p_poreldate GT date_7 AND wa_final-p_poreldate LE date_15.
wa_cellcolor-fname = 'P_PORELDATE'.
wa_cellcolor-color-col = '3'. "color code 3 stands for Yellow
wa_cellcolor-color-int = '1'. "1 = Intensified on, 0 = Intensified off
wa_cellcolor-color-inv = '0'. "1 = text colour, 0 = background colour
APPEND wa_cellcolor TO wa_final-cellcolor.
MODIFY it_final FROM wa_final INDEX ld_index TRANSPORTING cellcolor.
ENDIF.
IF ( wa_final-p_mfgreldate LE date_7 AND wa_final-p_mfgreldate GT sy-datum ).
wa_cellcolor-fname = 'P_MFGRELDATE'.
wa_cellcolor-color-col = '6'. "color code 6 stands for Red
wa_cellcolor-color-int = '1'. "1 = Intensified on, 0 = Intensified off
wa_cellcolor-color-inv = '0'. "1 = text colour, 0 = background colour
APPEND wa_cellcolor TO wa_final-cellcolor.
MODIFY it_final FROM wa_final INDEX ld_index TRANSPORTING cellcolor.
ELSEIF wa_final-p_mfgreldate GT date_7 AND wa_final-p_mfgreldate LE date_15.
wa_cellcolor-fname = 'P_MFGRELDATE'.
wa_cellcolor-color-col = '3'. "Color code 3 stands for yellow
wa_cellcolor-color-int = '1'. "1 = Intensified on, 0 = Intensified off
wa_cellcolor-color-inv = '0'. "1 = text colour, 0 = background colour
APPEND wa_cellcolor TO wa_final-cellcolor.
MODIFY it_final FROM wa_final INDEX ld_index TRANSPORTING cellcolor.
ENDIF.
ENDLOOP.
SORT it_final.
DELETE ADJACENT DUPLICATES FROM it_final COMPARING ALL FIELDS.
CLEAR: wa_final, wa_mlst, wa_vbap, wa_coep, wa_kna1, wa_afvc, wa_afvc1, wa_sono, temp_tabix.
REFRESH: it_mlst, it_vbap, it_coep, it_afvc, it_afvc1, it_sono, it_kna1.
ENDFORM. "get_data
*&---------------------------------------------------------------------*
*& Form build_fieldcatalog
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM build_fieldcatalog .
wa_fieldcatalog-fieldname = 'PSPHI'.
wa_fieldcatalog-seltext_l = ' Project No. '.
wa_fieldcatalog-tabname = 'IT_FINAL'.
wa_fieldcatalog-emphasize = 'X'.
wa_fieldcatalog-just = 'L'.
APPEND wa_fieldcatalog TO fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'VBELN'.
wa_fieldcatalog-seltext_l = ' Sales Order No. '.
wa_fieldcatalog-tabname = 'IT_FINAL'.
wa_fieldcatalog-emphasize = 'X'.
APPEND wa_fieldcatalog TO fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'NAME1'.
wa_fieldcatalog-seltext_l = ' Customer Name '.
wa_fieldcatalog-tabname = 'IT_FINAL'.
wa_fieldcatalog-emphasize = 'X'.
APPEND wa_fieldcatalog TO fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'MATNR'.
wa_fieldcatalog-seltext_l = ' Line Item Material '.
wa_fieldcatalog-tabname = 'IT_FINAL'.
wa_fieldcatalog-emphasize = 'X'.
APPEND wa_fieldcatalog TO fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'POSID'.
wa_fieldcatalog-seltext_l = ' WBS No. '.
wa_fieldcatalog-tabname = 'IT_FINAL'.
wa_fieldcatalog-emphasize = 'X'.
APPEND wa_fieldcatalog TO fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'POST1'.
wa_fieldcatalog-seltext_l = ' WBS Description '.
wa_fieldcatalog-tabname = 'IT_FINAL'.
wa_fieldcatalog-emphasize = 'X'.
APPEND wa_fieldcatalog TO fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'NETWR'.
wa_fieldcatalog-seltext_l = ' Net Value '.
wa_fieldcatalog-tabname = 'IT_FINAL'.
wa_fieldcatalog-emphasize = 'X'.
wa_fieldcatalog-just = 'L'.
APPEND wa_fieldcatalog TO fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'P_PORELDATE'.
wa_fieldcatalog-seltext_l = ' Planned PO/R2 Release Date '.
wa_fieldcatalog-tabname = 'IT_FINAL'.
wa_fieldcatalog-emphasize = 'X'.
APPEND wa_fieldcatalog TO fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'A_PORELDATE'.
wa_fieldcatalog-seltext_l = ' Actual PO/R2 Release Date '.
wa_fieldcatalog-tabname = 'IT_FINAL'.
wa_fieldcatalog-emphasize = 'X'.
APPEND wa_fieldcatalog TO fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'P_MFGRELDATE'.
wa_fieldcatalog-seltext_l = ' Planned MFG Clearance/R3 Release Date '.
wa_fieldcatalog-tabname = 'IT_FINAL'.
wa_fieldcatalog-emphasize = 'X'.
APPEND wa_fieldcatalog TO fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'A_MFGRELDATE'.
wa_fieldcatalog-seltext_l = ' Actual MFG Clearance/R3 Release Date '.
wa_fieldcatalog-tabname = 'IT_FINAL'.
wa_fieldcatalog-emphasize = 'X'.
APPEND wa_fieldcatalog TO fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'P_INVOICEDATE'.
wa_fieldcatalog-seltext_l = ' Planned Invoice/Despatch Clearance Date '.
wa_fieldcatalog-tabname = 'IT_FINAL'.
wa_fieldcatalog-emphasize = 'X'.
APPEND wa_fieldcatalog TO fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'A_INVOICEDATE'.
wa_fieldcatalog-seltext_l = ' Actual Invoice/Despatch Clearance Date '.
wa_fieldcatalog-tabname = 'IT_FINAL'.
wa_fieldcatalog-emphasize = 'X'.
APPEND wa_fieldcatalog TO fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'EBELN'.
wa_fieldcatalog-seltext_l = ' Purchase Order Number '.
wa_fieldcatalog-tabname = 'IT_FINAL'.
wa_fieldcatalog-emphasize = 'X'.
APPEND wa_fieldcatalog TO fieldcatalog.
CLEAR wa_fieldcatalog.
ENDFORM. "build_fieldcatalog
*&---------------------------------------------------------------------*
*& Form build_layout
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM build_layout .
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-info_fieldname = 'Color'.
gd_layout-zebra = 'X'.
gd_layout-coltab_fieldname = 'CELLCOLOR'.
ENDFORM. " build_layout
*&---------------------------------------------------------------------*
*& Form display_alv_report
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM display_alv_report.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
TABLES
t_outtab = it_final
.
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_alv_report
INPUT SCREEN:
OUTPUT SCREEN:
Your suggestions and comments are welcome in this section.
Please mail all your contributions to administrator@abapmadeeasy.com We request you to mention your Name, Designation, Experience & Organization you are working for. Your posts will be verified and posted in this site with your name.