REPORT ZVVF_CR008_MONTHLYREPORT .
*&---------------------------------------------------------------------*
*& Report ZVVF_CR008_MONTHLYREPORT *
* *
* MODULE : Production Planning *
* *
*---------------------------------------------------------------------*
* Objective : Report for Material Wise-Monthly Plan v/s Actual *
* Production Review *
* *
* Program : Update Tables( ) Download Data( ) Outputs List (X) *
* *
* Technical Specs No : *
* *
* Date Created : *
* *
* Author : *
* *
* Location : VVF/Mumbai *
* *
* LDB : NOT-USED *
*---------------------------------------------------------------------*
*----------------------------------------------------------------------*
* Type-pools
*----------------------------------------------------------------------*
TYPE-POOLS : slis.
*----------------------------------------------------------------------*
* Tables
*----------------------------------------------------------------------*
TABLES : zvvf_ct_matdisp,
PBIM,
PBED.
*----------------------------------------------------------------------*
* TYPES
*----------------------------------------------------------------------*
TYPES : BEGIN OF TY_MAIN,
WERKS LIKE ZVVF_CT_MATDISP-WERKS,
MATNR LIKE ZVVF_CT_MATDISP-MATNR,
PBDNR LIKE ZVVF_CT_MATDISP-PBDNR,
MAKTX LIKE ZVVF_CT_MATDISP-MAKTX,
PLNMG LIKE PBED-PLNMG,
MEINS LIKE PBED-MEINS,
BDZEI LIKE PBIM-BDZEI,
CHGQTY LIKE PBED-PLNMG,
GSMNG LIKE ZVVF_CT_MATDISP-GSMNG,
MENGE LIKE MSEG-MENGE,
ERFMG LIKE MSEG-ERFMG,
ERFME LIKE MSEG-ERFME,
DIFF LIKE MSEG-MENGE,
PERCEN(5) TYPE P DECIMALS 2,
REASON(20) TYPE C,
REQUIRED LIKE MSEG-MENGE,
REMARKS(20) TYPE C,
END OF TY_MAIN.
TYPES : BEGIN OF TY_MATDISP,
WERKS LIKE ZVVF_CT_MATDISP-WERKS,
MATNR LIKE ZVVF_CT_MATDISP-MATNR,
VERNO LIKE ZVVF_CT_MATDISP-VERNO,
GSMNG LIKE ZVVF_CT_MATDISP-GSMNG,
END OF TY_MATDISP.
TYPES : BEGIN OF TY_DATA,
WERKS LIKE ZVVF_CT_MATDISP-WERKS,
MATNR LIKE ZVVF_CT_MATDISP-MATNR,
PBDNR LIKE ZVVF_CT_MATDISP-PBDNR,
MAKTX LIKE ZVVF_CT_MATDISP-MAKTX,
BDZEI LIKE ZVVF_CT_MATDISP-BDZEI,
END OF TY_DATA.
TYPES : BEGIN OF TY_PBED,
PDATU LIKE PBED-PDATU,
PLNMG LIKE PBED-PLNMG,
MEINS LIKE PBED-MEINS,
END OF TY_PBED.
TYPES : BEGIN OF TY_VER1,
WERKS LIKE ZVVF_CT_MATDISP-WERKS,
MATNR LIKE ZVVF_CT_MATDISP-MATNR,
MAKTX LIKE ZVVF_CT_MATDISP-MAKTX,
PBDNR LIKE ZVVF_CT_MATDISP-PBDNR,
BDZEI LIKE ZVVF_CT_MATDISP-BDZEI,
PDATU LIKE PBED-PDATU,
PLNMG LIKE PBED-PLNMG,
MEINS LIKE PBED-MEINS,
CHGQTY LIKE PBED-PLNMG,
END OF TY_VER1.
TYPES : BEGIN OF TY_MKPF,
MBLNR LIKE MKPF-MBLNR,
MJAHR LIKE MKPF-MJAHR,
END OF TY_MKPF.
TYPES : BEGIN OF TY_MSEG,
WERKS LIKE MSEG-WERKS,
MATNR LIKE MSEG-MATNR,
MENGE LIKE MSEG-MENGE,
ERFMG LIKE MSEG-ERFMG,
ERFME LIKE MSEG-ERFME,
END OF TY_MSEG .
TYPES : BEGIN OF TY_VERVS,
VERVS LIKE PBIM-VERVS,
END OF TY_VERVS.
*----------------------------------------------------------------------*
* INTERNAL TABLES
*----------------------------------------------------------------------*
DATA : IT_MAIN TYPE STANDARD TABLE OF TY_MAIN WITH HEADER LINE.
DATA : IT_MAIN1 TYPE STANDARD TABLE OF TY_MAIN WITH HEADER LINE.
DATA : IT_MATDISP TYPE STANDARD TABLE OF TY_MATDISP WITH HEADER LINE.
DATA : IT_DATA TYPE STANDARD TABLE OF TY_DATA WITH HEADER LINE.
DATA : IT_DATA_ACT TYPE STANDARD TABLE OF TY_DATA WITH HEADER LINE.
DATA : IT_VER1 TYPE STANDARD TABLE OF TY_VER1 WITH HEADER LINE.
DATA : IT_VER1_ACT TYPE STANDARD TABLE OF TY_VER1 WITH HEADER LINE.
DATA : IT_VER1_HOLD TYPE STANDARD TABLE OF TY_VER1 WITH HEADER LINE.
DATA : IT_PBED TYPE STANDARD TABLE OF TY_PBED WITH HEADER LINE.
DATA : IT_MKPF TYPE STANDARD TABLE OF TY_MKPF WITH HEADER LINE.
DATA : IT_MSEG TYPE STANDARD TABLE OF TY_MSEG WITH HEADER LINE.
DATA : IT_MSEG_HOLD TYPE STANDARD TABLE OF TY_MSEG WITH HEADER LINE.
DATA : IT_VERVS TYPE STANDARD TABLE OF TY_VERVS WITH HEADER LINE.
*----------------------------------------------------------------------*
* CONTANTS
*----------------------------------------------------------------------*
CONSTANTS : C_DESC(65) TYPE C VALUE 'Material wise-monthly plan v/s actual production review'.
*----------------------------------------------------------------------*
* DATA
*----------------------------------------------------------------------*
DATA : W_VERSION1 LIKE ZVVF_CT_MATDISP-VERNO,
W_VERSION2 LIKE ZVVF_CT_MATDISP-VERNO,
W_PBDNR1 LIKE ZVVF_CT_MATDISP-PBDNR,
W_PBDNR2 LIKE zvvf_ct_matdisp-pbdnr,
W_VERSB LIKE PBIM-VERSB,
W_DATE LIKE SY-DATUM,
W_STDATE LIKE SY-DATUM,
W_ENDDATE LIKE SY-DATUM.
DATA: W_FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
W_LAYOUT TYPE SLIS_LAYOUT_ALV,
W_LISTHEADER TYPE SLIS_T_LISTHEADER,
W_EVENTS TYPE SLIS_T_EVENT,
W_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
W_REPID TYPE SY-REPID,
W_INFO(65) TYPE C,
w_info1(65) TYPE C,
W_WERKS LIKE T001W-NAME1.
*---------------------------------------------------------------------*
* parameters *
*---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN SKIP 1.
PARAMETERS : PR_WERKS LIKE PBIM-WERKS.
*---------------------------------------------------------------------*
* Select-options *
*---------------------------------------------------------------------*
SELECT-OPTIONS : SO_PBDNR FOR ZVVF_CT_MATDISP-PBDNR,
SO_VERSB FOR ZVVF_CT_MATDISP-VERSB,
SO_PDATU FOR PBED-PDATU,
SO_PSTTR FOR ZVVF_CT_MATDISP-PSTTR,
SO_PEDTR FOR ZVVF_CT_MATDISP-PEDTR.
SELECTION-SCREEN END OF BLOCK B2 .
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
SELECT-OPTIONS :SO_VERNO FOR ZVVF_CT_MATDISP-VERNO." NO INTERVALS NO-EXTENSION,
SELECTION-SCREEN END OF BLOCK B1 .
*---------------------------------------------------------------------*
* INITIALIZATION *
*---------------------------------------------------------------------*
INITIALIZATION.
W_REPID = SY-REPID.
CLEAR : IT_MAIN,IT_MAIN1,IT_MATDISP,IT_DATA,
IT_DATA_ACT,IT_VER1,IT_VER1_ACT,IT_VER1_HOLD,
IT_PBED,IT_MKPF,IT_MSEG,IT_MSEG_HOLD.
REFRESH : IT_MAIN,IT_MAIN1,IT_MATDISP,IT_DATA,
IT_DATA_ACT,IT_VER1,IT_VER1_ACT,IT_VER1_HOLD,
IT_PBED,IT_MKPF,IT_MSEG,IT_MSEG_HOLD.
PERFORM F005_eventtab_build_temp USING w_events[].
*---------------------------------------------------------------------*
* AT SELECTION-SCREEN ON VALUE REQUEST .
*---------------------------------------------------------------------*
At Selection-screen ON VALUE-REQUEST FOR SO_VERNO-LOW.
PERFORM f010_f4_help_for_low.
At Selection-screen ON VALUE-REQUEST FOR SO_VERNO-HIGH.
PERFORM F011_F4_HELP_FOR_HIGH.
*---------------------------------------------------------------------*
* At selection screen *
*---------------------------------------------------------------------*
At Selection-screen.
PERFORM F006_LIST_HEADING.
*---------------------------------------------------------------------*
* START-OF-SELECTION *
*---------------------------------------------------------------------*
START-OF-SELECTION .
PERFORM F007_FIELDCAT_INIT.
PERFORM F001_FETCH_DATA.
PERFORM F008_DISPLAY_DATA USING W_LISTHEADER[].
*---------------------------------------------------------------------*
* END-OF-SELECTION *
*---------------------------------------------------------------------*
END-OF-SELECTION.
PERFORM F009_DISPLAY_LIST.
*----------------------------------------------------------------------*
* TOP-OF-PAGE *
*----------------------------------------------------------------------*
TOP-OF-PAGE.
*----------------------------------------------------------------------*
* TOP-OF-PAGE *
*----------------------------------------------------------------------*
END-OF-PAGE.
*&---------------------------------------------------------------------*
*& Form F001_FETCH_DATA
*&---------------------------------------------------------------------*
FORM F001_FETCH_DATA .
*-----TO GET PREVIOUS MONTH DATA...
W_VERSION1 = SO_VERNO-LOW.
W_PBDNR1 = SO_PBDNR-LOW.
W_VERSB = W_VERSION1+4(1).
CONCATENATE W_VERSB '2' INTO W_VERSB.
PERFORM F002_PREVIOUS_MONTH_DATA.
*-----TO GET CURRENT MONTH DATA...
W_VERSION2 = SO_VERNO-HIGH.
W_PBDNR2 = SO_PBDNR-HIGH.
W_VERSB = W_VERSION2+4(1).
CONCATENATE W_VERSB '2' INTO W_VERSB.
*---USING THE SAME INTERNAL TABLES FOR GETTING CURRENT MONTH'S DATA ALSO
*----SO CLEARING BEFORE USING THEM
CLEAR : IT_DATA,IT_VER1,IT_VER1_HOLD,IT_DATA_ACT,
IT_VER1_ACT,IT_MATDISP.
REFRESH : IT_DATA,IT_VER1,IT_VER1_HOLD,IT_DATA_ACT,
IT_VER1_ACT,IT_MATDISP.
PERFORM F003_CURRENT_MONTH_DATA.
PERFORM F004_COMBINE_BOTH_DATA.
ENDFORM. " F001_FETCH_DATA
*&---------------------------------------------------------------------*
*& Form GET_PREVIOUS_MONTH_DAYS
*&---------------------------------------------------------------------*
FORM GET_PREVIOUS_MONTH_DAYS .
DATA : LW_VAR(2) TYPE C,
LW_VAR1(1) TYPE C,
LW_YEAR(4) TYPE C,
LW_NO TYPE P,
LW_DAYS(2) TYPE C.
LW_VAR1 = SY-DATUM+5(1).
IF LW_VAR1 NE '1'.
LW_VAR = SY-DATUM+4(2) .
LW_VAR = LW_VAR - 1.
IF LW_VAR = '0'.
LW_VAR = '12'.
ELSEIF STRLEN( LW_VAR ) = 1.
CONCATENATE '0' LW_VAR INTO LW_VAR.
ENDIF.
CONCATENATE SY-DATUM+0(4) LW_VAR '01' INTO W_DATE.
ELSE.
LW_YEAR = SY-DATUM+0(4) - 1.
CONCATENATE LW_YEAR '1201' INTO W_DATE.
ENDIF.
***--------TO GET THE NO OF DAYS OF PREVIOUS MONTH
CALL FUNCTION 'HR_E_NUM_OF_DAYS_OF_MONTH'
EXPORTING
P_FECHA = W_DATE
IMPORTING
NUMBER_OF_DAYS = LW_NO.
LW_DAYS = LW_NO.
W_STDATE = W_DATE.
CONCATENATE W_DATE+0(6) LW_DAYS INTO W_ENDDATE.
ENDFORM. " GET_PREVIOUS_MONTH_DAYS
*&---------------------------------------------------------------------*
*& Form F002_PREVIOUS_MONTH_DATA
*&---------------------------------------------------------------------*
FORM F002_PREVIOUS_MONTH_DATA .
*----------------FOR PREVIOUS MONTH DATA
*-------------FOR LATEST VERSION
SELECT WERKS MATNR PBDNR MAKTX BDZEI
INTO CORRESPONDING FIELDS OF TABLE IT_DATA
FROM ZVVF_CT_MATDISP
WHERE WERKS = PR_WERKS AND
VERNO = W_VERSION1.
SORT IT_DATA BY WERKS MATNR BDZEI PBDNR.
DELETE ADJACENT DUPLICATES FROM IT_DATA COMPARING WERKS MATNR BDZEI PBDNR.
SELECT PLNMG MEINS BDZEI
INTO CORRESPONDING FIELDS OF TABLE IT_VER1
FROM PBED
FOR ALL ENTRIES IN IT_DATA
WHERE BDZEI = IT_DATA-BDZEI.
LOOP AT IT_VER1.
READ TABLE IT_DATA WITH KEY BDZEI = IT_VER1-BDZEI.
IF SY-SUBRC = 0.
IT_VER1-WERKS = IT_DATA-WERKS.
IT_VER1-MATNR = IT_DATA-MATNR.
IT_VER1-PBDNR = IT_DATA-PBDNR.
IT_VER1-MAKTX = IT_DATA-MAKTX.
MODIFY IT_VER1 TRANSPORTING WERKS MATNR PBDNR MAKTX WHERE BDZEI = IT_DATA-BDZEI.
ENDIF.
ENDLOOP.
IT_VER1_HOLD[] = IT_VER1[].
SORT IT_VER1 BY MATNR PBDNR BDZEI.
LOOP AT IT_VER1.
AT END OF BDZEI.
SUM.
READ TABLE IT_VER1_HOLD WITH KEY MATNR = IT_VER1-MATNR
PBDNR = IT_VER1-PBDNR
BDZEI = IT_VER1-BDZEI.
IF SY-SUBRC = 0.
MOVE IT_VER1_HOLD-WERKS TO IT_MAIN-WERKS.
MOVE IT_VER1_HOLD-MATNR TO IT_MAIN-MATNR.
MOVE IT_VER1_HOLD-MAKTX TO IT_MAIN-MAKTX.
MOVE IT_VER1_HOLD-PBDNR TO IT_MAIN-PBDNR.
MOVE IT_VER1_HOLD-MEINS TO IT_MAIN-MEINS.
MOVE IT_VER1_HOLD-BDZEI TO IT_MAIN-BDZEI.
MOVE IT_VER1-PLNMG TO IT_MAIN-PLNMG.
APPEND IT_MAIN.
ENDIF.
ENDAT.
ENDLOOP.
CLEAR : IT_VER1_HOLD." TO USE THE SAME INTERNAL TABLE FOR
"ACTUAL VERSION ALSO.
*-----------FOR ACTUAL VERSION
SELECT WERKS MATNR PBDNR BDZEI
INTO CORRESPONDING FIELDS OF TABLE IT_DATA_ACT
FROM PBIM
WHERE WERKS = PR_WERKS AND
PBDNR = W_PBDNR1 AND
VERSB = W_VERSB.
SORT IT_DATA_ACT BY WERKS MATNR BDZEI PBDNR.
DELETE ADJACENT DUPLICATES FROM IT_DATA_ACT COMPARING WERKS MATNR BDZEI PBDNR.
SELECT PLNMG MEINS BDZEI
INTO CORRESPONDING FIELDS OF TABLE IT_VER1_ACT
FROM PBED
FOR ALL ENTRIES IN IT_DATA_ACT
WHERE BDZEI = IT_DATA_ACT-BDZEI.
LOOP AT IT_VER1_ACT.
READ TABLE IT_DATA_ACT WITH KEY BDZEI = IT_VER1_ACT-BDZEI.
IF SY-SUBRC = 0.
IT_VER1_ACT-MATNR = IT_DATA_ACT-MATNR.
IT_VER1_ACT-PBDNR = IT_DATA_ACT-PBDNR.
IT_VER1_ACT-MAKTX = IT_DATA_ACT-MAKTX.
MODIFY IT_VER1_ACT TRANSPORTING MATNR PBDNR MAKTX WHERE BDZEI = IT_DATA_ACT-BDZEI.
ENDIF.
ENDLOOP.
* IT_VER1_HOLD[] = IT_VER1_ACT[].
SORT IT_VER1_ACT BY MATNR PBDNR BDZEI.
LOOP AT IT_VER1_ACT.
AT END OF BDZEI.
SUM.
READ TABLE IT_MAIN WITH KEY MATNR = IT_VER1_ACT-MATNR
PBDNR = IT_VER1_ACT-PBDNR
BDZEI = IT_VER1_ACT-BDZEI.
IF SY-SUBRC = 0.
IT_MAIN-CHGQTY = IT_MAIN-PLNMG - IT_VER1_ACT-PLNMG.
MODIFY IT_MAIN TRANSPORTING CHGQTY WHERE MATNR = IT_VER1_ACT-MATNR AND
PBDNR = IT_VER1_ACT-PBDNR AND
BDZEI = IT_VER1_ACT-BDZEI.
ENDIF.
ENDAT.
ENDLOOP.
*------------ TO GET PLANNED ORDER QTY.
SELECT WERKS MATNR VERNO GSMNG INTO CORRESPONDING FIELDS OF TABLE IT_MATDISP
FROM ZVVF_CT_MATDISP
FOR ALL ENTRIES IN IT_MAIN
WHERE MATNR = IT_MAIN-MATNR AND
WERKS = IT_MAIN-WERKS AND
VERNO = W_VERSION1 AND
PSTTR IN SO_PSTTR AND
PEDTR IN SO_PEDTR.
SORT IT_MATDISP BY WERKS MATNR VERNO.
LOOP AT IT_MATDISP.
AT END OF VERNO.
SUM.
READ TABLE IT_MAIN WITH KEY MATNR = IT_MATDISP-MATNR
WERKS = IT_MATDISP-WERKS.
IT_MAIN-GSMNG = IT_MATDISP-GSMNG.
MODIFY IT_MAIN TRANSPORTING GSMNG WHERE MATNR = IT_MATDISP-MATNR AND
WERKS = IT_MATDISP-WERKS.
ENDAT.
ENDLOOP.
*------------GETTING ACTUAL PRODUCED QUANTITY.
PERFORM GET_PREVIOUS_MONTH_DAYS.
SELECT MBLNR INTO CORRESPONDING FIELDS OF TABLE IT_MKPF
FROM MKPF
WHERE CPUDT GE W_STDATE AND
CPUDT LE W_ENDDATE AND
* MJAHR = W_YEAR AND
VGART IN ('WF','WR').
IF SY-SUBRC = 0.
SELECT WERKS MATNR MENGE ERFMG ERFME
INTO CORRESPONDING FIELDS OF TABLE IT_MSEG
FROM MSEG
FOR ALL ENTRIES IN IT_MKPF
WHERE MBLNR = IT_MKPF-MBLNR AND
WERKS = PR_WERKS.
IF SY-SUBRC = 0.
SORT IT_MSEG BY WERKS MATNR.
LOOP AT IT_MSEG.
READ TABLE IT_MAIN WITH KEY MATNR = IT_MSEG-MATNR WERKS = IT_MSEG-WERKS.
IF SY-SUBRC NE 0.
DELETE IT_MSEG.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
IT_MSEG_HOLD[] = IT_MSEG[].
LOOP AT IT_MSEG.
AT END OF MATNR.
SUM.
READ TABLE IT_MAIN WITH KEY WERKS = IT_MSEG-WERKS MATNR = IT_MSEG-MATNR.
IF SY-SUBRC = 0.
IT_MAIN-MENGE = IT_MSEG-MENGE.
IT_MAIN-ERFMG = IT_MSEG-ERFMG.
READ TABLE IT_MSEG_HOLD WITH KEY WERKS = IT_MSEG-WERKS MATNR = IT_MSEG-MATNR.
IT_MAIN-ERFME = IT_MSEG_HOLD-ERFME.
MODIFY IT_MAIN TRANSPORTING MENGE ERFMG ERFME
WHERE MATNR = IT_MSEG-MATNR AND
WERKS = IT_MSEG-WERKS.
ENDIF.
ENDAT.
ENDLOOP.
LOOP AT IT_MAIN.
IT_MAIN-DIFF = IT_MAIN-GSMNG - IT_MAIN-MENGE.
IF IT_MAIN-GSMNG NE '0'.
IT_MAIN-PERCEN = IT_MAIN-DIFF / IT_MAIN-GSMNG * 100.
ENDIF.
MODIFY IT_MAIN INDEX SY-TABIX.
ENDLOOP.
ENDFORM. " F002_PREVIOUS_MONTH_DATA
*&---------------------------------------------------------------------*
*& Form F003_CURRENT_MONTH_DATA
*&---------------------------------------------------------------------*
FORM F003_CURRENT_MONTH_DATA .
*--------FOR CURRENT MONTH DATA....
*-------------FOR LATEST VERSION
SELECT WERKS MATNR PBDNR MAKTX BDZEI
INTO CORRESPONDING FIELDS OF TABLE IT_DATA
FROM ZVVF_CT_MATDISP
WHERE WERKS = PR_WERKS AND
VERNO = W_VERSION2.
SORT IT_DATA BY WERKS MATNR BDZEI PBDNR.
DELETE ADJACENT DUPLICATES FROM IT_DATA COMPARING WERKS MATNR BDZEI PBDNR.
SELECT PLNMG MEINS BDZEI
INTO CORRESPONDING FIELDS OF TABLE IT_VER1
FROM PBED
FOR ALL ENTRIES IN IT_DATA
WHERE BDZEI = IT_DATA-BDZEI.
LOOP AT IT_VER1.
READ TABLE IT_DATA WITH KEY BDZEI = IT_VER1-BDZEI.
IF SY-SUBRC = 0.
IT_VER1-WERKS = IT_DATA-WERKS.
IT_VER1-MATNR = IT_DATA-MATNR.
IT_VER1-PBDNR = IT_DATA-PBDNR.
IT_VER1-MAKTX = IT_DATA-MAKTX.
MODIFY IT_VER1 TRANSPORTING WERKS MATNR PBDNR MAKTX WHERE BDZEI = IT_DATA-BDZEI.
ENDIF.
ENDLOOP.
IT_VER1_HOLD[] = IT_VER1[].
SORT IT_VER1 BY MATNR PBDNR BDZEI.
LOOP AT IT_VER1.
AT END OF BDZEI.
SUM.
READ TABLE IT_VER1_HOLD WITH KEY MATNR = IT_VER1-MATNR
PBDNR = IT_VER1-PBDNR
BDZEI = IT_VER1-BDZEI.
IF SY-SUBRC = 0.
MOVE IT_VER1_HOLD-WERKS TO IT_MAIN1-WERKS.
MOVE IT_VER1_HOLD-MATNR TO IT_MAIN1-MATNR.
MOVE IT_VER1_HOLD-MAKTX TO IT_MAIN1-MAKTX.
MOVE IT_VER1_HOLD-PBDNR TO IT_MAIN1-PBDNR.
MOVE IT_VER1_HOLD-MEINS TO IT_MAIN1-MEINS.
MOVE IT_VER1_HOLD-BDZEI TO IT_MAIN1-BDZEI.
MOVE IT_VER1-PLNMG TO IT_MAIN1-PLNMG.
APPEND IT_MAIN1.
ENDIF.
ENDAT.
ENDLOOP.
CLEAR : IT_VER1_HOLD." TO USE THE SAME INTERNAL TABLE FOR
"ACTUAL VERSION ALSO.
*-----------FOR ACTUAL VERSION
SELECT WERKS MATNR PBDNR BDZEI
INTO CORRESPONDING FIELDS OF TABLE IT_DATA_ACT
FROM PBIM
WHERE WERKS = PR_WERKS AND
PBDNR = W_PBDNR2 AND
VERSB = W_VERSB.
SORT IT_DATA_ACT BY WERKS MATNR BDZEI PBDNR.
DELETE ADJACENT DUPLICATES FROM IT_DATA_ACT COMPARING WERKS MATNR BDZEI PBDNR.
SELECT PLNMG MEINS BDZEI
INTO CORRESPONDING FIELDS OF TABLE IT_VER1_ACT
FROM PBED
FOR ALL ENTRIES IN IT_DATA_ACT
WHERE BDZEI = IT_DATA_ACT-BDZEI.
LOOP AT IT_VER1_ACT.
READ TABLE IT_DATA_ACT WITH KEY BDZEI = IT_VER1_ACT-BDZEI.
IF SY-SUBRC = 0.
IT_VER1_ACT-MATNR = IT_DATA_ACT-MATNR.
IT_VER1_ACT-PBDNR = IT_DATA_ACT-PBDNR.
IT_VER1_ACT-MAKTX = IT_DATA_ACT-MAKTX.
MODIFY IT_VER1_ACT TRANSPORTING MATNR PBDNR MAKTX WHERE BDZEI = IT_DATA_ACT-BDZEI.
ENDIF.
ENDLOOP.
* IT_VER1_HOLD[] = IT_VER1_ACT[].
SORT IT_VER1_ACT BY MATNR PBDNR BDZEI.
LOOP AT IT_VER1_ACT.
AT END OF BDZEI.
SUM.
READ TABLE IT_MAIN1 WITH KEY MATNR = IT_VER1_ACT-MATNR
PBDNR = IT_VER1_ACT-PBDNR
BDZEI = IT_VER1_ACT-BDZEI.
IF SY-SUBRC = 0.
IT_MAIN1-CHGQTY = IT_MAIN1-PLNMG - IT_VER1_ACT-PLNMG.
MODIFY IT_MAIN1 TRANSPORTING CHGQTY WHERE MATNR = IT_VER1_ACT-MATNR AND
PBDNR = IT_VER1_ACT-PBDNR AND
BDZEI = IT_VER1_ACT-BDZEI.
ENDIF.
ENDAT.
ENDLOOP.
*------------ TO GET PLANNED ORDER QTY.
SELECT WERKS MATNR VERNO GSMNG INTO CORRESPONDING FIELDS OF TABLE IT_MATDISP
FROM ZVVF_CT_MATDISP
FOR ALL ENTRIES IN IT_MAIN1
WHERE MATNR = IT_MAIN1-MATNR AND
WERKS = IT_MAIN1-WERKS AND
VERNO = W_VERSION2 AND
PSTTR IN SO_PSTTR AND
PEDTR IN SO_PEDTR.
SORT IT_MATDISP BY WERKS MATNR VERNO.
LOOP AT IT_MATDISP.
AT END OF VERNO.
SUM.
READ TABLE IT_MAIN1 WITH KEY MATNR = IT_MATDISP-MATNR
WERKS = IT_MATDISP-WERKS.
IT_MAIN1-GSMNG = IT_MATDISP-GSMNG.
MODIFY IT_MAIN1 TRANSPORTING GSMNG WHERE MATNR = IT_MATDISP-MATNR AND
WERKS = IT_MATDISP-WERKS.
ENDAT.
ENDLOOP.
ENDFORM. " F003_CURRENT_MONTH_DATA
*&---------------------------------------------------------------------*
*& Form F004_COMBINE_BOTH_DATA
*&---------------------------------------------------------------------*
FORM F004_COMBINE_BOTH_DATA .
LOOP AT IT_MAIN1.
MOVE-CORRESPONDING IT_MAIN1 TO IT_MAIN.
APPEND IT_MAIN.
ENDLOOP.
LOOP AT IT_MAIN.
SHIFT IT_MAIN-MATNR LEFT DELETING LEADING '0'.
MODIFY IT_MAIN INDEX SY-TABIX.
ENDLOOP.
ENDFORM. " F004_COMBINE_BOTH_DATA
*&---------------------------------------------------------------------*
*& Form F005_eventtab_build_temp
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_W_EVENTS[] text
*----------------------------------------------------------------------*
FORM F005_eventtab_build_temp USING RT_EVENTS TYPE SLIS_T_EVENT.
DATA : LW_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = RT_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 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.
READ TABLE RT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE INTO LW_EVENT.
IF SY-SUBRC = 0.
MOVE W_TOP_OF_PAGE TO LW_EVENT-FORM.
APPEND LW_EVENT TO RT_EVENTS.
ENDIF.
ENDFORM. " F005_eventtab_build_temp
*&---------------------------------------------------------------------*
*& Form F006_LIST_HEADING
*&---------------------------------------------------------------------*
FORM F006_LIST_HEADING .
SELECT VERVS INTO CORRESPONDING FIELDS OF TABLE IT_VERVS "(W_VERVS)
FROM PBIM
WHERE VERSB = SO_VERSB-LOW AND
WERKS = PR_WERKS.
IF SY-SUBRC = 0.
READ TABLE IT_VERVS WITH KEY VERVS = 'X'.
IF SY-SUBRC NE 0.
MESSAGE E000(ZMSG_C007_8_9_PP).
ENDIF.
endif.
CLEAR IT_VERVS.
REFRESH IT_VERVS.
SELECT VERVS INTO CORRESPONDING FIELDS OF TABLE IT_VERVS "(W_VERVS)
FROM PBIM
WHERE VERSB = SO_VERSB-HIGH AND
WERKS = PR_WERKS.
IF SY-SUBRC = 0.
READ TABLE IT_VERVS WITH KEY VERVS = 'X'.
IF SY-SUBRC NE 0.
MESSAGE E000(ZMSG_C007_8_9_PP).
ENDIF.
endif.
IF PR_WERKS NE SO_VERNO-LOW+0(4).
MESSAGE E008(zmsg_c007_8_9_pp).
ELSEIF SO_PBDNR-low NE SO_VERNO-LOW+4(4) .
MESSAGE E008(zmsg_c007_8_9_pp).
ELSEIF SO_VERSB-low NE SO_VERNO-LOW+8(2).
MESSAGE E008(zmsg_c007_8_9_pp).
ENDIF.
IF PR_WERKS NE SO_VERNO-high+0(4).
MESSAGE E008(zmsg_c007_8_9_pp).
ELSEIF SO_PBDNR-HIGH NE SO_VERNO-HIGH+4(4) .
MESSAGE E008(zmsg_c007_8_9_pp).
ELSEIF SO_VERSB-HIGH NE SO_VERNO-HIGH+8(2).
MESSAGE E008(zmsg_c007_8_9_pp).
ENDIF.
CONCATENATE 'Plant Code : ' pr_werks into W_INFO.
SELECT SINGLE NAME1 INTO (W_WERKS)
FROM T001W
WHERE WERKS = PR_WERKS.
IF SY-SUBRC = 0.
CONCATENATE 'Plant Description :' w_werks into W_INFO1.
ENDIF.
ENDFORM. " F006_LIST_HEADING
*&---------------------------------------------------------------------*
*& Form F007_FIELDCAT_INIT
*&---------------------------------------------------------------------*
FORM F007_FIELDCAT_INIT .
DATA : LW_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'MATNR'.
LW_FIELDCAT-SELTEXT_M = 'Material No'.
LW_FIELDCAT-OUTPUTLEN = 18.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'MAKTX'.
LW_FIELDCAT-SELTEXT_M = 'Material Description'.
LW_FIELDCAT-OUTPUTLEN = 40.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'PBDNR'.
LW_FIELDCAT-SELTEXT_M = 'Requisition No'.
LW_FIELDCAT-OUTPUTLEN = 10.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'PLNMG'.
LW_FIELDCAT-SELTEXT_M = 'Planned Qty'.
LW_FIELDCAT-OUTPUTLEN = 13.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'MEINS'.
LW_FIELDCAT-SELTEXT_M = 'UOM'.
LW_FIELDCAT-OUTPUTLEN = 3.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'CHGQTY'.
LW_FIELDCAT-SELTEXT_M = 'Change in Pln Qty'.
LW_FIELDCAT-OUTPUTLEN = 13.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'GSMNG'.
LW_FIELDCAT-SELTEXT_M = 'Planned Order Qty after Firming of Line Plan'.
LW_FIELDCAT-OUTPUTLEN = 13.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'MENGE'.
LW_FIELDCAT-SELTEXT_M = 'Actual Produced Qty'.
LW_FIELDCAT-OUTPUTLEN = 13.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'ERFMG'.
LW_FIELDCAT-SELTEXT_M = 'Qty in Unit of Entry'.
LW_FIELDCAT-OUTPUTLEN = 13.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'ERFME'.
LW_FIELDCAT-SELTEXT_M = 'UOE'.
LW_FIELDCAT-OUTPUTLEN = 3.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'DIFF'.
LW_FIELDCAT-SELTEXT_M = 'Difference(Plan vs Actual in Bom)'.
LW_FIELDCAT-OUTPUTLEN = 13.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'PERCEN'.
LW_FIELDCAT-SELTEXT_M = '% of Diff'.
LW_FIELDCAT-OUTPUTLEN = 5.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'REASON'.
LW_FIELDCAT-SELTEXT_M = 'Reason for Shortfall'.
LW_FIELDCAT-OUTPUTLEN = 20.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'REQUIRED'.
LW_FIELDCAT-SELTEXT_M = 'Production Required'.
LW_FIELDCAT-OUTPUTLEN = 13.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
CLEAR LW_FIELDCAT.
LW_FIELDCAT-FIELDNAME = 'REMARKS'.
LW_FIELDCAT-SELTEXT_M = 'Remarks'.
LW_FIELDCAT-OUTPUTLEN = 20.
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
ENDFORM. " F007_FIELDCAT_INIT
*&---------------------------------------------------------------------*
*& Form F008_DISPLAY_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_W_LISTHEADER[] text
*----------------------------------------------------------------------*
FORM F008_DISPLAY_DATA USING lt_top_of_page TYPE slis_t_listheader .
DATA: LW_LINE TYPE SLIS_LISTHEADER.
CLEAR LW_LINE.
LW_LINE-TYP = 'H'.
LW_LINE-INFO = C_DESC.
APPEND LW_LINE TO LT_TOP_OF_PAGE.
CLEAR LW_LINE.
CLEAR LW_LINE.
LW_LINE-TYP = 'S'.
LW_LINE-INFO = W_INFO.
APPEND LW_LINE TO LT_TOP_OF_PAGE.
CLEAR LW_LINE.
CLEAR LW_LINE.
LW_LINE-TYP = 'S'.
LW_LINE-INFO = W_INFO1.
APPEND LW_LINE TO LT_TOP_OF_PAGE.
CLEAR LW_LINE.
ENDFORM. " F008_DISPLAY_DATA
*&---------------------------------------------------------------------*
*& Form F009_DISPLAY_LIST
*&---------------------------------------------------------------------*
FORM F009_DISPLAY_LIST .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = W_REPID
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
I_BACKGROUND_ID = 'ALV_BACKGROUND'
* I_GRID_TITLE =
* I_GRID_SETTINGS =
IS_LAYOUT = W_LAYOUT
IT_FIELDCAT = W_FIELDCATALOG[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
IT_EVENTS = W_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
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_MAIN
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. " F009_DISPLAY_LIST
*&--------------------------------------------------------------------*
*& Form TOP_OF_PAGE
*&--------------------------------------------------------------------*
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = W_LISTHEADER
i_logo = ' '.
ENDFORM. "top_of_page
*&---------------------------------------------------------------------*
*& Form F010_F4_HELP_FOR_LOW
*&---------------------------------------------------------------------*
FORM F010_F4_HELP_FOR_LOW.
DATA : IT_DYNPFIELDS LIKE TABLE OF DYNPREAD,
WA_IT_DYNPFIELDS LIKE LINE OF IT_DYNPFIELDS.
DATA: IT_RET LIKE TABLE OF DDSHRETVAL,
WA_RET LIKE LINE OF IT_RET.
DATA : IT_VALUE LIKE TABLE OF ZVVF_CS_MATDISP,"OF TYPE STRUCTURE
IT_DYNPFLD LIKE TABLE OF DSELC,
WA_IT_DYNPFLD LIKE LINE OF IT_DYNPFLD.
DATA : W_PBDNR LIKE ZVVF_CT_MATDISP-PBDNR,
W_VERSB LIKE ZVVF_CT_MATDISP-VERSB,
W_WERKS LIKE PBIM-WERKS.
MOVE 'SO_PBDNR-LOW' TO WA_IT_DYNPFIELDS-FIELDNAME.
APPEND WA_IT_DYNPFIELDS TO IT_DYNPFIELDS.
MOVE 'SO_VERSB-LOW' TO WA_IT_DYNPFIELDS-FIELDNAME.
APPEND WA_IT_DYNPFIELDS TO IT_DYNPFIELDS.
MOVE 'PR_WERKS' TO WA_IT_DYNPFIELDS-FIELDNAME.
APPEND WA_IT_DYNPFIELDS TO IT_DYNPFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-REPID
DYNUMB = '1000'
TRANSLATE_TO_UPPER = 'X'
* REQUEST = ' '
* PERFORM_CONVERSION_EXITS = ' '
* PERFORM_INPUT_CONVERSION = ' '
* DETERMINE_LOOP_INDEX = ' '
TABLES
DYNPFIELDS = it_dynpfields
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE IT_DYNPFIELDS INTO WA_IT_DYNPFIELDS
WITH KEY FIELDNAME = 'SO_PBDNR-LOW'.
W_PBDNR = WA_IT_DYNPFIELDS-FIELDVALUE.
READ TABLE IT_DYNPFIELDS INTO WA_IT_DYNPFIELDS
WITH KEY FIELDNAME = 'SO_VERSB-LOW'.
W_VERSB = WA_IT_DYNPFIELDS-FIELDVALUE.
READ TABLE IT_DYNPFIELDS INTO WA_IT_DYNPFIELDS
WITH KEY FIELDNAME = 'PR_WERKS'.
W_WERKS = WA_IT_DYNPFIELDS-FIELDVALUE.
SELECT VERNO FROM ZVVF_CT_MATDISP
INTO CORRESPONDING FIELDS OF TABLE IT_VALUE
WHERE PBDNR = W_PBDNR
AND VERSB = W_VERSB
AND WERKS = W_WERKS.
SORT IT_VALUE BY VERNO.
DELETE ADJACENT DUPLICATES FROM it_value COMPARING VERNO.
****IF WE WANT TO GET DISPLAY OTHER SELECTION-SCREEN VALUES ALONG WITH THIS
****F4 HELP VALUE
*MOVE 'ZKRIZ' TO WA_IT_DYNPFLD-FLDNAME.
*MOVE 'PR_GPCNT' TO WA_IT_DYNPFLD-DYFLDNAME.
*APPEND WA_IT_DYNPFLD TO IT_DYNPFLD.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = 'ZVVF_CS_MATDISP'
RETFIELD = 'VERNO'
* PVALKEY = ' '
DYNPPROG = 'ZVVF_CR008_MONTHLYREPORT'
DYNPNR = '1000'
DYNPROFIELD = 'SO_VERNO-LOW'
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
VALUE_TAB = IT_VALUE
* FIELD_TAB =
RETURN_TAB = IT_RET
* DYNPFLD_MAPPING = IT_DYNPFLD
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
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. " F010_F4_HELP_FOR_LOW
*&---------------------------------------------------------------------*
*& Form F011_F4_HELP_FOR_HIGH
*&---------------------------------------------------------------------*
FORM F011_F4_HELP_FOR_HIGH .
DATA : IT_DYNPFIELDS LIKE TABLE OF DYNPREAD,
WA_IT_DYNPFIELDS LIKE LINE OF IT_DYNPFIELDS.
DATA: IT_RET LIKE TABLE OF DDSHRETVAL,
WA_RET LIKE LINE OF IT_RET.
DATA : IT_VALUE LIKE TABLE OF ZVVF_CS_MATDISP,"OF TYPE STRUCTURE
IT_DYNPFLD LIKE TABLE OF DSELC,
WA_IT_DYNPFLD LIKE LINE OF IT_DYNPFLD.
DATA : W_PBDNR LIKE ZVVF_CT_MATDISP-PBDNR,
W_VERSB LIKE ZVVF_CT_MATDISP-VERSB,
W_WERKS LIKE PBIM-WERKS.
MOVE 'SO_PBDNR-HIGH' TO WA_IT_DYNPFIELDS-FIELDNAME.
APPEND WA_IT_DYNPFIELDS TO IT_DYNPFIELDS.
MOVE 'SO_VERSB-HIGH' TO WA_IT_DYNPFIELDS-FIELDNAME.
APPEND WA_IT_DYNPFIELDS TO IT_DYNPFIELDS.
MOVE 'PR_WERKS' TO WA_IT_DYNPFIELDS-FIELDNAME.
APPEND WA_IT_DYNPFIELDS TO IT_DYNPFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-REPID
DYNUMB = '1000'
TRANSLATE_TO_UPPER = 'X'
* REQUEST = ' '
* PERFORM_CONVERSION_EXITS = ' '
* PERFORM_INPUT_CONVERSION = ' '
* DETERMINE_LOOP_INDEX = ' '
TABLES
DYNPFIELDS = it_dynpfields
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE IT_DYNPFIELDS INTO WA_IT_DYNPFIELDS
WITH KEY FIELDNAME = 'SO_PBDNR-HIGH'.
W_PBDNR = WA_IT_DYNPFIELDS-FIELDVALUE.
READ TABLE IT_DYNPFIELDS INTO WA_IT_DYNPFIELDS
WITH KEY FIELDNAME = 'SO_VERSB-HIGH'.
W_VERSB = WA_IT_DYNPFIELDS-FIELDVALUE.
READ TABLE IT_DYNPFIELDS INTO WA_IT_DYNPFIELDS
WITH KEY FIELDNAME = 'PR_WERKS'.
W_WERKS = WA_IT_DYNPFIELDS-FIELDVALUE.
SELECT VERNO FROM ZVVF_CT_MATDISP
INTO CORRESPONDING FIELDS OF TABLE IT_VALUE
WHERE PBDNR = W_PBDNR
AND VERSB = W_VERSB
AND WERKS = W_WERKS.
SORT IT_VALUE BY VERNO.
DELETE ADJACENT DUPLICATES FROM it_value COMPARING VERNO.
****IF WE WANT TO GET DISPLAY OTHER SELECTION-SCREEN VALUES ALONG WITH THIS
****F4 HELP VALUE
*MOVE 'ZKRIZ' TO WA_IT_DYNPFLD-FLDNAME.
*MOVE 'PR_GPCNT' TO WA_IT_DYNPFLD-DYFLDNAME.
*APPEND WA_IT_DYNPFLD TO IT_DYNPFLD.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = 'ZVVF_CS_MATDISP'
RETFIELD = 'VERNO'
* PVALKEY = ' '
DYNPPROG = 'ZVVF_CR008_MONTHLYREPORT'
DYNPNR = '1000'
DYNPROFIELD = 'SO_VERNO-LOW'
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
VALUE_TAB = IT_VALUE
* FIELD_TAB =
RETURN_TAB = IT_RET
* DYNPFLD_MAPPING = IT_DYNPFLD
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
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. " F011_F4_HELP_FOR_HIGH
if you want to publish or Add something on ERP, SAP , SAP FUNCTIONAL, SAP ABAP then mail us along with your email-id. contain must be yours email-id :- avinashkr_raj@yahoo.com(any email) email-id :- avinaskr_raj.abap@blogger.com
Go on link..
link us with ...
Subscribe to:
Post Comments (Atom)
link us...
For Visitors
if you want to publish or Add something on ERP, SAP , SAP FUNCTIONAL, SAP ABAP then mail us along with your email-id. contain must be yours
email-id :- avinashkr_raj@yahoo.com(any email)
email-id :- avinaskr_raj.abap@blogger.com ( use only gmail)
email-id :- avinashkr_raj@yahoo.com(any email)
email-id :- avinaskr_raj.abap@blogger.com ( use only gmail)
No comments:
Post a Comment