Error in Bapi_GoodsMvt_Create using Purchase order

Hi Friends,
I am using Bapi_goodsmvt_create for Goods Receipts against Purchase order.
The below code i have given for Goods receipts
It shows the error like
ID : 8J
Err No.:182
Message : Entry 4500000344 00040 0000 not valid; correct entry
Please help me to correct this error.
Thanks
Shankar
===================================
Heading Structure
st_gm_code-gm_code          = '01'.
st_gm_header-pstng_date = '20070930'.
st_gm_header-doc_date = '20070930'.
st_gm_header-gr_gi_slip_no = '970015'.
st_gm_header-bill_of_lading = '527213'.
st_gm_header-header_txt = 'AIR'.
st_gm_header-ref_doc_no = '4500000344'.
Tables - ITEM CREATE.
itab_afs_gm_itemx-plant = '2000'.
itab_afs_gm_itemx-deliv_numb = '80100121'.
itab_afs_gm_itemx-stge_loc = '2110'.
itab_afs_gm_itemx-move_stloc = '2110'.
itab_afs_gm_itemx-po_number = '4500000344'.
itab_afs_gm_itemx-po_item = '00040'.
itab_afs_gm_itemx-vendor = '0000650003'.
itab_afs_gm_itemx-vendrbatch = 'ABC123'.
itab_afs_gm_itemx-move_type = '101'.
itab_afs_gm_itemx-mvt_ind = 'B'.
itab_afs_gm_itemx-material = '000000000030000227'.
itab_afs_gm_itemx-entry_qnt = 10.
APPEND itab_afs_gm_itemx .
****&& Grid values
gr_afs-matdoc_itm     = '0001'.
gr_afs-grid_value = '205'.
gr_afs-withdrawn_sku = 'X'. "Final issue at sku level
gr_afs-stock_cat = '0000000001000366'.
APPEND gr_afs.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
  EXPORTING
    goodsmvt_header           = st_gm_header
    goodsmvt_code             = st_gm_code
  TESTRUN                     = ' '
IMPORTING
   goodsmvt_headret           = st_gm_headret
   materialdocument            = mat_doc
   matdocumentyear             =  doc_year
  TABLES
    goodsmvt_item             = itab_afs_gm_itemx
   afs_goodsmvt_sku           = gr_afs
    return                    = bapi_return.
IF sy-subrc = 0.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      wait = 'X'.
ENDIF.
CLEAR itab_afs_gm_itemx.
REFRESH itab_afs_gm_itemx.
CLEAR gr_afs.
REFRESH gr_afs.

Hi,
Here is some sample code from one of my programs, which does a 551 movement type. This should get you started. Just check the RETURN table for messages, they should tell you what you are missing.
code
Structures for BAPI
data: gm_header type bapi2017_gm_head_01.
data: gm_code type bapi2017_gm_code.
data: gm_headret type bapi2017_gm_head_ret.
data: gm_item type table of
bapi2017_gm_item_create with header line.
data: gm_return type bapiret2 occurs 0.
data: gm_retmtd type bapi2017_gm_head_ret-mat_doc.
clear: gm_return, gm_retmtd. refresh gm_return.
Setup BAPI header data.
gm_header-pstng_date = sy-datum.
gm_header-doc_date = sy-datum.
gm_code-gm_code = '06'. " MB11
Write 551 movement to table
clear gm_item.
move '551' to gm_item-move_type .
move '000000000040001234' to gm_item-material.
move '1' to gm_item-entry_qnt.
move 'EA' to gm_item-entry_uom.
move '0004' to gm_item-plant.
move '4000' to gm_item-stge_loc.
move '201' to gm_item-move_reas.
Determine cost center per plant
case xresb-werks.
when '0004'.
move '0000041430' to gm_item-costcenter.
when '0006'.
move '0000041630' to gm_item-costcenter.
when '0007'.
move '0000041731' to gm_item-costcenter.
when '0008'.
move '0000041830' to gm_item-costcenter.
endcase.
append gm_item.
Call goods movement BAPI
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gm_header
goodsmvt_code = gm_code
importing
goodsmvt_headret = gm_headret
materialdocument = gm_retmtd
tables
goodsmvt_item = gm_item
return = gm_return.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
[/code]
Welcome to SDN! Please remember to award points for helpful answers and mark you post as solved when solved completely. Thanks.
REgards,
Raj.

