Skip to Content

Dear,

If you want to get WIP report means KKAO output in detail then read following.

For that you have to develope z program butz program take lts of time to execute so try to enhance kkao and take data from kkao to one z table  and then make report .

to get data from KKAO enhance  report SAPKKA07 in FORM create_grundliste 

like

ENHANCEMENT ZWIP.    “active version

* EXPORT T_AUFTLST FROM T_AUFTLST TO MEMORY ID ‘DATA’.

  DATA : WIP TYPE STANDARD TABLE OF ZWIP WITH HEADER LINE.

  DATA : SRNO TYPE I.

  DELETE FROM ZWIP WHERE UNAME = SYUNAME.

  CLEAR WIP.

  SELECT MAX( SRNO ) FROM ZWIP

    INTO SRNO.

  LOOP AT T_AUFTLST.

    MOVE-CORRESPONDING T_AUFTLST TO WIP.

    SRNO = WIPSRNO = SRNO + 1.

    WIPZYEAR = ABGR_PERIODJ.

    WIPPERIO = ABGR_PERIODM.

    WIPUNAME = SYUNAME.

    APPEND WIP.

*   INSERT ZWIP FROM TABLE WIP ACCEPTING DUPLICATE KEYS.

  ENDLOOP.

  INSERT ZWIP FROM TABLE WIP ACCEPTING DUPLICATE KEYS.

ENDENHANCEMENT.

then make program like below

*&———————————————————————*

*& Report  ZWIP

*&

*&———————————————————————*

*&

*&

*&———————————————————————*

REPORT  ZWIP.

TYPE-POOLS : SLIS.

*tables****************************************************************

TABLES:

AUFK, “Order master data

*JEST, “Object status

*AFKO, “Order header data PP orders

COEP, “CO Object: Line Items (by Period)

COBK, “CO Object: Document Header

*MSEG, “Document Segment: Material

*AFRU, “Order completion confirmations

*RESB, “Reservation/dependent requirements

*JCDS, “Change Documents for System/User Statuses (Table JEST)

*T001W,”Plants/Branches

*TJ02T,”System status texts

  1. MARA.

*MAKT. “Material DescriptionsTYPES : BEGIN OF TY_FINAL,  SR_NO TYPE I ,  CELLCOLOR TYPE LVC_T_SCOL,  AUFNR TYPE AFPO-AUFNR,  POSNR TYPE AFPO-POSNR,  OBJNR TYPE COEP-OBJNR,  GSTRS TYPE AFKO-GSTRS,  MEINS TYPE AFPO-MEINS,  MATNR TYPE AFPO-MATNR,  MAKTX TYPE MAKT-MAKTX,  PSMNG TYPE AFPO-PSMNG,  WEMNG TYPE AFPO-WEMNG,  PEMNG TYPE AFKO-GAMNG,  STLNR TYPE STPO-STLNR,  DATUV TYPE STPO-DATUV,  ANDAT TYPE STPO-ANDAT,  IDNRK TYPE STPO-IDNRK,  BOMNG TYPE STPO-MENGE,  REMNG TYPE STPO-MENGE,  MEGBTR TYPE COEP-MEGBTR,  MBGBTR TYPE COEP-MBGBTR,  STMNG TYPE STPO-MENGE,  RMEINS TYPE STPO-MEINS,  WOGBTR TYPE COEP-WOGBTR,  AVALUE1 TYPE COEP-WOGBTR,  AVALUE2 TYPE COEP-WOGBTR,  AVALUE TYPE COEP-WOGBTR,  CMATNR TYPE COEP-MATNR,  CMAKTX TYPE MAKT-MAKTX,  BUDAT TYPE COBK-BUDAT,  BOM TYPE C,END OF TY_FINAL.DATA : IT_FINAL TYPE STANDARD TABLE OF TY_FINAL.DATA : WA_FINAL TYPE TY_FINAL.*DATA : WA_FINAL1 TYPE TY_FINAL.DATA : CMATNR TYPE I.*TYPES : BEGIN OF TY_FINAL1,*  AUFNR TYPE AFPO-AUFNR,*  POSNR TYPE AFPO-POSNR,*  OBJNR TYPE COEP-OBJNR,*  MATNR TYPE AFPO-MATNR,*  MAKTX TYPE MAKT-MAKTX,*  WOGBTR TYPE COEP-WOGBTR,*  AVALUE TYPE COEP-WOGBTR,*  CMATNR TYPE COEP-MATNR,*END OF TY_FINAL1.*DATA : IT_FINAL1 TYPE STANDARD TABLE OF TY_FINAL1 WITH HEADER LINE. *TYPES : BEGIN OF TY_AUFK, ” OCCURS 0,*AUFNR TYPE AUFK-AUFNR,*OBJNR TYPE AUFK-OBJNR,*AUART TYPE AUFK-AUART,** aufnr TYPE afko-aufnr,*GAMNG TYPE AFKO-GAMNG,*PLNBEZ TYPE AFKO-PLNBEZ,*GMEIN TYPE AFKO-GMEIN,*AUFPL TYPE AFKO-AUFPL,*RSNUM TYPE AFKO-RSNUM,*DISPO TYPE AFKO-DISPO,*STLNR TYPE AFKO-STLNR,*END OF TY_AUFK.*DATA : IT_AUFK TYPE STANDARD TABLE OF TY_AUFK WITH HEADER LINE.*DATA : BEGIN OF IT_WIP OCCURS 0.*  INCLUDE STRUCTURE ZWIP.**  AUFNR TYPE ZWIP-AUFNR,**  OBJNR TYPE ZWIP-OBJNR,**  ZYEAR TYPE ZWIP-ZYEAR,**  PERIO TYPE ZWIP-PERIO,**  UNAME TYPE ZWIP-UNAME,**  MATNR TYPE ZWIP-MATNR,**  WRT TYPE ZWIP-WRT,**  WRTK TYPE ZWIP-WRTK,**  BEWER TYPE ZWIP-BEWER,*DATA : END OF IT_WIP.DATA : IT_WIP TYPE STANDARD TABLE OF ZWIP WITH HEADER LINE.TYPES : BEGIN OF TY_TEMP, ” OCCURS 0,AUFNR TYPE AUFK-AUFNR,OBJNR TYPE AUFK-OBJNR,AUART TYPE AUFK-AUART,GSTRS TYPE CAUFV-GSTRS,SDATV TYPE CAUFV-SDATV,AUFLD TYPE CAUFV-AUFLD,* aufnr TYPE afko-aufnr,GAMNG TYPE AFKO-GAMNG,IGMNG TYPE AFKO-IGMNG,PLNBEZ TYPE AFKO-PLNBEZ,GMEIN TYPE AFKO-GMEIN,AUFPL TYPE AFKO-AUFPL,RSNUM TYPE AFKO-RSNUM,DISPO TYPE AFKO-DISPO,STLNR TYPE AFKO-STLNR,POSNR TYPE AFPO-POSNR,MEINS TYPE AFPO-MEINS,MATNR TYPE AFPO-MATNR,PSMNG TYPE AFPO-PSMNG,WEMNG TYPE AFPO-WEMNG,END OF TY_TEMP.DATA : IT_TEMP TYPE STANDARD TABLE OF TY_TEMP WITH HEADER LINE.*DATA : IT_TEMP1 TYPE STANDARD TABLE OF TY_TEMP WITH HEADER LINE.TYPES : BEGIN OF TY_RESB,  MATNR TYPE RESB-MATNR,  BDMNG TYPE RESB-BDMNG,  MEINS TYPE RESB-MEINS,  SHKZG TYPE RESB-SHKZG,  AUFNR TYPE RESB-AUFNR,  OBJNR TYPE AUFK-OBJNR,END OF TY_RESB.DATA : IT_RESB TYPE STANDARD TABLE OF TY_RESB WITH HEADER LINE.DATA : IT_RESB1 TYPE STANDARD TABLE OF TY_RESB WITH HEADER LINE.DATA : BDMNG TYPE RESB-BDMNG. TYPES : BEGIN OF TY_MDFA,  AUFNR TYPE MDFA-AUFNR,  MATNR TYPE MDFA-MATNR,  WEMNG TYPE MDFA-WEMNG,END OF TY_MDFA.DATA : IT_MDFA TYPE STANDARD TABLE OF TY_MDFA WITH HEADER LINE. TYPES : BEGIN OF TY_STPO, ” OCCURS 0,  STLNR TYPE STPO-STLNR,  DATUV TYPE STPO-DATUV,  ANDAT TYPE STPO-ANDAT,  IDNRK TYPE STPO-IDNRK,  MENGE TYPE STPO-MENGE,  MEINS TYPE STPO-MEINS,END OF TY_STPO.DATA : IT_STPO TYPE STANDARD TABLE OF TY_STPO WITH HEADER LINE. TYPES : BEGIN OF TY_COEP, ” OCCURS 0,KSTAR TYPE COEP-KSTAR,BUZEI TYPE COEP-BUZEI,PERIO TYPE COEP-PERIO,BELNR TYPE COEP-BELNR,OBJNR TYPE COEP-OBJNR,VRGNG TYPE COEP-VRGNG,MATNR TYPE COEP-MATNR,GJAHR TYPE COEP-GJAHR,WERKS TYPE COEP-WERKS,MEINB TYPE COEP-MEINB,WOGBTR TYPE COEP-WOGBTR,MEGBTR TYPE COEP-MEGBTR,MBGBTR TYPE COEP-MBGBTR,MEINH TYPE COEP-MEINH,REFBN TYPE COBK-REFBN,BUDAT TYPE COBK-BUDAT,END OF TY_COEP.DATA : IT_COEP TYPE STANDARD TABLE OF TY_COEP WITH HEADER LINE.DATA : IT_COEP1 TYPE STANDARD TABLE OF TY_COEP WITH HEADER LINE.DATA : IT_COEP2 TYPE STANDARD TABLE OF TY_COEP WITH HEADER LINE.DATA : IT_COEP3 TYPE STANDARD TABLE OF TY_COEP WITH HEADER LINE.DATA : IT_COEP4 TYPE STANDARD TABLE OF TY_COEP WITH HEADER LINE.DATA : IT_COEP5 TYPE STANDARD TABLE OF TY_COEP WITH HEADER LINE.DATA : IT_COEP6 TYPE STANDARD TABLE OF TY_COEP WITH HEADER LINE.DATA : IT_COEP7 TYPE STANDARD TABLE OF TY_COEP WITH HEADER LINE.DATA : COEP_TEMP TYPE STANDARD TABLE OF TY_COEP WITH HEADER LINE.DATA : WOGBTR TYPE COEP-WOGBTR,*       WOGBTR1 TYPE COEP-WOGBTR,       MEGBTR TYPE COEP-MEGBTR,       MBGBTR TYPE COEP-MBGBTR.*DATA : COUNT TYPE I.TYPES : BEGIN OF TY_MAKT,  MATNR TYPE MAKT-MATNR,  MAKTX TYPE MAKT-MAKTX,END OF TY_MAKT.DATA : IT_MAKT TYPE STANDARD TABLE OF TY_MAKT WITH HEADER LINE.DATA : IT_MAKT1 TYPE STANDARD TABLE OF TY_MAKT WITH HEADER LINE. *TYPES: BEGIN OF TY_JEST, ” OCCURS 0,*OBJNR TYPE JEST-OBJNR,*STAT TYPE JEST-STAT,*END OF TY_JEST.*DATA : IT_JEST TYPE STANDARD TABLE OF TY_JEST WITH HEADER LINE.*TYPES: BEGIN OF TY_JCDS, ” OCCURS 0,*OBJNR TYPE JCDS-OBJNR,*STAT TYPE JCDS-STAT,*UDATE TYPE JCDS-UDATE,*INACT TYPE JCDS-INACT,*END OF TY_JCDS.*DATA : IT_JCDS TYPE STANDARD TABLE OF TY_JCDS WITH HEADER LINE.*DATA : IT_JEST1 TYPE STANDARD TABLE OF TY_JEST WITH HEADER LINE.*DATA : IT_JEST2 TYPE STANDARD TABLE OF TY_JEST WITH HEADER LINE.*DATA : IT_JEST3 TYPE STANDARD TABLE OF TY_JEST WITH HEADER LINE.*DATA : IT_JEST4 TYPE STANDARD TABLE OF TY_JEST WITH HEADER LINE.*DATA : IT_JEST5 TYPE STANDARD TABLE OF TY_JEST WITH HEADER LINE.*DATA : IT_JEST6 TYPE STANDARD TABLE OF TY_JEST WITH HEADER LINE.*DATA : IT_JEST7 TYPE STANDARD TABLE OF TY_JEST WITH HEADER LINE.*DATA : IT_JEST8 TYPE STANDARD TABLE OF TY_JEST WITH HEADER LINE.*DATA : IT_JEST9 TYPE STANDARD TABLE OF TY_JEST WITH HEADER LINE.*DATA : IT_JEST0 TYPE STANDARD TABLE OF TY_JEST WITH HEADER LINE.*DATA : IT_JEST11 TYPE STANDARD TABLE OF TY_JEST WITH HEADER LINE.*DATA : IT_JEST12 TYPE STANDARD TABLE OF TY_JEST WITH HEADER LINE.*DATA: I_TJ02T TYPE TJ02T OCCURS 0 WITH HEADER LINE.*DATA : GVALUE TYPE COEP-WOGBTR,*       GVALUE1 TYPE COEP-WOGBTR.*DATA : STAT TYPE C.*************************************************************************CONSTANTS: C_AUTYP TYPE AUFK-AUTYP VALUE ’10’,*C_TRUE VALUE ‘X’,*C_FALSE VALUE ‘ ‘,*C_TECO(5) VALUE ‘I0045’,*C_DLV(5) VALUE ‘I0012’,*C_DELT(5) VALUE ‘I0013’.DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,       IT_LAYOUT TYPE SLIS_LAYOUT_ALV,       GT_TOP TYPE SLIS_T_LISTHEADER,       GW_TOP TYPE SLIS_LISTHEADER,       IT_SORT TYPE SLIS_T_SORTINFO_ALV,       WA_SORT TYPE SLIS_SORTINFO_ALV,*       IT_EVENTS TYPE SLIS_T_EVENT,       IT_EVENT TYPE SLIS_T_EVENT.*       WA_EVENTS TYPE SLIS_ALV_EVENT.DATA  SRNO TYPE I.DATA : MONTH(2) TYPE C,       YEAR(4) TYPE C,       PERIO TYPE COEP-PERIO,       GJAHR TYPE COEP-GJAHR.*       MAX_PERIO TYPE COEP-PERIO,*       MIN_PERIO TYPE COEP-PERIO.***********************************************************************SELECTION-SCREEN: BEGIN OF BLOCK A01 WITH FRAME TITLE TEXT-S01.SELECT-OPTIONS: S_KOKRS FOR COEP-KOKRS OBLIGATORY DEFAULT ‘1000’ NO-EXTENSION NO INTERVALS, ” Control area*                S_WERKS FOR AUFK-WERKS OBLIGATORY DEFAULT ‘1000’ NO-EXTENSION NO INTERVALS,”MEMORY ID WRK OBLIGATORY NO-EXTENSION NO INTERVALS, ” “*                S_AUART FOR AUFK-AUART ,”DEFAULT ‘ZP04’, ” Order type                S_MATNR FOR MARA-MATNR,”AFKO-PLNBEZ,” ” material number                S_AUFNR FOR AUFK-AUFNR, ” default ‘2000011*                S_DISPO FOR AFKO-DISPO, ” MRP controller                S_BUDAT FOR COBK-BUDAT OBLIGATORY NO INTERVALS NO-EXTENSION DEFAULT SY-DATUM.SELECTION-SCREEN: END OF BLOCK A01.************************************************************************ AT SELECTION-SCREEN.  MONTH = S_BUDAT+07(02).  YEAR  = S_BUDAT+03(04).  PERIO = MONTH – 3.  IF PERIO LE 0.    PERIO = PERIO + 12.  ENDIF.  IF PERIO > 09.    GJAHR = YEAR – 1.  ELSE.    GJAHR = YEAR.  ENDIF. ************************************************************************START-OF-SELECTION.  PERFORM GET_DATA.  PERFORM FIELDCAT.  PERFORM LAYOUT.  PERFORM SORT.  PERFORM EVENT_GET.  PERFORM SET_CELL_COLOURS.  PERFORM DISPLAY. *&———————————————————————**&      Form GET_DATA*&———————————————————————**       text*———————————————————————-**  –> p1        text*  <– p2        text*———————————————————————-*FORM GET_DATA .*  CLEAR IT_AUFK.*  REFRESH IT_AUFK.   SELECT * “AUFNR OBJNR ZYEAR PERIO UNAME MATNR WRT WRTK BEWER    FROM ZWIP    INTO CORRESPONDING FIELDS OF TABLE IT_WIP    WHERE UNAME = SY-UNAME    AND ZYEAR = GJAHR    AND PERIO = PERIO    AND AUFNR IN S_AUFNR    AND MATNR IN S_MATNR.   IF IT_WIP[] IS NOT INITIAL.    SELECT A~AUFNR A~OBJNR A~AUART A~GSTRS          A~GAMNG A~IGMNG A~PLNBEZ A~GMEIN A~AUFPL A~RSNUM A~STLNR          A~DISPO A~SDATV A~AUFLD A~RSNUM B~POSNR B~MEINS B~MATNR B~PSMNG B~WEMNG      INTO CORRESPONDING FIELDS OF TABLE IT_TEMP      FROM CAUFV AS A INNER JOIN AFPO AS B ON A~AUFNR = B~AUFNR      FOR ALL ENTRIES IN IT_WIP      WHERE A~AUFNR = IT_WIP-AUFNR      AND A~PLNBEZ IN S_MATNR.  ENDIF.   IF IT_TEMP[] IS INITIAL.    MESSAGE E000(ZPP) WITH ‘No Valid status for Production Order selection.’.  ELSE.    PERFORM SELECT_DATA.  ENDIF.

  1. ENDFORM.                    ” GET_DATA

