Idoc: post goods movement and batch classification

Hi,
I want to process a goods receipt to PO (mvt: 101) via Idoc for a batch managed part and also add some data into the batch classification.
The idoc processing works (including the creation of the classification data). but as soon as I want to add data to the classification within the same function module I get a lock entry error.
Can someone give me a hint of how to do that? what is the best option to fill additional classification data (maybe a BAPI?)
Thanks for any help!
Right now I added the following coding to the function module (copy of IDOC_INPUT_MBGMCR) which processes the idoc (here I get the error that the data of material XXX is blocked!):
    PERFORM dynpro USING:
            'X'  'SAPMM03S'     '0105',
            ' '  'RM03S-MATNR'   batch_data-matnr,
            ' '  'RM03S-WERKS'   batch_data-werks,
            ' '  'RM03S-CHARG'   batch_data-batch,
            ' '  'RM03S-LGORT'   '    ',
            'X'  'SAPMM03S'     '0200',
            ' '  'BDC_OKCODE'   '/7',
            'X'  'SAPLCTMS'     '0109'.
    IF batch_data-trace1 NE space.
      PERFORM dynpro USING:
            ' '  'RCTMS-MNAME(1)'  'TRACECODE1',
            ' '  'RCTMS-MWERT(1)'   batch_data-trace1.
    ENDIF.
    IF batch_data-trace2 NE space.
      PERFORM dynpro USING:
            ' '  'RCTMS-MNAME(2)'  'TRACECODE2',
            ' '  'RCTMS-MWERT(2)'   batch_data-trace2.
    ENDIF.
    IF batch_data-lotno NE space.
      PERFORM dynpro USING:
            ' '  'RCTMS-MNAME(4)'  'STM_LOT',
            ' '  'RCTMS-MWERT(4)'   batch_data-lotno.
    ENDIF.
    IF batch_data-difflot NE space.
      PERFORM dynpro USING:
            ' '  'RCTMS-MNAME(5)'  'STM_DIFFUSION_LOT',
            ' '  'RCTMS-MWERT(5)'   batch_data-difflot.
    ENDIF.
    PERFORM dynpro USING:
            ' '  'BDC_OKCODE'   '/3',
            'X'  'SAPMM03S'     '0200',
            ' '  'BDC_OKCODE'   '/11'.
  post changes
    CLEAR:  msg, msg[].
    l_mode = 'N'.
    CALL TRANSACTION 'MSC2' USING tbdc MODE l_mode UPDATE 'S'
                            MESSAGES INTO msg.

Sorry! resolved it myself. I was jsut a commit missing.
I called the BAPI_TRANSACTION_COMMIT before processing my routine to update the classification data and it worked.

