Skip to Content
author's profile photo Former Member
Former Member

Report

Anyone please send the code to prepare the report :purchase order release report to display open puchase orders and select puchase order take the selection to release transaction ME28 with authorization.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 18, 2008 at 05:38 PM

    Hi ,

    I am not sure what exactly you are looking for. But the below code will display the open purchase orders by buyer.

    Could you please provide some more details, it would be helpfull.

    REPORT ZAMSO05 LINE-SIZE 242 MESSAGE-ID Z8 NO STANDARD PAGE HEADING.

    *----


    *--


    tables declaration--


    TABLES: EKKO, " Purchasing Document Header

    EKPO, " Purchasing Document Item

    EKET, " Delivery Schedules

    EKBE, " History of Purchasing Document

    MARA, " Material Master: General Data

    T156. " Movement Type

    *----


    DATA TREC TYPE I.

    DATA TOTREC TYPE I.

    DATA TOT_QTY_REC LIKE EKBE-MENGE.

    *--


    internal tables start--


    DATA: BEGIN OF T_EKKO OCCURS 0,

    EBELN LIKE EKKO-EBELN, " Purchasing document number

    WAERS LIKE EKKO-WAERS, " Currency key

    LIFNR LIKE EKKO-LIFNR, " Vendor's account number

    BSART LIKE EKKO-BSART, " Purchasing Document Type

    END OF T_EKKO.

    DATA: BEGIN OF T_EKPO OCCURS 0,

    EBELN LIKE EKPO-EBELN,

    EBELP LIKE EKPO-EBELP, " Item number of purchasing doc.

    NETPR LIKE EKPO-NETPR, " Net price in purchasing docume

    BPRME LIKE EKPO-BPRME, " Order price unit (purchasing)

    MATNR LIKE EKPO-MATNR, " Material

    MENGE LIKE EKPO-MENGE, " Purchase order quantity

    TXZ01 LIKE EKPO-TXZ01, " description

    MATKL LIKE EKPO-MATKL, " Material group

    TOT_QTY_REC LIKE EKPO-MENGE, " Purchase order quantity

    EINDT LIKE EKET-EINDT, " Item delivery date

    RATIO TYPE P DECIMALS 2,

    END OF T_EKPO.

    *--


    internal tables end--


    *--


    selection screen--


    SELECTION-SCREEN BEGIN OF BLOCK ONE WITH FRAME .

    SELECTION-SCREEN COMMENT 10(69) TEXT-004.

    SELECT-OPTIONS: ELIFNR FOR EKKO-LIFNR.

    SELECTION-SCREEN END OF BLOCK ONE.

    ----


    • main program starts...............

    ----


    SY-TVAR1 = SY-REPID.

    • Sy-sysid : Name of SAP R/3 System

    SY-TVAR2 = SY-SYSID.

    PERFORM AUTHORITY-CHECK.

    TOP-OF-PAGE.

    PERFORM TOP_PAGE.

    ----


    START-OF-SELECTION.

    ----


    SELECT * FROM EKKO WHERE LIFNR IN ELIFNR.

    CLEAR: TREC.

    MOVE-CORRESPONDING EKKO TO T_EKKO.

    SELECT * FROM EKPO WHERE EBELN EQ EKKO-EBELN.

    CLEAR TOT_QTY_REC.

    MOVE-CORRESPONDING EKPO TO T_EKPO.

    SELECT SINGLE * FROM EKET WHERE EBELN = EKPO-EBELN

    AND EBELP = EKPO-EBELP.

    MOVE EKET-EINDT TO T_EKPO-EINDT.

    ----


    • select * from mara where matnr = ekpo-matnr.

    • t_ekpo-matnr = mara-matnr.

    • append t_mara.

    • endselect.

    ----


    SELECT * FROM EKBE WHERE EBELN EQ EKPO-EBELN

    AND EBELP EQ EKPO-EBELP.

    • if movement type (bwart) = 101 then

    CHECK EKBE-BWART <> SPACE.

    SELECT SINGLE * FROM T156 WHERE BWART = EKBE-BWART.

    IF T156-SHKZG = 'S'. "SHKZG : Debit/Credit Indicator(INCOMMING)

    • BPMNG = Quantity in purchase order price unit

    TOT_QTY_REC = TOT_QTY_REC + EKBE-BPMNG.

    ELSEIF T156-SHKZG = 'H'. "UTGOING

    TOT_QTY_REC = TOT_QTY_REC - EKBE-BPMNG.

    ENDIF.

    ENDSELECT.

    IF TOT_QTY_REC < T_EKPO-MENGE.

    T_EKPO-RATIO = TOT_QTY_REC / T_EKPO-MENGE * 100.

    T_EKPO-TOT_QTY_REC = TOT_QTY_REC.

    APPEND T_EKPO.

    ELSE.

    CLEAR T_EKPO.

    ENDIF.

    ENDSELECT.

    DESCRIBE TABLE T_EKPO LINES TREC.

    IF TREC = 0.

    CLEAR T_EKKO.

    ELSE.

    APPEND T_EKKO.

    ENDIF.

    ENDSELECT.

    ----


    SORT T_EKKO BY LIFNR.

    ----


    DESCRIBE TABLE T_EKKO LINES TOTREC.

    IF TOTREC > 0.

    • perform page_header.

    ELSE.

    • IF THERE ARE NO OPEN PURCHASE ORDER THEN.....

    *----


    CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'

    EXPORTING

    TITEL = 'OPEN PURCHASE ORDERS '

    TEXTLINE1 = 'THERE ARE NO OPEN PURCHASE ORDER'

    TEXTLINE2 = 'FOR THE SELECTED VENDOR'

    EXCEPTIONS

    OTHERS = 1.

    *----


    ENDIF.

    LOOP AT T_EKKO.

    *if sy-pagno > 1.

    • at first.

    • perform purchase_header.

    • endat.

    WRITE: /7 T_EKKO-EBELN,

    28 T_EKKO-WAERS,

    56 T_EKKO-BSART.

    LOOP AT T_EKPO WHERE EBELN = T_EKKO-EBELN.

    WRITE: 19 T_EKPO-EBELP,

    40 T_EKPO-MATKL,

    68 T_EKPO-MATNR,

    86 T_EKPO-TXZ01,

    128 T_EKPO-EINDT,

    144 T_EKPO-NETPR,

    160 T_EKPO-BPRME,

    166 T_EKPO-MENGE,

    185 T_EKPO-TOT_QTY_REC,

    223 T_EKPO-RATIO.

    ENDLOOP.

    ENDLOOP.

    &----


    *& Form PURCHASE_HEADER

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    **FORM PURCHASE_HEADER.

      • ULINE.

      • WRITE:/ 'VENDOR NO = ', T_EKKO-LIFNR.

      • ULINE.

      • WRITE: /7 'ORDERNO',

      • 19 'ITEM NO',

      • 28 'CURRENCY',

      • 40 'MATERIAL GROUP',

      • 56 'ORDER TYPE',

      • 68 'MATERIAL NO',

      • 86 'DESRIPTION',

      • 128 'SHIPMENT DATE',

      • 144 'UNIT PRICE',

      • 160 'UNIT'(010),

      • 166 'QTY ORDERED',

      • 185 'QTY RECEIVED',

      • 204 'QTY BILLED',

      • 223 '%RECIEVED'.

      **

        • WRITE: 67 SY-VLINE, 165 SY-VLINE,

        • 18 SY-VLINE, 85 SY-VLINE, 184 SY-VLINE,

        • 27 SY-VLINE, 127 SY-VLINE, 203 SY-VLINE,

        • 39 SY-VLINE, 143 SY-VLINE, 222 SY-VLINE,

        • 55 SY-VLINE, 159 SY-VLINE,

        • 6 SY-VLINE.

        • ULINE.

        **ENDFORM. " PURCHASE_HEADER

        &----


        *& Form PAGE_HEADER

        &----


        • text

        ----


        • --> p1 text

        • <-- p2 text

        ----


        FORM PAGE_HEADER.

        WRITE:/35 'OPEN PURCHASE ORDERS BY BUYER.' ,

        95 'Page' , SY-PAGNO .

        WRITE:/1 'Report Name' , SY-REPID ,

        90 'Date', SY-DATUM .

        WRITE:/1 'User Name' , SY-UNAME ,

        90 'Time' , SY-UZEIT .

        ULINE.

        ENDFORM. " PAGE_HEADER

        &----


        *& Form AUTHORITY-CHECK

        &----


        • text

        ----


        • --> p1 text

        • <-- p2 text

        ----


        FORM AUTHORITY-CHECK.

        AUTHORITY-CHECK OBJECT 'M_INFO_MCD'

        ID 'ACTVT' FIELD '02'

        ID 'GSTRU' FIELD 'S901'

        ID 'VRSIO' DUMMY

        ID 'SSOUR' DUMMY.

        IF NOT SY-SUBRC IS INITIAL.

        MESSAGE E085 WITH SY-REPID.

        ENDIF.

        ENDFORM. " AUTHORITY-CHECK

        &----


        *& Form TOP_PAGE_WRITTING

        &----


        • text

        ----


        • --> p1 text

        • <-- p2 text

        ----


        FORM TOP_PAGE.

        WRITE:/20 'OPEN PURCHASE ORDER BY BUYER.' ,

        65 'Page' , SY-PAGNO .

        WRITE:/1 'Report Name' , SY-REPID ,

        60 'Date', SY-DATUM .

        WRITE:/1 'User Name' , SY-UNAME ,

        60 'Time' , SY-UZEIT .

        ULINE.

        WRITE:/ 'VENDOR NO = ', T_EKKO-LIFNR.

        ULINE.

        WRITE: /7 'ORDERNO',

        19 'ITEM NO',

        28 'CURRENCY',

        40 'MATERIAL GROUP',

        56 'ORDER TYPE',

        68 'MATERIAL NO',

        86 'DESRIPTION',

        128 'SHIPMENT DATE',

        144 'UNIT PRICE',

        160 'UNIT'(010),

        166 'QTY ORDERED',

        185 'QTY RECEIVED',

        204 'QTY BILLED',

        223 '%RECIEVED'.

        • 235 'STATUS'.

        WRITE: 67 SY-VLINE, 165 SY-VLINE,

        18 SY-VLINE, 85 SY-VLINE, 184 SY-VLINE,

        27 SY-VLINE, 127 SY-VLINE, 203 SY-VLINE,

        39 SY-VLINE, 143 SY-VLINE, 222 SY-VLINE,

        55 SY-VLINE, 159 SY-VLINE,

        6 SY-VLINE.

        ULINE.

        ENDFORM. " TOP_PAGE_WRITTING

        Add a comment
        10|10000 characters needed characters exceeded

      • author's profile photo Former Member
        Former Member
        Posted on Jul 24, 2008 at 11:23 AM

        thanks to all

        Add a comment
        10|10000 characters needed characters exceeded

      Before answering

      You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
      You must be Logged in to submit an answer.

      Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.