*&———————————————————————**&      Form SELECT_DATA*&———————————————————————**       text*———————————————————————-**  –> p1        text*  <– p2        text*———————————————————————-*FORM SELECT_DATA .  IF IT_TEMP[] IS NOT INITIAL.    SORT IT_TEMP BY AUFNR OBJNR POSNR.    SELECT AUFNR MATNR WEMNG      INTO CORRESPONDING FIELDS OF TABLE IT_MDFA      FROM MDFA      FOR ALL ENTRIES IN IT_TEMP      WHERE AUFNR EQ IT_TEMP-AUFNR.     SELECT MATNR BDMNG MEINS SHKZG AUFNR      INTO CORRESPONDING FIELDS OF TABLE IT_RESB      FROM RESB      FOR ALL ENTRIES IN IT_TEMP      WHERE RSNUM = IT_TEMP-RSNUM      AND AUFNR EQ IT_TEMP-AUFNR.    IF IT_RESB[] IS NOT INITIAL.      PERFORM IT_RESB.    ENDIF.    SELECT STLNR DATUV ANDAT IDNRK MENGE MEINS     FROM STPO      INTO CORRESPONDING FIELDS OF TABLE IT_STPO      FOR ALL ENTRIES IN IT_TEMP      WHERE STLNR EQ IT_TEMP-STLNR.     SELECT MATNR MAKTX      INTO CORRESPONDING FIELDS OF TABLE IT_MAKT1      FROM MAKT      FOR ALL ENTRIES IN IT_TEMP      WHERE MATNR EQ IT_TEMP-MATNR      AND SPRAS EQ ‘EN’.     SELECT    COEP~KSTAR COEP~BUZEI COEP~PERIO COEP~BELNR COEP~OBJNR    COEP~VRGNG COEP~MATNR COEP~GJAHR COEP~WERKS COEP~MEINB    COEP~WOGBTR COEP~MEGBTR COEP~MBGBTR COEP~MEINH    COBK~REFBN COBK~BUDAT    INTO CORRESPONDING FIELDS OF TABLE IT_COEP    FROM ( COBK INNER JOIN COEP ON COBK~KOKRS = COEP~KOKRS AND COBK~BELNR = COEP~BELNR )    FOR ALL ENTRIES IN IT_TEMP    WHERE COEP~KOKRS IN S_KOKRS    AND COEP~OBJNR EQ IT_TEMP-OBJNR    AND COBK~BUDAT <= S_BUDAT-LOW    AND COEP~LEDNR EQ ’00’.    IT_COEP5[] = IT_COEP[].    LOOP AT IT_COEP5.” WHERE GJAHR <= GJAHR.      IF IT_COEP5-GJAHR < GJAHR.        MOVE IT_COEP5 TO IT_COEP1.*        MOVE-CORRESPONDING IT_COEP5 TO IT_COEP1.        APPEND IT_COEP1.      ELSEIF IT_COEP5-GJAHR = GJAHR.        IF IT_COEP5-PERIO <= PERIO.          MOVE IT_COEP5 TO IT_COEP1.*          MOVE-CORRESPONDING IT_COEP5 TO IT_COEP1.          APPEND IT_COEP1.        ENDIF.      ENDIF.    ENDLOOP.    IF IT_COEP[] IS NOT INITIAL.” AND IT_COEP1[] IS NOT INITIAL.      PERFORM IT_COEP.      CLEAR IT_COEP4.      REFRESH IT_COEP4.      IF IT_RESB[] IS NOT INITIAL.        IT_COEP4[] = IT_COEP[].        PERFORM FILL_FINAL.      ENDIF.    ENDIF.  ENDIF.

  1. ENDFORM.                    ” SELECT_DATA

*&———————————————————————**&      Form IT_RESB*&———————————————————————**       text*———————————————————————-**  –> p1        text*  <– p2        text*———————————————————————-*FORM IT_RESB .  CLEAR IT_RESB1[].  REFRESH IT_RESB1.  IT_RESB1[] = IT_RESB[].  CLEAR IT_RESB.  REFRESH IT_RESB.  SORT IT_RESB1 BY AUFNR MATNR.  LOOP AT IT_RESB1.    IF IT_RESB-AUFNR = IT_RESB1-AUFNR AND IT_RESB-MATNR = IT_RESB1-MATNR.      CLEAR BDMNG.      BDMNG = IT_RESB1-BDMNG + IT_RESB-BDMNG.      CLEAR IT_RESB-BDMNG.      IT_RESB-BDMNG = BDMNG.      MODIFY IT_RESB TRANSPORTING BDMNG WHERE AUFNR = IT_RESB1-AUFNR AND MATNR = IT_RESB1-MATNR.    ELSE.      MOVE IT_RESB1 TO IT_RESB.*      MOVE-CORRESPONDING IT_RESB1 TO IT_RESB.      READ TABLE IT_TEMP WITH KEY AUFNR = IT_RESB-AUFNR.      IF SY-SUBRC = 0.        IT_RESB-OBJNR = IT_TEMP-OBJNR.      ENDIF.      APPEND IT_RESB.    ENDIF.  ENDLOOP.  SELECT MATNR MAKTX    INTO CORRESPONDING FIELDS OF TABLE IT_MAKT    FROM MAKT    FOR ALL ENTRIES IN IT_RESB    WHERE MATNR EQ IT_RESB-MATNR    AND SPRAS EQ ‘EN’.

  1. ENDFORM.                    ” IT_RESB

