BAPI error for mvmt types 201 and 202

Hi all,
  I'm using a bapi BAPI_GOODSMVT_CREATE for the movement type 201 and 202 with the gm_code = '03' for the transaction mb11- Goods movement. But it returns an error u201D Account 400000 requires an assignment to a CO object u201D...I'm unable to resolve this one....I have attached the code below. Please help me in fixing this issue...
if sy-subrc = 0.
  loop at it_mchb into wa_mchb.
    if wa_mchb-clabs gt 0.
      clear wa_header.
      wa_header-pstng_date = sy-datum.          " fill header data
      wa_header-doc_date   = sy-datum.
      wa_code-gm_code      = '03'.              "fill code data
      clear wa_item.
      wa_item-material     = wa_mchb-matnr.     " fillitem data
      wa_item-plant        = wa_mchb-werks.
      wa_item-stge_loc     = wa_mchb-lgort.
      wa_item-batch        = wa_mchb-charg.
      wa_item-entry_qnt    = wa_mchb-clabs.
      wa_item-move_type    = '201'.
                   wa_item-entry_uom    = wa_mchb-meins.
      append wa_item to it_item.
    elseif wa_mchb-clabs lt 0.
      clear wa_header.
      wa_header-pstng_date = sy-datum.          " fill header data
      wa_header-doc_date   = sy-datum.
      wa_code-gm_code      = '03'.              "fill code data
      clear wa_item.
      wa_item-material     = wa_mchb-matnr.     " fillitem data
      wa_item-plant        = wa_mchb-werks.
      wa_item-stge_loc     = wa_mchb-lgort.
      wa_item-batch        = wa_mchb-charg.
      wa_item-entry_qnt    = wa_mchb-clabs.
      wa_item-move_type    = '202'.
                   wa_item-entry_uom    = wa_mchb-meins.
      append wa_item to it_item.
    endif.
  endloop.
  clear lv_lin.
  describe table it_item lines lv_lin.
  if lv_lin = 0.
    write : / 'No records found'.
  endif.
  call function 'BAPI_GOODSMVT_CREATE'
    exporting
      goodsmvt_header  = wa_header
      goodsmvt_code    = wa_code
    importing
      materialdocument = lv_matdoc
    tables
      goodsmvt_item    = it_item
      return           = it_return.
  if it_return is initial.        " if record created successfully
    call function 'BAPI_TRANSACTION_COMMIT'. " commit work
    write : / lv_matdoc, 'IS CREATED SUCCESSFULLY' color 5.
    loop at it_item into wa_item.
      write : / 'Mat :', wa_item-material,'bat :', wa_item-batch.
    endloop.
  else.                           " if record is not created successfylly
    loop at it_return into wa_return.
      write : / wa_return-message color 6.
    endloop.
    uline.
  endif.
else.
  write : / 'No Records found' color 7.
endif. " gt_s035 is not initial
Edited by: Arunmozhi_06 on May 30, 2011 12:48 PM

Hi,
   Did you passing the leading 0's in the cost center field?
and check the below coding..
* 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.
  perform show_status using 'Scrapping(551) Material'.
* 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 xresb-matnr  to gm_item-material.
  move p_bdmng      to gm_item-entry_qnt.
  move xresb-meins  to gm_item-entry_uom.
  move xresb-werks  to gm_item-plant.
  move xresb-lgort  to gm_item-stge_loc.
  move p_grund      to gm_item-move_reas.
* Determine cost center per plant
  case xresb-werks.
    when '0004'.
      move '0000041430' to gm_item-costcenter."pass leading zero's in the cost center field
    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.
Maybe there is some config missing for your cost center, or maybe something missing in your code. check above.
Regards,
Dhina,..
Edited by: Dhina DMD on May 31, 2011 8:02 AM

