Skip to Content
avatar image
Former Member

bom report

i hav to generate a bom report on sales order base.in selection screen i provide sales order no and line item it shud display all the material level by level and cost.is there any prog for that.pls help.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Aug 20, 2007 at 04:31 AM

    Hi,

    Check this

    BOM             
            CS00    BOM Menu
            CS01    Create Material BOM
            CS02    Change Material BOM
            CS03    Display Material BOM
            CS05    Change Material BOM Group
            CS06    Display Material BOM Group
            CS07    Allocate Material BOM to Plant
            CS08    Change Material BOM - Plant Alloc.
            CS09    Display Allocations to Plant
            CS11    Display BOM Level by Level
            CS12    Multilevel BOM
            CS13    Summarized BOM
            CS14    BOM Comparison
            CS15    Single-Level Where-Used List
            CS20    Mass Change: Initial Screen
            CS21    Mass Material Change: Initial Screen
            CS22    Mass Document Change: Initial Screen
            CS23    Mass Class Change: Initial Screen
            CS25    Archiving for BOMs
            CS26    BOM deletion
            CS27    Retrieval of BOMs
            CS28    Archiving for BOMs
            CS31    Create class BOM
            CS32    Change class BOM
            CS33    Display class BOM
            CS40    Create Link to Configurable Material
            CS41    Change Material Config. Allocation
            CS42    Display Material Config. Assignment
            CS51    Create standard BOM
            CS52    Change standard BOM
            CS53    Display standard BOM
            CS61    Create Order BOM
            CS62    Change Order BOM
            CS63    Display Order BOM
            CS71    Create WBS BOM
            CS72    Change WBS BOM
            CS73    Display WBS BOM
            CS74    Create multi-level WBS BOM
            CS75    Change multi-level WBS BOM
            CS76    Display multi-level WBS BOM
            CS80    Change Documents for Material BOM
            CS81    Change Documents for Standard BOM
            CS82    Change documents for sales order BOM
            CS83    Change documents for WBS BOM
            CS84    Change documents for class BOM
            CS90    Material BOM Number Ranges
            CS91    Number Ranges for Standard BOMs
            CS92    Number Ranges for Sales Order BOMs
    

    aRs

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 04:53 AM

    Hi,

    First u get all sales order wise data from VBAK and VBAP table.Then gotp MAST

    table which contain all bom data.

    tables: VBAP

    STLNR Bill of material

    tables: Mast

    fields

    STLAN BOM Usage

    STLNR Bill of material

    STLAL Alternative BOM

    Still u r not able to make report send thread for it and i will send you whole report.

    rewards if it is useful.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      thank for u r reply Bhatia.

      But i m not using MAST table. i m using VBAK,VBAP,KDST,STPO,MBEW,MARA, TABLES.my code is like this

      TABLES : STKO,STPO,VBAK,VBAP,KNA1,MBEW,AFKO,MARA.

      DATA : IKDST LIKE KDST OCCURS 0 WITH HEADER LINE,

      ISTKO LIKE STKO OCCURS 0 WITH HEADER LINE,

      • ISTPO LIKE STPO OCCURS 0 WITH HEADER LINE,

      • IVBAK LIKE VBAK OCCURS 0 WITH HEADER LINE,

      IVBAP LIKE VBAP OCCURS 0 WITH HEADER LINE,

      IMBEW LIKE MBEW OCCURS 0 WITH HEADER LINE,

      IMARA LIKE MARA OCCURS 0 WITH HEADER LINE.

      DATA : t_stpox LIKE stpox OCCURS 0 WITH HEADER LINE.

      DATA : BEGIN OF ISTPO OCCURS 0.

      INCLUDE STRUCTURE STPO.

      DATA : MAKTX TYPE MAKT-MAKTX,

      matnr TYPE stpo-idnrk,

      LBKUM TYPE MBEW-LBKUM,

      END OF ISTPO.

      DATA : BEGIN OF IVBAK OCCURS 0.

      INCLUDE STRUCTURE VBAK.

      DATA : KUNR1 TYPE KNA1-KUNNR,

      NAME1 TYPE KNA1-NAME1,

      END OF IVBAK.

      DATA : V_VBELN LIKE VBAK-VBELN,

      V_POSNR LIKE VBAP-POSNR,

      DIFF TYPE STPO-MENGE,

      MATNR1(18) TYPE N,

      POSNR(6) TYPE N,

      matnr type vbap-matnr,

      MENG1 TYPE MBEW-LBKUM,

      meng2 type mbew-lbkum,

      meng3 type mbew-lbkum,

      UNIT TYPE MBEW-LBKUM,

      TOTP TYPE MBEW-LBKUM.

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

      SELECT-OPTIONS: S_VBELN FOR V_VBELN ,"NO INTERVALS NO-EXTENSION,

      S_POSNR FOR V_POSNR ."NO INTERVALS NO-EXTENSION.

      SELECTION-SCREEN SKIP.

      PARAMETERS : SUM AS CHECKBOX.

      SELECTION-SCREEN END OF BLOCK B.

      AT SELECTION-SCREEN.

      TOP-OF-PAGE.

      FORMAT COLOR 7.

      WRITE:/40 ' STOCK DETAILS WITH BOM MATERIAL',142 ''.

      IF SUM = 'X'.

      WRITE:73 '(Summary Display)'.

      ENDIF.

      IF S_VBELN-LOW IS INITIAL.

      WRITE:/5 'OC Number(s) : All'.

      ELSE.

      WRITE:/5 'OC Number(s) :',S_VBELN-LOW.

      ENDIF.

      WRITE: 110 'Date :',SY-DATUM,142 ''.

      IF S_POSNR-LOW IS INITIAL.

      WRITE:/5 'Line item(s) : All'.

      ELSE.

      WRITE:/5 'Line item(s) :',S_POSNR-LOW.

      ENDIF.

      WRITE: 110 'Time :',SY-UZEIT,142 ''.

      WRITE:/1(142) SY-ULINE.

      .

      *******************************************************************

      START-OF-SELECTION.

      SELECT * FROM VBAK INTO TABLE IVBAK WHERE VBELN IN S_VBELN.

      SELECT * FROM VBAP INTO TABLE IVBAP WHERE VBELN IN S_VBELN

      AND POSNR IN S_POSNR.

      SELECT * FROM KDST INTO TABLE IKDST FOR ALL ENTRIES IN IVBAP

      WHERE VBELN = IVBAP-VBELN

      AND VBPOS = IVBAP-POSNR.

      SELECT * FROM STPO INTO TABLE ISTPO FOR ALL ENTRIES IN IKDST

      WHERE STLNR = IKDST-STLNR

      AND STLTY = 'K'.

      LOOP AT IVBAK.

      SELECT KUNNR NAME1 FROM KNA1 INTO (ivbak-kunr1, ivbak-name1)

      WHERE KUNNR = IVBAK-KUNNR.

      MODIFY IVBAK.

      ENDSELECT.

      ENDLOOP.

      LOOP AT ISTPO.

      SELECT SINGLE LBKUM FROM MBEW INTO ISTPO-LBKUM

      WHERE MATNR = ISTPO-IDNRK.

      SELECT SINGLE MAKTX FROM MAKT INTO ISTPO-MAKTX

      WHERE MATNR = ISTPO-IDNRK.

      istpo-matnr = istpo-idnrk.

      MODIFY ISTPO.

      ENDLOOP.

      SELECT * FROM MBEW INTO TABLE IMBEW FOR ALL ENTRIES IN ISTPO

      WHERE MATNR = ISTPO-IDNRK

      AND BWKEY = 'PLPN'.

      SELECT * FROM MARA INTO TABLE IMARA FOR ALL ENTRIES IN IMBEW

      WHERE MATNR = IMBEW-MATNR.

      *******************************************************************

      END-OF-SELECTION.

      LOOP AT IVBAK.

      FORMAT COLOR 5 INTENSIFIED ON.

      WRITE : /2 IVBAK-KUNR1,

      25 IVBAK-NAME1,

      142 ' '.

      AT NEW VBELN.

      FORMAT COLOR 1 INTENSIFIED ON.

      WRITE: /2 IVBAK-VBELN.

      ENDAT.

      LOOP AT IVBAP.

      new-line.

      AT NEW POSNR.

      FORMAT COLOR 1 INTENSIFIED ON.

      WRITE: /18 IVBAP-POSNR.

      ENDAT.

      FORMAT COLOR 1 INTENSIFIED ON.

      WRITE:"1 sy-vline, 12 sy-vline, 19 sy-vline,

      30 IVBAP-MATNR,"29 sy-vline,

      50 IVBAP-ARKTX,"60 sy-vline,

      100 IVBAP-KWMENG,142 ''.

      NEW-LINE.

      WRITE:1(140) SY-ULINE.

      read table ikdst with key VBELN = IVBAP-VBELN

      VBPOS = IVBAP-POSNR

      matnr = ivbap-matnr.

      WRITE:1(142) SY-ULINE.

      clear unit.

      LOOP AT ISTPO WHERE STLNR = IKDST-STLNR

      AND STLTY = 'K'.

      LOOP AT IMBEW WHERE MATNR = ISTPO-IDNRK.

      LOOP AT IMARA WHERE MATNR = IMBEW-MATNR.

      DIFF = ISTPO-LBKUM - ISTPO-MENGE.

      IF IMARA-MTART = 'ROHE' or imara-mtart = 'ERSA'.

      IF IMBEW-VPRSV = 'V'.

      UNIT = IMBEW-VERPR.

      ELSE.

      UNIT = IMBEW-STPRS.

      ENDIF.

      ENDIF.

      FORMAT COLOR 2 INTENSIFIED OFF.

      WRITE:/1 SY-VLINE,

      5 ISTPO-IDNRK,23 SY-VLINE,

      24 istpo-posnr,31 sy-vline,

      32 ISTPO-MAKTX,73 SY-VLINE,

      74 ISTPO-MENGE,87 SY-VLINE.

      MENG1 = ISTPO-MENGE * IVBAP-KWMENG.

      WRITE:88 MENG1,105 SY-VLINE,

      106 UNIT,124 SY-VLINE,

      125 TOTP, 142 SY-VLINE.

      clear unit.

      *at first .

      *

      *meng2 = meng1.

      *

      *endat.

      loop at ikdst where vbeln = ivbap-vbeln

      and vbpos = ivbap-posnr

      and matnr ne ivbap-matnr

      and matnr = istpo-matnr.

      *Read table ikdst with key vbeln = ivbap-vbeln

      • vbpos = ivbap-posnr

      • matnr = iSTPO-IDNRK.

      READ TABLE ISTPO WITH KEY STLNR = IKDST-STLNR.

      new-line.

      FORMAT COLOR 1 INTENSIFIED ON.

      WRITE:"1 sy-vline, 12 sy-vline, 19 sy-vline,

      30 ikdst-MATNR,"29 sy-vline,

      101 meng1,

      142 ''.

      NEW-LINE.

      *

      *

      loop at istpo where stlnr = ikdst-stlnr.

      *

      READ TABLE IMBEW WITH KEY MATNR = ISTPO-IDNRK.

      READ TABLE IMARA WITH KEY MATNR = IMBEW-MATNR.

      DIFF = ISTPO-LBKUM - ISTPO-MENGE.

      IF IMARA-MTART = 'ROHE' OR IMARA-MTART = 'ERSA'.

      IF IMBEW-VPRSV = 'V'.

      UNIT = IMBEW-VERPR.

      ELSEIF IMBEW-VPRSV = 'S'.

      UNIT = IMBEW-STPRS.

      ENDIF.

      ENDIF.

      • CLEAR UNIT.

      meng2 = meng1.

      MENG3 = ISTPO-MENGE * meng2.

      FORMAT COLOR 2 INTENSIFIED OFF.

      WRITE:/1 SY-VLINE,

      5 ISTPO-IDNRK, 23 SY-VLINE,

      24 istpo-posnr, 31 sy-vline,

      32 ISTPO-MAKTX, 73 SY-VLINE,

      74 ISTPO-MENGE, 87 SY-VLINE,

      88 MENG3, 105 SY-VLINE,

      106 UNIT, 124 SY-VLINE,

      125 TOTP, 142 SY-VLINE.

      clear unit.

      ENDLOOP.

      ENDLOOP.

      endloop.

      endloop.

      endloop.

      endloop.

      endloop.

      *ENDLOOP.

      WRITE:/1(142) SY-ULINE.

      NEW-LINE.

      *ENDLOOP.

      *ENDIF.

      if u hav any prog pls send.