*&———————————————————————**&      Form IT_COEP*&———————————————————————**       text*———————————————————————-**  –> p1        text*  <– p2        text*———————————————————————-*FORM IT_COEP .  CLEAR COEP_TEMP.  REFRESH COEP_TEMP.  COEP_TEMP[] = IT_COEP1[].  SORT COEP_TEMP BY OBJNR MATNR PERIO DESCENDING.  CLEAR IT_COEP1.  REFRESH IT_COEP1.  LOOP AT COEP_TEMP.    IF IT_COEP1-OBJNR EQ COEP_TEMP-OBJNR AND IT_COEP1-MATNR EQ COEP_TEMP-MATNR AND IT_COEP1-PERIO = COEP_TEMP-PERIO.      CLEAR : WOGBTR,MEGBTR,MBGBTR.      WOGBTR = IT_COEP1-WOGBTR + COEP_TEMP-WOGBTR.      MEGBTR = IT_COEP1-MEGBTR + COEP_TEMP-MEGBTR.      MBGBTR = IT_COEP1-MBGBTR + COEP_TEMP-MBGBTR.      CLEAR : IT_COEP1-WOGBTR,IT_COEP1-MEGBTR,IT_COEP1-MBGBTR.      IT_COEP1-WOGBTR = WOGBTR.      IT_COEP1-MEGBTR = MEGBTR.      IT_COEP1-MBGBTR = MBGBTR.      MODIFY IT_COEP1 TRANSPORTING WOGBTR MEGBTR MBGBTR                      WHERE OBJNR = COEP_TEMP-OBJNR                      AND MATNR = COEP_TEMP-MATNR                      AND PERIO = COEP_TEMP-PERIO.    ELSE.      MOVE COEP_TEMP TO IT_COEP1.*      MOVE-CORRESPONDING COEP_TEMP TO IT_COEP1.      APPEND IT_COEP1. ” DATA WITH ALL PERIOD LESS THAN OR EQUAL TO ENTERED PERIOD    ENDIF.  ENDLOOP.  CLEAR : COEP_TEMP,IT_COEP2,IT_COEP3.  REFRESH : COEP_TEMP, IT_COEP2,IT_COEP3.  LOOP AT IT_COEP1.    IF IT_COEP1-PERIO <> PERIO.      IF IT_COEP2-OBJNR = IT_COEP1-OBJNR AND IT_COEP2-MATNR = IT_COEP1-MATNR.        CLEAR : WOGBTR,MEGBTR,MBGBTR.        WOGBTR = IT_COEP2-WOGBTR + IT_COEP1-WOGBTR.        MEGBTR = IT_COEP2-MEGBTR + IT_COEP1-MEGBTR.        MBGBTR = IT_COEP2-MBGBTR + IT_COEP1-MBGBTR.        CLEAR : IT_COEP2-WOGBTR,IT_COEP2-MEGBTR,IT_COEP2-MBGBTR.        IT_COEP2-WOGBTR = WOGBTR.        IT_COEP2-MEGBTR = MEGBTR.IT_COEP2-MBGBTR = MBGBTR.        MODIFY IT_COEP2 TRANSPORTING WOGBTR MEGBTR MBGBTR                        WHERE OBJNR = IT_COEP1-OBJNR                        AND MATNR = IT_COEP1-MATNR.*                        AND PERIO = IT_COEP1-PERIO.      ELSE.        MOVE IT_COEP1 TO IT_COEP2.*        MOVE-CORRESPONDING IT_COEP1 TO IT_COEP2.        APPEND IT_COEP2.” DATA WITHOUT ENTERED PERIOD      ENDIF.    ELSE.      IF IT_COEP3-OBJNR = IT_COEP1-OBJNR AND IT_COEP3-MATNR = IT_COEP1-MATNR.        CLEAR : WOGBTR,MEGBTR,MBGBTR.        WOGBTR = IT_COEP3-WOGBTR + IT_COEP1-WOGBTR.        MEGBTR = IT_COEP3-MEGBTR + IT_COEP1-MEGBTR.        MBGBTR = IT_COEP3-MBGBTR + IT_COEP1-MBGBTR.        CLEAR : IT_COEP3-WOGBTR,IT_COEP3-MEGBTR,IT_COEP3-MBGBTR.        IT_COEP3-WOGBTR = WOGBTR.        IT_COEP3-MEGBTR = MEGBTR.        IT_COEP3-MBGBTR = MBGBTR.        MODIFY IT_COEP2 TRANSPORTING WOGBTR MEGBTR MBGBTR                        WHERE OBJNR = IT_COEP1-OBJNR                        AND MATNR = IT_COEP1-MATNR                        AND PERIO = IT_COEP1-PERIO.      ELSE.        MOVE IT_COEP1 TO IT_COEP3.*        MOVE-CORRESPONDING IT_COEP1 TO IT_COEP3.        APPEND IT_COEP3.” DATA WITH ENTERED PERIOD      ENDIF.    ENDIF.    IF IT_COEP1-GJAHR <> GJAHR.      IF IT_COEP6-OBJNR = IT_COEP1-OBJNR AND IT_COEP6-MATNR = IT_COEP1-MATNR.        CLEAR : WOGBTR,MEGBTR,MBGBTR.        WOGBTR = IT_COEP6-WOGBTR + IT_COEP1-WOGBTR.        MEGBTR = IT_COEP6-MEGBTR + IT_COEP1-MEGBTR.MBGBTR = IT_COEP6-MBGBTR + IT_COEP1-MBGBTR.        CLEAR : IT_COEP6-WOGBTR,IT_COEP6-MEGBTR,IT_COEP6-MBGBTR.        IT_COEP6-WOGBTR = WOGBTR.        IT_COEP6-MEGBTR = MEGBTR.        IT_COEP6-MBGBTR = MBGBTR.        MODIFY IT_COEP6 TRANSPORTING WOGBTR MEGBTR MBGBTR                        WHERE OBJNR = IT_COEP1-OBJNR                        AND MATNR = IT_COEP1-MATNR.*                        AND PERIO = IT_COEP1-PERIO.      ELSE.        MOVE IT_COEP1 TO IT_COEP6.*        MOVE-CORRESPONDING IT_COEP1 TO IT_COEP6.        APPEND IT_COEP6.” DATA WITHOUT ENTERED YEAR      ENDIF.    ELSE.      IF IT_COEP7-OBJNR = IT_COEP1-OBJNR AND IT_COEP7-MATNR = IT_COEP1-MATNR.        CLEAR : WOGBTR,MEGBTR,MBGBTR.        WOGBTR = IT_COEP7-WOGBTR + IT_COEP1-WOGBTR.        MEGBTR = IT_COEP7-MEGBTR + IT_COEP1-MEGBTR.        MBGBTR = IT_COEP7-MBGBTR + IT_COEP1-MBGBTR.        CLEAR : IT_COEP7-WOGBTR,IT_COEP7-MEGBTR,IT_COEP7-MBGBTR.        IT_COEP7-WOGBTR = WOGBTR.        IT_COEP7-MEGBTR = MEGBTR.        IT_COEP7-MBGBTR = MBGBTR.        MODIFY IT_COEP7 TRANSPORTING WOGBTR MEGBTR MBGBTR                        WHERE OBJNR = IT_COEP1-OBJNR                        AND MATNR = IT_COEP1-MATNR.*                        AND PERIO = IT_COEP1-PERIO.      ELSE.        MOVE IT_COEP1 TO IT_COEP7.*        MOVE-CORRESPONDING IT_COEP1 TO IT_COEP7.        APPEND IT_COEP7.” DATA WITHOUT ENTERED YEAR      ENDIF.    ENDIF.  ENDLOOP.  COEP_TEMP[] = IT_COEP[].  CLEAR : IT_COEP.  REFRESH IT_COEP.  SORT COEP_TEMP BY OBJNR MATNR DESCENDING.  LOOP AT COEP_TEMP.    IF IT_COEP-OBJNR EQ COEP_TEMP-OBJNR AND IT_COEP-MATNR EQ COEP_TEMP-MATNR.      CLEAR : WOGBTR,MEGBTR,MBGBTR.      WOGBTR = IT_COEP-WOGBTR + COEP_TEMP-WOGBTR.      MEGBTR = IT_COEP-MEGBTR + COEP_TEMP-MEGBTR.      MBGBTR = IT_COEP-MBGBTR + COEP_TEMP-MBGBTR.      CLEAR : IT_COEP-WOGBTR,IT_COEP-MEGBTR,IT_COEP-MBGBTR.      IT_COEP-WOGBTR = WOGBTR.      IT_COEP-MEGBTR = MEGBTR.      IT_COEP-MBGBTR = MBGBTR.      MODIFY IT_COEP TRANSPORTING WOGBTR MEGBTR MBGBTR  WHERE OBJNR EQ COEP_TEMP-OBJNR AND MATNR EQ COEP_TEMP-MATNR.    ELSE.      MOVE COEP_TEMP TO IT_COEP.*      MOVE-CORRESPONDING COEP_TEMP TO IT_COEP.      APPEND IT_COEP. ” DATA WITH LESS THAN OR EQUAL TO ENTERED DATE    ENDIF.  ENDLOOP.

  1. ENDFORM.                    ” IT_COEP

*&———————————————————————**&      Form FILL_FINAL*&———————————————————————**       text*———————————————————————-**  –> p1        text*  <– p2        text*———————————————————————-*FORM FILL_FINAL .  LOOP AT IT_RESB.    CLEAR WA_FINAL.    ON CHANGE OF IT_RESB-AUFNR.      CLEAR SRNO.      WA_FINAL-SR_NO = 0.    ENDON.    WA_FINAL-SR_NO = WA_FINAL-SR_NO + SRNO + 1.    CLEAR SRNO.     WA_FINAL-CMATNR = IT_RESB-MATNR.    WA_FINAL-REMNG  = IT_RESB-BDMNG.    WA_FINAL-RMEINS  = IT_RESB-MEINS.    WA_FINAL-AUFNR  = IT_RESB-AUFNR.     READ TABLE IT_TEMP WITH KEY AUFNR = WA_FINAL-AUFNR.    IF SY-SUBRC EQ 0.      WA_FINAL-OBJNR = IT_TEMP-OBJNR.      WA_FINAL-POSNR = IT_TEMP-POSNR.      WA_FINAL-GSTRS = IT_TEMP-GSTRS.      WA_FINAL-MEINS = IT_TEMP-MEINS.      WA_FINAL-MATNR = IT_TEMP-MATNR.      WA_FINAL-PSMNG = IT_TEMP-GAMNG.      WA_FINAL-STLNR = IT_TEMP-STLNR.      WA_FINAL-DATUV = IT_TEMP-SDATV.      WA_FINAL-ANDAT = IT_TEMP-AUFLD.    ENDIF.     READ TABLE IT_MDFA WITH KEY AUFNR = WA_FINAL-AUFNR                                  MATNR = WA_FINAL-MATNR.    IF SY-SUBRC EQ 0.      WA_FINAL-WEMNG = IT_MDFA-WEMNG.    ENDIF.     READ TABLE IT_MAKT WITH KEY MATNR = WA_FINAL-CMATNR.    IF SY-SUBRC EQ 0.      WA_FINAL-CMAKTX = IT_MAKT-MAKTX.    ENDIF.     READ TABLE IT_MAKT1 WITH KEY MATNR = WA_FINAL-MATNR.    IF SY-SUBRC EQ 0.      WA_FINAL-MAKTX = IT_MAKT1-MAKTX.    ENDIF.     READ TABLE IT_STPO WITH KEY STLNR = WA_FINAL-STLNR                                  IDNRK = WA_FINAL-CMATNR.    IF SY-SUBRC EQ 0.      WA_FINAL-IDNRK = IT_STPO-IDNRK.      WA_FINAL-BOMNG = IT_STPO-MENGE.      WA_FINAL-BOM   = ‘Y’.    ELSE.      WA_FINAL-BOM = ‘N’.    ENDIF.     READ TABLE IT_COEP WITH KEY OBJNR = WA_FINAL-OBJNR                                MATNR = WA_FINAL-CMATNR.    IF SY-SUBRC = 0.      WA_FINAL-MEGBTR = IT_COEP-MEGBTR.      WA_FINAL-WOGBTR = IT_COEP-WOGBTR.      WA_FINAL-MBGBTR = IT_COEP-MBGBTR.WA_FINAL-BUDAT = IT_COEP-BUDAT.      DELETE IT_COEP WHERE OBJNR EQ WA_FINAL-OBJNR AND MATNR EQ WA_FINAL-CMATNR.    ENDIF.    IF WA_FINAL-CMATNR IS INITIAL.      CMATNR = 0.    ELSE.      CMATNR = 1.    ENDIF.    CASE CMATNR.      WHEN ‘0’.        WA_FINAL-AVALUE = WA_FINAL-WOGBTR.        WA_FINAL-PEMNG = WA_FINAL-PSMNG – WA_FINAL-WEMNG.        WA_FINAL-STMNG = WA_FINAL-MBGBTR – ( WA_FINAL-WEMNG * WA_FINAL-BOMNG ).      WHEN ‘1’.        WA_FINAL-PEMNG = WA_FINAL-PSMNG – WA_FINAL-WEMNG.        IF WA_FINAL-CMATNR <> WA_FINAL-MATNR.          IF WA_FINAL-BOM = ‘Y’.            WA_FINAL-STMNG = WA_FINAL-MBGBTR – ( WA_FINAL-WEMNG * WA_FINAL-BOMNG ).          ENDIF.        ELSE.          WA_FINAL-STMNG = WA_FINAL-MBGBTR * ( -1 ).        ENDIF.      WHEN OTHERS.    ENDCASE.    SRNO = WA_FINAL-SR_NO.    APPEND WA_FINAL TO IT_FINAL.  ENDLOOP.  IF IT_FINAL[] IS NOT INITIAL.    SORT IT_FINAL BY AUFNR OBJNR SR_NO DESCENDING.    SORT IT_COEP BY OBJNR MATNR.    IF IT_COEP[] IS NOT INITIAL.      PERFORM FINAL.    ENDIF.  ENDIF.

  1. ENDFORM.                    ” FILL_FINAL