Similar Messages

  • Error message while viewing Purchase order summary

    Hi all,
    we are in 11.5.10.2 , we are getting error message while viewing purchase order "Currency formatting cannot be performed without a currency code".
    is it beacuse of currency not popluated in Purchase order?
    Verified metalink note - 960504.1
    Thanks
    Kiran

    Hi Kiran,
    Verified metalink and other areas but could not get any appropriate solution.
    I tried to reproduce the issue in various available environments...but no luck!
    My guess would be the datafix/BUG that you have referred in the MOS note 960504.1
    Please check with your DBA for this patch in test instance.
    Thanks
    -Arif.

  • BAPI For Inbound Delivery using Purchase Order Number

    Hi All,
    Is there any BAPI for posting Inbound Delivery (VL31N) using Purchase Order as reference.
    thanks
    bobby

    Not sure what it has to do with enhancements and modifications, but there is no such BAPI:
    http://tech.groups.yahoo.com/group/ABAP/message/38307
    http://sap.ittoolbox.com/groups/technical-functional/sap-log-mm/bapi-for-inbound-delivery-creation-and-update-vl31n-1201265
    FYI all BAPIs may be viewed in BAPI transaction.

  • User exit or badi or enhance for MIRO using Purchase order

    Hello All,
              When Miro was done using Purchase order i want to change the field BSEG-ZUONR value to assign purchase oder number.
    In the setting when the purhcase order was selected but still it comes as blank. could any body suggest the solution.
             Thanks in Advance !
    Regards
    Srinivas

    Hello srinivas,
    Exits for the given tcode
    LMR1M001  User exits in Logistics Invoice Verification
    LMR1M002  Account grouping for GR/IR account maintenance
    LMR1M003  Number assignment in Logistics Invoice Verification
    LMR1M004  Logistics Invoice Verification: item text for follow-on
    LMR1M005  Logistics Inv. Verification: Release Parked Doc. for Po
    LMR1M006  Logistics Invoice Verification: Process XML Invoice
    MRMH0001  Logistics Invoice Verification: ERS procedure
    MRMH0002  Logistics Invoice Verification: EDI inbound
    MRMH0003  Logistics Invoice Verification: Revaluation/RAP
    MRMN0001  Message output and creation: Logistics Invoice Verifica
    Badis and Enhcance spots for the given tcode
    Badis                                 Enhcance spots
    INVOICE_BW                     ES_BADI_INVOICE                BW Update
    INVOICE_UPDATE             INVOICE_UPDATE
    INVOICE_UPDATE                                                       Business Add-In
    Thanks,
    Santhosh Kumar R
    Edited by: santhosh kumar on Dec 23, 2010 9:25 AM

  • How can i search several orders at a time using purchase order numbers?

    Hi,
    I need to search several sales orders by using purchase order numbers at a time instead of
    searching for single order at a time.
    And i need to send several order confirmations to the customers at a time, how can i do this?.
    Help me regarding this.
    Thanks
    Raghu

    Hi,
    Go to VA05N
    On initial screen speciefy PO number and execute then you will get report list
    To send this
    Menu LIST >> SEND TO >> Mail reciepient
    Enter the reciepient & reciepient type and send (see list in attachment tab)
    Kapil

  • Error while creation of PUrchase order by using BAPI.

    Hi All,
       We are creating a purchase order thru BAPI ("BAPI_POEC_CREATE") and we are passing the following parameters ( I_PO_HEADER , I_PO_ITEMS , I_PO_ACCASS , I_PO_PARTNER and I_PO_ORGDATA)  to the bapi and after processing  we are getting the following error and Abend messages.
    Messages:
    1) Enter at least one item or one limit ( we have added line items in I_PO_ITEMS structure).
    2) Incorrect interface data for set 78 in method C.
    3) Interface data contains errors.
    Can anyone help me in fixing these errors inorder to proceed further.
    Regards
    Dharmaraju

    Hi there,
    Did you manage to sort this problem ?
    If not let me know
    I am using the same and know how to overcome
    Thanks
    Turlock
    T

  • WebDynpro Error while creating a Purchase Order in SRM 7.0

    Hello Friends,
    I need help.
    We are on SRM 7.0 with support pack 8.0 and  we are getting the below error wile clicking on Shopping cart or Purchase Order link in Portal.
    Any idea on how to resolve this error.
    Thanks
    Jyothi.
    http://sapsrm.erpcx.com:8000/sap/bc/webdynpro/sapsrm/wda_l_fpm_oif/
    ASSERTION_FAILED
    The ASSERT condition was violated.
    Method: ADD_EVENT_TO_QUEUE of program CL_FPM========================CP
    Method: IF_FPM~RAISE_EVENT of program CL_FPM========================CP
    Method: SET_CREATE_BUTTON_ACTIVE of program /1BCWDY/0FJM4718F184UKVHA34J==CP
    Method: IF_COMPONENTCONTROLLER~SET_CREATE_BUTTON_ACTIVE of program /1BCWDY/0FJM4718F184UKVHA34J==CP
    Method: RESET_SCREEN of program /1BCWDY/0FJM4718F184UKVHA34J==CP
    Method: IF_V_PRSEL~RESET_SCREEN of program /1BCWDY/0FJM4718F184UKVHA34J==CP
    Method: WDDOMODIFYVIEW of program /1BCWDY/0FJM4718F184UKVHA34J==CP
    Method: IF_WDR_VIEW_DELEGATE~WD_DO_MODIFY_VIEW of program /1BCWDY/0FJM4718F184UKVHA34J==CP
    Method: DO_MODIFY_VIEW of program CL_WDR_DELEGATING_VIEW========CP
    Method: MODIFY_VIEW of program CL_WDR_VIEW===================CP

    Here is what I see:
    Error analysis                                                                                |
    The following checkpoint group was used: "No checkpoint group specified"
    If in the ASSERT statement the addition FIELDS was used, you can find
    the content of the first 8 specified fields in the following overview:
    " (not used) "
    " (not used) "
    " (not used) "
    " (not used) "
    " (not used) "
    " (not used) "
    " (not used) "
    " (not used) "
    How to correct the error
    Probably the only way to eliminate the error is to correct the program.
    If the error occures in a non-modified SAP program, you may be able to
    find an interim solution in an SAP Note.
    If you have access to SAP Notes, carry out a search with the following
    keywords:
    "ASSERTION_FAILED" " "
    "CL_FPM========================CP" or "CL_FPM========================CM004"
    "ADD_EVENT_TO_QUEUE"
    If you cannot solve the problem yourself and want to send an error
    notification to SAP, include the following information:
    1. The description of the current problem (short dump)
    To save the description, choose "System->List->Save->Local File
    (Unconverted)".
    2. Corresponding system log
    Display the system log by calling transaction SM21.
    Restrict the time interval to 10 minutes before and five minutes
    after the short dump. Then choose "System->List->Save->Local File
    (Unconverted)".
    3. If the problem occurs in a problem of your own or a modified SAP
    program: The source code of the program
    In the editor, choose "Utilities->More
    Utilities->Upload/Download->Download".
    4. Details about the conditions under which the error occurred or which
    actions and input led to the error.
    |

  • Unable to change make a down payment using Purchase order

    Hello Experts,
    I created a purchase order and used that purchase order in f-47 and f-48 (created down payment for the P.O).
    When i tried to execute the good receipt i encountered an error that said profit center not mentioned in line item 001. I understood that the profit center was not given in the material masters. I tried to give the profit center in the material masters. However, it says that there are purchase orders existing and cannot save for that reason.
    Now i am unable to delete the Purchase order and the material masters is not saving because the p.o is existing. I am not able to come out of this.
    Any help is highly appreciated
    Regards
    Raghuveer

    Hi
    If you have stocks you cannot change the profit center. The only way I can think of is to write a substitution rule to populate the profit center, so that you can do the GRN. You will have to do a profit center substitution probably by reading the plant.
    Another way is to set the message MM335 in T Code OMT4 as a warning and than try updating the profit center in material master itself.
    Thanks & Regards
    Sanil Bhandari

  • Error while save framework purchase order.

    dear all
    i am working SAP R/3 4.7 ides while  creating framework po, i input all the data field correctly , but when i am going to save the purchase order, it given the error Massages  " Indicator for invoice receipt used not allowed
    Message no. MEPO026"
    then i tell me how i save  the po.  i request to all the experts

    Dear,
    What account assignment you are using?
    Use account assignment category as K  and item category as B  Also do not enter material ID.
    Now try.
    Regards
    Utsav

  • Money overflow error when updating a Purchase Order

    Dear all,
    Our customer is using SAP B1 2007A, SP00, PL 30 - MS SQL 2005 SP2. The customer can create a purchase order but when they update it the below error appears:
    Money Overflow; can not display all digits (ODBC-104) [Message 7001-21]"
    even if they want to update only the remark field or change the unit price to 0.
    Anyone who faces the same problem?
    What is wrong with our customer DB?
    Please help me to solve this problem.
    Thanks.
    Doan

    Dear all
    What is SAP note,  I wanted to know where it will be kindly share knowledge
    Regards
    Vamsi Krishna 

  • GTS 7.2 - Error with account assigned purchase order without material

    All,
    I am creating an account assigned purchase order without any material master in the feeder system (ECC 5.0) and it a standard SAP functionality.
    I am getting the following GTS related pop up message and documents are posted to technically incomplete documents in GTS 7.2.
    "Legal Control: Custs Prod. Mast. Required
    Material                                                  "
    Any ideas on how get rid of this error message
    Edited by: James Puzon on Oct 3, 2008 9:32 PM

    James,
    Even though material numbers are not mandatory on POs in the feeder system (ie in ECC) they ARE mandatory in SAP-GTS.
    This means that every line item (PO, SO, delivery) that is sent to GTS for compliance screening or Customs processing MUST have a material number in the feeder system.  You have a couple of options to resolve this:
    1. Always use a material number on all transactions that you enter in your feeder system if they are exports or imports (ie relevant for GTS). You can create service materials or "dummy" materials in ECC for items such as user manuals, warranties or installation services that are part of a particular shipment.
    2. You can add logic in the interface for GTS to always transfer a particular material number to GTS if the material number is blank on the line item of the feeder system document.  Ideally you would want to link this custom logic to a custom maintenance table in ECC so that you can easily change the material number that is sent to GTS without having to change the code.
    3. Override the error message by changing the message type to a warning or informational message (not recommended because this would require a small code modification because I don't think the message type is configurable for this error).  Even if you did make this code change you would likely run into more issues in GTS because license determination and other GTS services need a material number to function properly.
    Hope this helps.
    Sascha

  • Creating confirmation using Purchase Order details

    Hi all,
    I am trying to create a confirmation for a Purchase Order in SRM Version 5,ECC 5.0(ECS Scenario).
    In my program, I first get all the Purchase Orders using the function module, BBP_PD_PO_GETDETAIL. Then I want to confirm this Purchase Order in the back end and front end using some funtion module.
    I have tried with the function module, BP_PD_CONF_CREATE, to create the confirmation.For this function module, I have passed the header details such as Object_id,process_type,log_system_FI ,be_log_system,
    be_object_type , be_refobj_type.
    I have also passed the Item,partner,account,org,longtext,pridoc and tax details of the PO as input to this function module.
    On execution of this function module, I get the Confirmation number, but the confirmation does not get created in the front end as well as backend. I also tried with the following function modules,
    BAPI_CONFEC_CREATE - For this function module I first tried passing the PO details as above as input but it didnt work. Then I tried passing the output of the Function module BP_PD_CONF_CREATE which had the Confirmation number, as input to BAPI_CONFEC_CREATE. It gives an error 'There has been a unexpected exception'.
    I also used the following function modules,
    BBP_PD_CONF_UPDATE
    BBP_GOODS_MVT_CREATE
    BBP_PROCDOC_CREATE
    But none of them works....
    Please help me if anyone has dealed with such a scenario.
    Thanks,
    Sowmiya M

    Hello,
    I am also new in SCM ICH, but may be there is no transportation line defined for this material.
    Call transaction /SAPAPO/SCC_TL1 in your ICH-System or select menu Inventory Collaboration Hub - Master Data - Transportation Lane.
    Create a product-specific transportation line.
    I am not sure, if it's neccessary to transfer the PO once more before confirming.

  • Deleated Valuation Type --Need Error Message while creating Purchase Order

    Hi,
    In our scenario , i need a message should flash , if enduser by mistake select the deleated valuation type while creating Purchase Order.
    In current configuration , it's not there.
    Await your expert opinion.
    Regards
    Shyam Kogta

    I investigated this recently in our company and gave this answer:
    A deletion flag does not restrict anything. It is just an indicator to tell SAP that you want this record to be deleted with the next archiving run.
    The archiving run then checks if a deletion is possible or not.
    So you can set such deletion flags long time in advance, even at a moment where you still have inventory.
    To block materials from beeing used in business transactions, usually the material and sales status are used. But these statuses can only be set at overall, plant and sales organisation level.  
    In some transactions SAP issues warning messages if a material has a deletion flag. This messages could be customized to be an error and prevent any business. However, this type of restriction is not designed for our machine, as we use the material and sales status.
    Anyhow, there is no message for valuation types that have a deletion flag in procurement area.
    There is one for goods receipts (but only for a certain industry solution that is not used by us)
    There is one for deliveries ( VL 211 ).
    The valuation types are defaulted from customizing to the transaction e.g. purchase order. Or from info record to the PO. So a standard purchase order gets valuation type  ABC , while an internal order (production) gets the DEF.  Usually there should not be a need to change this valuation type manually.
    So the only solution is to archive the material master at valuation type level.
    But I guess, you already have POs with that wrong valuation type, which means you have to archive the POs first. It you have already batches with wrong valuation type, then thy have to be archived as well before a material can be archived.
    And finally if you had stock in current year, then you can archive your material in year after next year, as SAP archives only materials that have no stock in current and previous year.

  • Error in Process in purchase order

    Hi ,
    I have created the purchase order and sent for approval .After approval i have  changed PO , i have changed the currency of PO and and also the Value of PO and sent for approval and status was approved . After that i created the confirmation and cancelled the confirmation , and  again changed the purchase order value and sent for approval and it was approved but the status of PO is "ERROR IN PROCESS "
    Please help ....

    Neha.
    Use the trx RZ20 and SLG1 for determine the detail of the error.
    Raul

  • Error, While updating a purchase order

    Hi All,
    I am getting following error massage while updating a existing PO:
    " Cannot Insert the value null into column docentry, Table db name.dbo. POR4; column does not allow nulls. Insert Fail."
    We have upto 886 items in the PO and the summary type is " No summary". Even when i treid to change the summary type to "By items", the system is till throwing the same error message. Please let me knwo the cause of this error and how to rectify this??
    Thanks in advance,
    Joseph

    Dear Joseph,
    Please try the followings in a testing database and check the results:
    1. if you give full authorisation to this specific user, will the error persist when adding the rows?
    2. if adding new rows at the end of the purchase order will it be successful?
    3. if you duplicate the sales order then add the new rows, will the error occur?
    4. will the error persist if you upgrade the client to the latest patch?
    5. please check the note 1139134 and 1249795.
    Regards,
    Varun
    SAP Business One Forum Team

Maybe you are looking for

  • Bluetooth no longer works between iPhone 5 running iOS8 and my 2012 Buick LaCrosse

    Since I uploaded the new iOS 8 on my iPhone 5 the Bluetooth connection is no longer working correctly in my 2012 Buick LaCrosse.   The phone pairs (illuminating the Bluetooth icon in the car stereo display) however then it doesn't work.  I cannot rec

  • How to set the default text in an input box or a label to be a predefine, multiline text

    how to set the default text in an input box or a label to be a predefine, multiline text. In other words how to break the line in the code of a text box. thank you

  • High "CPU + Wait for CPU" event on pl/sql execute operation

    I am executing a pl/sql in 256 parallel sessions, on 11G r2 DB (RAC 2 nodes), on a 42core IBM P7 Machine. PL/sql function opens a cursor on a huge table with around 20M rows and does further processing. Work-load is equally divided into 256 parallel

  • PayPal Error When Launching

    Hello. When launching Contribute CS3 an error message appears: PayPal AC Trans.htm has configuration information that is invalid In Dreamweaver, long ago, the extension just needed to be turned off, but there isn't an option in Contribute. Any help w

  • Installing X11 on Mac Pro with 10.4.8

    I just got my Mac Pro and tried to install X11 1.1.2 from the mac site. However I get an error message saying that it cannot be installed on my drive because new software is already installed. However my system is brand new with no X11 installed. Tha