Similar Messages

  • Different Consumption Account for Movement type 201 and 261

    Dear All ;
    Client want use different consumption account for movement type 201 and 261  .
    How we canmap this in SAP
    Kindly suggest .
    Regards;
    Joydeep Mukherjee

    This you can acheive by setting account assignment indicator is checked.
    OMJJ >>> Movement Type >>>Account Grouping >>Check account Assignment
    If this indicator is set, the system checks whether a G/L account or an account assignment has been specified on the item screen when user post transactional data. If so, the system copies this data to the posting line for account determination.
    If this indicator is not set, the system always uses the G/L accounts or account assignments determined automatically.

  • Disable or Validate Order or Cost center in MIGO for Mvmt type 201/261

    Hi All,
    I want to disable or validate 'Order' field in MIGO for the goods issue if the movement type is 201.
    I want to disable or validate  'Cost Center' field in MIGO for the goods issue if the movement type is 261.
    User do not want 'Order' field in MIGO for movement type 201 & User do not want 'Cost centre' field in MIGO for movement type 261.
    Thanks
    Pabi

    Hi
    go to OMJJ
    here select move type and then give move type 201
    now select 201 and click on Field selection (ENJOY)
    now just remove the order field from here
    similarly do for 261 movememt
    this will affect to whole client

  • Fld selectn for mvmt type 201 / acct 96220 differs for CO/PP order (011)

    Hi all,
    Purpose :  Our client want to use Statistical Internal Order in Movement Type - 201 with entries to be get posted to selective G/L Accounts relating to Vehicle Expenses
    For that purpose we have made the Order field as "Optional Field" for transfer posting.
    When we make an entry in Order field, system is allowing to post the entries in predefined G/L Accounts but our client want to post the entries to the specific G/L created for that purpose.
    After selecting that G/L in Tcode - MB1A we are getting the above error (Message no. M7093)..
    In FS00 - G/L Master, we have made the CO/PP Order field as Mandatory field
    When we make the Order field as "Mandatory" for transfer posting, system is allowing us to input the specific G/L but we do not want to keep the Order field as Mandatory for transfer posting since that will affect all other transfer postings.
    Please give us any solution
    Regards,
    Raj

    Hi
    Goto Transaction SE38 & enter the Program RM07CUFA
    Execute the program & enter the Movemnt type & G/L account change the Field sataus for the Mobvemnt type for the Field CO/PP Order as optional similarly change the G/L account to optional to suit your requirements.
    Thanks & Regards
    Kishore

  • Field Selection error for movement type and G/L account

    I am currently experiencing a field selection error between movement type 601 and G/L account 7140000.  The problem field is 'Segment'.  This field is set to required for the G/L account, but it is hidden for the movement type 601. This inconsistency causes an error when posting the goods movement. According to business requirement the field must be required for the G/L account, therefore we must make this field optional for the movement type.
    However, in configuration the field segment does not appear for the movement type 601. Therefore it can not be changed to optional.
    Does anyone know a workaround other than making this field optional for the G/L account because the business requirement is to have this field as required?????
    Many Thanks

    Hi,
    On the Error message detail, system will guide you to the Configuration details for Field settings for Movement type & Account, please get in touch with your FI consultant, to make the Field selection for the account similr to that of your movement type, this is a very common issue.
    Regards
    Chandra Shekhar

  • Fleet Equipment-IFCU-Goods movement not possible with mvmt type 201

    Hi Experts,
    When I am trying to post the movement of consumed Fuel & Distance by IFCU,the error comes 'Goods movement not possible with mvmt type 201'.
    Goods movement not possible with mvmt type 201
    Message no. M7096
    Diagnosis
    You have entered a movement type that has not been defined for this transaction/event.
    Procedure
    Choose another movement type.
    You can choose the movement type as follows:
    If you know the movement type, enter it directly in the Movement type field.
    Choose the movement type via the menu option Movement type.
    Choose the required movement type from the possible entries.
    If you do not find a suitable movement type, exit this function and choose a different goods movement from the Inventory Management menu.
    I cheked some of old post but not solved.I have also maintained IFCU in OMJJ for allowed transaction for 201 & 202 movement type but still not working.
    Please suggest me.

    Hi Maheswaran,
    Thanks for your reply.I have already configured,maintained the values and setting.
    Please check and update if any other solution.
    Regards,
    Baiju

  • Account assignment for Movt type 101 and 501

    All SAP Gurus,
    We want to do the account assignment for movt types 101, 102, 122, 123, 201, 202, 261, 262 accourding to the movement types.
    We are aware that the Transaction Key is 'GBB'.
    But how to know that which 'General Modification' is used for which movement types.
    (in short where we can find this link between movement types and Transaction Key and 'General Modification')
    Regards,

    To know this first you have to know what does the different general modifications means for GBB:
    AUA: for order settlement
    AUF: for goods receipts for orders (without account assignment)
    and for order settlement if AUA is not maintained
    AUI: Subsequent adjustment of actual price from cost center directly
    to material (with account assignment)
    BSA: for initial entry of stock balances
    INV: for expenditure/income from inventory differences
    VAX: for goods issues for sales orders without
    account assignment object (the account is not a cost element)
    VAY: for goods issues for sales orders with
    account assignment object (account is a cost element)
    VBO: for consumption from stock of material provided to vendor
    VBR: for internal goods issues (for example, for cost center)
    VKA: for sales order account assignment
    (for example, for individual purchase order)
    VKP: for project account assignment (for example, for individual PO)
    VNG: for scrapping/destruction
    VQP: for sample withdrawals without account assignment
    VQY: for sample withdrawals with account assignment
    ZOB: for goods receipts without purchase orders (mvt type 501)
    ZOF: for goods receipts without production orders
    (mvt types 521 and 531)
    You can also define your own account groupings. If you intend to post goods issues for cost centers (mvt type 201) and goods issues for orders (mvt type 261) to separate consumption accounts, you can assign the account grouping ZZZ to movement type 201 and account grouping YYY to movement type 261
    Then go and check OMWN.
    Regards,
    Indranil

  • Fld selection for mvmt type-561/acc399999 differs for ext GA amount in lc

    Dear pp experties
    When i am doing MB1C mvmt type 561, in repetitave manufacturing, i am facing one error message,
    the error message is (fld selection for mvmt type-561/acc 399999 differs for ext.GA amount in LC(023),I already checked g/l acc(fs00), already creted in plant 1234.
    pls explain i am very thank full in adv
    devendra (pp)

    Hi there,
    I think you have mistaken the forum.
    can you please explain how the current error is connected to CAF and/or GP?
    Regards,
    George.

  • Fld selection for mvmt type 511/ acct 520302 differes from Profit center Er

    Dear Gurus,
    I got error Fld selection for mvmt type 511/ acct 520302 differes from Profit center (042), since we have scrapped so many times with same GL, why this issue comes.
    if i do in OBC4>>>>Field status group>>>G018>>scrapping>>Additional acct assginment>>Profit center changer from suppress to opt entry. Is this error goes.
    But previous we have done scrapping, no issues, but currently happening
    Please advice me
    Thanks
    RS

    Hi,
    go to FS02 put the account 520302.then go to create/bank/interest tab .
    here double click on field status group. go into the additional accounting data here make profitcenter as optional if it is supress.
    OR
    goto SPRO >MM> Inventory mgm >movt types > select the 511 movement type.go to its field selection .
    here goto addinal accounting data and make profit cesnter as otional if it is supress
    regards,
    sujit

  • Fld selectn for mvmt type 543 / acct 6190030 differs for Asset retirement

    Dear All,
    I create a Subcontracting PO and issue goods to vender against that PO.
    Suppose i issue two materials with Qty 50 Each to vender.
    again Vender gave me back 10 Qty each becoze there is only 40 Qty is ussed for that material in subcontracting Scnerio.
    i take back that material to my inventory with movement type 542 against Sub PO.
    but again when i go to MIGO, then there is two problems
    1) System still show me BOM of 50 each but vender gave me back 10 each Qty.
    and i change that manually 40 Qty for Each.
    2) while Posting MIGO, system gave me this error 
    Fld selectn for mvmt type 543 / acct 6190030 differs for Asset retirement (016)
    please help me and give me direction if i have done any thing wrong.
    Regards,
    Pardeep malik

    Hi,
    Check the field status group in the create/bank/interest TAB of G/L Account 6190030
    in T.code: FS00.
    Also Use T.code: SE38 , Enter Program RM07CUFA
    Enter the Movement type 543 & enter G/L account 6190030
    Enter the company code
    Click on execute
    & update  & save.
    Now try ur transaction.
    Regards,
    Biju K

  • Fld selectn for mvmt type 673 / acct 407300 differs for Business Area (033)

    Hi All,
    I am implementing the Inetrcompany return process for the client.
    1) I have created a intercompany Return PO (NB doc type) .
    2)  Created a delivery against this PO.
    3) when i am posting goods issue for this Return delivery , i am getting this error "Fld selectn for mvmt type 673 / acct 407300 differs for Business Area (033)"
    Am i doing the steps correctly or i need to handle intercompany return differently?
    thanks
    Akkshaya

    hi
    it will due to the cross field selections in movement type 637 and field selection for gl acct
    any one of it have entry as required and one might not have
    go tothat acct in FS00 check the create/bank tab here see what u havein Field status group
    now go to OBC4 here for ur co co de meke business area mandetory or optional for that Field status group
    also check OMJJ for movemnt 673
    hope it help

  • Fld selectn for mvmt type 543 / acct 41281100 differs for Asset retir

    Dear Experts,
    I face an error while doing MIGO for subcontracting scenario.The error is " Fld selectn for mvmt type 543/acct 41281100 differs for Asset retir.
    I have checked in OBC4 for G/L account field for Asset retir and OMBW for movement type .I have also checked SE38 and had run the program.Still the error persisits .what may be the problem.
    Thanks & Regards
    subhash kulkarni

    Go to FS00, input the G/L Account 41281100 and execute.  There go to tab Create/bank/interest and chech whether you have maintained any value against "Field status group" and also you have checked the box for "Post automatically only".
    This should be done in consultation with your FI consultants in case the issue is in production.
    thanks
    G. Lakshmipathi

  • Fld selectn for mvmt type 543 / acct 41301100 differs for Asset retirement

    Hi all!
    While i am doing GR for a sub-contracting PO i am getting an error as below,
    "Fld selectn for mvmt type 543 / acct 41301100 differs for Asset retirement".
    What is the reason for this. I followed the proceed in performance asistant but held up there..
    How to solve this error.
    Thx in advance,
    Raj.

    Hi, Check the field selection in SA38, RM07CUFA and enter the mov and G/l account you can found red mark indication where gl account field status vary with MM field status.
    change as per your requirement.
    Enter the Movemnt type 543 & enter G/L account 41301100 Enter the compnay code
    Click on execute
    Click on the Column of G/L account for Asset requirement
    Anothe rsecreen with Field Status Group overview will be displayed.
    Click on Additional account assignments
    Change the filed Selection of Asset requirement from mandatory to Optional & save.
    Thanks & Regards,
    Kiran

  • Fld selectn for mvmt type 261 / acct 404000 differs for Cost center (010)

    Hi Guru's,
    When trying to Post a stock from one valuation type to other valuation type in MB11 with reference to refurbishment order i am getting
    "Fld selectn for mvmt type 261 / acct 404000 differs for Cost center (010)".
    May I know the actual problem and please help on rectifying this.
    -balaji

    Hi,
    Please Run the below Program through transaction code SE38
    RM07CUFA
    Provide Movement type 261
    Company Code
    GL code    404000
    Find out the error message, there can be conflicts between movement type Filed status and GL field status group.
    Please change the GL field status group.
    Ravi polampalli

  • Fld selectn for mvmt type 501 / acct 520075 differs for Vendor goods moveme

    Hi,
    When i do goodreceipt through 501 movment , I am getting the below error.
    "Fld selectn for mvmt type 501 / acct 520075 differs for Vendor goods movement (014)"
    Can you suggest , how to correct this.
    Thanks and regards
    Karthikeyan

    hi,
    use mov type 561 .
    or need to check account GL is correct or not .
    regards,
    sabs

Maybe you are looking for

  • REALLY old GR/IR clearing account problem

    Hello gurus, we have found an entry for a PO on our GR/IR clearing account. For that PO there has been a goods receipt (1 pc., 34,69$) and an invoice receipt (1 pc., 46,75$). Now, the trouble is, all this happened in 1998 (twelve years ago)! Can we d

  • How to disable Wifi and Network access in low level setting for security ?

    Hi New to here One of our final customer bought imac last months. OS 10.9, SN is c02*******J4i Since they are security printing, all the necessary ports accessing to outisdes need to be disabled in low level setting(not the ons just like turn on and

  • Filter Value for BADI

    Hi, Kindly Let me know the Filter Defined for Implementaing BADI. Hoping for your Response...!!!

  • Where can I find a service for macbook air?

    Where can I find a service for macbook air?

  • How to keep Firefox profile data on SD card?

    My Sony Xperia ZR is running out of internal memory. One of the culprits happens to be Firefox which seems to be occupying around 350+ MB of space. I have a separate SD card and wish to either move Firefox completely to it or at least move the profil