*&———————————————————————**&      Form FINAL*&———————————————————————**       text*———————————————————————-**  –> p1        text*  <– p2        text*———————————————————————-*FORM FINAL .*  IF IT_COEP[] IS NOT INITIAL.    LOOP AT IT_COEP.      CLEAR WA_FINAL.      IF IT_COEP-MATNR IS INITIAL.        READ TABLE IT_FINAL INTO WA_FINAL  WITH KEY OBJNR = IT_COEP-OBJNR.        IF SY-SUBRC = 0.          WA_FINAL-SR_NO = WA_FINAL-SR_NO + 1.          WA_FINAL-CMATNR = IT_COEP-MATNR.          WA_FINAL-RMEINS = IT_COEP-MEINB.          WA_FINAL-MEGBTR = IT_COEP-MEGBTR.          WA_FINAL-MBGBTR = IT_COEP-MBGBTR.          WA_FINAL-WOGBTR = IT_COEP-WOGBTR.          WA_FINAL-BUDAT = IT_COEP-BUDAT.          CLEAR : WA_FINAL-POSNR,WA_FINAL-GSTRS,WA_FINAL-STLNR,WA_FINAL-DATUV,WA_FINAL-ANDAT,WA_FINAL-IDNRK,WA_FINAL-BOMNG,WA_FINAL-REMNG,WA_FINAL-STMNG,WA_FINAL-AVALUE1,WA_FINAL-AVALUE2,WA_FINAL-AVALUE,WA_FINAL-CMAKTX,WA_FINAL-BOM.          CLEAR SRNO.          SRNO = WA_FINAL-SR_NO.          APPEND WA_FINAL TO IT_FINAL.        ENDIF.      ELSE.        CLEAR WA_FINAL.        READ TABLE IT_FINAL INTO WA_FINAL  WITH KEY OBJNR = IT_COEP-OBJNRMATNR = IT_COEP-MATNR.        IF SY-SUBRC = 0.          IF SRNO IS NOT INITIAL.            WA_FINAL-SR_NO = SRNO + 1.          ELSE.            WA_FINAL-SR_NO = WA_FINAL-SR_NO + 1.          ENDIF.          WA_FINAL-CMATNR = IT_COEP-MATNR.          WA_FINAL-CMAKTX = WA_FINAL-MAKTX.          WA_FINAL-RMEINS = WA_FINAL-MEINS.          WA_FINAL-MBGBTR = IT_COEP-MBGBTR.          WA_FINAL-STMNG = IT_COEP-MBGBTR * ( -1 ).          WA_FINAL-WOGBTR = IT_COEP-WOGBTR.          WA_FINAL-BUDAT = IT_COEP-BUDAT.          CLEAR : WA_FINAL-POSNR,WA_FINAL-GSTRS,WA_FINAL-STLNR,WA_FINAL-DATUV,WA_FINAL-ANDAT,WA_FINAL-IDNRK,WA_FINAL-BOMNG,WA_FINAL-REMNG,WA_FINAL-MEGBTR,WA_FINAL-AVALUE1,WA_FINAL-AVALUE2,WA_FINAL-AVALUE,WA_FINAL-BOM.          APPEND WA_FINAL TO IT_FINAL.        ELSE.          READ TABLE IT_FINAL INTO WA_FINAL  WITH KEY OBJNR = IT_COEP-OBJNR.          IF SY-SUBRC = 0.            IF SRNO IS NOT INITIAL.              WA_FINAL-SR_NO = SRNO + 1.            ELSE.              WA_FINAL-SR_NO = WA_FINAL-SR_NO + 1.            ENDIF.            WA_FINAL-CMATNR = IT_COEP-MATNR.            WA_FINAL-RMEINS = IT_COEP-MEINB.            WA_FINAL-MEGBTR = IT_COEP-MEGBTR.            WA_FINAL-MBGBTR = IT_COEP-MBGBTR.            WA_FINAL-STMNG = IT_COEP-MBGBTR * ( -1 ).            WA_FINAL-WOGBTR = IT_COEP-WOGBTR.            WA_FINAL-BUDAT = IT_COEP-BUDAT.            CLEAR : WA_FINAL-POSNR,WA_FINAL-GSTRS,WA_FINAL-STLNR,WA_FINAL-DATUV,WA_FINAL-ANDAT,WA_FINAL-IDNRK,WA_FINAL-BOMNG,WA_FINAL-REMNG,WA_FINAL-STMNG,WA_FINAL-AVALUE1,WA_FINAL-AVALUE2,WA_FINAL-AVALUE,WA_FINAL-CMAKTX,WA_FINAL-BOM.            CLEAR SRNO.            SRNO = WA_FINAL-SR_NO.            APPEND WA_FINAL TO IT_FINAL.          ENDIF.        ENDIF.      ENDIF.    ENDLOOP.    SORT IT_FINAL BY AUFNR OBJNR MATNR SR_NO ASCENDING.*  ENDIF.  IF IT_FINAL[] IS NOT INITIAL.    PERFORM PERIOD_CHANGE.  ENDIF.

  1. ENDFORM.                    ” FINAL

*&———————————————————————**&      Form PERIOD_CHANGE*&———————————————————————**       text*———————————————————————-**  –> p1        text*  <– p2        text*———————————————————————-*FORM PERIOD_CHANGE .  LOOP AT IT_FINAL INTO WA_FINAL.    READ TABLE IT_WIP WITH KEY OBJNR = WA_FINAL-OBJNR.    IF SY-SUBRC = 0.      IF IT_WIP-WRT IS NOT INITIAL.        IF IT_WIP-BEWER IS INITIAL.          READ TABLE IT_COEP6 WITH KEY OBJNR = WA_FINAL-OBJNR                                     MATNR = WA_FINAL-CMATNR.          IF SY-SUBRC = 0.            WA_FINAL-AVALUE1 = IT_COEP6-WOGBTR * ( -1 ).          ENDIF.        ELSE.          READ TABLE IT_COEP7 WITH KEY OBJNR = WA_FINAL-OBJNR                           MATNR = WA_FINAL-CMATNR.              IF SY-SUBRC = 0.                WA_FINAL-AVALUE1 = IT_COEP7-WOGBTR.              ENDIF.*          CASE IT_WIP-WIPTYP.*            WHEN ‘Res. for Unrealized Costs’.*              READ TABLE IT_COEP4 WITH KEY OBJNR = WA_FINAL-OBJNR*                           MATNR = WA_FINAL-CMATNR.*              IF SY-SUBRC = 0.*                WA_FINAL-AVALUE1 = IT_COEP4-WOGBTR.*              ENDIF.*            WHEN ‘Inventory (WIP)’.*              READ TABLE IT_COEP2 WITH KEY OBJNR = WA_FINAL-OBJNR*                           MATNR = WA_FINAL-CMATNR.*              IF SY-SUBRC = 0.*                WA_FINAL-AVALUE1 = IT_COEP2-WOGBTR.*              ENDIF.*            WHEN OTHERS.*          ENDCASE.        ENDIF.ENDIF.      IF IT_WIP-WRTK IS INITIAL.        CLEAR WA_FINAL-WOGBTR.      ENDIF.      MODIFY IT_FINAL FROM WA_FINAL TRANSPORTING WOGBTR AVALUE1.    ENDIF.  ENDLOOP.

  1. ENDFORM.                    ” PERIOD_CHANGE

