Regarding : Material document data and PO data do not match (Plant)

Hi Gurus,
Please go through this BAPI program.
While uploading it is giving an error ' Material document data and PO data do not match (Plant) '.
Please help regarding this issue.For all Other moment types it is working fine except this 351 moment type.
dATA: i_excel TYPE truxs_t_text_data. "work table for excel upload
DATA: BEGIN OF it_itab OCCURS 100,
      docdate(10),
      postdate(10),
      mvt_type(3), "Movement Type
      plant(4), "Plant
      lgort(4),
      pur_doc(10), "Purchase Document No
      po_item(3), "Purchase Document Item No
      material(18), "Material Number
     delnote(16),
      erfmg(13),
      uom(3),
     lfmng(13), "Quantity
      batch(10) TYPE c,
      vfdat TYPE vfdat,
      END OF it_itab.
DATA: it_goodsmvt_head TYPE TABLE OF bapi2017_gm_head_01      INITIAL SIZE 100,
      it_goodsmvt_code TYPE TABLE OF bapi2017_gm_code         INITIAL SIZE 100,
      it_goodsmvt_item TYPE TABLE OF bapi2017_gm_item_create  INITIAL SIZE 100.
DATA: wa_goodsmvt_head LIKE LINE OF it_goodsmvt_head,
      wa_goodsmvt_code LIKE LINE OF it_goodsmvt_code,
      wa_goodsmvt_item LIKE LINE OF it_goodsmvt_item.
DATA: w_mat_doc  TYPE bapi2017_gm_head_ret-mat_doc,
      w_year     TYPE bapi2017_gm_head_ret-doc_year.
DATA: BEGIN OF it_errmsg_goodsmvt OCCURS 10.
        INCLUDE STRUCTURE bapiret2.
DATA: END OF it_errmsg_goodsmvt.
DATA : obj_type LIKE bapiache09-obj_type,
       obj_key  LIKE bapiache09-obj_key,
       obj_sys  LIKE bapiache09-obj_sys.
DATA: v_date1 TYPE sy-datum.
DATA: v_date2 TYPE sy-datum.
DATA: w_lines TYPE i.
DATA: errflag.
SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-100.
PARAMETERS: p_file TYPE  rlgrap-filename.
SELECTION-SCREEN END OF BLOCK bk1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      field_name = 'P_FILE'
    IMPORTING
      file_name  = p_file.
Start-of-selection processing
START-OF-SELECTION.
  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
      i_line_header        = 'X'
      i_tab_raw_data       = i_excel
      i_filename           = p_file
    TABLES
      i_tab_converted_data = it_itab[]
    EXCEPTIONS
      conversion_failed    = 1
      OTHERS               = 2.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
  LOOP AT it_itab.
    REFRESH it_goodsmvt_head.
    REFRESH it_goodsmvt_item.
    CONCATENATE it_itab-docdate6(4) it_itab-docdate3(2) it_itab-docdate+0(2) INTO v_date1.
    CONCATENATE it_itab-postdate6(4) it_itab-postdate3(2) it_itab-postdate+0(2) INTO v_date2.
    wa_goodsmvt_head-pstng_date = v_date2.
    wa_goodsmvt_head-doc_date   = v_date1.
   wa_goodsmvt_head-ref_doc_no = it_itab-delnote.
wa_goodsmvt_head-pr_uname   = sy-uname.
    APPEND wa_goodsmvt_head TO it_goodsmvt_head.
Maintain it_goodsmvt_code
    wa_goodsmvt_code-gm_code    = '04'.
Maintain it_goodsmvt_item
*LOOP AT it_itab.
IF wa_goodsmvt_item-po_number IS INITIAL.
    wa_goodsmvt_item-po_number    = it_itab-pur_doc.
    wa_goodsmvt_item-move_type    = it_itab-mvt_type.
    wa_goodsmvt_item-MOVE_PLANT      = it_itab-plant.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = it_itab-material
      IMPORTING
        output = it_itab-material.
    wa_goodsmvt_item-material     = it_itab-material.
    wa_goodsmvt_item-stge_loc     = it_itab-lgort.
    wa_goodsmvt_item-po_item      = it_itab-po_item.
    wa_goodsmvt_item-entry_qnt    = it_itab-erfmg.
    wa_goodsmvt_item-ENTRY_UOM_ISO    = it_itab-uom.
   wa_goodsmvt_item-po_pr_qnt    = it_itab-lfmng.
    wa_goodsmvt_item-batch        = it_itab-batch.
    wa_goodsmvt_item-expirydate   = it_itab-vfdat.
   wa_goodsmvt_item-NO_MORE_GR   = 'X'.
    wa_goodsmvt_item-mvt_ind      = 'B'.
    APPEND wa_goodsmvt_item TO it_goodsmvt_item.
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
      EXPORTING
        goodsmvt_header  = wa_goodsmvt_head
        goodsmvt_code    = wa_goodsmvt_code
      IMPORTING
        materialdocument = w_mat_doc
      TABLES
        goodsmvt_item    = it_goodsmvt_item
        return           = it_errmsg_goodsmvt.
