Problem in lsmw for purchase order (direct input)

hi friends,
i am trying to upload po using lsmw by direct input method.
only problem is it is not taking delivery date properly.
at the end error message is 'plz enter valid delivery date'.
can any one tell me why it is happning.
thanks
sonu

Check the format of your date and check the format expected.
sometimes you can have diff like YYYYMMDD, MM.DD.YYYY,...
Look at the converted data.
Hope this helps,
Erwan

Similar Messages

  • Scheduling problem in LSMW for Sales Order

    I am doing LSMW for Sales Order using the BAPI method.
    I am able to upload the item details along with their quantities also but the problem that I am now facing is the scheduling problem.I am unable to schedule the item quantities, only the last quantity passed is taken as the final quantity and the consolidated quantity is also getting ignored.
    I am using E1BPSCHDL structure, in this structure I am mapping Itm_number , req_date and req_qty(scheduled qty).....
    in the structure E1BPSCHDLX, the same fields are mapped as 'X'.
    in the structure E1BPSDITM, I am mapping the item info along with the consolidated qty(TARGET_QTY), but this is getting ignored and the last scheduled qty is taken as the final consolidated qty and the rest scheduled qty data is getting rejected.
    Please do help... I dont know why this problem is coming... tried n number of alternatives but of no hope... do try to help me
    with regards,
    Daya.

    Check the format of your date and check the format expected.
    sometimes you can have diff like YYYYMMDD, MM.DD.YYYY,...
    Look at the converted data.
    Hope this helps,
    Erwan

  • LSMW for Purchase order

    hi all
    Can anyone tell me how STYPE (Batch Input Interface Record Type) is supposed to be filled out when using program RM06EEI0.
    Thanks in advance,

    Hi Lee,
    When you use RM06EEI0 program. STYPE ,must be '1' for Header (MBEPOH-STYPE), and it must be '2' for Items (MBEPOI-STYPE). Otherwise you will get this error MV 022 (Record type & not allowed).

  • Problem in creating a SyncBo for Purchase Order BAPIs

    Hello Everybody,
    I am trying to create a smart sync application for Purchase Orders.
    I have used standard bapis like BAPI_PO_GETDETAIL AND BAPI_PO_CREATE1.
    I have developed my own wrapper functions using these std bapis. For the PO creation i only plan to insert the necessary and mandatory data. The problem i face is that some of the tables in the create bapi which are mandatory for a PO creation are freezed in the SyncBo.
    Tables like POITEMX, POADDRDELIVERY, POSCHEDULE and structure POHEADERX are all required for the creation of a PO. Without this minimum data a PO cannot be created.
    After i have created the syncBo, on the mapping screen i can only see these tables under the create BAPI. But i am not able to perform the mapping of their fields. These are non-editable or i must say that they are freezed.
    And if i cannot map them then i cannot pass data for them from the client. Although i can do the mapping for the table PO_ITEM and the structure PO_HEADER.
    I hope i am able to expplain my problem. Kindly get back to me if i am not clear. Any sort of help is welcome.
    Thanking in advance,
    Saurabh.

    Hi Saurabh,
    Hope you are aware of the prerequisites for creating the BAPI Wrappers.
    If you want to insert some data into the Business Object, then you have to include
    GETLIST, GETDETAIL and CREATE Bapi Wrappers.
    I think in your case,
    You might not have mapped those fields in your GETLIST Bapi Wrapper.Just check whether you have mapped those fields that are necessary for PO creation in your GETLIST and GETDETAIL BApi wrapper mapping screen.
    Those fields you have mapped in the GETLIST and GETDETAIL BAPI wrappers will be visible (for selection - checkboxes will be editable) in the mapping screen for CREATE BAPI Wrapper.
    So first of all, you have to map fields there in the mapping screens for GETLIST and GETDETAIL Bapi Wrappers...
    check this thing...
    refer these links..
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/com.sap.km.cm.docs/library/mobile/mobile%20infrastructure/mobile%20development%20kit%202.5/content/appdev/smartsync/introduction.html
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/com.sap.km.cm.docs/library/mobile/mobile%20infrastructure/mobile%20development%20kit%202.5/content/appdev/smartsync/bapi_wrapper_types.html
    In the second link, you can see one figure, which is explaining the things that are to be satisfied by the BAPI Wrappers for SyncBO creation...
    Let me know If you have doubts in the prerequisite section itself...
    Regards,
    Kishor Gopinathan

  • Problem in using output type for purchase order

    Hi experts,
         I am using output type for first time so may be i have done wrong configuration for po output type.The steps i have done are :-
    1) Going to  tcode NACE->Selected  the row u201CEF Purchase Orderu201D and clicked on u201CProcedures".
    2) In procedures there are 2 procedures for the application EF (Purchase Order). To proceed further, we would need to find out the procedure that is currently active.Gone to transaction SPRO. In this, navigate as Materials management -> Purchasing ->Messages -> Output control -> Message Determination Schemas ->Define Message Schema for Purchase Order
    3) Clicking on u201CAssign Schema to Purchase Orderu201D. So, the procedure RMBEF1 is active for EF (Purchase Order) . 
    4) Go back to transaction NACE. Select u2018EFu2019 and click on u201COutput typesu201D.
    5)  Let us use the output type u201CNEU name purchase orderu201D for this purpose. Double-click on NEU.
    6) Ensured  that the checkboxes u201CAccess to conditionsu201D and u201Cmultiple issuingu201D are checked and the access sequence is 0001(DocType/PurchOrg/Vendor).Only 0001 and 0002 is available in f4 help for this.
    7) Now clicked on u201CProcessing Routinesu201D on the left hand side. Ensured that there is an entry for Medium u2018Au2019 (Distribution ALE).
    8) After that going back to the main screen of NACE. Select EF (Purchase Order) and clicked on u201CCondition Recordsu201D.
    Select NEU and clicked on u201CCondition recordsu201D. The pop-up box appears that gives three radio button option :-
      1) Purchasing output determination :purchasing org / vendor for EDI
      2) Purchasing output determination :doc. type / purchasing org /vendor
      3) Purchasing output determination :document type
          but it is not having option only for purchasing organisation through which we can send idoc for changes or creation of PO in that particular pur.org now if i choose 2) i have to give doc type and purchasing org both bcoz they are mandatory fields and value for vendor.
    9)  Also i  have done the necessary ALE configuration (not covered in this document). In the partner profiles, use the message type u201CORDERSu201D and the IDOC type u201CORDERS05u201D.In the tab u201CMessage Controlu201D, used the process codes u201CME10u201D and u201CME11u201D for u201CPO Createu201D and u201CPO Changeu201D respectively.
    but the idoc is not generated many times when po is changed and when once it is generated it is giving error
    Please suggest solution.
    Thanks in advance
    nehavt

    In me22n in messages tab after looking into  processing log it is giving->No recipient found for message type ORDCHG in the
    ALE model ,next time giving error as no idoc items belonging to purchasing document found,when i changed message type to ORDCHG the  status is green in messages tab it is giving-> error occured while idoc xyz is sent and in WE02 status is red 02
    error passing data to port(could not find code page for receiving system)

  • Activating conditions for Purchase Order workflows in EBP

    Dear SRMer's,
    I am facing the following problem:
    System Info :SRM Server 5.5, ECC 6.0
    Scenario 1:
    All start conditions for Purchase Order in SAP Business Workflow are activated.
    I created a direct procurement shopping cart (DP)  in SRM browser and ordered it, then I logged in as proffessional purchaser, changed the Price and processed the DP PO.
    When Ordering, the follow on Documents are created, but says the PO is waiting for approval.  When I check for this PO in the Backend R/3 system in the Me22n (Display PO changes), I don't see the PO.
    Scenario 2:
    All Start conditions for Purchase Order in SAP Business Workflow are de-activated
    I created  another direct procurement shopping cart (DP2)  in SRM browser and ordered it, then I logged in as proffessional purchaser, changed the Price and processed the DP2 PO (Status is held). 
    When Ordering, I get the Warning message, no workflow found, contact system administrator.
    Please advice what needs to be configured for the PO to be ordered successfully.
    Thanks in advance
    Raj

    Hi,
    In your scenario 1, if system is saying that there the PO has to be approved, it means that you have managed the user that will receive the workitem..
    Activating all PO WF is not a solution as in standard there are two many cases activated (amount, role, limit...)
    I propose you to first activate only the 0 step WF and to overwrite the code inside
    Just code that every PO modification should trigger O step WF thus it will be more simple to test it.
    Later on, if you want to implement more complex starting conditions, you just have to modify the WF content...
    Kind regards,
    Yann

  • Service entry sheet:No provision for service entry for purchase order

    Hi.I create a Purchase order with one item.The Item category was D(Service).Also lines of Service number was input in the Service tab of the item detail.After save the Purchase order,I goto t-code ML81N to Maintain the Service entry sheet.When I input the Purchase order number and item number and press enter,the SAP raise an error message box with following text:
    No provision for service entry for purchase order 4500000149 00010
    Message no. SE198
    Diagnosis
    The "GR =NO" (no goods receipts) indicator has been set in the PO item. It is thus not possible to enter services against this purchase order.
    I don't know why and how to resolve this problem.So I need the experts to give me some advice.Thank you so much.
    Regards
    Yoda

    pls check in ur PO at item details in delivery tab whether goods receipt checkbox is unticked.if yes then tick it and then process.
    regards,
    indranil

  • Document in transfer for purchase order - creation not possible

    Hi Experts,
    we get this error when we do confirmation"'document in transfer for purchase order - creation not possible'"
    any inputs are appreciated
    Rg
    sam

    Hi All,
    We have resolved the above problem.
    When user does confirmation ,if it sucessfully  created then there will be  no entry in BBP_Document_tab table.If it's in error in process and next time when user tries to do GR then he will encounter a pop up message "Document in transfer for PO, creation not possible".
    So we need to delete the entries from table BBP_DOCUMENT_TAB using FM BBP_DELETE_FROM_DOCUMENT_TAB.
    Then check again in BBP_DOCUMENT_TAB now there will be noentry there...so now user can do the confirmation from SRM,he will not encounter this error now.
    Thanks to all the ppl who has replied
    sameer

  • Dump in smartform driver program for purchase order

    i created one smartform with driver program for purchase order.
    in smartfrom i gave
    form interface: p_ebeln as import,   
                        tables as it_ekpo like ekpo.
    global definitions are
    wa_ekko type ekko for printing the  ekko data in one window,
                                           wa_ekpo type ekpo .
    in main window i took  the  one table and loop the ekpo table for  printing the item details.
    no errors is there.but ; when i call this generated function module to my driver program it goes to dump.
    in driver program i declare structures,internal tables,work areas, and parameter as p_ebeln .
    and also select statements for my table all are good.but its not work.
    in function module i pass the details as export p_ebeln = p_ebeln and table it_ekpo  = it_ekpo.
    and also i done debugging in this data come to the internal table and work areas.
    but it goes to dump.
    if u dont mind plz solve my problem.
    Thanks
    Navya.
    Moderator message: empty lines removed, subject corrected, please use meaningful subject lines when posting!
    Edited by: Thomas Zloch on Mar 24, 2011 10:10 AM

    Hi Navya,
    Your smartform is correct. But, as per my understanding, the dump comes when you call the smartform from the driver program. If that is the case, please check the input parameters and all th parameters in the program should be same as used in samrtform. Any deviation would lead to a dump.
    Analyse and resolve!!!
    Regards
    Atul Sachdeva

  • Processing log output for Purchase order

    Dear All,
    Iam getting some problem when iam creating an IDOC and checking in the Processing log for IDOC number.
    Actually i had created one custom idoc for Purchase order since my client need only some field and in one line for header and line item, I had done it and i can see it in sdata of EDIDD structure. When i create a Purchase order and save it an idoc number is posting and I can see this file in my physical directory indeed.
    Now when iam going into change mode of PO ME22n to see the Processing LOG, It is not showing the IDOC Number in Purchase order output processing log popup.

    The processing log will only show output based standard output control (Table NAST).
    How is your IDoc being created. Via a user exit, BADI. If so then they will not appear on the processing log.
    It is being created as a custom IDOC for which i had written a Z function module and given that in PO processing code which is ME10. When iam checking the standard IDOC for PO it is generating the IDOC in processing log as well.
    Iam just placing my code just have a look at it and suggest if any thing needs to be done.
    FUNCTION Z_IDOC_OUTPUT_ORDERS.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(OBJECT) LIKE  NAST STRUCTURE  NAST
    *"     VALUE(CONTROL_RECORD_IN) LIKE  EDIDC STRUCTURE  EDIDC
    *"  EXPORTING
    *"     VALUE(OBJECT_TYPE) LIKE  WFAS1-ASGTP
    *"     VALUE(CONTROL_RECORD_OUT) LIKE  EDIDC STRUCTURE  EDIDC
    *"  TABLES
    *"      INT_EDIDD STRUCTURE  EDIDD
    *"  EXCEPTIONS
    *"      ERROR_MESSAGE_RECEIVED
    *"      DATA_NOT_RELEVANT_FOR_SENDING
    DATA: xdruvo.                          "Druckvorgang
    DATA: neu  VALUE '1',                  "Neudruck
          h_kappl LIKE nast-kappl,         "Hilfsfeld Applikation
          h_parvw LIKE ekpa-parvw,         "Hilfsfeld Partnerrolle
          h_ebeln LIKE ekko-ebeln.         "Hilfsfeld Belegnummer
      CLEAR control_record_out.
       xdruvo = neu.
      h_kappl = object-kappl.
      h_ebeln = object-objky.
      h_parvw = object-parvw.
      DATA:
           LT_EDIDC LIKE EDIDC OCCURS 0 WITH HEADER LINE,
             L_EDIDC LIKE EDIDC,
             L_SEND_FLAG,
             W_SDATA LIKE EDIDD-SDATA.
      DATA: T_BDI_MODEL LIKE BDI_MODEL OCCURS 0 WITH HEADER LINE.
      DATA: T_EDIDC LIKE EDIDC OCCURS 0 WITH HEADER LINE.
      DATA: T_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE.
      DATA: C_MESSAGE_TYPE LIKE EDIDC-MESTYP VALUE 'ZORDER'.
    *- Call function module to determine if message is to be distributed
    OBJECT_TYPE = 'BUS2012'.
      MOVE control_record_in TO control_record_out.
      CALL FUNCTION 'ALE_MODEL_DETERMINE_IF_TO_SEND'
        EXPORTING
          MESSAGE_TYPE           = C_MESSAGE_TYPE
        IMPORTING
          IDOC_MUST_BE_SENT      = L_SEND_FLAG.
       EXCEPTIONS
         OWN_SYSTEM_NOT_DEFINED = 1
         OTHERS                 = 2.
      DATA : BEGIN OF EKKO_tAB OCCURS 0,
      EBELN LIKE EKKO-EBELN,
      F1 TYPE C VALUE ',',
      BUKRS LIKE EKKO-BUKRS,
      F2 TYPE C VALUE ',',
      BSART LIKE EKKO-BSART,
      F3 TYPE C VALUE ',',
      LIFNR LIKE EKKO-LIFNR,
      F4 TYPE C VALUE ',',
      WAERS LIKE EKKO-WAERS,
      F5 TYPE C VALUE ',',
      BEDAT LIKE EKKO-BEDAT,
      F6 TYPE C VALUE ',',
      WERKS LIKE EKPO-WERKS,
      F7 TYPE C VALUE ',',
      PLIFZ LIKE EKPO-PLIFZ,
      F8 TYPE C VALUE ',',
      EBELP LIKE EKPO-EBELP,
      F9 TYPE C VALUE ',',
      MATNR LIKE EKPO-MATNR,
      F10 TYPE C VALUE ',',
      MENGE LIKE EKPO-MENGE,
      F11 TYPE C VALUE ',',
      MEINS LIKE EKPO-MEINS,
      F12 TYPE C VALUE ',',
      END OF EKKO_TAB.
      DATA SDATA1 LIKE EKKO_tAB OCCURS 0 WITH HEADER LINE.
      DATA EBELN LIKE EKKO-EBELN.
      WRITE OBJECT-OBJKY TO EBELN.
      SELECT T1EBELN T1BUKRS BSART LIFNR WAERS BEDAT  WERKS PLIFZ EBELP MATNR MENGE MEINS
      FROM EKKO AS T1
      INNER JOIN EKPO AS T2 ON T2EBELN = t1EBELN
      INTO CORRESPONDING FIELDS OF TABLE EKKO_tAB
      WHERE
    *T1~KAPPL = 'EF' AND
      T1~EBELN = EBELN.
    *T1~KSCHL = 'YEDI' .
      DATA SDATA LIKE EDIDD-SDATA.
      DATA NDATE LIKE SY-DATUM.
      DATA NMENGE(17) TYPE C.
      LOOP AT EKKO_tAB.
        WRITE EKKO_TAB-MENGE TO NMENGE.
        NDATE = EKKO_tAB-BEDAT + EKKO_tAB-PLIFZ.
        CONCATENATE  EKKO_tAB-EBELP ',' EKKO_tAB-BUKRS ',' EKKO_tAB-BSART EKKO_tAB-EBELN ',' EKKO_tAB-LIFNR ',' EKKO_tAB-BEDAT ','
        NDATE ',' EKKO_tAB-BSART EKKO_tAB-EBELN ',' EKKO_tAB-EBELN ', 0,' EKKO_tAB-MATNR ','
        NMENGE ',' EKKO_tAB-MEINS ',' EKKO_tAB-WERKS INTO SDATA.
        MOVE SDATA TO: W_SDATA, T_EDIDD-SDATA.
        MOVE 'ZORDERS' TO T_EDIDD-SEGNAM.
        APPEND T_EDIDD.
      ENDLOOP.
    *call function 'L_IDOC_SEGMENT_CREATE'
        exporting
             i_segnam = 'ZORDERS'
             i_sdata  = w_sdata
        exceptions
             others   = 1.
    *LT_EDIDC
    call function 'L_IDOC_SEND'
         tables
              t_comm_idoc           = LT_EDIDC
         exceptions
              error_distribute_idoc = 1
              others                = 2.
    *DATA T_BDI_MODEL LIKE BDI_MODEL.
    WRITE OBJECT-OBJKY TO T_BDI_MODEL.
    READ TABLE T_BDI_MODEL INDEX 1.      " maximum 1 recipient
    L_EDIDC-DIRECT = 1.
      L_EDIDC-DOCNUM = DOCNUM. "***
      L_EDIDC-RCVPRN = 'HCM_00_785'.
      L_EDIDC-RCVPOR = 'MM_PO_FILO'.
      MOVE 'ZORDER'   TO L_EDIDC-MESTYP.
      MOVE 'ZPURIDOC' TO L_EDIDC-IDOCTP.
      MOVE 'LS'      TO L_EDIDC-RCVPRT.
    MOVE T_BDI_MODEL-RCVSYSTEM TO L_EDIDC-RCVPRN.
    *MOVE-CORRESPONDING L_EDIDC TO W_EDIDC.
    *- Distribute the iDoc
    BREAK-POINT.
      CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE' "IN UPDATE TASK
        EXPORTING
          MASTER_IDOC_CONTROL            = L_EDIDC
        TABLES
          COMMUNICATION_IDOC_CONTROL     = LT_EDIDC
          MASTER_IDOC_DATA               = T_EDIDD
        EXCEPTIONS
          ERROR_IN_IDOC_CONTROL          = 01
          ERROR_WRITING_IDOC_STATUS      = 02
          ERROR_IN_IDOC_DATA             = 03
          SENDING_LOGICAL_SYSTEM_UNKNOWN = 04.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    READ TABLE LT_EDIDC INDEX 1.
      control_record_out-direct = '1'.
      CONTROL_RECORD_OUT-DOCNUM = DOCNUM. " ***
      control_record_out-serial = sy-datum.
      control_record_out-serial+8 = sy-uzeit.
      control_record_out-mestyp = LT_EDIDC-mestyp.
      control_record_out-idoctp = LT_EDIDC-idoctp.
      control_record_out-SNDPRN = 'HCM_00_786'.
      MOVE 'MM_PO_FILO' TO control_record_out-RCVPOR.
      MOVE 'LI'      TO control_record_out-SNDPRT.
      MOVE 'SAPQIS' TO control_record_out-SNDPOR.
    ENDFUNCTION.

  • PO 'No goods receipt possible for purchase order'

    Hi gurus!
    While trying to make Confirmation of a PO in the SRM Portal the user is getting the error 'No goods receipt possible for purchase order'
    The scenario used is Classic, so PO is replicated directly to the R/3 system.
    Any idea why this is happening?
    Thanks a lot!

    Hi, thanks for the quick reply!
    Where i can check the Item category?
    I found a field called 'subitem category' but it's blank
    with this possible values:
    1 Variant                               
    2 Discount in kind: inclusive bonus qty.
    3 Empties                               
    4 Discount in kind: exclusive bonus qty.
    5 Prepack item                          
    6 Display item                          
    7 Set item                              
    8 Interchangeable items (IBU: A&D)      
    9 Pre-packing (SLS items)               
    H GT Bill of Material, Header Relevant  
    I GT Bill of Material, Item Relevant    
    About PO type i think it's EC (doc_type?), in R/3 is shown as EBP PO
    I checked in backend system, in the item details > Delivery and the 'Goods Receipt' is checked.

  • Use of SAVE_TEXT in customer exits / BADI for purchase order

    Hi All,
    I am trying to save some long text by using SAVE_TEXT function module in a badi implementation for purchase order header text. The same is working fine if i try to update the PO header text via a report. But if i try using badi (the code is written in a PAI event for the BADI), then though the text transfer and save is successful during the code excution, but for the first time when i add any text its not visible in ME22N tcode. Since its an online event. But when i double click on that editor and the sap script editor gets opened. then i press back button, the text is appearing on the same small screen edtor . after this any number of time i edit or delete text, the save_text function module works fine.
    My issue is why for the first time always i have to double click on the editor to open the sap script editor. I have also included commit_text in this case after save_text FM.
    the requirement here goes like this. in one tab for PO header the user will enter some number (This is a customizing screen implemented through badi.) and the corresponsing discription should appear when user clicks on text tab in po header screen (me21n / me22n).
    Kindly help.
    Thanks
    Mamata

    Hi  mamata rath
    I have solve the problem which similar to yours.  the code which is as the following
    DATA: textline TYPE tdline,
            name TYPE c LENGTH 70,
            glines TYPE TABLE OF tline,
            gline  LIKE LINE OF glines,
            ls_header TYPE thead.
         CONCATENATE ch_eban-banfn ch_eban-bnfpo INTO name.
             ls_header-tdobject = 'EBAN'.
             ls_header-tdname = name.
             ls_header-tdid = 'B01'.
             ls_header-tdspras = sy-langu.
             CALL FUNCTION 'SAVE_TEXT'
               EXPORTING
    *           CLIENT                = SY-MANDT
                 header                = ls_header
    *           INSERT                = ' '
    *           SAVEMODE_DIRECT       = ' '
    *           OWNER_SPECIFIED       = ' '
    *           LOCAL_CAT             = ' '
    *         IMPORTING
    *           FUNCTION              =
    *           NEWHEADER             =
               tables
                 lines                 = glines
               EXCEPTIONS
                 ID                    = 1
                 LANGUAGE              = 2
                 NAME                  = 3
                 OBJECT                = 4
                 OTHERS                = 5
              IF sy-subrc = 0.
                  CALL FUNCTION 'COMMIT_TEXT'
                    EXPORTING
                      OBJECT                = 'EBAN'
                      NAME                  = name
    *                ID                    = '*'
    *                LANGUAGE              = '*'
    *                SAVEMODE_DIRECT       = ' '
    *                KEEP                  = ' '
    *                LOCAL_CAT             = ' '
    *              IMPORTING
    *                COMMIT_COUNT          =
    *              TABLES
    *                T_OBJECT              =
    *                T_NAME                =
    *                T_ID                  =
    *                T_LANGUAGE            =
              ENDIF.

  • Call BAPI_GOODSMVT_CREATE to create a goods receipt for purchase order

    Hi,
    I'm calling the bapi BAPI_GOODSMVT_CREATE to create a goods receipt for purchase order, but the following code doesn't work. It doesn't give me any kind of error message but it does nothing as well...
    Can anyone help me please?
    Thank You
    Hugo
    Code
    DATA: wa_goodsmvt_header  LIKE bapi2017_gm_head_01,
                            wa_goodsmvt_code    LIKE bapi2017_gm_code,
                            wa_bapi2017_gm_head TYPE bapi2017_gm_head_ret-mat_doc.
                      DATA: it_goodsmvt_item LIKE bapi2017_gm_item_create OCCURS  0 WITH HEADER LINE,
                            it_return        LIKE bapiret2 OCCURS  0 WITH HEADER LINE.
                      wa_goodsmvt_header-pstng_date = SY-DATUM.
                      wa_goodsmvt_header-doc_date   = SY-DATUM.
                      wa_goodsmvt_header-ref_doc_no = '4500000020'.
                      wa_goodsmvt_code-gm_code = '01'.          "Goods receipt for purchase Order
                      it_goodsmvt_item-stge_loc  = 'BPF2'.
                      it_goodsmvt_item-move_type = '101' .
                      it_goodsmvt_item-entry_qnt = 17.
                      it_goodsmvt_item-entry_uom = 'KG'.
                      it_goodsmvt_item-mvt_ind   = 'B'.
                      it_goodsmvt_item-po_number = '4500000020'.
                      it_goodsmvt_item-po_item   = '00010'.
                      it_goodsmvt_item-material  = '50'.
                      APPEND it_goodsmvt_item.
                      CALL FUNCTION  'BAPI_GOODSMVT_CREATE'
                        EXPORTING
                          goodsmvt_header  = wa_goodsmvt_header
                          goodsmvt_code    = wa_goodsmvt_code
                        IMPORTING
                          materialdocument = wa_bapi2017_gm_head
                        TABLES
                          goodsmvt_item    = it_goodsmvt_item
                          return            = it_return.
                        data: begin of errmsg occurs 10.
                                include structure bapiret2.
                        data: end of errmsg.
                        data: wmenge like iseg-menge,
                              errflag.
                        clear errflag.
                        loop at errmsg.
                          if errmsg-type eq 'E'.
                            write:/'Error in function', errmsg-message.
                            errflag = 'X'.
                          else.
                            write:/ errmsg-message.
                          endif.
                        endloop.
                        if errflag is initial.
                          commit work and wait.
                          if sy-subrc ne 0.
                            write:/ 'Error in updating'.
                            exit.
                          else.
                            write:/ 'Ok'.
                          endif.
                        endif.
                        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                        EXPORTING
                        wait = ' '.

    Hi,
    Thank you for the asnwer! I'm a rookie at ABAP so please forgive my stupid questions
    I've changed the code to:
    DATA: wa_goodsmvt_header  LIKE bapi2017_gm_head_01,
                            wa_goodsmvt_code    LIKE bapi2017_gm_code,
                            wa_bapi2017_gm_head TYPE bapi2017_gm_head_ret-mat_doc.
                      DATA: it_goodsmvt_item LIKE bapi2017_gm_item_create OCCURS  0 WITH HEADER LINE,
                            it_return        LIKE bapiret2 OCCURS  0 WITH HEADER LINE.
                      wa_goodsmvt_header-pstng_date = SY-DATUM.
                      wa_goodsmvt_header-doc_date   = SY-DATUM.
                      wa_goodsmvt_header-ref_doc_no = '4500000020'.
                      wa_goodsmvt_code-gm_code = '01'.          "Goods receipt for purchase Order
                      it_goodsmvt_item-plant     = 'BP01'.
                      it_goodsmvt_item-stge_loc  = 'BPF2'.
                      it_goodsmvt_item-move_type = '101' .
                      it_goodsmvt_item-entry_qnt = 10.
                      it_goodsmvt_item-entry_uom = 'KG'.
                      it_goodsmvt_item-mvt_ind   = 'B'.
                      it_goodsmvt_item-po_number = '4500000020'.
                      it_goodsmvt_item-po_item   = '10'.
                      it_goodsmvt_item-material  = '50'.
                      APPEND it_goodsmvt_item.
                      CALL FUNCTION  'BAPI_GOODSMVT_CREATE'
                        EXPORTING
                          goodsmvt_header  = wa_goodsmvt_header
                          goodsmvt_code    = wa_goodsmvt_code
                        IMPORTING
                          materialdocument = wa_bapi2017_gm_head
                        TABLES
                          goodsmvt_item    = it_goodsmvt_item
                          return            = it_return.
                          write:/ it_return-message.
    And the return message is : Material document data and PO data do not match (Material)
    Any idea of what might be the problem?
    Thanks

  • No goods receipt possible for purchase order

    Hi Experts,
       Received the goods 10 PC from Vendor on one date, then reversing the GRN on another date, So now GRN total quantity is zero. I am getting error  u201CERROR - 036No goods receipt possible for purchase order 43086066 00220 " while again i am trying to do GRN. Please help me to solve the problem.
    Thanks

    Hi,
    Try to do the GR wrt Mat doc # which you have cancelled.
    regds,
    CB

  • Goods receipt for purchase order is not allowed

    Hi,
    When I am doing the PO receipt i am facing the error message "Goods receipt for purchase order is not allowed WBS element xxxxxx"
    What could be the problem
    Thanks
    Lucky

    Hi,
    Please check the WBS element in CJ03, in Basic Data, System status,
    Is the WBS is not released or blocked.
    Hope it helps you.
    Thanks

Maybe you are looking for