*&———————————————————————**&      Form FIELDCAT*&———————————————————————**       text*———————————————————————-**  –> p1        text*  <– p2        text*———————————————————————-*FORM FIELDCAT .  DATA : POS TYPE INT1 VALUE 0.   CLEAR IT_FIELDCAT.  POS = POS + 1.  IT_FIELDCAT-COL_POS = POS.*IT_FIELDCAT-FIX_COLUMN = ‘X’.  IT_FIELDCAT-KEY = ‘X’.  IT_FIELDCAT-FIELDNAME = ‘AUFNR’.  IT_FIELDCAT-TABNAME = ‘IT_FINAL’.  IT_FIELDCAT-SELTEXT_L = ‘Order Number’.  IT_FIELDCAT-OUTPUTLEN = 12.  IT_FIELDCAT-EMPHASIZE = ‘X’.  APPEND IT_FIELDCAT.   CLEAR IT_FIELDCAT.  POS = POS + 1.  IT_FIELDCAT-COL_POS = POS.*IT_FIELDCAT-FIX_COLUMN = ‘X’.  IT_FIELDCAT-KEY = ‘X’.  IT_FIELDCAT-FIELDNAME = ‘MATNR’.  IT_FIELDCAT-TABNAME = ‘IT_FINAL’.  IT_FIELDCAT-SELTEXT_L = ‘Material’.  IT_FIELDCAT-OUTPUTLEN = 12.  APPEND IT_FIELDCAT.   CLEAR IT_FIELDCAT.  POS = POS + 1.  IT_FIELDCAT-COL_POS = POS.*IT_FIELDCAT-FIX_COLUMN = ‘X’.  IT_FIELDCAT-KEY = ‘X’.  IT_FIELDCAT-FIELDNAME = ‘MAKTX’.  IT_FIELDCAT-TABNAME = ‘IT_FINAL’.  IT_FIELDCAT-SELTEXT_L = ‘Material Description’.  IT_FIELDCAT-OUTPUTLEN = 12.  APPEND IT_FIELDCAT.   CLEAR IT_FIELDCAT.  POS = POS + 1.  IT_FIELDCAT-COL_POS = POS.*IT_FIELDCAT-FIX_COLUMN = ‘X’.  IT_FIELDCAT-KEY = ‘X’.  IT_FIELDCAT-FIELDNAME = ‘PSMNG’.  IT_FIELDCAT-TABNAME = ‘IT_FINAL’.  IT_FIELDCAT-SELTEXT_L = ‘Oreder Quantity’.  IT_FIELDCAT-OUTPUTLEN = 12.  APPEND IT_FIELDCAT.   CLEAR IT_FIELDCAT.  POS = POS + 1.  IT_FIELDCAT-COL_POS = POS.*IT_FIELDCAT-FIX_COLUMN = ‘X’.  IT_FIELDCAT-KEY = ‘X’.  IT_FIELDCAT-FIELDNAME = ‘WEMNG’.  IT_FIELDCAT-TABNAME = ‘IT_FINAL’.  IT_FIELDCAT-SELTEXT_L = ‘Confirm Quantity’.  IT_FIELDCAT-OUTPUTLEN = 12.  APPEND IT_FIELDCAT.   CLEAR IT_FIELDCAT.  POS = POS + 1.  IT_FIELDCAT-COL_POS = POS.  IT_FIELDCAT-FIX_COLUMN = ‘X’.  IT_FIELDCAT-KEY = ‘X’.  IT_FIELDCAT-FIELDNAME = ‘PEMNG’.  IT_FIELDCAT-TABNAME = ‘IT_FINAL’.  IT_FIELDCAT-SELTEXT_L = ‘Pending Quantity’.  IT_FIELDCAT-OUTPUTLEN = 12.  APPEND IT_FIELDCAT.   CLEAR IT_FIELDCAT.  POS = POS + 1.  IT_FIELDCAT-COL_POS = POS.*IT_FIELDCAT-FIX_COLUMN = ‘X’.  IT_FIELDCAT-FIELDNAME = ‘CMATNR’.  IT_FIELDCAT-TABNAME = ‘IT_FINAL’.  IT_FIELDCAT-SELTEXT_L = ‘Require Matrial’.  IT_FIELDCAT-OUTPUTLEN = 12.  APPEND IT_FIELDCAT.   CLEAR IT_FIELDCAT.  POS = POS + 1.  IT_FIELDCAT-COL_POS = POS.*IT_FIELDCAT-FIX_COLUMN = ‘X’.  IT_FIELDCAT-FIELDNAME = ‘CMAKTX’.  IT_FIELDCAT-TABNAME = ‘IT_FINAL’.  IT_FIELDCAT-SELTEXT_L = ‘Require Material Description’.  IT_FIELDCAT-OUTPUTLEN = 12.  APPEND IT_FIELDCAT.   CLEAR IT_FIELDCAT.  POS = POS + 1.  IT_FIELDCAT-COL_POS = POS.*IT_FIELDCAT-FIX_COLUMN = ‘X’.  IT_FIELDCAT-FIELDNAME = ‘REMNG’.  IT_FIELDCAT-TABNAME = ‘IT_FINAL’.  IT_FIELDCAT-SELTEXT_L = ‘Require Quantity’.  IT_FIELDCAT-OUTPUTLEN = 12.  APPEND IT_FIELDCAT.   CLEAR IT_FIELDCAT.  POS = POS + 1.  IT_FIELDCAT-COL_POS = POS.*IT_FIELDCAT-FIX_COLUMN = ‘X’.  IT_FIELDCAT-FIELDNAME = ‘MBGBTR’.  IT_FIELDCAT-TABNAME = ‘IT_FINAL’.  IT_FIELDCAT-SELTEXT_L = ‘Issue Quantity’.  IT_FIELDCAT-OUTPUTLEN = 12.  APPEND IT_FIELDCAT.   CLEAR IT_FIELDCAT.  POS = POS + 1.  IT_FIELDCAT-COL_POS = POS.*IT_FIELDCAT-FIX_COLUMN = ‘X’.  IT_FIELDCAT-FIELDNAME = ‘STMNG’.  IT_FIELDCAT-TABNAME = ‘IT_FINAL’.  IT_FIELDCAT-SELTEXT_L = ‘WIP Quantity’.  IT_FIELDCAT-OUTPUTLEN = 12.  APPEND IT_FIELDCAT.   CLEAR IT_FIELDCAT.  POS = POS + 1.  IT_FIELDCAT-COL_POS = POS.*IT_FIELDCAT-FIX_COLUMN = ‘X’.  IT_FIELDCAT-FIELDNAME = ‘RMEINS’.  IT_FIELDCAT-TABNAME = ‘IT_FINAL’.  IT_FIELDCAT-SELTEXT_L = ‘UOM’.  IT_FIELDCAT-OUTPUTLEN = 12.  APPEND IT_FIELDCAT.   CLEAR IT_FIELDCAT.  POS = POS + 1.  IT_FIELDCAT-COL_POS = POS.*IT_FIELDCAT-FIX_COLUMN = ‘X’.  IT_FIELDCAT-FIELDNAME = ‘WOGBTR’.  IT_FIELDCAT-TABNAME = ‘IT_FINAL’.  IT_FIELDCAT-SELTEXT_L = ‘WIP Value’.  IT_FIELDCAT-OUTPUTLEN = 12.  APPEND IT_FIELDCAT. *CLEAR IT_FIELDCAT.*POS = POS + 1.*IT_FIELDCAT-COL_POS = POS.**IT_FIELDCAT-FIX_COLUMN = ‘X’.*IT_FIELDCAT-FIELDNAME = ‘AVALUE’.*IT_FIELDCAT-TABNAME = ‘IT_FINAL’.*IT_FIELDCAT-SELTEXT_L = ‘WIP Value’.*IT_FIELDCAT-OUTPUTLEN = 12.*APPEND IT_FIELDCAT.   CLEAR IT_FIELDCAT.  POS = POS + 1.  IT_FIELDCAT-COL_POS = POS.*IT_FIELDCAT-FIX_COLUMN = ‘X’.  IT_FIELDCAT-FIELDNAME = ‘AVALUE1’.  IT_FIELDCAT-TABNAME = ‘IT_FINAL’.  IT_FIELDCAT-SELTEXT_L = ‘WIP Value (Period Change)’.  IT_FIELDCAT-OUTPUTLEN = 12.  APPEND IT_FIELDCAT.   CLEAR IT_FIELDCAT.  POS = POS + 1.  IT_FIELDCAT-COL_POS = POS.*IT_FIELDCAT-FIX_COLUMN = ‘X’.  IT_FIELDCAT-FIELDNAME = ‘BUDAT’.  IT_FIELDCAT-TABNAME = ‘IT_FINAL’.  IT_FIELDCAT-SELTEXT_L = ‘Posting Date’.  IT_FIELDCAT-OUTPUTLEN = 12.  APPEND IT_FIELDCAT.   CLEAR IT_FIELDCAT.  POS = POS + 1.  IT_FIELDCAT-COL_POS = POS.*IT_FIELDCAT-FIX_COLUMN = ‘X’.  IT_FIELDCAT-FIELDNAME = ‘BOM’.  IT_FIELDCAT-TABNAME = ‘IT_FINAL’.  IT_FIELDCAT-SELTEXT_L = ‘BOM Material’.  IT_FIELDCAT-OUTPUTLEN = 12.  APPEND IT_FIELDCAT.

  1. ENDFORM.                    ” FIELDCAT

*&———————————————————————**&      Form DISPLAY*&———————————————————————**       text*———————————————————————-**  –> p1        text*  <– p2        text*———————————————————————-*FORM DISPLAY .  CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’    EXPORTING      I_CALLBACK_PROGRAM     = SY-CPROG      I_CALLBACK_TOP_OF_PAGE = ‘TOP_OF_PAGE ‘      IS_LAYOUT              = IT_LAYOUT      IT_FIELDCAT            = IT_FIELDCAT[]      IT_SORT                = IT_SORT[]      IT_EVENTS              = IT_EVENT[]      I_DEFAULT              = ‘X’      I_SAVE                 = ‘A’    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.

  1. ENDFORM.                    ” DISPLAY

*&———————————————————————**&      Form TOP_OF_PAGE*&———————————————————————**       text*———————————————————————-**  –> p1        text*  <– p2        text*———————————————————————-*FORM top_of_page .  REFRESH GT_TOP.  GW_TOP-TYP = ‘H’.  GW_TOP-INFO = ‘Atul Auto Ltd.’.  APPEND GW_TOP TO GT_TOP.  CLEAR GW_TOP.   GW_TOP-TYP = ‘S’.  GW_TOP-INFO = ‘Work In Progress Report’.  APPEND GW_TOP TO GT_TOP.  CLEAR GW_TOP.  IF S_BUDAT-HIGH IS INITIAL.    S_BUDAT-HIGH = S_BUDAT-LOW.    CLEAR S_BUDAT-LOW.    S_BUDAT-LOW = ‘19000101’.  ENDIF.  CONCATENATE ‘Date : ‘ SPACE(1) S_BUDAT-LOW+6(2)  ‘-‘ S_BUDAT-LOW+4(2)    ‘-‘ S_BUDAT-LOW(4) SPACE(1)   ‘ To ‘ SPACE(1) S_BUDAT-HIGH+6(2) ‘-‘ S_BUDAT-HIGH+4(2) ‘-‘  S_BUDAT-HIGH(4)    INTO GW_TOP-INFO.  GW_TOP-TYP = ‘S’.  APPEND GW_TOP TO GT_TOP.  CLEAR GW_TOP.   CALL FUNCTION ‘REUSE_ALV_COMMENTARY_WRITE’    EXPORTING      it_list_commentary       = GT_TOP     I_LOGO                   = ‘ATUL_LOGO’*     I_END_OF_LIST_GRID       =*     I_ALV_FORM               =            .

  1. ENDFORM.                    ” TOP_OF_PAGE

*&———————————————————————**&      Form SORT*&———————————————————————**       text*———————————————————————-**  –> p1        text*  <– p2        text*———————————————————————-*FORM SORT .  IT_FIELDCAT-DO_SUM = ‘X’.  MODIFY IT_FIELDCAT TRANSPORTING DO_SUM WHERE FIELDNAME = ‘WOGBTR’.  MODIFY IT_FIELDCAT TRANSPORTING DO_SUM WHERE FIELDNAME = ‘AVALUE’.  MODIFY IT_FIELDCAT TRANSPORTING DO_SUM WHERE FIELDNAME = ‘AVALUE1’.   WA_SORT-SPOS = ’01’ .  WA_SORT-FIELDNAME = ‘AUFNR’.  WA_SORT-SUBTOT = ‘X’.  APPEND WA_SORT TO IT_SORT .  CLEAR WA_SORT.   WA_SORT-SPOS = ’02’ .  WA_SORT-FIELDNAME = ‘MATNR’.  APPEND WA_SORT TO IT_SORT .  CLEAR WA_SORT.   WA_SORT-SPOS = ’03’ .  WA_SORT-FIELDNAME = ‘MAKTX’.  APPEND WA_SORT TO IT_SORT .  CLEAR WA_SORT.   WA_SORT-SPOS = ’04’ .  WA_SORT-FIELDNAME = ‘PSMNG’.  APPEND WA_SORT TO IT_SORT .  CLEAR WA_SORT.   WA_SORT-SPOS = ’05’ .  WA_SORT-FIELDNAME = ‘WEMNG’.  APPEND WA_SORT TO IT_SORT .  CLEAR WA_SORT.   WA_SORT-SPOS = ’06’ .  WA_SORT-FIELDNAME = ‘PEMNG’.  APPEND WA_SORT TO IT_SORT .  CLEAR WA_SORT.

  1. ENDFORM.                    ” SORT

*&———————————————————————**&      Form EVENT_GET*&———————————————————————**       text*———————————————————————-**  –> p1        text*  <– p2        text*———————————————————————-*FORM EVENT_GET .  CONSTANTS : C_FORMNAME_SUBTOTAL_TEXT TYPE SLIS_FORMNAME VALUE ‘SUBTOTAL_TEXT’.  DATA : L_S_EVENT TYPE SLIS_ALV_EVENT.   CALL FUNCTION ‘REUSE_ALV_EVENTS_GET’    EXPORTING      I_LIST_TYPE     = 4    IMPORTING      ET_EVENTS       = IT_EVENT    EXCEPTIONS      LIST_TYPE_WRONG = 0      OTHERS          = 0.   READ TABLE IT_EVENT INTO L_S_EVENT WITH KEY NAME = SLIS_EV_SUBTOTAL_TEXT.  IF SY-SUBRC EQ 0.    MOVE C_FORMNAME_SUBTOTAL_TEXT TO L_S_EVENT-FORM.    MODIFY IT_EVENT FROM L_S_EVENT INDEX SY-TABIX.  ENDIF.

  1. ENDFORM.                    ” EVENT_GET

