Regarding Report on purchase order purchase requesition and GRN  No.

Dear All,
              I am creating ALV report in which. I want all  purchase order (EBELN), their respetive Purchase Requesition(BANFN)
              And GRN No(MBLNR)., if they are created. But all purchase order should be displayed evenif their GRN have not been
             made. GRN only haveing movement type 101 and 102. i.e. of 50 series and not 49 series.
                              i want tlike this
  For Ex:-
                      EBELN           BANFN          MBLNR
                  45000223       1000223       5000080
                  45000245                            5000056
                 45000676
                 45000848     .

Hi,
1. Fetch all the Purchase Orders from EKKO
2. Fetch Purchase Req from EBAN for all entries in above selected internal table where EBELN = EKKO-EBELN
3. Fetch GR info from EKBE for all entries in first selected internal table where EBELN = EKKO-EBELN and VGABE = '1'. (this indicates GR for a PO) and BWART in ('101', '102').
4.
Loop through EKKO.      
        T_FINAL-EBELN = EKKO-EBELN.
        Read EBAN with key EBELN = EKKO-EBELN.
        T_FINAL-BANFN = EBAN-BANFN.   
        Loop through EKBE where EBELN = EKKO-EBELN. (there can be multiple docs for a single PO)
             T_FINAL-MBLNR = EKBE-MBLNR.           
             Append T_FINAL.
        Endloop.
        If SY-SUBRC is not equal to 0. (If no GR happend, control will not go to EKBE loop, still you need to display it in ALV)
            Append T_FINAL.
       Endif.
    Endloop.
5. Display the contents of T_FINAL in ALV.
Hope this helps you !!!
Regards,
Ganga

