URGENT: REGARDING BOM EXPLORE REPORT

HI,
I making dis report and i want to display the BOM Explosion in which i have to display the output whihc conatins the details of it. I am sending my code in whihc it displays correct for 1 BOM but when comes to miultiple BOM it has following problem:-
1.) The materaial no does not change on the top of report .
2.) The DIVSION No. of the some of the materails are displayed and some of dem are not displaying.
plzz help me out with dis problem as help will be definately rewarded.
REPORT ZTET1.
TABLES: MBEW,           "Material Valuation
        MSLB,           "Special stocks with vendor
        MARA,           "Material Master
        MAKT,           "Material Descriptions
        MARD,           "Material Master: Storage Location/Batch Segment
        MAST,           "BOM Header
        STKO,           "BOM Detail
        STPO,           "Bom Components
        STAS.           "BOM Alternative
Text Elements
Plant
SELECT-OPTIONS: S_WERKS FOR MAST-WERKS DEFAULT 'CA',
Material
                S_MATNR FOR MAST-MATNR,
Material Type
                S_MTART FOR MARA-MTART.
Base Quantity
PARAMETERS: S_BASE TYPE I DEFAULT '1'.
Display up to Level
PARAMETERS: S_LVL  TYPE I DEFAULT '99'.
PARAMETERS: stlal  type mast-stlal default '01'.
SELECTION-SCREEN SKIP.
Include Vendor Stock
PARAMETERS: X_MSLB  AS CHECKBOX.
DATA: W_MATNR LIKE MAPL-MATNR.
DATA: PARENT_MATNR LIKE MAST-MATNR,
      CHILD_MATNR LIKE STPO-IDNRK,
      CHILD_WERKS LIKE MAST-WERKS,
      CHILD_STLAL LIKE MAST-STLAL,
      W_MAKTX LIKE MAKT-MAKTX,
      W_STD TYPE P DECIMALS 5,
      W_MAV TYPE P DECIMALS 5,
      W_MENGE TYPE P DECIMALS 3,
      W_LEVEL TYPE I,
      W_DOT(1),
      W_LVL(12),
      W_LVL1(12),
      W_LVL2(2),
      W_COL TYPE I,
      W_LFLAG,
      W_TTL LIKE MARD-LABST.
  DATA: SPART LIKE MARA-SPART.
DATA: BEGIN OF INT1 OCCURS 50,
        LGORT(6),
        LABST LIKE MARD-LABST,
      END OF INT1.
IF S_BASE EQ 0.
  S_BASE = 1.
ENDIF.
append multi level routing
SELECT * FROM MAST WHERE WERKS IN S_WERKS AND
     MATNR IN S_MATNR and stlal = stlal.
  SELECT SINGLE SPART FROM MARA INTO SPART WHERE MATNR = MAST-MATNR.
    write: 'aaaaa', sy-dbcnt.
SELECT SINGLE * FROM MARA WHERE MATNR = MAST-MATNR AND
      MTART IN S_MTART.
  IF SY-SUBRC NE 0.
    CONTINUE.
  ENDIF.
  IF MARA-LVORM <> 'X'.
    PARENT_MATNR = MAST-MATNR.
    CHILD_MATNR  = MAST-MATNR.
    CHILD_WERKS  = MAST-WERKS.
    CHILD_STLAL  = MAST-STLAL.
    SELECT SINGLE * FROM MAKT WHERE MATNR = MAST-MATNR AND
         SPRAS = 'E'.
    W_MAKTX = MAKT-MAKTX.
   REFRESH INT1.
   SELECT * FROM MARD WHERE MATNR = MAST-MATNR AND
        WERKS = MAST-WERKS AND
        LABST NE 0.
     MOVE MARD-LGORT TO INT1-LGORT.
     MOVE MARD-LABST TO INT1-LABST.
     APPEND INT1.
   ENDSELECT.
   IF X_MSLB EQ 'X'.
     SELECT * FROM MSLB WHERE MATNR EQ MAST-MATNR AND
          WERKS EQ MAST-WERKS AND
          LBLAB NE 0.
       MOVE MSLB-LIFNR TO INT1-LGORT.
       MOVE MSLB-LBLAB TO INT1-LABST.
       APPEND INT1.
     ENDSELECT.
   ENDIF.
    W_LEVEL = 1.
   NEW-PAGE.
    PERFORM GETCHILD.
  ENDIF.
ENDSELECT.
get child parts
FORM GETCHILD.
  SELECT * FROM STPO WHERE STLNR = MAST-STLNR
        ORDER BY POSNR.
    SELECT SINGLE * FROM STKO WHERE STLNR = STPO-STLNR
          AND STLAL = MAST-STLAL.
    SELECT SINGLE * FROM STAS WHERE STLNR = STPO-STLNR AND
          STLKN = STPO-STLKN AND
          STLAL = MAST-STLAL.
    IF SY-SUBRC EQ 0.
      CLEAR: W_DOT, W_LVL, W_LVL1.
      PERFORM WRT_DTL.
      CHILD_MATNR = STPO-IDNRK.
      W_LEVEL = W_LEVEL + 1.
      IF W_LEVEL <= S_LVL.
        PERFORM SUBCHILD.
      ENDIF.
      W_LEVEL = W_LEVEL - 1.
    ENDIF.
  ENDSELECT.
ENDFORM.
get grand children parts
FORM SUBCHILD.
  SELECT SINGLE * FROM MAST WHERE MATNR = CHILD_MATNR
     AND WERKS = CHILD_WERKS.
  IF SY-SUBRC NE 0.
    EXIT.
  ENDIF.
  SELECT * FROM STPO WHERE STLNR = MAST-STLNR.
    SELECT SINGLE * FROM STKO WHERE STLNR = STPO-STLNR AND
      STLAL = MAST-STLAL.
    SELECT SINGLE * FROM STAS WHERE STLNR = STPO-STLNR AND
        STLKN = STPO-STLKN AND
        STLAL = STKO-STLAL.
      IF SY-SUBRC EQ 0.
        W_DOT = '.'.
        PERFORM WRT_DTL.
        CHILD_MATNR = STPO-IDNRK.
        W_LEVEL = W_LEVEL + 1.
        IF W_LEVEL <= S_LVL.
          PERFORM SUBCHILD.
        ENDIF.
        W_LEVEL = W_LEVEL - 1.
        SHIFT W_LVL.
      ENDIF.
    ENDSELECT.
ENDFORM.
TOP-OF-PAGE.
WRITE:/ SY-DATUM,SY-UZEIT,
       85 'ABC PTE LTD',
      182 'Page', SY-PAGNO.
WRITE: / SY-REPID,
         75 'BOM STRUCTURE  (WITH LOCATION BALANCES)',
         182 SY-UNAME.
SKIP.
CLEAR W_LFLAG.
WRITE:/ 'Material No.:', PARENT_MATNR,
        60 'Plant    :', MAST-WERKS.
W_COL = 90.
CLEAR W_TTL.
**LOOP AT INT1.
IF W_COL > 195.
   IF W_LFLAG IS INITIAL.
     WRITE:/ 'Description :', W_MAKTX,
          60 'Base Qty :', S_BASE LEFT-JUSTIFIED.
     W_LFLAG = 'X'.
     W_COL = 90.
   ELSE.
     W_COL = 90.
     SKIP.
   ENDIF.
ENDIF.
WRITE AT W_COL 'Loc :'.
W_COL = W_COL + 6.
WRITE AT W_COL INT1-LGORT.
W_COL = W_COL + 7.
WRITE AT W_COL(12) INT1-LABST LEFT-JUSTIFIED.
W_COL = W_COL + 16.
W_TTL = W_TTL + INT1-LABST.
**ENDLOOP.
**IF W_LFLAG IS INITIAL.
WRITE:/ 'Description :', W_MAKTX,
      60 'Base Qty :', S_BASE LEFT-JUSTIFIED,
      90 'Total :', W_TTL LEFT-JUSTIFIED.
**ELSE.
WRITE AT W_COL 'Total :'.
W_COL = W_COL + 8.
WRITE AT W_COL W_TTL LEFT-JUSTIFIED.
**ENDIF.
SKIP.
ULINE.
WRITE: /001 'Level',
        011 'Item',
        017 'Component',
        037 'Description',
        079 '    Per',
        089 'UOM',
        094 ' Std Price',
        106 'Moving Avg',
        119 'Location',
        128 ' Balance',
        139 'Location',
        148 ' Balance',
        159 'Location',
        168 ' Balance',
        179 'Total Quantity'.