*&———————————————————————**&      Form SUBTOTAL_TEXT*&———————————————————————**       Build SUBTOTAL_TEXT*———————————————————————-**       P_total Total*       p_subtot_text Subtotal text info*———————————————————————-*FORM SUBTOTAL_TEXT CHANGING*               P_TOTAL TYPE ANY               P_SUBTOT_TEXT TYPE SLIS_SUBTOT_TEXT.   IF P_SUBTOT_TEXT-CRITERIA = ‘AUFNR’.    P_SUBTOT_TEXT-DISPLAY_TEXT_FOR_SUBTOTAL = ‘Production Order Level total'(010).  ENDIF.

  1. ENDFORM.                    “SUBTOTAL_TEXT

*&———————————————————————**&      Form LAYOUT*&———————————————————————**       text*———————————————————————-**  –> p1        text*  <– p2        text*———————————————————————-*FORM LAYOUT .  CLEAR IT_LAYOUT.*  IT_LAYOUT-ZEBRA = ‘X’.  IT_LAYOUT-NO_INPUT = ‘X’.  IT_LAYOUT-COLWIDTH_OPTIMIZE = ‘X’.  IT_LAYOUT-TOTALS_TEXT = ‘TOTALS'(201).  IT_LAYOUT-COLTAB_FIELDNAME = ‘CELLCOLOR’.

  1. ENDFORM.                    ” LAYOUT

*&———————————————————————**&      Form SET_CELL_COLOURS*&———————————————————————**       text*———————————————————————-**  –> p1        text*  <– p2        text*———————————————————————-*FORM SET_CELL_COLOURS .  DATA: WA_CELLCOLOR TYPE LVC_S_SCOL.  DATA: LD_INDEX TYPE SY-TABIX.  LOOP AT IT_FINAL INTO WA_FINAL.” WHERE CMATNR EQ WA_FINAL-MATNR.    LD_INDEX = SY-TABIX.     IF WA_FINAL-CMATNR EQ WA_FINAL-MATNR.      WA_CELLCOLOR-FNAME = ‘AVALUE’.      WA_CELLCOLOR-COLOR-COL = 6.  “color code 1-7, if outside rage defaults to 7      WA_CELLCOLOR-COLOR-INT = ‘0’.  “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.      WA_CELLCOLOR-FNAME = ‘WOGBTR’.      WA_CELLCOLOR-COLOR-COL = 6.  “color code 1-7, if outside rage defaults to 7      WA_CELLCOLOR-COLOR-INT = ‘0’.  “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.*  LOOP AT IT_FINAL INTO WA_FINAL WHERE BOM EQ ‘N’.*       LD_INDEX = SY-TABIX.    IF WA_FINAL-BOM EQ ‘N’.      WA_CELLCOLOR-FNAME = ‘CMATNR’.      WA_CELLCOLOR-COLOR-COL = 6.  “color code 1-7, if outside rage defaults to 7      WA_CELLCOLOR-COLOR-INT = ‘0’.  “1 = Intensified on, 0 = Intensified off      WA_CELLCOLOR-COLOR-INV = ‘0’.  “1 = text colour, 0 = background colour      APPEND WA_CELLCOLOR TO WA_FINAL-CELLCOLOR.       WA_CELLCOLOR-FNAME = ‘CMAKTX’.      WA_CELLCOLOR-COLOR-COL = 6.  “color code 1-7, if outside rage defaults to 7      WA_CELLCOLOR-COLOR-INT = ‘0’.  “1 = Intensified on, 0 = Intensified off      WA_CELLCOLOR-COLOR-INV = ‘0’.  “1 = text colour, 0 = background colour      APPEND WA_CELLCOLOR TO WA_FINAL-CELLCOLOR.       WA_CELLCOLOR-FNAME = ‘REMNG’.      WA_CELLCOLOR-COLOR-COL = 6.  “color code 1-7, if outside rage defaults to 7      WA_CELLCOLOR-COLOR-INT = ‘0’.  “1 = Intensified on, 0 = Intensified off      WA_CELLCOLOR-COLOR-INV = ‘0’.  “1 = text colour, 0 = background colour      APPEND WA_CELLCOLOR TO WA_FINAL-CELLCOLOR.       WA_CELLCOLOR-FNAME = ‘MBGBTR’.      WA_CELLCOLOR-COLOR-COL = 6.  “color code 1-7, if outside rage defaults to 7      WA_CELLCOLOR-COLOR-INT = ‘0’.  “1 = Intensified on, 0 = Intensified off      WA_CELLCOLOR-COLOR-INV = ‘0’.  “1 = text colour, 0 = background colour      APPEND WA_CELLCOLOR TO WA_FINAL-CELLCOLOR. WA_CELLCOLOR-FNAME = ‘STMNG’.      WA_CELLCOLOR-COLOR-COL = 6.  “color code 1-7, if outside rage defaults to 7      WA_CELLCOLOR-COLOR-INT = ‘0’.  “1 = Intensified on, 0 = Intensified off      WA_CELLCOLOR-COLOR-INV = ‘0’.  “1 = text colour, 0 = background colour      APPEND WA_CELLCOLOR TO WA_FINAL-CELLCOLOR.       WA_CELLCOLOR-FNAME = ‘RMEINS’.      WA_CELLCOLOR-COLOR-COL = 6.  “color code 1-7, if outside rage defaults to 7      WA_CELLCOLOR-COLOR-INT = ‘0’.  “1 = Intensified on, 0 = Intensified off      WA_CELLCOLOR-COLOR-INV = ‘0’.  “1 = text colour, 0 = background colour      APPEND WA_CELLCOLOR TO WA_FINAL-CELLCOLOR.       WA_CELLCOLOR-FNAME = ‘WOGBTR’.      WA_CELLCOLOR-COLOR-COL = 6.  “color code 1-7, if outside rage defaults to 7      WA_CELLCOLOR-COLOR-INT = ‘0’.  “1 = Intensified on, 0 = Intensified off      WA_CELLCOLOR-COLOR-INV = ‘0’.  “1 = text colour, 0 = background colour      APPEND WA_CELLCOLOR TO WA_FINAL-CELLCOLOR.       WA_CELLCOLOR-FNAME = ‘AVALUE’.      WA_CELLCOLOR-COLOR-COL = 6.  “color code 1-7, if outside rage defaults to 7      WA_CELLCOLOR-COLOR-INT = ‘0’.  “1 = Intensified on, 0 = Intensified off      WA_CELLCOLOR-COLOR-INV = ‘0’.  “1 = text colour, 0 = background colour      APPEND WA_CELLCOLOR TO WA_FINAL-CELLCOLOR.       WA_CELLCOLOR-FNAME = ‘BUDAT’.      WA_CELLCOLOR-COLOR-COL = 6.  “color code 1-7, if outside rage defaults to 7      WA_CELLCOLOR-COLOR-INT = ‘0’.  “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.

  1. ENDFORM.                    ” SET_CELL_COLOURS
To report this post you need to login first.

15 Comments