Similar Messages

  • Class for Purchase order item components and Production order components

    I'm looking for a some classes.   I'm very new to objects, so I could be searching for them incorrectly.
    The first class I'm looking for is a purchase order class that contains the item components.  I've looked at CL_PO_ITEM_HANDLE_MM and CL_PO_HEADER_HANDLE_MM.  I couldn't find components as a part of either of the classes.
    The second one I'm looking for is not as critical.  It is for the components for a production order.   I have a function module: BAPI_PRODORD_GET_DETAIL that gets the components for the order.  However, to take advantage of objects - I read somewhere - that if possible I should avoid calling a function module.
    Any help that you could give would be greatly appreciated.
    Thank you!
    Michelle

    Hello Michelle
    I do not think there are already classes available on ERP 6.0 for reading production order (yet I might be wrong...). However, regarding purchase order you are already on the right track.
    *& Report  ZUS_SDN_OO_READ_PO
    *& Thread: Class for Purchase order item components and Production order components
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1206523"></a>
    "& NOTE: Coding adapted from BAPI_PO_GETDETAIL1
    REPORT  zus_sdn_oo_read_po.
    TYPE-POOLS: abap, mmpur.
    PARAMETER:
      p_ebeln   TYPE ebeln  DEFAULT '3000000045'.
    DATA: gs_document    TYPE mepo_document,
          go_po          TYPE REF TO cl_po_header_handle_mm,
          gs_header      TYPE mepoheader,
          gd_tcode       TYPE sy-tcode,
          gd_result      TYPE mmpur_bool.
    data: gt_items       type PURCHASE_ORDER_ITEMS,
          gs_itm         type PURCHASE_ORDER_ITEM,
          gs_item        type mepoitem.
    START-OF-SELECTION.
    *  prepare creation of PO instance
      gs_document-doc_type    = 'F'.
      gs_document-process     = mmpur_po_process.
      gs_document-trtyp       = 'A'.  " anz.  => display
      gs_document-doc_key(10) = p_ebeln.
    *  object creation and initialization
    **  l_ebeln = purchaseorder.
      CREATE OBJECT go_po.
      CALL METHOD go_po->po_initialize( im_document = gs_document ).
      CALL METHOD go_po->set_po_number( im_po_number = p_ebeln ).
      CALL METHOD go_po->set_state( cl_po_header_handle_mm=>c_available ).
    *  read purchase order from database
      gd_tcode = 'ME23N'.
      CALL METHOD go_po->po_read
        EXPORTING
          im_tcode     = gd_tcode
          im_trtyp     = gs_document-trtyp
          im_aktyp     = gs_document-trtyp
          im_po_number = p_ebeln
          im_document  = gs_document
        IMPORTING
          ex_result    = gd_result.
    *  there was a problem in reading the PO
      IF ( gd_result EQ mmpur_no ).
    **    l_messages = l_handler->get_list_for_bapi( ).
    **    PERFORM return TABLES l_messages return
    **                          poitem poschedule poaccount.
    **    CALL METHOD l_po->po_close( ).
      ELSE.
        gs_header = go_po->if_purchase_order_mm~get_data( ).
        WRITE: / gs_header-ebeln,
                 gs_header-bukrs,
                 gs_header-bsart,
                 gs_header-lifnr.
      ENDIF.
      gt_items = go_po->if_purchase_order_mm~get_items( ).
      LOOP AT gt_items INTO gs_itm.
        gs_item = gs_itm-item->get_data( ).
        write: / gs_item-ebelp,
                 gs_item-matnr,
                 gs_item-menge.
      ENDLOOP.
    END-OF-SELECTION.
    Regards
      Uwe

  • SRM: "Purchase Order Change Approval " and "Invoice Approval"

    Hi,
    I would like to know the availability and details of the backend services for "Purchase Order Change Approval " and "Invoice Approval".
    Any pointers ?
    regards
    Sachin

    I want to know what are the Backend services exposed for the following processes :
    Purchase Order Change Approval in MM
    and Invoice Approval.

  • Purchase order print priview and spool print output are different.

    Hi Friends,
    there is problem with purchase order print priview and spool print output are different.
    mean : in me23n .. for a perticular po .. in po priview the TAX VALUES value is 120 coming..
    when i am giving print with spool.. the amount value is showing  TAX VALUE
    is 443..why it is showing wrong..
    this is for perticular output type.
    why TAX VALUES are showing different in print view and
    spool print.
    help me.
    regards,

    Hi Neil,
    thanks for your reply.
    but the valiadtions are happening in standard functional module PRICING.
    it is realted script(medruck)...but there is no code point for spool or printer side..
    and the issue is realted one PO OUTPUT TYPE..
    it is sap standard debugging... when i am debugging the functional module PRICING.
    the values are coming dynammically.
    help me.
    regards,

  • Internal Order - Purchase Order -Purchase Requisition

    Hi,
    Can anyone please help me out with understanding how costs are posted to an internal order from Purchase Order/Purchase Requsition?  How to make commitments via PO/PR? And how is it settled onto an asset?
    Sorry its too much to ask. If anyone can guide me to a document explaining this online somewhere.
    Thanks,
    M

    Hi,
    Whenever you assign your PO/PR items to be issued on internal order, you will see the posting on it. You will have to activate commitment management in CO (OKKP). After the GR/IR process is done, and the cost are on I/O, you can settle it to an asset. In order to do so, you have to define a settlement profile for order type, create a settlement rule in the order (KO02) and run the settlement (KO88/KO8G).
    Regards,
    Eli

  • Purchase Order (Purchase docuement type wise)

    Dear,
    We would like to Restrict Purchase order creation without purchase requisition based on various type of Purchase order (Purchase document type wise).
    A user can create some purchase order with purchase requisition as mandatory.
    Some purchase order with purchase requisition as optional.
    Please Suggest,
    Best Regards,
    Swapnil Vaidya

    After making pr field mandatory
    Go to OMET
    create functional Authorization Z
    only click Refrence to pr , Enter your field selection
    Then assign it to user
    parameter EFB -value z
    Vipin

  • How to deal with purchase order purchased with sale order

    Hi,
    I know we can produce with sale order, and the finished products can be priced in their own sale order and line item even when the  finished product master data is set 'S' in its price control field. But how to deal with purchase order purchased with sale order if its price control is 'S' and the purchased material can be priced differently with its own sale order?
    thanks.

    Hi,
    That is to say, we want to get these results:
    1. material purchased must match its sale order and its item
    2. the purchased material  is valued by sale order and its item when it is put into the stock.
    3.  the purchased material is set "valued by standard price' in its material master data.
    How to practice?
    Thanks.

  • Report on Purchase order header changes and Line item changes.

    Gurus
    All changes which has been done in Purchase order can be seen in enviroment----Header changes Or Item changes for a particular PO.
    Now end user want to see the changes made in all the purchase orders for a particular project in specified date range.
    Suppose there are total 100 POs placed in one month for a particular project. End user want to see the changes MADE (IF ANY) in above POs
    Is there any standard report is available to this effect OR it is z development
    Atul

    HI ,
    This report can easily be written useing the tables EKKO and EKPO
    First get the PO's created in that date range.
    From there get the change document numbers with this extarct the date from CDHDR and CDPOS tables.
    regards,
    Lalita

  • Purchase order smart forms and scripts

    i need to create a smart form and script in simple purchase order there is no requirements has given to me, can any one tell me in detail how i need to do and what are the procedures i need to follow, example code will be usefull and steps to build it.

    Hi,
    Go through the links mentioned below.
    http://www.****************/Tutorials/Smartforms/SFMain.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
    http://www.sapmaterial.com/smartform_example.html
    Re: Hands on SAP Smart Forms
    smartforms
    A Simple Smartform Tutorial
    SAP Smartforms can be used for creating and maintaining forms for mass printing in SAP Systems. The output medium for Smartforms support printer, fax, e-mail, or the Internet (by using the generated XML output).
    According to SAP, you need neither have any programming knowledge nor use a Script language to adapt standard forms. However, basic ABAP programming skills are required only in special cases (for example, to call a function module you created or for complex and extensive conditions).
    1. Create a new smartforms
    Transaction code SMARTFORMS
    Create new smartforms call ZSMART
    2. Define looping process for internal table
    Pages and windows
    First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
    Here, you can specify your title and page numbering
    &SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
    Main windows -> TABLE -> DATA
    In the Loop section, tick Internal table and fill in
    ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
    3. Define table in smartforms
    Global settings :
    Form interface
    Variable name Type assignment Reference type
    ITAB1 TYPE Table Structure
    Global definitions
    Variable name Type assignment Reference type
    ITAB2 TYPE Table Structure
    4. To display the data in the form
    Make used of the Table Painter and declare the Line Type in Tabstrips Table
    e.g. HD_GEN for printing header details,
    IT_GEN for printing data details.
    You have to specify the Line Type in your Text elements in the Tabstrips Output options.
    Tick the New Line and specify the Line Type for outputting the data.
    Declare your output fields in Text elements
    Tabstrips - Output Options
    For different fonts use this Style : IDWTCERTSTYLE
    For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
    5. Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
    http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
    INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
    MOVE-CORRESPONDING MKPF TO INT_MKPF.
    APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSMARTFORM'
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    if sy-subrc <> 0.
    WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function FM_NAME
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    GS_MKPF = INT_MKPF
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5.
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Additional Fonts for your SMARTFORMS
    You can create additional fonts and style with transaction SMARTSTYLES
    This can then be define in the paragraph and character formats, which you can then be assign to texts and fields in the Smart Form.
    The character formats includes effects such as superscript, subscript, barcode and font attributes.
    Also, you can refer to the below link for the explanation:
    http://help.sap.com/saphelp_46c/helpdata/en/4b/83fb42df8f11d3969700a0c930660b/frameset.htm
    Reward if helpful.
    Regards,
    Harini.S

  • Table For Purchase Order Version Number and Version Created Date

    Dear Sir,
    Whenever we make any change in Purchase Order , then a new Version Number  along with Created Date is assigned . In Me23n the Version Number and It's Created date is also displayed ( at PO Header Level) .
    We request you to kindly guide us as which Table is required to be reffered to get the Version Number and Version Created date  for the Purchase Order .
    With Thanks and Rgds
    Sonia

    Hi
    Check in EKKO - Purchase order header
    EKPO - Purchase order item
    CDHDR
    CHPOS
    Regards
    Ram
    Edited by: Parasuram M on Sep 16, 2009 11:59 AM

  • Purchase Order Release Strategy and SAP user RelationShip

    Hi,
    We are currently developing a work flow to streamline PO release in our company . What we want to achieve is that
    E.g
    A purchase order 100001 is creates and a release strategy s1 is applied to it which is a 3 level relase statrgy having release code c1,c2,c3 which are uniquely assigned to user/employee of the company and no 2 users'employee can have the same release code.
    Now when c1 release the purchase order a work item should be created to for the user/employee who is assigned the c2 code.
    Currently this workflow is not implemented in our company adn the relase stategy is handeled by authorization oobjects and when ever a po user relase the po he calls up the other persona next in relase strategy to notify him about the work he has to do .
    I am need to know can we develop a relationship b/w the release code and sap user or employee
    Regards
    Kamran ellahi

    Hi,
    We are currently developing a work flow to streamline PO release in our company . What we want to achieve is that
    E.g
    A purchase order 100001 is creates and a release strategy s1 is applied to it which is a 3 level relase statrgy having release code c1,c2,c3 which are uniquely assigned to user/employee of the company and no 2 users'employee can have the same release code.
    Now when c1 release the purchase order a work item should be created to for the user/employee who is assigned the c2 code.
    Currently this workflow is not implemented in our company adn the relase stategy is handeled by authorization oobjects and when ever a po user relase the po he calls up the other persona next in relase strategy to notify him about the work he has to do .
    I am need to know can we develop a relationship b/w the release code and sap user or employee
    Regards
    Kamran ellahi

  • Purchase order price variance and quantity variance

    Hi All ,
         I am working on a report development where we need price change , value change and quantity change in the report along with net value (ekpo-netwr) .
        Can anybody suggest me tables  in ECC where the changes (price,quantity and total value ) are captured ??? and if there is any BI content datasource which can satisfy this requirement.

    Hi All ,
         I am working on a report development where we need price change , value change and quantity change in purchase order in  the report along with net value (ekpo-netwr)
        Can anybody suggest me tables  in ECC where the changes (price,quantity and total value ) are captured ??? and if there is any BI content datasource which can satisfy this requirement.

  • Purchase Order Document Type and Account Assignment

    Hi  ,
    We have a requirement to control Account Assignment in Purchase Order Item line based on the Document type selected on the Purchase Order header.
    Like if user selects Purchase Order document type "ZNB" (Customized created) , then he will only able to select "K" or Blank or "P" as account assignment and similary we want to limit other Account assignments based on the Purchase Document type.
    How can we make this Control settings?
    Regards
    Shrey

    Hi,
    You can't really limit the account assignment categories per document type, at least not directly.
    You can limit the item categories that can be used for a document type via configuration:
    Materials Management > Purchasing > Purchase Order > Define Document Types
    Within this transaction you can define which item categories are valid for a specific document type.
    You can then define which account assignment categories are valid for each item category
    Materials Management > Purchasing > Account Assignment > Define Combination of Item Categories/Account Assignment Categories
    BUT
    limiting the account assignment categories that are valid for an item category will affect ALL purchase order document types that this item category is valid for. And you can't create your own item categories as this is a SAP standard table that can NOT be altered.
    Regards,
    Monika

  • Assigning customised purchase order driver program and form ?

    Hi ,
    I have a created my own driver program  and form form for purchase order.........after developing where should i assign it..
    i tried in nace but im getting the following error :
    Processing routine ENTRY_NEU in program ZSK_PO does not exist.
    wats the error i have made ?
    thanks,
    Siva.

    Hi
    You have to attach in the NACE itself. Check IF your program is activated and did you use:
    Form ENTRY_NEU.
    "all your code should be here.
    ENdform.
    IN your program??
    Regards,
    VIshwa.
    Edited by: Vishwa Sri Hari on Oct 22, 2008 4:18 PM

  • IDOC Types for Purchase Orders, Vendor Master and Goods Receipt

    Hello All,
    Can any have idea about the IDOC Types that can be used for triggering when the actions creation/change/deletion on Purchase Orders or Vendor Master or Goods Receipt is performed?
    Please let me know the names of IDOC Type, Process Codes, message type... and all the other required information...
    Thanks in Advance,
    Kumar.

    Hello Ferry,
    Thanks again for the IDOC Types. I have another question. Can we use those IDOC types for creating/changing/deletion of Purchase orders or Vendor Master or Goods Receipt happens? I mean can we configure in such a way that when ever there is a change or deletion of PO or VM or GR happens?
    I have got to know about the IDOC PORDCH01 which can be used for Purchase Order. Can u suggest me which can be used for PO's?
    Regards,
    Phani.
    Message was edited by:
            Sivapuram Phani Kumar

Maybe you are looking for