ULINE.
FORM WRT_DTL.
  CLEAR: MAKT-MAKTX, W_MAV, W_STD.
  SELECT SINGLE * FROM MAKT WHERE MATNR = STPO-IDNRK AND
       SPRAS = 'E'.
SELECT SINGLE * FROM MBEW WHERE MATNR = STPO-IDNRK AND
      BWKEY = MAST-WERKS.
IF SY-SUBRC = 0.
   W_MAV = MBEW-VERPR / MBEW-PEINH.
   W_STD = MBEW-STPRS / MBEW-PEINH.
ENDIF.
W_MENGE = ( STPO-MENGE / STKO-BMENG ) * S_BASE.
W_LVL2 = W_LEVEL.
  CONCATENATE W_DOT W_LVL INTO W_LVL.
  CONCATENATE W_LVL W_LVL2 INTO W_LVL1.
SELECT SINGLE SPART FROM MARA INTO SPART WHERE MATNR = MAST-MATNR.
SELECT SINGLE SPART FROM MARA INTO SPART WHERE MATNR = STPO-IDNRK.
  WRITE: /001 ' ',
          011 STPO-POSNR,
          017 STPO-IDNRK,
          037 MAKT-MAKTX,
          079 SPART.
         079(8) W_MENGE,
         089 STPO-MEINS,
         094(10) W_STD,
         106(10) W_MAV.
W_COL = 119.
CLEAR W_TTL.
SELECT * FROM MARD WHERE MATNR = STPO-IDNRK AND
      WERKS = MAST-WERKS AND
      LABST NE 0.
   IF W_COL > 166.
     W_COL = 119.
     WRITE AT /W_COL ' '.
   ENDIF.
   WRITE AT W_COL MARD-LGORT.
   W_COL = W_COL + 5.
   WRITE AT W_COL(13) MARD-LABST.
   W_COL = W_COL + 15.
   W_TTL = W_TTL + MARD-LABST.
ENDSELECT.
IF X_MSLB EQ 'X'.
   SELECT * FROM MSLB WHERE MATNR = STPO-IDNRK AND
        WERKS = MAST-WERKS AND
        LBLAB NE 0.
     IF W_COL > 166.
       W_COL = 119.
       WRITE AT /W_COL ' '.
     ENDIF.
     WRITE AT W_COL(6) MSLB-LIFNR.
     W_COL = W_COL + 6.
     WRITE AT W_COL(12) MSLB-LBLAB.
     W_COL = W_COL + 14.
     W_TTL = W_TTL + MSLB-LBLAB.
   ENDSELECT.
ENDIF.
WRITE AT 179(15) W_TTL.
ENDFORM.

Hi Ric
hope this will help you.
pls reward if help.
REPORT ZMULTIBOM NO STANDARD PAGE HEADING LINE-SIZE 195
                LINE-COUNT 60(2) MESSAGE-ID Z1.
TABLES: MBEW,           "Material Valuation
        MSLB,           "Special stocks with vendor
        MARA,           "Material Master
        MAKT,           "Material Descriptions
        MARD,           "Material Master: Storage Location/Batch Segment
        MAST,           "BOM Header
        STKO,           "BOM Detail
        STPO,           "Bom Components
        STAS.           "BOM Alternative
Text Elements
Plant
SELECT-OPTIONS: S_WERKS FOR MAST-WERKS DEFAULT 'CA',
Material
                S_MATNR FOR MAST-MATNR,
Material Type
                S_MTART FOR MARA-MTART.
Base Quantity
PARAMETERS: S_BASE TYPE I DEFAULT '1'.
Display up to Level
PARAMETERS: S_LVL  TYPE I DEFAULT '99'.
SELECTION-SCREEN SKIP.
Include Vendor Stock
PARAMETERS: X_MSLB  AS CHECKBOX.
DATA: W_MATNR LIKE MAPL-MATNR.
DATA: PARENT-MATNR LIKE MAST-MATNR,
      CHILD-MATNR LIKE STPO-IDNRK,
      CHILD-WERKS LIKE MAST-WERKS,
      CHILD-STLAL LIKE MAST-STLAL,
      W_MAKTX LIKE MAKT-MAKTX,
      W_STD TYPE P DECIMALS 5,
      W_MAV TYPE P DECIMALS 5,
      W_MENGE TYPE P DECIMALS 3,
      W_LEVEL TYPE I,
      W_DOT(1),
      W_LVL(12),
      W_LVL1(12),
      W_LVL2(2),
      W_COL TYPE I,
      W_LFLAG,
      W_TTL LIKE MARD-LABST.
DATA: BEGIN OF INT1 OCCURS 50,
        LGORT(6),
        LABST LIKE MARD-LABST,
      END OF INT1.
IF S_BASE EQ 0.
  S_BASE = 1.
ENDIF.
append multi level routing
SELECT * FROM MAST WHERE WERKS IN S_WERKS AND
     MATNR IN S_MATNR.
  SELECT SINGLE * FROM MARA WHERE MATNR = MAST-MATNR AND
       MTART IN S_MTART.
  IF SY-SUBRC NE 0.
    CONTINUE.
  ENDIF.
  IF MARA-LVORM <> 'X'.
    PARENT-MATNR = MAST-MATNR.
    CHILD-MATNR  = MAST-MATNR.
    CHILD-WERKS  = MAST-WERKS.
    CHILD-STLAL  = MAST-STLAL.
    SELECT SINGLE * FROM MAKT WHERE MATNR = MAST-MATNR AND
         SPRAS = 'E'.
    W_MAKTX = MAKT-MAKTX.
    REFRESH INT1.
    SELECT * FROM MARD WHERE MATNR = MAST-MATNR AND
         WERKS = MAST-WERKS AND
         LABST NE 0.
      MOVE MARD-LGORT TO INT1-LGORT.
      MOVE MARD-LABST TO INT1-LABST.
      APPEND INT1.
    ENDSELECT.
    IF X_MSLB EQ 'X'.
      SELECT * FROM MSLB WHERE MATNR EQ MAST-MATNR AND
           WERKS EQ MAST-WERKS AND
           LBLAB NE 0.
        MOVE MSLB-LIFNR TO INT1-LGORT.
        MOVE MSLB-LBLAB TO INT1-LABST.
        APPEND INT1.
      ENDSELECT.
    ENDIF.
    W_LEVEL = 1.
    NEW-PAGE.
    PERFORM GETCHILD.
  ENDIF.
ENDSELECT.
get child parts
FORM GETCHILD.
  SELECT * FROM STPO WHERE STLNR = MAST-STLNR
        ORDER BY POSNR.
    SELECT SINGLE * FROM STKO WHERE STLNR = STPO-STLNR
          AND STLAL = MAST-STLAL.
    SELECT SINGLE * FROM STAS WHERE STLNR = STPO-STLNR AND
          STLKN = STPO-STLKN AND
          STLAL = MAST-STLAL.
    IF SY-SUBRC EQ 0.
      CLEAR: W_DOT, W_LVL, W_LVL1.
      PERFORM WRT_DTL.
      CHILD-MATNR = STPO-IDNRK.
      W_LEVEL = W_LEVEL + 1.
      IF W_LEVEL <= S_LVL.
        PERFORM SUBCHILD.
      ENDIF.
      W_LEVEL = W_LEVEL - 1.
    ENDIF.
  ENDSELECT.
ENDFORM.
get grand children parts
FORM SUBCHILD.
  SELECT SINGLE * FROM MAST WHERE MATNR = CHILD-MATNR
     AND WERKS = CHILD-WERKS.
  IF SY-SUBRC NE 0.
    EXIT.
  ENDIF.
  SELECT * FROM STPO WHERE STLNR = MAST-STLNR
        ORDER BY POSNR.
    SELECT SINGLE * FROM STKO WHERE STLNR = STPO-STLNR AND
      STLAL = MAST-STLAL.
    SELECT SINGLE * FROM STAS WHERE STLNR = STPO-STLNR AND
        STLKN = STPO-STLKN AND
        STLAL = STKO-STLAL.
      IF SY-SUBRC EQ 0.
        W_DOT = '.'.
        PERFORM WRT_DTL.
        CHILD-MATNR = STPO-IDNRK.
        W_LEVEL = W_LEVEL + 1.
        IF W_LEVEL <= S_LVL.
          PERFORM SUBCHILD.
        ENDIF.
        W_LEVEL = W_LEVEL - 1.
        SHIFT W_LVL.
      ENDIF.
    ENDSELECT.