You must be Logged on to comment or reply to a post.

  1. Sovanna Hang

    Dear Mr. Bharat Rathod,

    Please help me telling me the fields or Table Structure of ZWIP that need to be created??? while we doing the enhancement on report SAPKKA07 in FORM create_grundliste and create ZWIP report.

    *DATA : BEGIN OF IT_WIP OCCURS 0.
    *  INCLUDE STRUCTURE ZWIP.*
    *  AUFNR TYPE ZWIP-AUFNR,*
    *  OBJNR TYPE ZWIP-OBJNR,*
    *  ZYEAR TYPE ZWIP-ZYEAR,*
    *  PERIO TYPE ZWIP-PERIO,*
    *  UNAME TYPE ZWIP-UNAME,*
    *  MATNR TYPE ZWIP-MATNR,*
    *  WRT TYPE ZWIP-WRT,*
    *  WRTK TYPE ZWIP-WRTK,*
    *  BEWER TYPE ZWIP-BEWER,
    *DATA : END OF IT_WIP.

    DATA : IT_WIP TYPE STANDARD TABLE OF ZWIP WITH HEADER LINE.

    Best Regards,

    Sovanna Hang

    (0) 
      1. Bharat Rathod Post author
        SRNO INT4 10 0 Serial No
        ZYEAR GJAHR NUMC 4 0 Fiscal Year
        PERIO PERIO DEC 3 0 Number of periods per seasonal cycle
        UNAME UNAME CHAR 12 0 User Name
        .INCLUDE KKAPARA_TA STRU 0 0 Table w/order pack. for RFC func.mod. for parallel WIP calc.
        MANDT MANDT CLNT 3 0 Client
        AUFNR AUFNR CHAR 12 0 Order Number
        POSNR CO_POSNR NUMC 4 0 Order Item Number
        OBJNR J_OBJNR CHAR 22 0 Object number
        OBJNP J_OBJNR CHAR 22 0 Object number
        OBJID CO_OBJID CHAR 40 0 Cost Object (Cost Accounting Object)
        AUTYP AUFTYP NUMC 2 0 Order category
        SAFNR SA_AUFNR CHAR 12 0 Run schedule header number
        MATNR CO_MATNR CHAR 18 0 Material Number for Order
        MAKTX MAKTX CHAR 40 0 Material Description (Short Text)
        PWERK CO_PWERK CHAR 4 0 Planning plant for the order
        VERID VERID CHAR 4 0 Production Version
        PROCNR CKML_F_PROCNR NUMC 12 0 Production Process
        VERSN VERSN_ABGR CHAR 3 0 Results Analysis Version
        WRT KKA_WIP_CHANGE CURR 15 2 Change in Work in Process Against Previous Period
        WRTK KKA_WIP CURR 15 2 Total Value of Work in Process
        WRT_UPD KKA_WRTUPD CURR 15 2 Value of work in process still to be updated
        WAEHR WAERS CUKY 5 0 Currency Key
        AMPEL KKA_AMPEL CHAR 1 0 Internal Representation of a Traffic Light (Exception)
        MAXNT KKA_MSGMAX CHAR 1 0 Maximum Message Type in Processing an Order
        WERKS WERKS_D CHAR 4 0 Plant
        NO_AUTH_PLANT XFELD CHAR 1 0 Checkbox
        AUART AUFART CHAR 4 0 Order Type
        KTEXT KTRKTEXT CHAR 40 0 Short Text of Cost Object
        WEMNG CO_WEMNG QUAN 13 3 Quantity of goods received for the order item
        PSMNG CO_PSMNG QUAN 13 3 Order item quantity
        AMEIN CO_AUFME UNIT 3 0 Unit of measure for in-house production
        ABART ABGR_ART CHAR 1 0 Results Analysis Type
        BEWER KKA_WIPBEW CHAR 20 0 WIP Valuation
        BWVAR K_WIPBVA CHAR 3 0 Valuation Variant for WIP
        PAR_AUFLO XFELD CHAR 1 0 Checkbox
        VALUTYP VALUTYP NUMC 1 0 Valuation View
        NO_AUTH_VALUTYP XFELD CHAR 1 0 Checkbox
        VALUTEXT KKACHR25 CHAR 25 0 25-Character Field
        FLG_MLTPS CO_MLTPS CHAR 1 0 Order with multiple items
        BUKRS BUKRS CHAR 4 0 Company Code
        ABGSL ABGR_SCHL CHAR 6 0 Results Analysis Key
        STATTEXT J_TXT04 CHAR 4 0 Individual status of an object (short form)
        WIPTYP KKACHR25 CHAR 25 0 25-Character Field
        ZSCHL AUFZSCHL CHAR 6 0 Overhead key
        LOEKZ AUFLOEKZ CHAR 1 0 Deletion flag
        PKOSA PKOSA_D CHAR 12 0 Cost collector for production process PROCNR
        PRCTR PRCTR CHAR 10 0 Profit Center
        PROCNR_TXT CKML_N_FPROC CHAR 50 0 Production Process: Generated/Changeable Name

        this is the structure for ZWIP

        (0) 
      2. Bharat Rathod Post author
        SRNO INT4 10 0 Serial No
        ZYEAR GJAHR NUMC 4 0 Fiscal Year
        PERIO PERIO DEC 3 0 Number of periods per seasonal cycle
        UNAME UNAME CHAR 12 0 User Name
        .INCLUDE KKAPARA_TA STRU 0 0 Table w/order pack. for RFC func.mod. for parallel WIP calc.
        MANDT MANDT CLNT 3 0 Client
        AUFNR AUFNR CHAR 12 0 Order Number
        POSNR CO_POSNR NUMC 4 0 Order Item Number
        OBJNR J_OBJNR CHAR 22 0 Object number
        OBJNP J_OBJNR CHAR 22 0 Object number
        OBJID CO_OBJID CHAR 40 0 Cost Object (Cost Accounting Object)
        AUTYP AUFTYP NUMC 2 0 Order category
        SAFNR SA_AUFNR CHAR 12 0 Run schedule header number
        MATNR CO_MATNR CHAR 18 0 Material Number for Order
        MAKTX MAKTX CHAR 40 0 Material Description (Short Text)
        PWERK CO_PWERK CHAR 4 0 Planning plant for the order
        VERID VERID CHAR 4 0 Production Version
        PROCNR CKML_F_PROCNR NUMC 12 0 Production Process
        VERSN VERSN_ABGR CHAR 3 0 Results Analysis Version
        WRT KKA_WIP_CHANGE CURR 15 2 Change in Work in Process Against Previous Period
        WRTK KKA_WIP CURR 15 2 Total Value of Work in Process
        WRT_UPD KKA_WRTUPD CURR 15 2 Value of work in process still to be updated
        WAEHR WAERS CUKY 5 0 Currency Key
        AMPEL KKA_AMPEL CHAR 1 0 Internal Representation of a Traffic Light (Exception)
        MAXNT KKA_MSGMAX CHAR 1 0 Maximum Message Type in Processing an Order
        WERKS WERKS_D CHAR 4 0 Plant
        NO_AUTH_PLANT XFELD CHAR 1 0 Checkbox
        AUART AUFART CHAR 4 0 Order Type
        KTEXT KTRKTEXT CHAR 40 0 Short Text of Cost Object
        WEMNG CO_WEMNG QUAN 13 3 Quantity of goods received for the order item
        PSMNG CO_PSMNG QUAN 13 3 Order item quantity
        AMEIN CO_AUFME UNIT 3 0 Unit of measure for in-house production
        ABART ABGR_ART CHAR 1 0 Results Analysis Type
        BEWER KKA_WIPBEW CHAR 20 0 WIP Valuation
        BWVAR K_WIPBVA CHAR 3 0 Valuation Variant for WIP
        PAR_AUFLO XFELD CHAR 1 0 Checkbox
        VALUTYP VALUTYP NUMC 1 0 Valuation View
        NO_AUTH_VALUTYP XFELD CHAR 1 0 Checkbox
        VALUTEXT KKACHR25 CHAR 25 0 25-Character Field
        FLG_MLTPS CO_MLTPS CHAR 1 0 Order with multiple items
        BUKRS BUKRS CHAR 4 0 Company Code
        ABGSL ABGR_SCHL CHAR 6 0 Results Analysis Key
        STATTEXT J_TXT04 CHAR 4 0 Individual status of an object (short form)
        WIPTYP KKACHR25 CHAR 25 0 25-Character Field
        ZSCHL AUFZSCHL CHAR 6 0 Overhead key
        LOEKZ AUFLOEKZ CHAR 1 0 Deletion flag
        PKOSA PKOSA_D CHAR 12 0 Cost collector for production process PROCNR
        PRCTR PRCTR CHAR 10 0 Profit Center
        PROCNR_TXT CKML_N_FPROC CHAR 50 0 Production Process: Generated/Changeable Name

        this is the structure for ZWIP

        (0) 
      3. Bharat Rathod Post author
        SRNO INT4 10 0 Serial No
        ZYEAR GJAHR NUMC 4 0 Fiscal Year
        PERIO PERIO DEC 3 0 Number of periods per seasonal cycle
        UNAME UNAME CHAR 12 0 User Name
        .INCLUDE KKAPARA_TA STRU 0 0 Table w/order pack. for RFC func.mod. for parallel WIP calc.
        MANDT MANDT CLNT 3 0 Client
        AUFNR AUFNR CHAR 12 0 Order Number
        POSNR CO_POSNR NUMC 4 0 Order Item Number
        OBJNR J_OBJNR CHAR 22 0 Object number
        OBJNP J_OBJNR CHAR 22 0 Object number
        OBJID CO_OBJID CHAR 40 0 Cost Object (Cost Accounting Object)
        AUTYP AUFTYP NUMC 2 0 Order category
        SAFNR SA_AUFNR CHAR 12 0 Run schedule header number
        MATNR CO_MATNR CHAR 18 0 Material Number for Order
        MAKTX MAKTX CHAR 40 0 Material Description (Short Text)
        PWERK CO_PWERK CHAR 4 0 Planning plant for the order
        VERID VERID CHAR 4 0 Production Version
        PROCNR CKML_F_PROCNR NUMC 12 0 Production Process
        VERSN VERSN_ABGR CHAR 3 0 Results Analysis Version
        WRT KKA_WIP_CHANGE CURR 15 2 Change in Work in Process Against Previous Period
        WRTK KKA_WIP CURR 15 2 Total Value of Work in Process
        WRT_UPD KKA_WRTUPD CURR 15 2 Value of work in process still to be updated
        WAEHR WAERS CUKY 5 0 Currency Key
        AMPEL KKA_AMPEL CHAR 1 0 Internal Representation of a Traffic Light (Exception)
        MAXNT KKA_MSGMAX CHAR 1 0 Maximum Message Type in Processing an Order
        WERKS WERKS_D CHAR 4 0 Plant
        NO_AUTH_PLANT XFELD CHAR 1 0 Checkbox
        AUART AUFART CHAR 4 0 Order Type
        KTEXT KTRKTEXT CHAR 40 0 Short Text of Cost Object
        WEMNG CO_WEMNG QUAN 13 3 Quantity of goods received for the order item
        PSMNG CO_PSMNG QUAN 13 3 Order item quantity
        AMEIN CO_AUFME UNIT 3 0 Unit of measure for in-house production
        ABART ABGR_ART CHAR 1 0 Results Analysis Type
        BEWER KKA_WIPBEW CHAR 20 0 WIP Valuation
        BWVAR K_WIPBVA CHAR 3 0 Valuation Variant for WIP
        PAR_AUFLO XFELD CHAR 1 0 Checkbox
        VALUTYP VALUTYP NUMC 1 0 Valuation View
        NO_AUTH_VALUTYP XFELD CHAR 1 0 Checkbox
        VALUTEXT KKACHR25 CHAR 25 0 25-Character Field
        FLG_MLTPS CO_MLTPS CHAR 1 0 Order with multiple items
        BUKRS BUKRS CHAR 4 0 Company Code
        ABGSL ABGR_SCHL CHAR 6 0 Results Analysis Key
        STATTEXT J_TXT04 CHAR 4 0 Individual status of an object (short form)
        WIPTYP KKACHR25 CHAR 25 0 25-Character Field
        ZSCHL AUFZSCHL CHAR 6 0 Overhead key
        LOEKZ AUFLOEKZ CHAR 1 0 Deletion flag
        PKOSA PKOSA_D CHAR 12 0 Cost collector for production process PROCNR
        PRCTR PRCTR CHAR 10 0 Profit Center
        PROCNR_TXT CKML_N_FPROC CHAR 50 0 Production Process: Generated/Changeable Name

        this is the structure for ZWIP

        (0) 
      4. Bharat Rathod Post author
        SRNO INT4 10 0 Serial No
        ZYEAR GJAHR NUMC 4 0 Fiscal Year
        PERIO PERIO DEC 3 0 Number of periods per seasonal cycle
        UNAME UNAME CHAR 12 0 User Name
        .INCLUDE KKAPARA_TA STRU 0 0 Table w/order pack. for RFC func.mod. for parallel WIP calc.
        MANDT MANDT CLNT 3 0 Client
        AUFNR AUFNR CHAR 12 0 Order Number
        POSNR CO_POSNR NUMC 4 0 Order Item Number
        OBJNR J_OBJNR CHAR 22 0 Object number
        OBJNP J_OBJNR CHAR 22 0 Object number
        OBJID CO_OBJID CHAR 40 0 Cost Object (Cost Accounting Object)
        AUTYP AUFTYP NUMC 2 0 Order category
        SAFNR SA_AUFNR CHAR 12 0 Run schedule header number
        MATNR CO_MATNR CHAR 18 0 Material Number for Order
        MAKTX MAKTX CHAR 40 0 Material Description (Short Text)
        PWERK CO_PWERK CHAR 4 0 Planning plant for the order
        VERID VERID CHAR 4 0 Production Version
        PROCNR CKML_F_PROCNR NUMC 12 0 Production Process
        VERSN VERSN_ABGR CHAR 3 0 Results Analysis Version
        WRT KKA_WIP_CHANGE CURR 15 2 Change in Work in Process Against Previous Period
        WRTK KKA_WIP CURR 15 2 Total Value of Work in Process
        WRT_UPD KKA_WRTUPD CURR 15 2 Value of work in process still to be updated
        WAEHR WAERS CUKY 5 0 Currency Key
        AMPEL KKA_AMPEL CHAR 1 0 Internal Representation of a Traffic Light (Exception)
        MAXNT KKA_MSGMAX CHAR 1 0 Maximum Message Type in Processing an Order
        WERKS WERKS_D CHAR 4 0 Plant
        NO_AUTH_PLANT XFELD CHAR 1 0 Checkbox
        AUART AUFART CHAR 4 0 Order Type
        KTEXT KTRKTEXT CHAR 40 0 Short Text of Cost Object
        WEMNG CO_WEMNG QUAN 13 3 Quantity of goods received for the order item
        PSMNG CO_PSMNG QUAN 13 3 Order item quantity
        AMEIN CO_AUFME UNIT 3 0 Unit of measure for in-house production
        ABART ABGR_ART CHAR 1 0 Results Analysis Type
        BEWER KKA_WIPBEW CHAR 20 0 WIP Valuation
        BWVAR K_WIPBVA CHAR 3 0 Valuation Variant for WIP
        PAR_AUFLO XFELD CHAR 1 0 Checkbox
        VALUTYP VALUTYP NUMC 1 0 Valuation View
        NO_AUTH_VALUTYP XFELD CHAR 1 0 Checkbox
        VALUTEXT KKACHR25 CHAR 25 0 25-Character Field
        FLG_MLTPS CO_MLTPS CHAR 1 0 Order with multiple items
        BUKRS BUKRS CHAR 4 0 Company Code
        ABGSL ABGR_SCHL CHAR 6 0 Results Analysis Key
        STATTEXT J_TXT04 CHAR 4 0 Individual status of an object (short form)
        WIPTYP KKACHR25 CHAR 25 0 25-Character Field
        ZSCHL AUFZSCHL CHAR 6 0 Overhead key
        LOEKZ AUFLOEKZ CHAR 1 0 Deletion flag
        PKOSA PKOSA_D CHAR 12 0 Cost collector for production process PROCNR
        PRCTR PRCTR CHAR 10 0 Profit Center
        PROCNR_TXT CKML_N_FPROC CHAR 50 0 Production Process: Generated/Changeable Name

        this is the structure for ZWIP

        (0) 
      5. Bharat Rathod Post author
        SRNO INT4 10 0 Serial No
        ZYEAR GJAHR NUMC 4 0 Fiscal Year
        PERIO PERIO DEC 3 0 Number of periods per seasonal cycle
        UNAME UNAME CHAR 12 0 User Name
        .INCLUDE KKAPARA_TA STRU 0 0 Table w/order pack. for RFC func.mod. for parallel WIP calc.
        MANDT MANDT CLNT 3 0 Client
        AUFNR AUFNR CHAR 12 0 Order Number
        POSNR CO_POSNR NUMC 4 0 Order Item Number
        OBJNR J_OBJNR CHAR 22 0 Object number
        OBJNP J_OBJNR CHAR 22 0 Object number
        OBJID CO_OBJID CHAR 40 0 Cost Object (Cost Accounting Object)
        AUTYP AUFTYP NUMC 2 0 Order category
        SAFNR SA_AUFNR CHAR 12 0 Run schedule header number
        MATNR CO_MATNR CHAR 18 0 Material Number for Order
        MAKTX MAKTX CHAR 40 0 Material Description (Short Text)
        PWERK CO_PWERK CHAR 4 0 Planning plant for the order
        VERID VERID CHAR 4 0 Production Version
        PROCNR CKML_F_PROCNR NUMC 12 0 Production Process
        VERSN VERSN_ABGR CHAR 3 0 Results Analysis Version
        WRT KKA_WIP_CHANGE CURR 15 2 Change in Work in Process Against Previous Period
        WRTK KKA_WIP CURR 15 2 Total Value of Work in Process
        WRT_UPD KKA_WRTUPD CURR 15 2 Value of work in process still to be updated
        WAEHR WAERS CUKY 5 0 Currency Key
        AMPEL KKA_AMPEL CHAR 1 0 Internal Representation of a Traffic Light (Exception)
        MAXNT KKA_MSGMAX CHAR 1 0 Maximum Message Type in Processing an Order
        WERKS WERKS_D CHAR 4 0 Plant
        NO_AUTH_PLANT XFELD CHAR 1 0 Checkbox
        AUART AUFART CHAR 4 0 Order Type
        KTEXT KTRKTEXT CHAR 40 0 Short Text of Cost Object
        WEMNG CO_WEMNG QUAN 13 3 Quantity of goods received for the order item
        PSMNG CO_PSMNG QUAN 13 3 Order item quantity
        AMEIN CO_AUFME UNIT 3 0 Unit of measure for in-house production
        ABART ABGR_ART CHAR 1 0 Results Analysis Type
        BEWER KKA_WIPBEW CHAR 20 0 WIP Valuation
        BWVAR K_WIPBVA CHAR 3 0 Valuation Variant for WIP
        PAR_AUFLO XFELD CHAR 1 0 Checkbox
        VALUTYP VALUTYP NUMC 1 0 Valuation View
        NO_AUTH_VALUTYP XFELD CHAR 1 0 Checkbox
        VALUTEXT KKACHR25 CHAR 25 0 25-Character Field
        FLG_MLTPS CO_MLTPS CHAR 1 0 Order with multiple items
        BUKRS BUKRS CHAR 4 0 Company Code
        ABGSL ABGR_SCHL CHAR 6 0 Results Analysis Key
        STATTEXT J_TXT04 CHAR 4 0 Individual status of an object (short form)
        WIPTYP KKACHR25 CHAR 25 0 25-Character Field
        ZSCHL AUFZSCHL CHAR 6 0 Overhead key
        LOEKZ AUFLOEKZ CHAR 1 0 Deletion flag
        PKOSA PKOSA_D CHAR 12 0 Cost collector for production process PROCNR
        PRCTR PRCTR CHAR 10 0 Profit Center
        PROCNR_TXT CKML_N_FPROC CHAR 50 0 Production Process: Generated/Changeable Name

        this is the structure for ZWIP

        (0) 
      6. Bharat Rathod Post author
        SRNO INT4 10 0 Serial No
        ZYEAR GJAHR NUMC 4 0 Fiscal Year
        PERIO PERIO DEC 3 0 Number of periods per seasonal cycle
        UNAME UNAME CHAR 12 0 User Name
        .INCLUDE KKAPARA_TA STRU 0 0 Table w/order pack. for RFC func.mod. for parallel WIP calc.
        MANDT MANDT CLNT 3 0 Client
        AUFNR AUFNR CHAR 12 0 Order Number
        POSNR CO_POSNR NUMC 4 0 Order Item Number
        OBJNR J_OBJNR CHAR 22 0 Object number
        OBJNP J_OBJNR CHAR 22 0 Object number
        OBJID CO_OBJID CHAR 40 0 Cost Object (Cost Accounting Object)
        AUTYP AUFTYP NUMC 2 0 Order category
        SAFNR SA_AUFNR CHAR 12 0 Run schedule header number
        MATNR CO_MATNR CHAR 18 0 Material Number for Order
        MAKTX MAKTX CHAR 40 0 Material Description (Short Text)
        PWERK CO_PWERK CHAR 4 0 Planning plant for the order
        VERID VERID CHAR 4 0 Production Version
        PROCNR CKML_F_PROCNR NUMC 12 0 Production Process
        VERSN VERSN_ABGR CHAR 3 0 Results Analysis Version
        WRT KKA_WIP_CHANGE CURR 15 2 Change in Work in Process Against Previous Period
        WRTK KKA_WIP CURR 15 2 Total Value of Work in Process
        WRT_UPD KKA_WRTUPD CURR 15 2 Value of work in process still to be updated
        WAEHR WAERS CUKY 5 0 Currency Key
        AMPEL KKA_AMPEL CHAR 1 0 Internal Representation of a Traffic Light (Exception)
        MAXNT KKA_MSGMAX CHAR 1 0 Maximum Message Type in Processing an Order
        WERKS WERKS_D CHAR 4 0 Plant
        NO_AUTH_PLANT XFELD CHAR 1 0 Checkbox
        AUART AUFART CHAR 4 0 Order Type
        KTEXT KTRKTEXT CHAR 40 0 Short Text of Cost Object
        WEMNG CO_WEMNG QUAN 13 3 Quantity of goods received for the order item
        PSMNG CO_PSMNG QUAN 13 3 Order item quantity
        AMEIN CO_AUFME UNIT 3 0 Unit of measure for in-house production
        ABART ABGR_ART CHAR 1 0 Results Analysis Type
        BEWER KKA_WIPBEW CHAR 20 0 WIP Valuation
        BWVAR K_WIPBVA CHAR 3 0 Valuation Variant for WIP
        PAR_AUFLO XFELD CHAR 1 0 Checkbox
        VALUTYP VALUTYP NUMC 1 0 Valuation View
        NO_AUTH_VALUTYP XFELD CHAR 1 0 Checkbox
        VALUTEXT KKACHR25 CHAR 25 0 25-Character Field
        FLG_MLTPS CO_MLTPS CHAR 1 0 Order with multiple items
        BUKRS BUKRS CHAR 4 0 Company Code
        ABGSL ABGR_SCHL CHAR 6 0 Results Analysis Key
        STATTEXT J_TXT04 CHAR 4 0 Individual status of an object (short form)
        WIPTYP KKACHR25 CHAR 25 0 25-Character Field
        ZSCHL AUFZSCHL CHAR 6 0 Overhead key
        LOEKZ AUFLOEKZ CHAR 1 0 Deletion flag
        PKOSA PKOSA_D CHAR 12 0 Cost collector for production process PROCNR
        PRCTR PRCTR CHAR 10 0 Profit Center
        PROCNR_TXT CKML_N_FPROC CHAR 50 0 Production Process: Generated/Changeable Name

        this is the structure for ZWIP

        (0) 
      7. Bharat Rathod Post author
        SRNO INT4 10 0 Serial No
        ZYEAR GJAHR NUMC 4 0 Fiscal Year
        PERIO PERIO DEC 3 0 Number of periods per seasonal cycle
        UNAME UNAME CHAR 12 0 User Name
        .INCLUDE KKAPARA_TA STRU 0 0 Table w/order pack. for RFC func.mod. for parallel WIP calc.
        MANDT MANDT CLNT 3 0 Client
        AUFNR AUFNR CHAR 12 0 Order Number
        POSNR CO_POSNR NUMC 4 0 Order Item Number
        OBJNR J_OBJNR CHAR 22 0 Object number
        OBJNP J_OBJNR CHAR 22 0 Object number
        OBJID CO_OBJID CHAR 40 0 Cost Object (Cost Accounting Object)
        AUTYP AUFTYP NUMC 2 0 Order category
        SAFNR SA_AUFNR CHAR 12 0 Run schedule header number
        MATNR CO_MATNR CHAR 18 0 Material Number for Order
        MAKTX MAKTX CHAR 40 0 Material Description (Short Text)
        PWERK CO_PWERK CHAR 4 0 Planning plant for the order
        VERID VERID CHAR 4 0 Production Version
        PROCNR CKML_F_PROCNR NUMC 12 0 Production Process
        VERSN VERSN_ABGR CHAR 3 0 Results Analysis Version
        WRT KKA_WIP_CHANGE CURR 15 2 Change in Work in Process Against Previous Period
        WRTK KKA_WIP CURR 15 2 Total Value of Work in Process
        WRT_UPD KKA_WRTUPD CURR 15 2 Value of work in process still to be updated
        WAEHR WAERS CUKY 5 0 Currency Key
        AMPEL KKA_AMPEL CHAR 1 0 Internal Representation of a Traffic Light (Exception)
        MAXNT KKA_MSGMAX CHAR 1 0 Maximum Message Type in Processing an Order
        WERKS WERKS_D CHAR 4 0 Plant
        NO_AUTH_PLANT XFELD CHAR 1 0 Checkbox
        AUART AUFART CHAR 4 0 Order Type
        KTEXT KTRKTEXT CHAR 40 0 Short Text of Cost Object
        WEMNG CO_WEMNG QUAN 13 3 Quantity of goods received for the order item
        PSMNG CO_PSMNG QUAN 13 3 Order item quantity
        AMEIN CO_AUFME UNIT 3 0 Unit of measure for in-house production
        ABART ABGR_ART CHAR 1 0 Results Analysis Type
        BEWER KKA_WIPBEW CHAR 20 0 WIP Valuation
        BWVAR K_WIPBVA CHAR 3 0 Valuation Variant for WIP
        PAR_AUFLO XFELD CHAR 1 0 Checkbox
        VALUTYP VALUTYP NUMC 1 0 Valuation View
        NO_AUTH_VALUTYP XFELD CHAR 1 0 Checkbox
        VALUTEXT KKACHR25 CHAR 25 0 25-Character Field
        FLG_MLTPS CO_MLTPS CHAR 1 0 Order with multiple items
        BUKRS BUKRS CHAR 4 0 Company Code
        ABGSL ABGR_SCHL CHAR 6 0 Results Analysis Key
        STATTEXT J_TXT04 CHAR 4 0 Individual status of an object (short form)
        WIPTYP KKACHR25 CHAR 25 0 25-Character Field
        ZSCHL AUFZSCHL CHAR 6 0 Overhead key
        LOEKZ AUFLOEKZ CHAR 1 0 Deletion flag
        PKOSA PKOSA_D CHAR 12 0 Cost collector for production process PROCNR
        PRCTR PRCTR CHAR 10 0 Profit Center
        PROCNR_TXT CKML_N_FPROC CHAR 50 0 Production Process: Generated/Changeable Name

        this is the structure for ZWIP

        (0) 
  2. Renzo Vecchi

    Dear Bharat Rathod we need to calculate the scrap value using the WIP value.

    Is it possible for you to send me an export of that abap report, and to explain which are the prerequisite of that report (like the creation of the custom Table ZWIP)???

    Best Regards

    (0) 
    1. Bharat Rathod Post author

      Dear Renzo,

      I already submit ZWIP report and ZWIP table Structure.

      Before use this report you have to create zwip table and enhance standard KKAO report as shown in my above post after that copy my report text and paste it to your report and change logic as per your scenareio.

      (0) 
      1. Renzo Vecchi

        Thank you Bharat,

        since I don’t know what an enhancement exactly is, I don’t  know where the report ZWIP ends and the enhancement starts.

        I only understand the ZWIP table structure.

        Best regards.

        (0) 
        1. Renzo Vecchi

          Dear Bharat, I know SE38 for the implementation of ZWIP report, but I haven’t implementend any enhancement.

          Is it possible for you send me an export of the program ZWIP, bacouse when I paste the text it is all scrambled.

          Regards

          (0) 

Leave a Reply