Similar Messages

  • Inbound idoc for posting Goods movements

    hi,
      iam using Transaction WE19 and posting some test data to post goods movement into same system for testing . i have used the message type MBGMCR and process code BAPI for the inbound processing.
    Iam posting test data for movement types 101,102,641 and 642 .and iam processing with the unbound FM BAPI_IDOC_INPUT1,  but iam getting a status 51 (application dod not posted ) with error as ' Update control of movement type is incorrect (entry 101 X X )'.
    what does this mean? please suggest why this error could come?
    if i get a status of 54 - EDI: Partner profile inbound not available .what may be the error? my partner profile setting were correct.
    thanks,
    soha

    Hi !
    The error means that there is an inconsistency between the "given" data and the date that BWA 101 is needing.
    The Table that is beeing checked is the T156.
    Check the data you are giving to the idoc. You may check it with the IDOC-docu or with the Docu of the FM BAPI_GOODSMVT_CREATE to see what fields
    have to be filled in what way to create an 101 .
    Regards
    Rainer
    Some points would be nice if that helped...

  • IDOC on Goods movement

    Hi Experts,
    I need to generate outbound IDOC on goods movement 551 - scrapping. It is an information IDoc whenever a 551 is posted. Let me know the message & basic type & steps to create the same.
    Thanks,
    Sourabh

    Message Type: WMMBXY
    Basic Type: WMMBID02
    FM: L_IDOC_INPUT_WMMBXY
    1 -  Create a new output type ZXXX with program as RSNASTED and form as EDI_PROCESSING and medium as 6.
    2 -  Create an OUTBOUND partner profile for LS type in WE20 and use WMMBXY message type. Create a port in Transactional RFC.
    3 - Create a condition record in MN21 for automatic processing for that output type.
    If you want the output type to be triggered only for 551 movement, create a requirement and assign it to the output type in the output determination procedure.

  • Outbound IDoc for Goods Movement

    HI
    We need to generate XML files for goods movement posted in SAP at Goods Receipt (MIGO) and Post Goods Issue (VL02N). Requirement is asynchronous update where the receiving system will poll the xml file at the end of the day.
    I have not been able to find any standard outbound idoc for goods movement.Can someone advise how they tackled any similar requirement? Any other approach also appreciated.
    Thanks
    Sriram

    Answer to the question, which would be useful to all.
    <b>MIGO</b>
    MB_CF001 - Customer Function Exit in the Case of Updating a Mat. Doc.
    This exit is called on update task, populate segments (edidc & edidd) of WMMBID02 (WMMBXY message type) and use MASTER_IDOC_DISTRIBUTE. Also you need to maintain the ALE Distribution model in WE64 for this message type.
    Inside the code you can restrict based on movement type. No need to issue COMMIT.
    <b>VL02N</b>
    You can use BAdi: LE_SHP_DELIVERY_PROC to perform this.
    Create Implementation and use the method SAVE_AND_PUBLISH_DOCUMENT.
    Hope this help to others as well.

  • Error in posting goods movement with production order

    Hi all,
        I have a custom program that post goods movement using function  'Bapi_Goodsmvt_Create'.
    The material passed into is a FERT material along with movement type 101,  goods-movement code = 02', movement indicator = 'F'.    This function gives an error :
    'E M7 022 Order quantity exceeded by 21.390 cse : item xxxxxx, plant xx prod order xxxxx'.
    The material is a take weight material.   In production order, it came up to 910lb for total weight.
    In goods receiving this material, i have changed the material from 910lb to 1016.950.
    This is where the error came in.  Note: 21.39 cases = 106.95 lb.
    We had such take weight material worked before.
    Can anyone pls suggestion what can be done about this ?
    Thanks
    Joyce

    Hi Dario,
        Because the finised material is a take weight product, it should be ok unless there is a tolerance in the takeweight.   Also the production order is generated from 2 sales orders.
       To migo a production order, would it be A01 Goods Receipt and  R08 for prod order ?
    Thank you.
    Joyce

  • CORUAWFP "An application for posting goods movements is already active"

    Hi Experts,
    We have a strange message- we don't get it why this happnes so often.
    In our system, production order confirmatins are done vai BAPI (BAPI_PRODORDCONF_CREATE_TT) and we are executing CO1P (CORUAWFP) every 10 minutes in order to avoid "Intended Goods Movements (GRs are suspendded, because of Lock sutuation)" .
    The problem is when CO1P(CORUAWFP)) is kicked, sometimes a strange message is displayed  ,"An application for posting goods movements is already active" , and the job ends abnormaly. We are sure we don't run CO1P  (CORUAWFP) in parallel.
    Why this situation happnens?
    Thanks in advance.
    Best Refards,
    /Hiro Okamoto
    Edited by: Hiro Okamoto on Aug 27, 2011 5:36 PM
    Edited by: Hiro Okamoto on Aug 27, 2011 5:37 PM
    Edited by: Hiro Okamoto on Aug 27, 2011 5:37 PM

    The message simply means there are 2 or more programs being executed simultaneously accessing the same set of data & hence a locking occurs or the table lock is not getting released within time so that the next program can get a lock.
    Get in touch with your system admin & ask them to monitor & let you know which programs are locking. Once you have that info, you can then change the schedule of the programs to prevent locking.

  • Error in PARALLEL goods movements involving batch name

    Hello everybody,
    I am facing some problem in goods movement and expect some views in the following scenario.
    Having a problem in PARALLEL goods movements when multiple users perform any of these pair of transactions
    (PGI with GR),
    (GR with GR),
    (GR-PGI-PPorder confirmation)
    The system generates message M3682 'Batch & of material & is already locked by &'.
    We are facing this transaction blocks very frequently.
    The common factor in all these transactions is the batch name 'OK'.
    Till now the material lock (OMJI) was "EXCLUSIVE LOCK", i had tried to simulate with activating "LATE LOCK" also, but the same error M3682.
    Please spare some time in analysing this scenario. Please let me know if you need more details.
    Thanks & Regards,
    Joy Ghosh

    What is the quantity of one batch?
    How many plants do you have?
    in what portions do you sell this material?
    Answering those questions could actually bring some light, as I usually consider this as an unlikely event, which often happens in training sessions because of unrealistic test cases, but occurs less often in reality.
    I am working in a chemical company and a batch could be for example any quantity between 2 and 100 tons.
    Lets assume we produced 20 tons, and we pack this into 50 drums with 200 kg and 100 drums with 100 kg
    Assuming that each customer orders just 1 drum, then we would have a maximum of 150 activities until the batch is gone.
    if this is distributed through 15 plants, then each plant has just 10 activities.
    In a normal day with 8 hour working time, it is a little more than one activity per hour in average.
    Is a batch really  sold off within one day, or isn't it usual that you may need several days until everything is sold?
    If the users are well trained, which means they know that they shall not use a change transaction to display content, that they shall leave a transaction when they go for lunch (or something else) then such cases that they block each other can happen but much less than some panic stories try tell us.
    Try to search for notes, there are some, but they can certainly not make this locking go away as it is technically needed, like you cannot have 2 trains on single track without collision

  • Goods Movement and Billing status at header level

    Hello,
    Im new to this topic and have some very basic questions
    Will WBSTK field be updated with goods movement status for a given sales order number in VBUK table ?
    Similarly, will FKSTK/FKSTK or BUCHK will be updated with billing status ?
    I know that for a given delivery document number, I can track the status at the item level.
    But my aim is to know the overall goods movement and billing status at the order header level.
    Any clues will be of great help.
    Thanking you in advance.
    Regards,
    Preethi

    Hi Preethi,
    A sales order does not determine a billing status for delivery related billing, field VBUK-FKSTK is only determined for delivey.
    Just because of this, you will not find billing status field in VA03 -> goto header;
    you could only find billing status field for delivery in VL03N -> status overview.
    Best regards,
    Crystal Lin

  • FM/BAPI for Post Goods Recipt and Reservations

    Hi All,
    Is there any BAPI/FM for posting Goods receipt and Reservations . Please send some sample example to post goods receipt using Inbound Delivery & Reservations
    Thanks
    Bobby

    Bobby,
          I think you can use the FM  BAPI_ACC_GOODS_MOVEMENT_POST for this purpose. You try to write a sample program and see how it works.
    Sojan

  • Related to goods movement and IDOC generation

    Hi,
    I need to create an IDOC for custom output type attached to transaction MIGO for purchase order after goods reciept.
    How can I attach an output type with transaction MIGO.
    Or is there is any other method to generate IDOC after good reciept.

    Dear Goutam
    All the three you can see in <b>MB51</b>.
    Thanks
    G. Lakshmipathi

  • Lock a certain day from posting goods movements

    Hi, is it possible to lock a certain calendar day so that no goods movement can be posted on that day? Thanks in advance for any input.
    yu

    In that case you want to use auth group that I mentioned earlier. From Jan 20 through Jan 31 when you want to lock MM transactions but leave it open for COGS or other adjustment /correction postings, then you should define which group of people should have that access and assign auth group to inventory accounts as well as these users. You should activate auth group control only for such period. But remember such group of people will be able to do any inventory transaction. If you know they will be posting only to COGS then bring COGS account as well under same auth group and let them not post to any other GL accounts. You can still automate these changes using the program and batch job. Obviously OB52 will look complicated.
    There is no way to establish date wise control if you are looking for it. You will have to work around one of these ways.
    Regards
    Subodh

  • IDoc For Goods Movement

    Hi All,
    We have a catch weight management implemented and am using IDoc Type /CWM/MBGMCR01 to create goods movement.
    However, I do not see any segment in the IDOC where I could pass data into the batch characterisitcs for Goods Receipt. Currently we have around 20 characteristics on the batch for any particular GR and my client wants to create GR with all the characteristics our Vendor would be transmitting to us.
    Is there a way to achieve this.
    Thanks.

    in IDOC MBGMCR03 u can use extention segment E1BPPAREX for passing characteristics values directly to database table. U need to pass pass table name, fields name and values in parameter of this structure.
    Please search SDN for how to use extension structures in BAPI ..
    regards

  • Need Bapi Names for Post Goods Reciept and Post Goods issue to STO in MIGO

    Hi All..
    I need to post goods receipt using input data in MIGO. Is there any BAPI that i can use.
    Also once STO (Stock Transport order) is created, i also need to Post goods issue to STO in MIGO transaction. I do need a bapi for this too...
    Appreciate your help and will reward any helpful answers.
    Thanks..

    Hi,
    ata  : 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 with header line.
    data  : gm_retmtd  type bapi2017_gm_head_ret-mat_doc.
    clear : gm_return, gm_retmtd. refresh gm_return.
    gm_code-gm_code      = '03'.
    gm_header-header_txt = firstscreen-bktxt.
        gm_header-pstng_date = sy-datum.
        gm_header-doc_date   = sy-datum.
        gm_header-ver_gr_gi_slip = ' '.  "print
        gm_code-gm_code      = '03'.
      move lineitem1-bwartwa  to gm_item-move_type     .
          move lineitem1-matnr  to gm_item-material.
          move lineitem1-erfmg     to gm_item-entry_qnt.
          move 'EA'    to gm_item-entry_uom.
          move lineitem1-werks  to gm_item-plant.
          move lineitem1-lgort  to gm_item-stge_loc.
          move lineitem1-kostl to gm_item-costcenter.
          while gm_item-costcenter+9(1) = ' '.
            shift gm_item-costcenter right.
          endwhile.
          overlay gm_item-costcenter with '0000000000'.
          append gm_item.
    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.
    Thanks
    venki

  • Goods Movement with Batch Management

    Hi,
    During Goods Receipt or One Step transfer posting, I need to search first for a batch with characteristic values, and if a batch already exists in the system with the same characteristic values it posts to the same batch number. If a batch doesn't exist with the characteristic then it assigns a new batch number for the items to be received.
    Ex. I have batch num 1 in the system with characteristics X and Y. I receive new item, and input characteristics X and Z...since it doesnt exist it creates a new batch 2. but if I receive another item with characteristics X and Y, it uses batch 1.
    Is this possible?
    Thanks,
    Lee

    Hi PSantosh,
    How does Batch Derivation exactly work? My purpose is just to get the Batch Number unique with the Lot num and Expiration Date.
    So I cannot have an entry for example:
    Batch Num 001, Lot1234, 01/25/2008
    Batch Num 002, Lot1234, 01/25/2008
    During goods receipt, if I get a material with Lot1234, 01/25/2008 from a Vendor, it must post only to the existing Batch num with Lot1234, 01/25/2008. If it doesn;t exist thats when a new batch is created.
    Thanks,
    Lee

  • IDOC for Goods Movements

    Hi gurus,
    I am currently looking for IDOCs configuration in order to send (outbound) and receive (inbound) goods movements between SAP and a legacy system.
    Basically information about configuration( how to trigger IDOC outbound to legacy system), message type, Idoc type, Process Code (For inbound).
    Any information will be appreciated.
    Best Regards,
    Gabriel Santana

    Hi !
    Here comes some information for the INBOUND idocs....
    There is a IDOC for transmitting goods movements from a legacy system.
    It's message-type is: WMMBXY
    IDOC-Type is: WMMBID02 (See we60 for it's pretty good docu....)
    Prcoess-Code is :WMMB
    The function that processes the data is: L_IDOC_INPUT_WMMBXY
    Hope that helped a bit (for inbound)....
    Regards
    Rainer
    Some points would be nice if that helped.

Maybe you are looking for

  • Is it possible to broadcast live skype conversatio...

    I have a discussion forum and I would love to be able to have members call in via skype and have live discussions with me that could be broadcast for all members to hear. Is this possible? Is there some sort of widget that would allow this?

  • Domains ending in .local are no longer accessible under Yosemite

    Yesterday, on Mavericks, I was able to access our lan's local debian server which runs dnsmasq and serves out sites that have domains like web1.debbox.local. Today, on Yosemite, they are not accessible. The mac is unable to ping servers that end with

  • Ringtones and iTunes

    My question is in regard to, how I get "ringtones" to show up in iTunes? I go under preferences and it's not there. I've tried looking but can't find a place where "ringtones" is at. Thanks so much for the help! I'm trying to get a m4r file to become

  • Does restoring from backup overwrite current library with backed-up one?

    My external hard drive died a sudden and mysterious death, so I am cobbling my music collection back together from backup DVDs and my iPod. Can someone please tell me if restoring from backup DVDs will overwrite my current library with the backed-up

  • Msi bluetooth headset is bot recogizable as bluetooth device

    I have bought a MSI bluetooth headset. The manual of this device claims that it should work with a SonyEricsson T610, but my GSM doesn't "see" the headset. The GSM is able to see other bluetooth (headset) devices. I tried the headset with my laptop.