Process of commit work
    IF it_goodsmvt_head[] IS NOT INITIAL.
      DESCRIBE TABLE it_goodsmvt_head LINES w_lines.
    ENDIF.
    IF it_goodsmvt_item[] IS NOT INITIAL.
      DESCRIBE TABLE it_goodsmvt_item LINES w_lines.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    IMPORTING
    RETURN        =
      CLEAR errflag.
      READ TABLE it_errmsg_goodsmvt INDEX 1.
      IF it_errmsg_goodsmvt-type EQ 'E'.
        WRITE:/'Error in function', it_errmsg_goodsmvt-message.
        errflag = 'X'.
      ELSE.
        WRITE:/ it_errmsg_goodsmvt-message.
      ENDIF.
      IF errflag IS INITIAL.
        COMMIT WORK AND WAIT.
        IF sy-subrc NE 0.
          WRITE:/ 'Error in updating'.
          EXIT.
        ELSE.
          WRITE:/ 'Material Document created successfully and the Document Number for the Material',
                  wa_goodsmvt_item-material,'is:', w_mat_doc, w_year.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.

Hey,
Just wanted to post that in my case this was the error of MVT_IND field in item table. When I made it from 'B' to blank then it worked.
Mine is solved....
Thanks

Similar Messages

  • Billing Document and Material Document number and Date (Goods Issue)

    Dear Experts,
    Is there a way I can find the relationship between a billing document and a material document number and Goods issue date?
    Thanks

    Hi Abid
    Is there a way I can find the relationship between a billing document and a material document number and Goods issue date?
    You have to follow the flow from the billing document to the material document. This will only work if the billing document comes from a delivery note.
    Billing document => Delivery
    LIPS-VBELN = VBRP-VGBEL
    and LIPS-POSNR-VBRP-VGPOS
    So you have LIPS + LIKP with the LIKP-WADAT_IST as the goods issue date.
    Delivery => Material Document Number
    You can use the table VBFA with the delivery item as the preceding document number (VBFA-VBELV) and item (VBFA-POSNV) ; you will also have to define the preceding document type as J (delivery) and the document category of subsequent document as R (material document).
    Because in SAP nothing is simple, there might more than one material document, because the goods issue (601) movement might have been canceled and issue again. So you will have to decide what to do in that case.
    Best Regards,
    Franck

  • Status 51 material document data and po data do not match(vendor)

    i am using we19 to try an inbound idoc mbgmcr(receipt for po)
    i put in gm_code 01
    movement indicator B(goods receipt for po)
    vendor 3815
    PO 4500015241
    PO Order Item 00030
    Movement type 101
    qty in unit of entry  1
    iso code unit of measurement pc
    on the po screen i see the po item and qty to be delivered is 75
    when i run the inbound idoc i get
    status 51 material document data and po data do not match(vendor) but as i say on the po inquiry screen i see the po vendor item with 75 to be delivered
    what am i missing????????????????

    thank you
    i put in the leading zeros and got rid of that problem
    now i am getting status 51
    posting only possible in 2004/07 and 2004/06
    but in the posting date i use 07/02/2004  i have tried several dates in the period but get the same error
    any ideas?
    thanks you

  • Regarding Goods issue date and order date.

    Hi All,
    Could you please tell me from where we can fetch Goods issue date and Order date.
    Waiting for your reply.

    Preeti,
    Goods issue date/order date of what ?
    Goods can be issued in a number of ways, in reference to many types of documents.  In each case, the GI date and order date are found in different places.
    Please elaborate your request.
    Best Regards,
    DB49

  • Posting Date, Document Date and Due Date as same

    Hi All
    I would like to make Posing date , Document Date and Due date as same
    The movement i enter Posting date it should automatically carry the same value to Due date and Document date field . How can i make it
    Regards
    Rashid

    Dear Gordon
    Thanks, it is working for Marketing documents,
    I would like to have the same for JE and JV
    Regards
    Rashid

  • Changing document date and posting date by SE16N

    Hi All,
    an user has posted some customer documents (with tax codes) with wrong document date and posting date.
    I have to modify these data by se16n.
    In which tables I have to fill in?
    Thanks
    Gandalf

    Hi,
    It is not advisable to change the document date and posting date. Instead, try to reverse the document and post the correct one.
    Regards,
    Jigar

  • Material Staging date and Committed Date

    Deal all,
    At the outset,Wish you a very happy new year.
    As per my understanding the material staging date should always be equal to Committed date in the Delivery schedule of the PO. Also the pick date in the delivery would be the staging date of the PO.
    In which scenario, the staging date could differ to the committed date? What may be the reasons to have different staging and committed date in PO?
    Appreciate your speedy responce.
    Regards,
    Shashidhar

    it would not make much sense to have 2 fields for staging date and committed date if they should  always be equal.
    The F1 help of each field describes it already a little bit more.
    Staging date is the date by which sufficient quantities of the item must be available for picking to begin.
    Dependend on the volume that must be picked and staged it can take days to have everything in the staging area so that it can be delivered from there.
    In the customizing of shipping point you can enter days/hours needed for picking and packing.

  • Default key date, Document date and posting date needs to be changed automa

    Hi Experts,
    The user wants to create a variant for Foreign currency valuation, wherein the default key date, Doc date and Posting date needs to be changed every month automatically. Is it possible?
    Please let me know your thoughts.
    Warm regards,
    Murukan Arunachalam

    Hi
    Please follow this process.
    Only specify fields that should be changed
    Select these fields by entering an X in the checkboxes
    Enter a U in the UPDATEFLAG field
    Always specify key fields when changing the data, including in the checkboxes
    The configuration is an exception here. If this needs to be changed, you need to complete it again fully.
    Maintain quantities and dates in the schedule line data.
    1. Minimum entry:
    You must enter the order number in the SALESDOCUMENT structure.
    You must always enter key fields for changes.
    You must always specify the update indicator in the ORDER_HEADER_INX.
    2. Commit control:
    The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.

  • MIGO -- document date and posting date

    Dear all,
    When i call Tcode MIGO then by default it is picking document date and posting date as 25.8.9
    I want document date as current date.....
    guide me

    Check your System date..
    also check  u have the option in the header - seting-default values in MIGO Trxn

  • Document Date and Posting date are refelected in different ways

    Hi All
    stange thing is happening ::::
    For a perticular company code the Document Date and Posting Date is same in FBL5N but it is different in FB03 . Any clue y it is happening this ways ????
    Making me crazy ... please help.
    Thanks in advance
    Shweta Bhardwaj

    Hi,
    Pl check se16- table bkpf.
    Should be the one here.
    BLDAT is document date and
    BUDAT is posting date.
    In FBL5n / Fb03 u could do a F1 and display technical settings to ensure you compare same with same.
    Reg
    Hein

  • Diff B/W master data and transaction data

    Hi all,
    What is the main Diff B/W master data and transaction data.  give me some example ?
    Thanks in Advance
    Krish...

    hi krish,
    MASTER Data is the data that exists in the organization like employee details, material master, customer master, vendor master etc. These are generally created once.
    Master data are distributed throughout the company, they are often not standardised and often redundant. As a result it is very costly to offer efficient customer service, keep track of supply chains and make strategic decisions. With SAP Master Data Management (SAP MDM) these important business data from across the company can be brought together, harmonised and made accessible to all staff and business partners. As a key component of SAP NetWeaver, SAP MDM ensures data integrity via all IT systems.
    Regardless of the industry, companies often work with different ERP and Legacy systems. The result: the business processes are based on information about customers, partners and products which is displayed in different ways in the systems. If the data are recorded manually, there are more inconsistencies: some data sets are entered several times, others cannot be retrieved by all divisions of the company.
    As corporate applications are becoming increasingly complex and produce ever greater amounts of data, the problem is intensified further. Nevertheless, your employees must work with the inconsistent data and make decisions on this basis. The lack of standardised master data easily leads to wrong decisions, which restrict efficiency and threaten customer satisfaction and profitability.
    In a word: in order to save costs and ensure your company’s success it is necessary to consolidate master data about customers, partners and products, make them available to all employees beyond system boundaries and use attributes valid company-wide for the purpose of description.
    TRASNACTION Data - These are the business documents that you create using the master data - Purchase orders, sales orders etc
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9d/193e4045796913e10000000a1550b0/content.htm
    Regards,
    GNK.

  • Meta data,Transaction data and Master data

    Hi all,
    Could you plz make me clear exactly wht does Meta data,Transaction data and Master data mean and the differences

    Hi Ganesh,
    <b>MASTER Data</b> is the data that exists in the organization like employee details, material master, customer master, vendor master etc. These are generally created once.
    Master data are distributed throughout the company, they are often not standardised and often redundant. As a result it is very costly to offer efficient customer service, keep track of supply chains and make strategic decisions. With SAP Master Data Management (SAP MDM) these important business data from across the company can be brought together, harmonised and made accessible to all staff and business partners. As a key component of SAP NetWeaver, SAP MDM ensures data integrity via all IT systems.
    Regardless of the industry, companies often work with different ERP and Legacy systems. The result: the business processes are based on information about customers, partners and products which is displayed in different ways in the systems. If the data are recorded manually, there are more inconsistencies: some data sets are entered several times, others cannot be retrieved by all divisions of the company.
    As corporate applications are becoming increasingly complex and produce ever greater amounts of data, the problem is intensified further. Nevertheless, your employees must work with the inconsistent data and make decisions on this basis. The lack of standardised master data easily leads to wrong decisions, which restrict efficiency and threaten customer satisfaction and profitability.
    In a word: in order to save costs and ensure your company’s success it is necessary to consolidate master data about customers, partners and products, make them available to all employees beyond system boundaries and use attributes valid company-wide for the purpose of description.
    <b>TRASNACTION Data</b> - These are the business documents that you create using the master data - Purchase orders, sales orders etc
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9d/193e4045796913e10000000a1550b0/content.htm
    Regards,
    Santosh

  • Mass change of pricing date and billing date in credit memo request

    Hi,
    Can i change the billing date pricing date on credit memo request docs using MASS transaction?
    If i enter the regular sales order number it prompts me to change the value but if i enter the credit memo request doc number,the message "No data meets the selection criteria" is displayed.I also checked with IDES ,message is the same
    Is there any different way to do mass change for credit memo requests or am i missing something here.
    Please Suggest
    Thanks
    Abhilash Nayak

    Hi,
    Go to the transaction code MASS  and enter the OBJECT  TYPE as BUS2032 and enter
    It will lead you to the next screen where you can find the  Table and Field TABS
    Select the  SALES ORDER HEADER DATA  and choose the fields data and choose the fields PRICING DATE and BILLING DATE  and execute
    In the subsequent screen you can see the selection screen where you can enter all the Sales documents for which you want to change
    Key in all the documents and execute
    Now change the date as per your requirement and check the effect
    regards,
    santosh

  • Asset value date and posting date are not in same fiscal year

    Hi,
    Our business user has created an asset under an incorrect asset class, which he is trying to transfer to a new asset whcih was created under correct asset class. However system is restricting user with the error message "Asset value date and posting date are not in same fiscal year". Can you please advise me how we can proceed further with this error.
    Regards,
    Asam.

    Hi,
    To transfer one asset to another asset within a company code can be done through ABUMN only.
    While doing this transfer you have enter the document date, posting date, and value date for the transaction, but all these dates should be in same fiscal year only.
    In your case you must have been entered the dates for asset value date and posting date , and these two dates are in diff financial years.
    Please make sure that both the dates are in same FY.
    Hope this will fix your issue.
    Thanks,
    Srinu

  • Add new payment term base on sales order contract date and shipment date

    Dear Sir/Madam,
    My company need to create new payment term base on sales order's contract date and shipment date.
    the first time is 30% made in T/T within 30days from contract signed date.
    the second time is 70% made in T/T before shipment.
    I don't know how to configuration this payment term base on that both date, who can tell me ,thanks very much!
    Best Regards
    Danny Zhang

    Hi,
    You have to define the PAYMENT TERMS as per days and Percentage.
    Define the Payment terms in the transaction OBB8 and assign this payment terms in the CUSTOMER MASTER and will be copied to the SALES ORDER from the customer master
    In the MATERIAL MASTER in the SALES ORG 1 view you have to check the field CAHS DISCOUNT In the Pricing procedure you can defin the CASH DISCOUNT condition type ( in standard there are two SKTV & SKTO)
    Now process the sales order and check
    regards,

Maybe you are looking for