ENDFORM.
TOP-OF-PAGE.
WRITE:/ SY-DATUM,SY-UZEIT,
       85 'ABC PTE LTD',
      182 'Page', SY-PAGNO.
WRITE: / SY-REPID,
         75 'BOM STRUCTURE  (WITH LOCATION BALANCES)',
         182 SY-UNAME.
SKIP.
CLEAR W_LFLAG.
WRITE:/ 'Material No.:', PARENT-MATNR,
        60 'Plant    :', MAST-WERKS.
W_COL = 90.
CLEAR W_TTL.
LOOP AT INT1.
  IF W_COL > 195.
    IF W_LFLAG IS INITIAL.
      WRITE:/ 'Description :', W_MAKTX,
           60 'Base Qty :', S_BASE LEFT-JUSTIFIED.
      W_LFLAG = 'X'.
      W_COL = 90.
    ELSE.
      W_COL = 90.
      SKIP.
    ENDIF.
  ENDIF.
  WRITE AT W_COL 'Loc :'.
  W_COL = W_COL + 6.
  WRITE AT W_COL INT1-LGORT.
  W_COL = W_COL + 7.
  WRITE AT W_COL(12) INT1-LABST LEFT-JUSTIFIED.
  W_COL = W_COL + 16.
  W_TTL = W_TTL + INT1-LABST.
ENDLOOP.
IF W_LFLAG IS INITIAL.
  WRITE:/ 'Description :', W_MAKTX,
       60 'Base Qty :', S_BASE LEFT-JUSTIFIED,
       90 'Total :', W_TTL LEFT-JUSTIFIED.
ELSE.
  WRITE AT W_COL 'Total :'.
  W_COL = W_COL + 8.
  WRITE AT W_COL W_TTL LEFT-JUSTIFIED.
ENDIF.
SKIP.
ULINE.
WRITE: /001 'Level',
        011 'Item',
        017 'Component',
        037 'Description',
        079 '    Per',
        089 'UOM',
        094 ' Std Price',
        106 'Moving Avg',
        119 'Location',
        128 ' Balance',
        139 'Location',
        148 ' Balance',
        159 'Location',
        168 ' Balance',
        179 'Total Quantity'.
ULINE.
FORM WRT_DTL.
  CLEAR: MAKT-MAKTX, W_MAV, W_STD.
  SELECT SINGLE * FROM MAKT WHERE MATNR = STPO-IDNRK AND
       SPRAS = 'E'.
  SELECT SINGLE * FROM MBEW WHERE MATNR = STPO-IDNRK AND
       BWKEY = MAST-WERKS.
  IF SY-SUBRC = 0.
    W_MAV = MBEW-VERPR / MBEW-PEINH.
    W_STD = MBEW-STPRS / MBEW-PEINH.
  ENDIF.
  W_MENGE = ( STPO-MENGE / STKO-BMENG ) * S_BASE.
  W_LVL2 = W_LEVEL.
  CONCATENATE W_DOT W_LVL INTO W_LVL.
  CONCATENATE W_LVL W_LVL2 INTO W_LVL1.
  WRITE: /001 W_LVL1,
          011 STPO-POSNR,
          017 STPO-IDNRK,
          037 MAKT-MAKTX,
          079(8) W_MENGE,
          089 STPO-MEINS,
          094(10) W_STD,
          106(10) W_MAV.
  W_COL = 119.
  CLEAR W_TTL.
  SELECT * FROM MARD WHERE MATNR = STPO-IDNRK AND
       WERKS = MAST-WERKS AND
       LABST NE 0.
    IF W_COL > 166.
      W_COL = 119.
      WRITE AT /W_COL ' '.
    ENDIF.
    WRITE AT W_COL MARD-LGORT.
    W_COL = W_COL + 5.
    WRITE AT W_COL(13) MARD-LABST.
    W_COL = W_COL + 15.
    W_TTL = W_TTL + MARD-LABST.
  ENDSELECT.
  IF X_MSLB EQ 'X'.
    SELECT * FROM MSLB WHERE MATNR = STPO-IDNRK AND
         WERKS = MAST-WERKS AND
         LBLAB NE 0.
      IF W_COL > 166.
        W_COL = 119.
        WRITE AT /W_COL ' '.
      ENDIF.
      WRITE AT W_COL(6) MSLB-LIFNR.
      W_COL = W_COL + 6.
      WRITE AT W_COL(12) MSLB-LBLAB.
      W_COL = W_COL + 14.
      W_TTL = W_TTL + MSLB-LBLAB.
    ENDSELECT.
  ENDIF.
  WRITE AT 179(15) W_TTL.
ENDFORM.

Similar Messages

  • Urgent: Regarding Stock Ageing report

    hi,
    i want to have stock ageing report in which i want to have the deatils :-
    This is the material which is present in the palnt from dis <b>date</b> and further details of it consumption. plzz tell the <b>tcode</b> for it.
    plzz help me out as it is most urgent to me..
    regards,
    ric.s
    Message was edited by:
            ric .s

    Hi
    The report MC.9 shows Last movement date/Last receipt date / Last issue date.
    In period to analyze give appropriate date range
    Or
    check  MSEG & MARD table to get details about material documents with date
    Vishal...

  • Urgent: regarding sales invoice report

    hi,
    i am making a report in which i have to dislplay for sales invoice ,d format of dis report is:-
    sales order,date,customer,material,invoice no,invioce date,invoice qty,amount.
    i wat to know which tables to be used and if possible which fields should be taken,plzz help me out as it s erally urgent to me.
    s help will be definately rewarded.

    Tables to be considered: VBAK, VBAP, VBFA, VBRK, VBRP.
    And dont keep the message "help will be definately rewarded " in your threads as we know how good you are at judging the replies and how you do appreciate the replies from your earlier threads.
    This might be a bit harsh, but expect tips and advices here rather than the whole solutions to problems in SDN.
    Kind Regards
    Eswar

  • Urgent : Regarding Purchase Requsition Report

    Hi,
    I am making  a report on Purchase Requisition in which i have to display that these are the persons who have released this requisition (i.e. If General Manager has  released that should be displayed,if Director had  released it should be displayed and if Managing Director had released it should display it and also the dates on which they released..)
    In my report i am not allowed to displayed that these are released by MMCONS OR SDCONS BUT it should display General Manager,Director  or Managing Director.. at these particular dates...
    If anybody help me out in this report he or she will be definately rewarded with points as it is most urgent to me ,,so plz reply as fast as possible.
    Regards,
    Ric.s
    Message was edited by:
            ric .s

    Hai ric,
              i have done a pr tracking report. it will show the persons name, plant, and department, etc .i have added that program here. if u dnt mine u can take
    with regards,
    safiq
    TYPE-POOLS slis.
    TABLES: t024, ekko, lfa1, ekpo, ekkn, cdhdr, cdpos, t16fs,
    eban, eket, ekbe, t024d.
    DATA: repid LIKE sy-repid.
    DATA: releasedat LIKE cdhdr-udate.
    CONSTANTS: c_to(4) TYPE c VALUE ' to ',
               c_vgabe_1 TYPE c VALUE '1',
               c_vgabe_2 TYPE c VALUE '2',
               c_object_banf LIKE cdpos-objectclas VALUE 'BANF',
               c_fname_frgzu LIKE cdpos-fname VALUE 'FRGZU',
               c_tcode like cdhdr-tcode value 'ME54',
    c_tcode1 like cdhdr-tcode value 'ME55',
             A1=add one more constant and value for ME55.
               c_tcode2 like cdhdr-tcode value 'ME28',
    CN 2 >> Addition
    CN 2 Start
               c_tcode3 like cdhdr-tcode value 'ME54N',
               c_tcode4 like cdhdr-tcode value 'ME29N',
    CN 2 End
               c_object_eink LIKE cdpos-objectclas VALUE 'EINKBELEG',
               c_fname_frgke LIKE cdpos-fname VALUE 'FRGKE'.
    DATA: list_layout TYPE slis_layout_alv,            "Layout
          ist_fieldcat TYPE STANDARD TABLE OF          "Field Catalog
              slis_fieldcat_alv,
          tmp_fieldcat TYPE slis_fieldcat_alv,         "Temp. Field Cat.
          gt_xevents TYPE slis_t_event,                "Events Table
          xs_event  TYPE slis_alv_event.               "Event Line
    RANGES: tcode for cdhdr-tcode.
    A1=Add range to store ME54 & ME55
    *&      To store Summary report information - added 30/5
    data: begin of i_summary occurs 100,
            PlantName1 LIKE T001W-Name1,              "Plant Name
            plant1 LIKE ekpo-werks,              "Plant
          Dept LIKE t024d-dsnam,               "MRP Contrl Code
          PRafIR type i,
          PRbfIR type i,
          Grandtotal type i,
          PerPRafIR type p decimals 2,
          PerPRbfIR type p decimals 2,
    end of i_summary.
    STRUCTURES
    DATA: BEGIN OF t_ekko OCCURS 0.
            INCLUDE STRUCTURE ekko.
    DATA: END OF t_ekko.
    DATA: BEGIN OF st_itab,
             pur_grp(22) TYPE c,
           vendor_name LIKE lfa1-name1,
           po_num LIKE ekko-ebeln,
           item_num LIKE ekpo-ebelp,
           mat_num LIKE ekpo-matnr,
           description LIKE ekpo-txz01,
           qty_order LIKE ekpo-menge,
           unit_price LIKE ekpo-netpr,
           total_price LIKE ekpo-netwr,
           plant LIKE ekpo-werks,
           cost_center LIKE ekkn-kostl,
           internal_order LIKE ekkn-aufnr,
           gl_code LIKE ekkn-sakto,
           dept LIKE t024d-dsnam,
           po_release_dat LIKE cdhdr-udate,
           delivery_dat LIKE eket-eindt,
    *       gr_dat like ekbe-budat,        "MICH01- 24/04/03
           gr_dat LIKE ekbe-bldat,        "MICH01+ 24/04/03
           on_time_delivery TYPE c,
           gr_qty LIKE ekbe-menge,
           gr_doc_num LIKE ekbe-belnr,
           ir_posting_date LIKE ekbe-budat,    "??? change to budat
           ir_doc_num LIKE ekbe-belnr,
    END OF st_itab.
    DATA: BEGIN OF st_itab1,
            aedat LIKE ekko-aedat,   "PO creation date
            lifnr LIKE ekko-lifnr,
            ebeln LIKE ekko-ebeln,  "PO number
            ekgrp LIKE ekko-ekgrp,
            matnr LIKE ekpo-matnr,
            banfn LIKE ekpo-banfn,  "PR number
            werks LIKE ekpo-werks,  "PO item number
            ebelp LIKE ekpo-ebelp,
            bnfpo like eban-bnfpo,  "PR item number
            txz01 LIKE ekpo-txz01,
            menge LIKE ekpo-menge,
            netpr LIKE ekpo-netpr,
            netwr LIKE ekpo-netwr,
            kostl LIKE ekkn-kostl,
            aufnr LIKE ekkn-aufnr,
            sakto LIKE ekkn-sakto,
            prctr LIKE ekkn-prctr,
            anln1 LIKE ekkn-anln1,
            pstyp LIKE eban-pstyp,
            badat LIKE eban-badat,
            afnam LIKE eban-afnam,
            dispo LIKE eban-dispo,
           vgabe LIKE ekbe-vgabe,
           belnr LIKE ekbe-belnr,
           bldat LIKE ekbe-bldat,  "GR Creation date
           budat LIKE ekbe-budat,  "IR Creation date
           gr_qty LIKE ekbe-menge,
            eindt LIKE eket-eindt,
           udate LIKE cdhdr-udate,
           beln1 LIKE ekbe-belnr,     "IR Doc. No.
            dsnam LIKE t024d-dsnam,    "MRP Controller Desc
            pur_grp LIKE t024-eknam,   "Desc. of Purchasing Gp
            name1 LIKE lfa1-name1,     "Vendor Code
            on_time_delivery TYPE c,   "On-time-delivery
            flag type c,               "Flag
    Added by @, 21.05.2007 >>
            PRAFIR TYPE i,
            PRBFIR TYPE i,
            TOTPR  TYPE i,
    Added by @, 21.05.2007 <<
          END OF st_itab1.
    GR History Movements
    DATA: BEGIN OF st_history,
            bldat LIKE ekbe-bldat,
            menge LIKE ekbe-menge,
            belnr LIKE ekbe-belnr,
          END OF st_history.
    PO Release Data
    DATA: BEGIN OF st_change,
            changenr LIKE cdpos-changenr,
            value_new LIKE cdpos-value_new,
          END OF st_change.
    data: begin of st_change1,
            udate like cdhdr-udate,
          end of st_change1.
    INTERNAL TABLES
    DATA: itab LIKE TABLE OF st_itab,
          ist_history LIKE TABLE OF st_history,
          wa_history LIKE st_history,
          ist_change LIKE TABLE OF st_change,
          wa_change LIKE st_change,
          ist_change1 like table of st_change1,
          wa_change1 like st_change1.
    data: begin of ist_itab occurs 0.
            include structure st_itab1.
    DATA : vgabe LIKE ekbe-vgabe,
          belnr LIKE ekbe-belnr,
          bldat LIKE ekbe-bldat,  "GR Creation date
          budat LIKE ekbe-budat,  "IR Creation date
          beln1 LIKE ekbe-belnr,     "IR Doc. No.
          gr_qty like ekbe-menge,    "GR Qty
          gr_unres LIKE ekbe-menge,  "GR to unrestricted
          gr_inspec_stk like ekbe-menge,  "GR to inspection stock
          gr_blk_stk like ekbe-menge,  "GR to blocked stock
          gr_rejected_stk like ekbe-menge,  "GR to rejected stock
          relcode1 like t16fs-FRGC1,  "Release code 1
          reldate1 like cdhdr-udate,  "Release date 1
          relcode2 like t16fs-FRGC1,  "Release code 2
          reldate2 like cdhdr-udate,  "Release date 2
          relcode3 like t16fs-FRGC1,  "Release code 3
          reldate3 like cdhdr-udate,  "Release date 3
          relcode4 like t16fs-FRGC1,  "Release code 4
          reldate4 like cdhdr-udate,  "Release date 4
          relcode5 like t16fs-FRGC1,  "Release code 5
          reldate5 like cdhdr-udate,  "Release date 5
          po_rel_date like cdhdr-udate.  "PO release date
    data: end of ist_itab.
    data: wa_itab LIKE ist_itab.
    Added on 21.05.2007 >>
    data: s_po Type C.
    data: s_pr Type C.
    SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK screen1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:
      so_aedat FOR ekko-aedat no-display,      "Purchase Order Creation Date
      so_udate FOR cdhdr-udate no-display,     "PO Release Date
      so_eindt FOR eket-eindt no-display,      "Delivery Date
      so_ekgrp FOR t024-ekgrp no-display,      "Purchasing Group
      so_lifnr FOR ekko-lifnr no-display,      "Vendor Code
      so_ebeln FOR ekko-ebeln no-display,      "PO Number
      so_matnr FOR ekpo-matnr no-display,      "Material No.
      so_banfn FOR ekpo-banfn no-display,      "PR No.
      so_dispo for eban-dispo no-display,      "MRP controller
      so_pstyp FOR ekpo-pstyp no-display,      "Item Category
      so_badat FOR eban-badat OBLIGATORY,                "PR Creation Date
      so_afnam FOR eban-afnam no-display,      "PR Requester Name
      so_werks FOR ekpo-werks OBLIGATORY,      "Plant
      so_kostl FOR ekkn-kostl no-display,      "Cost Center
      so_aufnr FOR ekkn-aufnr no-display,      "Internal Order
      so_sakto FOR ekkn-sakto no-display,      "G/L Account
      so_prctr FOR ekkn-prctr no-display,      "Profit Center
      so_anln1 FOR ekkn-anln1 no-display,      "Asset Number
      so_belnr FOR ekbe-belnr no-display,      "GR Doc. No.
      so_bldat FOR ekbe-bldat no-display,      "GR Creation Date
      so_budat FOR ekbe-budat no-display,      "IR Posting Date
      so_beln1 FOR ekbe-belnr no-display,      "IR Doc. No
      so_frgkz for eban-frgkz no-display.  "Release status of PR
    SELECTION-SCREEN SKIP 1.
    PARAMETERS:
      p_pr_rel(1) TYPE C no-display,          "PR Release Indicator
      p_on_del(1) TYPE C no-display.          "On-time-delivery
    SELECTION-SCREEN END OF BLOCK screen1.
    Selection Screen - add 30/5
    selection-screen begin of block screen2 with frame title text-002.
    selection-screen begin of line.
    parameters: r_sum radiobutton group grp1.
    selection-screen comment 2(20) text-003 for field r_sum.
    selection-screen end of line.
    selection-screen begin of line.
    parameters: r_det radiobutton group grp1 default 'X'.
    selection-screen comment  2(20) text-004 for field r_det.
    selection-screen end of line.
    selection-screen end of block screen2.
          MAIN                                                          *
    *s_pr = 'X'.
    Added on 21.05.2007 <<
    *repid = sy-repid.
    Assign release indicator
    *if p_pr_rel = 'Y'.
    so_frgkz-low = '2'.
    so_frgkz-option = 'EQ'.
    so_frgkz-sign = 'I'.
    append so_frgkz.
    clear so_frgkz.
    *elseif p_pr_rel = 'N'.
    so_frgkz-low = 'X'.
    so_frgkz-option = 'EQ'.
    so_frgkz-sign = 'I'.
    append so_frgkz.
    clear so_frgkz.
    *endif.
    *tcode-low    = 'ME54'.
    *tcode-option = 'EQ'.
    *tcode-sign   = 'I'.
    *append tcode.
    CN 2 >> Addition
    CN 2 Start
    *tcode-low    = 'ME54N'.
    *tcode-option = 'EQ'.
    *tcode-sign   = 'I'.
    *append tcode.
    CN 2 End
    *tcode-low    = 'ME55'.
    *tcode-option = 'EQ'.
    *tcode-sign   = 'I'.
    *append tcode.
    *PERFORM:
    get_details,
    get_data,
    get_gr_ir_data,
    get_other_data,
    Setup events --> Top-of-page
    setup_events,
    Build up ALV field catalogue
    setfieldcat,
    Output the data
    output_alv_report TABLES ist_fieldcat.
    Perform print_data.
    top-of-page.
    perform print_heading.
    END-OF-PAGE.
    WRITE :/ SY-ULINE(126).
          FORM Assign_Values                                            *
    FORM assign_values.
    ENDFORM.
          FORM setFieldCat                                              *
    FORM setfieldcat.
      PERFORM:
         add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'T024D'
                                           'DSNAM'
                                           'IST_ITAB'
                                           'DSNAM'
                                           'Dept'
                                           'X'
        add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKPO'
                                           'WERKS'
                                           'IST_ITAB'
                                           'WERKS'
                                           'Plant'
                                           'X'
        add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EBAN'
                                           'AFNAM'
                                           'IST_ITAB'
                                           'AFNAM'
                                           'PR Requestor Name'
                                           'X'
         add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  ''
                                           'IST_ITAB'
                                           'PRBFIR'
                                           'PRbfIR'
                                           '6'
        add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  ''
                                           'IST_ITAB'
                                           'PRAFIR'
                                           'PRafIR'
                                           '6'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  ''
                                           'IST_ITAB'
                                           'TOTPR'
                                           'TotalPR'
                                           '7'
         add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EBAN'
                                           'BADAT'
                                           'IST_ITAB'
                                           'BADAT'
                                           'PR Creation Date'
                                           'X'
         add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EBAN'
                                           'BANFN'
                                           'IST_ITAB'
                                           'BANFN'
                                           'PR No'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKKO'
                                           'EBELN'
                                           'IST_ITAB'
                                           'EBELN'
                                           'PO Number'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKKO'
                                           'EBELP'
                                           'IST_ITAB'
                                           'EBELP'
                                           'PO Item'
                                           'X'
          add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKKO'
                                           'AEDAT'
                                           'IST_ITAB'
                                           'AEDAT'
                                           'PO Creation Date'
                                           'X'
          add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKBE'
                                           'BLDAT'
                                           'IST_ITAB'
                                           'BLDAT'
                                           'GR Date'
                                           'X'
         add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKBE'
                                           'BUDAT'
                                           'IST_ITAB'
                                           'BUDAT'
                                           'IR Document Date'
                                           'X'
         add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKPO'
                                           'TXZ01'
                                           'IST_ITAB'
                                           'TXZ01'
                                           'Description'
                                           'X'
           add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKPO'
                                           'MENGE'
                                           'IST_ITAB'
                                           'MENGE'
                                           'Qty Ordered'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKPO'
                                           'NETPR'
                                           'IST_ITAB'
                                           'NETPR'
                                           'Unit Price'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKPO'
                                           'NETWR'
                                           'IST_ITAB'
                                           'NETWR'
                                           'Total Price'
                                           'X'
        add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'T024'
                                           'EKNAM'
                                           'IST_ITAB'
                                           'PUR_GRP'
                                           'PO PurGrp'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'LFA1'
                                           'NAME1'
                                           'IST_ITAB'
                                           'NAME1'
                                           'Vendor Name'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKPO'
                                           'MATNR'
                                           'IST_ITAB'
                                           'MATNR'
                                           'Material Number'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKKN'
                                           'KOSTL'
                                           'IST_ITAB'
                                           'KOSTL'
                                           'Cost Center'
                                           'X'
        add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKKN'
                                           'AUFNR'
                                           'IST_ITAB'
                                           'AUFNR'
                                           'Internal Order'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKKN'
                                           'SAKTO'
                                           'IST_ITAB'
                                           'SAKTO'
                                           'GL Code'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKKN'
                                           'ANLN1'
                                           'IST_ITAB'
                                           'ANLN1'
                                           'Asset'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKKN'
                                           'PRCTR'
                                           'IST_ITAB'
                                           'PRCTR'
                                           'Profit Centre'
                                           'X'
         add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'T16FS'
                                           'FRGC1'
                                           'IST_ITAB'
                                           'RELCODE1'
                                           'PR RelCode1'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'CDHDR'
                                           'UDATE'
                                           'IST_ITAB'
                                           'RELDATE1'
                                           'PR RelDate1'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'T16FS'
                                           'FRGC2'
                                           'IST_ITAB'
                                           'RELCODE2'
                                           'PR RelCode2'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'CDHDR'
                                           'UDATE'
                                           'IST_ITAB'
                                           'RELDATE2'
                                           'PR RelDate2'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'T16FS'
                                           'FRGC3'
                                           'IST_ITAB'
                                           'RELCODE3'
                                           'PR RelCode3'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'CDHDR'
                                           'UDATE'
                                           'IST_ITAB'
                                           'RELDATE3'
                                           'PR RelDate3'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'T16FS'
                                           'FRGC4'
                                           'IST_ITAB'
                                           'RELCODE4'
                                           'PR RelCode4'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'CDHDR'
                                           'UDATE'
                                           'IST_ITAB'
                                           'RELDATE4'
                                           'PR RelDate4'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'T16FS'
                                           'FRGC5'
                                           'IST_ITAB'
                                           'RELCODE5'
                                           'PR RelCode5'
                                           'X'
       add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'CDHDR'
                                           'UDATE'
                                           'IST_ITAB'
                                           'RELDATE5'
                                           'PR RelDate5'
                                           'X'
      add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'CDHDR'
                                           'UDATE'
                                           'IST_ITAB'
                                           'PO_REL_DATE'
                                           'PO Release Date'
                                           'X'
      add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKET'
                                           'EINDT'
                                           'IST_ITAB'
                                           'EINDT'
                                           'PO Dlv Date'
                                           'X'
    add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  ''
                                           'IST_ITAB'
                                           'ON_TIME_DELIVERY'
                                           'On Time Delivery'
                                           '16'
                                           'X'
      add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKBE'
                                           'MENGE'
                                           'IST_ITAB'
                                           'GR_QTY'
                                           'GR Qty'
                                           'X'
      add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKBE'
                                           'BELNR'
                                           'IST_ITAB'
                                           'BELNR'
                                           'GR Doc Num'
                                           'X'
      add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKBE'
                                           'MENGE'
                                           'IST_ITAB'
                                           'GR_UNRES'
                                           'GR to Unrestricted'
                                           'X'
      add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKBE'
                                           'MENGE'
                                           'IST_ITAB'
                                           'GR_INSPEC_STK'
                                           'GR to Inspection Stock'
                                           'X'
      add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKBE'
                                           'MENGE'
                                           'IST_ITAB'
                                           'GR_BLK_STK'
                                           'GR to Blocked Stock'
                                           'X'
      add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKBE'
                                           'MENGE'
                                           'IST_ITAB'
                                           'GR_REJECTED_STK'
                                           'GR to Rejected Stock'
                                           'X'
    Added by @, 21.05.2007 >>
    add_field_to_fieldcat TABLES ist_fieldcat
                                   USING  'EKBE'
                                          'BELNR'
                                          'IST_ITAB'
                                          'BELN1'
                                          'IR Doc Num'
                                          'X'
    add_field_to_fieldcat TABLES ist_fieldcat
                                    USING  'EKBE'
                                           'BELNR'
                                           'IST_ITAB'
                                           'BELN1'
                                           'IR Doc Num'
                                           'X'
    Added by @, 21.05.2007 <<
    ENDFORM.
          FORM XEVENTS                                                  *
    FORM setup_events.
      CLEAR xs_event.
      xs_event-name = slis_ev_end_of_page.
      xs_event-form = 'XEND_OF_PAGE'.
      APPEND xs_event TO gt_xevents.
      CLEAR xs_event.
      xs_event-name = slis_ev_top_of_page.
      xs_event-form = 'XTOP_OF_PAGE'.
      APPEND xs_event TO gt_xevents.
      CLEAR xs_event.
      xs_event-name = slis_ev_top_of_list.
      xs_event-form = 'XTOP_OF_LIST'.
      APPEND xs_event TO gt_xevents.
      CLEAR xs_event.
      xs_event-name = slis_ev_end_of_list.
      xs_event-form = 'XEND_OF_LIST'.
      APPEND xs_event TO gt_xevents.
    ENDFORM.
          FORM XTOP_OF_PAGE                                             *
    FORM xtop_of_page.
      Write at 117 sy-pagno right-justified.
      WRITE: / 'PR Tracking Report (against Invoice Date)'.
      WRITE:/(42) sy-uline.
    PO Creation Date
      IF NOT so_aedat-low IS INITIAL AND
             so_aedat-high IS INITIAL.
        WRITE:/ 'PO Creation Date:', so_aedat-low.
      ELSEIF NOT so_aedat-low IS INITIAL AND
             NOT so_aedat-high IS INITIAL.
        WRITE:/ 'PO Creation Date:', so_aedat-low,  c_to, so_aedat-high.
      ENDIF.
    PR Creation Date
      IF NOT so_badat-low IS INITIAL AND
             so_badat-high IS INITIAL.
        WRITE:/ 'PR Creation Date: ', so_badat-low.
      ELSEIF NOT so_badat-low IS INITIAL AND
             NOT so_badat-high IS INITIAL.
        WRITE:/ 'PR Creation Date: ', so_badat-low , c_to, so_badat-high.
      ENDIF.
    Plant
      IF NOT so_werks-low IS INITIAL AND
             so_werks-high IS INITIAL.
        WRITE:/ 'Plant: ', so_werks-low.
      ELSEIF NOT so_werks-low IS INITIAL AND
             NOT so_werks-high IS INITIAL.
        WRITE:/ 'Plant: ', so_werks-low , c_to, so_werks-high.
      ENDIF.
    Delivery Date
      IF NOT so_eindt-low IS INITIAL AND
             so_eindt-high IS INITIAL.
        WRITE:/ 'Delivery Date: ', so_eindt-low.
      ELSEIF NOT so_eindt-low IS INITIAL AND
             NOT so_eindt-high IS INITIAL.
        WRITE:/ 'Delivery Date: ', so_eindt-low , c_to, so_eindt-high.
      ENDIF.
    Purchasing Group
      IF NOT so_ekgrp-low IS INITIAL AND
             so_ekgrp-high IS INITIAL.
        WRITE:/ 'Purchasing Group: ', so_ekgrp-low.
      ELSEIF NOT so_ekgrp-low IS INITIAL AND
             NOT so_ekgrp-high IS INITIAL.
        WRITE:/ 'Purchasing Group: ', so_ekgrp-low , c_to, so_ekgrp-high.
      ENDIF.
    Vendor Code
      IF NOT so_lifnr-low IS INITIAL AND
             so_lifnr-high IS INITIAL.
        WRITE:/ 'Vendor Code: ', so_lifnr-low.
      ELSEIF NOT so_lifnr-low IS INITIAL AND
             NOT so_lifnr-high IS INITIAL.
        WRITE:/ 'Vendor Code: ', so_lifnr-low , c_to, so_lifnr-high.
      ENDIF.
    PO Number
      IF NOT so_ebeln-low IS INITIAL AND
             so_ebeln-high IS INITIAL.
        WRITE:/ 'PO Number: ', so_ebeln-low.
      ELSEIF NOT so_ebeln-low IS INITIAL AND
             NOT so_ebeln-high IS INITIAL.
        WRITE:/ 'PO Number: ', so_ebeln-low , c_to, so_ebeln-high.
      ENDIF.
    Material No
      IF NOT so_matnr-low IS INITIAL AND
             so_matnr-high IS INITIAL.
        WRITE:/ 'PO Number: ', so_matnr-low.
      ELSEIF NOT so_matnr-low IS INITIAL AND
             NOT so_matnr-high IS INI

  • URGENT: REGARDING PRINTOUT OF REPORT

    hi,
    i had made report who's width is 310 and i had taken printout but is not displaying all fields when i take printout . can any body tell me d solution of dis problem as i dont wanna reduce d width of it.
    CAN ANYBODY TELL ME D FORMAT FOR 310 LINE WIDTH FOR ALL FIELDS TO BE DISPLYED WHEN PRINTOUT IS TAKEN.
    plz reply as fast as possible n he or she will be rewarded

    Hi Yaki,
        If your printer is not displaying the entire 310 characters, then solution can be to break down your report into 2 line format instead of using 1 line.
       Many SAP standard reports come out that way you can check program SDV03V02 its output is in 2 lines.
       Or other option can be to download the report in Excel Format using List-Save
    and then take a printout of it..
       Reward if helpful.
    Best Regards,
    Imran

  • URGENT: REGARDING SALES ORDER REPORT

    HI,
    I making a report on sales order in which i have to display the      sales order no,date,customer no,date,material issued to customer,date of issue,invoice no,date,quantity,amount of invoice.
    can anbody tell what are the tables used for making dis report .
    currnetly i am using VBAK,VBAK,VBRP.
    PLZZ help me out as it is really urgent to me & help will be deifnately rewarded.
    Edited by: ric .s on Feb 19, 2008 11:01 AM

    Hello,
    Go through the Diagram on the page hope it will help you.
    http://www.erpgenie.com/abap/tables_sd.htm
    Thanks,
    Gunjan

  • Urgent: Regarding Vendor payment report

    Hi,
    I making a report in which i have to display the vendor payment is done or not?
    Curently i am using the 4 tables of Financial :-
    BSAK,BSIS,BSIK AND BSAS which gives the status of vendor whether it is paid or not .  1 thing i observed that data compared wit htew MKPF table among these tables(BSAS,BSIK N BSAK) is not coming right as i am taking common field XBLNR among them all .
    One more thing i observed that BLART is getting changed in each table.
    for instance,
    if the BLART is WE for material document and i am taking XBLNR filed from this table MKPF and den looking XBLNR in BKPF where the entry consist of BLART -  RE n WE and finally when i look up in the BSAK table the field consist of RE .
    How can i see that it is being paid or not the BLART is keep on changing.
    Plzz proivde me guidelines as how to rectify the problem?
    Edited by: abaper2008 on May 21, 2008 8:54 AM

    Hi
    May be the report also included the PO / Invoice details.
    BSIK - Vendor open items
    BSAK-Vendor cleare items
    When the invoice is created one entry creates in BSIK - once it is cleared (either through the payment/credit memo/reverse) that entry along with the cleared entry goes to BSAK.
    Above two entries 'll have unique data in the field BSAK-AUGBL - with that link you will get the BLART field link.
    As you are telling about the RE document type.....there are different types of document types like - FI Document types & MM Document types. RE is the FI document type
    As a linking part to get the PO details using the FI data only available field is BKPF-AWKEY data in that field is used in RSEG-BELNR along with Fiscal year.
    This is the brief about the link...let me know if you need further details
    VVR

  • Urgent: regarding stock aging report

    hi,
    i want to have t-code for 'STOCK AGING REPORT' which shows that this material is present in the plant from this <b>date</b>. <b>plzzz provide me the tcode for it.</b>
    if anybody provide me solution to it will be definately rewarded.
    Message was edited by:
            ric .s
    Message was edited by:
            ric .s
    Message was edited by:
            ric .s

    Hi,
    Please try transaction code MC50
    also u can use mc.9 in that use fields like last consumed last good issued and last goods receipt
    after runing report u will get material and values t add above fields
    press f6 and add last consumed last good issued and last goods receipt
    and with this data u can analys this data
    Reward if found  helpful ...
    Cheers,
    Chandra Sekhar.

  • Urgent: regarding physical inventory report display

    hi,
    i had made a report in which i have to display the physical inventory report details in which details about the material is to be given.
    I want to check the details which are present in the tcode MI07 . Can anybody tell me any tcode in which i can see the details of mi07 tcode(including the reason of it).

    Greetings,
    It might shed some light to read about the display in your portable computer: http://en.wikipedia.org/wiki/LCD
    LCDs are primarily plastic panels with various layers inside.  Pressure applied to those panels can cause them to crack, leaking the liquid crystal components about.  Pressure could be heavy books in a bag pushing against the screen, heavy cat sitting on a closed lid, dog, other animal, someone slamming the lid, child running through the room, etc.  This applies to any LCD whether it be in a computer or in a Television (don't press too hard on your TV screen!!).
    Displays don't exhibit the type of damage you indicate by themselves.  A single pixel might go dead in an LCD but zig zag lines indicates cracking of the layers inside the panels themselves.  Something from the outside world made an impact on the display resulting in the damage you see.  You may not have been the one pressing hard on it and you may not have seen it happen, but something happened.
    The 1 year limited warranty and AppleCare protection plan offer coverage for component failures, not damage.
    Coverage for damage would be provided by something along the lines of insurances (home owners, renters, etc.)  If you purchased this computer with a Credit Card you may wish to contact your Credit Card company.  Many cards have included insurance for purchases you make so even if an item is damage during your use of it, they will cover it.
    Best of luck.

  • Deleting the data in the infocube will delete the data in explorer reports?

    Hi,
    I have some explorer reports based on the BW queries.
    1. I have deleted the data in BW but when I go and check the data is still visible in the explorer reports ? Is there any option once I delete the data in BW the data should also be deleted in the explorer?
    2. Once I transport these explorer reports from dev to Quality, if the quality system cube does not have the data then these explorer reports does not show up any data or else it carries the data as well from the devlopment system?
    Regards
    A

    hi,
    Explorer reports will take data from Indexes in BWA, so it will show data even if you delete the data from cubes.
    you will have to index your queries/ cubes again if you need the latest data.
    I guess this can be scheduled through process chains.
    Regards, Mayur

  • **URGENT** - Vendor Line Item Reporting

    Dear Gurus,
    Need some “URGENT” help with regards to Vendor Reporting?
    Our business has requested for a Vendor Line Item / header Report, which will display ALL Vendor Items “NET” (before tax).
    At the moment our business it manually taking out Tax in FBL1n (Vendor Line Item Report).
    Please could you kindly let me know if there is ANY report in SAP which displays the Vendor Items NET & GROSS??
    Thanks Very Much
    RICK
    Edited by: Rick Desilva on Apr 22, 2008 4:00 PM

    Hi  Shridhar,
    All I want is a "net column" - Which will display the vendor invocie amount - BEFORE VAT (Tax).
    So on FBL1N or Another SAP-Vendor Report what I need is a
    Net Amount column and a Gross Amount Column.
    I hope this makes sense and someone can assist....
    Thanks & Regards
    RICK
    Edited by: Rick Desilva on Apr 23, 2008 9:36 AM

  • BOM Explosion report

    Hi All,
    I have problem with BOM explosion report CS12.
    We have material with 3 level BOM. While we are running CS12, upto 2nd level appears in the report. 3 rd level components dose'nt show. what may be the reason. I have checked validity period & BOM status is active for all levels.
    REgards,
    Srijit.

    HI
    Check the explosion types in OS17 also check whether phantom asseblies indicator in OS17.
    Check In BOM for whether you have defined some material as Phantom or not?
    Check and revert
    Regards
    Anupam Sharma

  • Discontinued parts in BoM explosion reports

    I am having difficulty with the BoM explosion reports (CS11-13, and CSP1-3), in that they seem to take no notice of discontinuation.  In particular we have some assemblies which are discontinued, and replaced by alternative parts with a different sub-assembly BoM.  It does not seem possible to explode through the new BoM - the reports appear to continue to use the obsolete assembly.
    Am I doing something wrong?  It would seem clear that the reports should explode the BoM through the new assemblies, particularly if there is no stock of the obsolete part.
    Is there an alternative way to get a BoM explosion report which does take note of the discontinuation data?

    Hi,
    In my opinion discontinuation is considered only during MRP run (planning) and has nothing to do with BOM reports (CS03, CS11, CS12, CSMB, etc).
    SAP online help:
    If this indicator is set, the material is defined as 'to be discontinued'. The material is then discontinued in MRP. MRP transfers dependent requirements that are no longer covered by stock of this material to the follow-up material.
    So, I think you won't see the follow-up material in BOM reports. Even if you maintain the discountinuation in BOM I think you cannot see the actual sitruation in BOM reports (you will see both follow-up and discontinued material).
    I hope I'm mistaken and this is a solved issue in SAP.
    Regards,
    Csaba

  • Alternative unit of measure in BOM explosion report

    Dear gurus
    I want to get the alternative unit of measure along with the base unit of measure during the BOM explosion report in CS11.I tried with the layout but I cant find the same.
    How is this possible?
    regards
    kumar s

    Hi Kumar,
    You can develop  a Z report. In the standard CS11, the functionality of displaying the alternate UOM is not feasible.
    thanks and regards
    Muruegsan

  • Very urgent: regarding display of parent material

    hi,
    i had been working on dis report and i hae to display the parent material on top and sub material in dis BOM structure report.
    plzz help me out  as i have to submimit dis report with 1 hour as help will be definately rewarded.
    TABLES: MBEW,           "Material Valuation
            MSLB,           "Special stocks with vendor
            MARA,           "Material Master
            MAKT,           "Material Descriptions
            MARD,           "Material Master: Storage Location/Batch Segment
            MAST,           "BOM Header
            STKO,           "BOM Detail
            STPO,           "Bom Components
            STAS.           "BOM Alternative
    Text Elements
    Plant
    SELECT-OPTIONS: S_WERKS FOR MAST-WERKS,
    DEFAULT 'CA',
    Material
                    S_MATNR FOR MAST-MATNR,
    Material Type
                    S_MTART FOR MARA-MTART.
    Base Quantity
    PARAMETERS: S_BASE TYPE I DEFAULT '1'.
    Display up to Level
    PARAMETERS: S_LVL  TYPE I DEFAULT '99'.
    PARAMETERS: stlal  type mast-stlal default '01'.
    SELECTION-SCREEN SKIP.
    Include Vendor Stock
    PARAMETERS: X_MSLB  AS CHECKBOX.
    DATA: W_MATNR LIKE MAPL-MATNR.
    DATA: PARENT_MATNR LIKE MAST-MATNR,
          CHILD_MATNR LIKE STPO-IDNRK,
          CHILD_WERKS LIKE MAST-WERKS,
          CHILD_STLAL LIKE MAST-STLAL,
          W_MAKTX LIKE MAKT-MAKTX,
          W_STD TYPE P DECIMALS 5,
          W_MAV TYPE P DECIMALS 5,
          W_MENGE TYPE P DECIMALS 3,
          W_LEVEL TYPE I,
          W_DOT(1),
          W_LVL(12),
          W_LVL1(12),
          W_LVL2(2),
          W_COL TYPE I,
          W_LFLAG,
          W_TTL LIKE MARD-LABST.
    DATA: SPART LIKE MARA-SPART.
    DATA: BEGIN OF INT1 OCCURS 50,
           LGORT(6),
            LABST LIKE MARD-LABST,
          END OF INT1.
    IF S_BASE EQ 0.
      S_BASE = 1.
    ENDIF.
    append multi level routing
    SELECT * FROM MAST WHERE WERKS IN S_WERKS AND
         MATNR IN S_MATNR and stlal = stlal.
      SELECT SINGLE SPART FROM MARA INTO SPART WHERE MATNR = MAST-MATNR AND  MTART IN S_MTART.
        write: 'aaaaa', sy-dbcnt.
    SELECT SINGLE * FROM MARA WHERE MATNR = MAST-MATNR AND
          MTART IN S_MTART.
      IF SY-SUBRC NE 0.
        CONTINUE.
      ENDIF.
      IF MARA-LVORM <> 'X'.
        PARENT_MATNR = MAST-MATNR.
        CHILD_MATNR  = MAST-MATNR.
        CHILD_WERKS  = MAST-WERKS.
        CHILD_STLAL  = MAST-STLAL.
        SELECT SINGLE * FROM MAKT WHERE MATNR = MAST-MATNR AND
             SPRAS = 'E'.
        W_MAKTX = MAKT-MAKTX.
        REFRESH INT1.
        SELECT * FROM MARD WHERE MATNR = MAST-MATNR AND
             WERKS = MAST-WERKS AND
             LABST NE 0.
          MOVE MARD-LGORT TO INT1-LGORT.
          MOVE MARD-LABST TO INT1-LABST.
          APPEND INT1.
        ENDSELECT.
        IF X_MSLB EQ 'X'.
          SELECT * FROM MSLB WHERE MATNR EQ MAST-MATNR AND
               WERKS EQ MAST-WERKS AND
               LBLAB NE 0.
            MOVE MSLB-LIFNR TO INT1-LGORT.
            MOVE MSLB-LBLAB TO INT1-LABST.
            APPEND INT1.
          ENDSELECT.
        ENDIF.
        W_LEVEL = 1.
       NEW-PAGE.
        PERFORM GETCHILD.
      ENDIF.
    ENDSELECT.
    get child parts
    FORM GETCHILD.
      SELECT * FROM STPO WHERE STLNR = MAST-STLNR
            ORDER BY POSNR.
        SELECT SINGLE * FROM STKO WHERE STLNR = STPO-STLNR
              AND STLAL = MAST-STLAL.
        SELECT SINGLE * FROM STAS WHERE STLNR = STPO-STLNR AND
              STLKN = STPO-STLKN AND
              STLAL = MAST-STLAL.
        IF SY-SUBRC EQ 0.
          CLEAR: W_DOT, W_LVL, W_LVL1.
          PERFORM WRT_DTL.
          CHILD_MATNR = STPO-IDNRK.
          W_LEVEL = W_LEVEL + 1.
          IF W_LEVEL <= S_LVL.
            PERFORM SUBCHILD.
          ENDIF.
          W_LEVEL = W_LEVEL - 1.
        ENDIF.
      ENDSELECT.
    ENDFORM.
    get grand children parts
    FORM SUBCHILD.
      SELECT SINGLE * FROM MAST WHERE MATNR = CHILD_MATNR
         AND WERKS = CHILD_WERKS.
      IF SY-SUBRC NE 0.
        EXIT.
      ENDIF.
      SELECT * FROM STPO WHERE STLNR = MAST-STLNR.
        SELECT SINGLE * FROM STKO WHERE STLNR = STPO-STLNR AND
          STLAL = MAST-STLAL.
        SELECT SINGLE * FROM STAS WHERE STLNR = STPO-STLNR AND
            STLKN = STPO-STLKN AND
            STLAL = STKO-STLAL.
          IF SY-SUBRC EQ 0.
            W_DOT = '.'.
            PERFORM WRT_DTL.
            CHILD_MATNR = STPO-IDNRK.
            W_LEVEL = W_LEVEL + 1.
            IF W_LEVEL <= S_LVL.
              PERFORM SUBCHILD.
            ENDIF.
            W_LEVEL = W_LEVEL - 1.
            SHIFT W_LVL.
          ENDIF.
        ENDSELECT.
    ENDFORM.
    TOP-OF-PAGE.
    WRITE:/ SY-DATUM,SY-UZEIT,
           85 'ABC PTE LTD',
          182 'Page', SY-PAGNO.
    WRITE: / SY-REPID,
             75 'BOM STRUCTURE  (WITH LOCATION BALANCES)',
             182 SY-UNAME.
    SKIP.
    CLEAR W_LFLAG.
    *WRITE:/ 'Material No.:', PARENT_MATNR,
           'Division No.:', SPART,
           60 'Plant    :', MAST-WERKS.
    W_COL = 90.
    CLEAR W_TTL.
    **LOOP AT INT1.
    IF W_COL > 195.
       IF W_LFLAG IS INITIAL.
         WRITE:/ 'Description :', W_MAKTX,
              60 'Base Qty :', S_BASE LEFT-JUSTIFIED.
         W_LFLAG = 'X'.
         W_COL = 90.
       ELSE.
         W_COL = 90.
         SKIP.
       ENDIF.
    ENDIF.
    WRITE AT W_COL 'Loc :'.
    W_COL = W_COL + 6.
    WRITE AT W_COL INT1-LGORT.
    W_COL = W_COL + 7.
    WRITE AT W_COL(12) INT1-LABST LEFT-JUSTIFIED.
    W_COL = W_COL + 16.
    W_TTL = W_TTL + INT1-LABST.
    **ENDLOOP.
    **IF W_LFLAG IS INITIAL.
    WRITE:/ 'Description :', W_MAKTX,
          60 'Base Qty :', S_BASE LEFT-JUSTIFIED,
          90 'Total :', W_TTL LEFT-JUSTIFIED.
    **ELSE.
    WRITE AT W_COL 'Total :'.
    W_COL = W_COL + 8.
    WRITE AT W_COL W_TTL LEFT-JUSTIFIED.
    **ENDIF.
    **SKIP.
    **ULINE.
    'Level',
    WRITE: /001 'Material No',
            011 'Item',
            017 'Component',
            037 'Description',
            079 '    Per',
            089 'UOM',
            094 ' Std Price',
            106 'Moving Avg',
            119 'Location',
            128 ' Balance',
            139 'Location',
            148 ' Balance',
            159 'Location',
            168 ' Balance',
            179 'Total Quantity'.
    ULINE.
    FORM WRT_DTL.
      CLEAR: MAKT-MAKTX, W_MAV, W_STD.
      SELECT SINGLE * FROM MAKT WHERE MATNR = STPO-IDNRK AND
           SPRAS = 'E'.
    SELECT SINGLE * FROM MBEW WHERE MATNR = STPO-IDNRK AND
          BWKEY = MAST-WERKS.
    IF SY-SUBRC = 0.
       W_MAV = MBEW-VERPR / MBEW-PEINH.
       W_STD = MBEW-STPRS / MBEW-PEINH.
    ENDIF.
    W_MENGE = ( STPO-MENGE / STKO-BMENG ) * S_BASE.
    W_LVL2 = W_LEVEL.
      CONCATENATE W_DOT W_LVL INTO W_LVL.
      CONCATENATE W_LVL W_LVL2 INTO W_LVL1.
    *001 PARENT_MATNR
      WRITE: /001 PARENT_MATNR,
             /011 STPO-POSNR,
              017 STPO-IDNRK,
              037 MAKT-MAKTX,
              079 SPART.
             079(8) W_MENGE,
             089 STPO-MEINS,
             094(10) W_STD,
             106(10) W_MAV.
    W_COL = 119.
    CLEAR W_TTL.
    SELECT * FROM MARD WHERE MATNR = STPO-IDNRK AND
          WERKS = MAST-WERKS AND
          LABST NE 0.
       IF W_COL > 166.
         W_COL = 119.
         WRITE AT /W_COL ' '.
       ENDIF.
       WRITE AT W_COL MARD-LGORT.
       W_COL = W_COL + 5.
       WRITE AT W_COL(13) MARD-LABST.
       W_COL = W_COL + 15.
       W_TTL = W_TTL + MARD-LABST.
    ENDSELECT.
    IF X_MSLB EQ 'X'.
       SELECT * FROM MSLB WHERE MATNR = STPO-IDNRK AND
            WERKS = MAST-WERKS AND
            LBLAB NE 0.
         IF W_COL > 166.
           W_COL = 119.
           WRITE AT /W_COL ' '.
         ENDIF.
         WRITE AT W_COL(6) MSLB-LIFNR.
         W_COL = W_COL + 6.
         WRITE AT W_COL(12) MSLB-LBLAB.
         W_COL = W_COL + 14.
         W_TTL = W_TTL + MSLB-LBLAB.
       ENDSELECT.
    ENDIF.
    WRITE AT 179(15) W_TTL.
    ENDFORM.
    Edited by: ric .s on Jan 21, 2008 10:19 AM

    Hi,
    Use these two function modules to explore the BOM.
    CSAP_MAT_BOM_READ or
    CS_BOM_EXPL_MAT_V2
    The second one is more appropriate.
    You dont have to write much code in your case.
    Pass appropriate data into the FM and get the BOm exploded and you can just loop the interbal table and display it accordingly.
    Reward points if useful.
    Thanks,
    Arul.

Maybe you are looking for