BAPI for MB1B transaction for 309 movemnet type

Dear ABAPERs,
I am using "BAPI_GOODSMVT_CREATE"  its working fine for only one record.
If in internal table number of records r there.
By looping that table paasing the record each time.
First time its working fine and posting the document.
But second time its giving error as "Finish batch already linked with batch 7607AF0120".
7607AF0120 which is previous(first batch number).
For first record BAPI is working fine for the remaing records its not working.
Please help me regarding this.
Regards,
Simha.

Hello,
use this code after the BAPI call.
IF NOT GM_RETMTD IS INITIAL.
  COMMIT WORK AND WAIT.
  CALL FUNCTION 'DEQUEUE_ALL'.
ELSE.
  COMMIT WORK AND WAIT.
  CALL FUNCTION 'DEQUEUE_ALL'.
ENDIF.
Vasanth

Similar Messages

  • Lsmw for mb1b transaction.

    hello,
        is it possible to do lsmw for mb1b transaction.
        if possible then how ?
        any suggestions please.

    Hi
    you can use the LSMW for the transaction MB1B .
    Or
    use the program to stock transfer from plant to plant :
    REPORT YMBIE096 LINE-SIZE 80.
    * Program: YMBIE096
    * Author: Sheila Titchener
    * Date: Mar 1999
    * Purpose: To move stock to new plant
    TABLES: MCHB.
    * internal table
    DATA: BEGIN OF I_MCHB OCCURS 0,
    MATNR LIKE MCHB-MATNR,
    LGORT LIKE MCHB-LGORT,
    CHARG LIKE MCHB-CHARG,
    J_2CTRNR LIKE MCHB-J_2CTRNR,
    J_2CELNG LIKE MCHB-J_2CELNG,
    CLABS LIKE MCHB-CLABS,
    END OF I_MCHB.
    *-----------------------new code smt nov 98-----------------------------
    * batch input tables
    DATA BEGIN OF BDCDATA OCCURS 100.
    INCLUDE STRUCTURE BDCDATA.
    DATA END OF BDCDATA.
    DATA BEGIN OF MESSTAB OCCURS 10.
    INCLUDE STRUCTURE BDCMSGCOLL.
    DATA END OF MESSTAB.
    SELECT-OPTIONS S_MATNR FOR MCHB-MATNR.
    PARAMETERS: P_DISP AS CHECKBOX.
    DATA W_MODE.
    DATA W_MESSAGE LIKE MESSAGE.
    START-OF-SELECTION.
    SELECT MATNR LGORT J_2CELNG CHARG CLABS J_2CTRNR FROM MCHB
    INTO CORRESPONDING FIELDS OF TABLE I_MCHB
    WHERE MATNR IN S_MATNR
    AND WERKS = 'BT'.
    END-OF-SELECTION.
    LOOP AT I_MCHB.
    CHECK I_MCHB-J_2CELNG NE 0.
    CHECK I_MCHB-J_2CELNG = I_MCHB-CLABS.
    PERFORM MOVE_STOCK.
    ENDLOOP.
    *& Form MOVE_STOCK
    * Call transaction MB1B to transfer stock
    FORM MOVE_STOCK.
    DATA: W_QTY(10).
    WRITE I_MCHB-J_2CELNG TO W_QTY DECIMALS 0.
    REFRESH: BDCDATA, MESSTAB.
    PERFORM DYNPRO USING:
    'X' 'SAPMM07M' '0400',
    ' ' 'RM07M-BWARTWA' '301',
    ' ' 'RM07M-WERKS' 'BT',
    ' ' 'RM07M-LGORT' I_MCHB-LGORT,
    ' ' 'BDC_OKCODE' '/0',
    'X' 'SAPMM07M' '0421',
    ' ' 'MSEGK-UMWRK' '94',
    ' ' 'MSEGK-UMLGO' I_MCHB-LGORT,
    ' ' 'BDC_OKCODE' 'NLE',
    *CODING BLOCK
    'X' 'SAPLKACB' '0002',
    ' ' 'BDC_OKCODE' '/0',
    'X' 'SAPMM07M' '0421',
    ' ' 'MSEG-MATNR(1)' I_MCHB-MATNR,
    ' ' 'MSEG-ERFMG(1)' W_QTY,
    ' ' 'MSEG-CHARG(1)' I_MCHB-CHARG,
    ' ' 'BDC_OKCODE' '/0',
    *CODING BLOCK
    'X' 'SAPLKACB' '0002',
    ' ' 'BDC_OKCODE' '/0',
    *CODING BLOCK
    'X' 'SAPLKACB' '0002',
    ' ' 'BDC_OKCODE' '/0',
    * 'X' 'SAPMM07M' '0410',
    * ' ' 'BDC_OKCODE' '/0',
    *CODING BLOCK
    * 'X' 'SAPLKACB' '0002',
    * ' ' 'BDC_OKCODE' '/8',
    *CODING BLOCK
    * 'X' 'SAPLKACB' '0002',
    * ' ' 'BDC_OKCODE' '/8',
    'X' 'SAPLJ2CW' '0190',
    ' ' 'J_5C7-UMCHA' I_MCHB-CHARG,
    ' ' 'BDC_OKCODE' '/7',
    'X' 'SAPMM07M' '0421',
    ' ' 'BDC_OKCODE' '/11',
    *CODING BLOCK
    'X' 'SAPLKACB' '0002',
    ' ' 'BDC_OKCODE' '/0'.
    IF P_DISP = 'X'.
    W_MODE = 'A'.
    ELSE.
    W_MODE = 'N'.
    ENDIF.
    CALL TRANSACTION 'MB1B' USING BDCDATA MODE W_MODE UPDATE 'S'
    MESSAGES INTO MESSTAB.
    WRITE: / I_MCHB-MATNR, I_MCHB-CHARG, I_MCHB-LGORT,
    I_MCHB-J_2CTRNR, I_MCHB-J_2CELNG.
    IF SY-SUBRC NE 0.
    * what to do if there's an error????
    LOOP AT MESSTAB.
    SY-MSGNO = MESSTAB-MSGNR.
    CALL FUNCTION 'WRITE_MESSAGE'
    EXPORTING
    MSGID = MESSTAB-MSGID
    MSGNO = SY-MSGNO
    MSGTY = MESSTAB-MSGTYP
    MSGV1 = MESSTAB-MSGV1
    MSGV2 = MESSTAB-MSGV2
    MSGV3 = MESSTAB-MSGV3
    MSGV4 = MESSTAB-MSGV4
    MSGV5 = MESSTAB-MSGV4
    IMPORTING
    * error =
    MESSG = W_MESSAGE
    * msgln =
    EXCEPTIONS
    OTHERS = 1.
    WRITE: / W_MESSAGE.
    * message id messtab-msgid type 'I' number messtab-msgnr.
    ENDLOOP.
    ENDIF.
    ENDFORM. " CHANGE_BILLING_TYPE
    * FORM DYNPRO - new form smt nov 1998
    * > DYNBEGIN
    * > NAME
    * > VALUE
    FORM DYNPRO USING DYNBEGIN NAME VALUE.
    IF DYNBEGIN = 'X'.
    CLEAR BDCDATA.
    MOVE: NAME TO BDCDATA-PROGRAM,
    VALUE TO BDCDATA-DYNPRO,
    'X' TO BDCDATA-DYNBEGIN.
    APPEND BDCDATA.
    ELSE.
    CLEAR BDCDATA.
    MOVE: NAME TO BDCDATA-FNAM,
    VALUE TO BDCDATA-FVAL.
    APPEND BDCDATA.
    ENDIF.
    ENDFORM.
    Edited by: raj on Jun 5, 2009 7:55 AM

  • User Exit / Enhacement / BADI for MB1B transaction

    Hi all,
    Movement type -311
    Plant 1004
    Storage Location - XXX
    Now reuirement is like during Transfer posting when user provides Receving Location and Material and Press Enter
    batch and qunatity should be automatically populated  based on some Selection.
    I checked BADI but no BADI is available when user press Enter.
    Please suggest me with Enhancement Spot , User Exit for this requirement.\
    Thanks in advance.
    Harsharandeep Singh

    Hi Harsha,
    Try these User Exits/Enhancements.
    Following are the BADIs for MB1B transaction:
    ARC_MM_MATBEL_CHECK Check Add-On-Specific Criteria for MM_MATBEL
    ARC_MM_MATBEL_WRITE Check Add-On-Specific Data for MM_MATBEL
    MB_CHECK_LINE_BADI BAdI: Check Line Before Copying to the Blocking Tables
    MB_CIN_LMBMBU04 posting of gr
    MB_CIN_MM07MFB7 BAdI for India Version exit in include MM07MFB7
    MB_CIN_MM07MFB7_QTY Proposal of quantity from Excise invoice in GR
    MB_DOCUMENT_BADI BAdIs when Creating a Material Document
    MB_DOCUMENT_UPDATE BADI when updating material document: MSEG and MKPF
    MB_MIGO_BADI BAdI in MIGO for External Detail Subscreens
    MB_MIGO_ITEM_BADI BAdI in MIGO for Changing Item Data
    MB_RESERVATION_BADI MB21/MB22: Check and Complete Dialog Data
    Following are the user exit for the same:
    MB_CF001 Customer Function Exit in the Case of Updating a Mat. Doc.
    MBCF0002 Customer function exit: Segment text in material doc. item
    MBCF0005 Material document item for goods receipt/issue slip
    MBCF0006 Customer function for WBS element
    MBCF0007 Customer function exit: Updating a reservation
    MBCF0009 Filling the storage location field
    MBCF0010 Customer exit: Create reservation BAPI_RESERVATION_CREATE1
    MBCF0011 Read from RESB and RKPF for print list in MB26
    Vishnu.

  • Mail Alert to Managing Director for every transaction for customer & vendor

    Dear Gurus,
    Please let me know how & where to do setting for mail alert to Managing Director for every transaction for customer & vendor,
    Like for Customer: Sales Order, PGI, Invoice, Payment receipt................
           for Vendor: Purchase Order, GR, Miro, Outgoing Payment for Vendor,
    Thanks in advance,
    Sai

    Hi Sai
    If you want to set the mail alert to Managing Director for every transaction for customer & vendor Like for Customer Sales Order, PGI, Invoice , PO  then maintain at  all levels  output type and at all levels for those output types  assign the authorization as Managing Director
    But for what purpose you want to assign the authorization member at all levels, what is your requirement?
    Regards
    Srinath

  • Create  of (demo for)OVAI (transaction for create entries for each vendor)

    hi all,
    can anyone plz tell me how 2 create (demo for)OVAI (transaction for create entries for each vendor)
    thans & regards,
    srinivas reddy.

    hiii
    yes you can call transaction like that..take tcode in that parameter then you can use it in your program with statement like
    call transaction (variable)..in background process.
    regards
    twinkal

  • Exit or Badi for Migo transaction for given condition

    Hi,
    I need exit or Badi for MIGO transaction for the following condition ( When the goods receipt for the PO is initiated, prior to posting the accounting document).
    Please let me know
    Regards
    Ramesh

    Hi
    In rel 4.6C you can find these BADIs:
    - MB_DOCUMENT_BADI or MB_DOCUMENT_UPDATE
    and these exits: MBCF0002, MB_CF001
    Max

  • Want Transaction History for Particular Transaction for Particular User. .

    Hello Friends,
    I have one query.
    I want to get detailed Transaction History for Particular Transaction for Particular User_Id for particular Time/Date period, with his/her Terminal ID info ,also.
    One USER_ID in SAP Server is shared among 6-7 people to do their work.
    So, I want to know that from which terminal that user has run that transaction to do its work on particular Date/time.
    I tried STAT, STAD, ST03N,  but did not help me very much to get deep level information.
    May be, i am missing something to get the solution for this kind of situation.
    Any Solution for this kind of Situation ?
    I am waiting for your valuable Response.
    Regards,
    Bhavik Shroff

    I want to get detailed Transaction History for Particular Transaction for Particular User_Id for particular Time/Date period, with his/her Terminal ID info ,also.
    ST01 will give you the Result after switching on the TRACE. I want to get Transaction History for a particular DAY/Weeks/Month .
    e.g.
    One User Id is shared among 6-7 people. One of the person did something using FB08 transaction on last 08/07/2008. But, as the User ID is shared among several User, How can i know the person who did that change and from which place/Terminal.
    See,
    I have the following information to fire the search.
    -> User Id information
    -> which transaction he/she used to do that work
    -> When he did the change for something (means i know the exact date)
    But , I want to know ,from which Terminal he/she executed that transaction, as the User ID is shared among several people.
    You tell me the way ,so that i can have total required information for this kind of situation.
    If  i am wrong at any step , then let me know.
    Regards,
    Bhavik Shroff.

  • Mb1b transaction for BAPI_GOODSMVT_CREATE

    Hello,
    i have to create a zbapi in which the user has to expose only selected fields(lgort, charg, and receiving storage location).
    i ll expose only those fields in importparameters of ZBAPI.
    In the source code, how to approach this and call the fm bapi_goodsmvt_create to update mb1b transaction.
    Can anyone give me source code to develop this in function module???

    In YOur Z Bapi call the original bapi.
    Fill the bapi structures with the import parameters you have for the z bapi.
    Pass the exporting parameters that are obtained from the original bapi to the exporting parameters of the Z bapi.
    Sample:
    FUNCTION Z_GOODSMVT_CREATE.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(GOODSMVT_HEADER) LIKE  BAPI2017_GM_HEAD_01 STRUCTURE
    *"        BAPI2017_GM_HEAD_01
    *"     VALUE(GOODSMVT_CODE) LIKE  BAPI2017_GM_CODE STRUCTURE
    *"        BAPI2017_GM_CODE
    *"     VALUE(TESTRUN) LIKE  BAPI2017_GM_GEN-TESTRUN DEFAULT SPACE
    *"  EXPORTING
    *"     VALUE(GOODSMVT_HEADRET) LIKE  BAPI2017_GM_HEAD_RET STRUCTURE
    *"        BAPI2017_GM_HEAD_RET
    *"     VALUE(MATERIALDOCUMENT) TYPE  BAPI2017_GM_HEAD_RET-MAT_DOC
    *"     VALUE(MATDOCUMENTYEAR) TYPE  BAPI2017_GM_HEAD_RET-DOC_YEAR
    *"  TABLES
    *"      GOODSMVT_ITEM STRUCTURE  BAPI2017_GM_ITEM_CREATE
    *"      GOODSMVT_SERIALNUMBER STRUCTURE  BAPI2017_GM_SERIALNUMBER
    *"       OPTIONAL
    *"      RETURN STRUCTURE  BAPIRET2
    Pass variables here..
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          GOODSMVT_HEADER       = GOODSMVT_HEADER
          GOODSMVT_CODE         = GOODSMVT_CODE
          TESTRUN               = TESTRUN
        IMPORTING
          GOODSMVT_HEADRET      = GOODSMVT_HEADRET
          MATERIALDOCUMENT      = MATERIALDOCUMENT
          MATDOCUMENTYEAR       = MATDOCUMENTYEAR
        TABLES
          GOODSMVT_ITEM         = GOODSMVT_ITEM
          GOODSMVT_SERIALNUMBER = GOODSMVT_SERIALNUMBER
          RETURN                = RETURN.
    endfunction.
    Regards,
    Ravi

  • I looking for a transaction for debug the IDOCS

    Hello friends,
    I looking for a transaction that allowed me to debug the IDOC´s when the direction is only 1 (Outbound),  for ex. for IDOC´s has direction 2 (Inbound) I used the WE19 transaction, and to choose the "Inbound Function Module" button and I take the "Call in debug mode" checkbox,
    Can you tell me if exist another program for this?
    Thanks in advance,
    David

    Hi,
    IDocs are processed by a function module, which are mapped against in table EDIFCT. When you process an IDoc with BD87 you can have a breakpoint in the function and it will stop. For outbound processing it depends on which program is sending the IDoc. For transactional data like purchase orders, the IDoc is created via RSNAST00 which in turn calls a function module assigned to the processing code (BD41).
    For your knowledge [reference1|Re: How to debug Idoc; [reference2|Outbound IDoc debug;.
    May it helps you.
    Regards,
    DS.

  • API need for miscellaneous transaction for an inventory

    Which API is normally used for a miscellaneous transaction for an inventory?
    Regards ,
    Tdhoke,

    Hi, Could you please send me the insert statement for this. i am having serialised item for it.
    Actually i am getting a error when i do insert into my mtl_material_transactions
    insert into mtl_transactions_interface
    ( SOURCE_CODE
    , SOURCE_LINE_ID
    , SOURCE_HEADER_ID
    , PROCESS_FLAG
    , TRANSACTION_MODE
    , TRANSACTION_INTERFACE_ID
    , ITEM_SEGMENT1
    , ORGANIZATION_ID
    , SUBINVENTORY_CODE
    , LOCATOR_ID
    , TRANSACTION_QUANTITY
    , TRANSACTION_UOM
    , TRANSACTION_DATE
    , TRANSACTION_SOURCE_ID
    , TRANSACTION_SOURCE_NAME
    , TRANSACTION_TYPE_ID
    , TRANSACTION_REFERENCE
    --, TRANSFER_SUBINVENTORY
    , XFER_LOC_SEGMENT1
    , XFER_LOC_SEGMENT2
    , XFER_LOC_SEGMENT3
    , XFER_LOC_SEGMENT4
    , LAST_UPDATE_DATE
    , LAST_UPDATED_BY
    , CREATION_DATE
    , CREATED_BY)
    values(
    'Mis Receipt Test Oct07',--SOURCE_CODE
    1,--SOURCE_LINE_ID
    1,--SOURCE_HEADER_ID
    1,--PROCESS_FLAG
    3,-- TRANSACTION_MODE
    1,-- TRANSACTION_INTERFACE_ID
    62925800100005,-- ITEM_SEGMENT1
    122,-- ORGANIZATION_ID
    'Put Away',-- SUBINVENTORY_CODE
    NULL,--LOCATOR_ID
    1,-- TRANSACTION_QUANTITY
    'EA',-- TRANSACTION_UOM
    SYSDATE,-- TRANSACTION_DATE
    1,-- TRANSACTION_SOURCE_ID
    'Purchase order',-- TRANSACTION_SOURCE_NAME
    35,-- TRANSACTION_TYPE_ID
    'Mis Receipt Test Oct07',-- TRANSACTION_REFERENCE
    NULL, TRANSFER_SUBINVENTORY
    NULL,-- XFER_LOC_SEGMENT1
    NULL,-- XFER_LOC_SEGMENT2
    NULL,-- XFER_LOC_SEGMENT3
    NULL,-- XFER_LOC_SEGMENT4
    SYSDATE,-- LAST_UPDATE_DATE
    1130,-- LAST_UPDATED_BY
    SYSDATE,-- CREATION_DATE
    1130-- CREATED_BY
    )

  • Background JOB scheduling for BD87 transaction for IDOC processing

    Hello All,
    I have a requirement to schedule program(BD87) for background processing.I have created varient for selection screen.
    Query is how do i slect a particular node ithe tree and execute a particular button in background processing.
    Do i need to write BDC for BD87 transaction?? or there is any other approach for the same.
    Thanks.

    oh!! that's different! if your IDOCs have errors and remain in status 51, no transaction in the whole world can proceed them.
    you will have to investigate what caused the status 51. go to transaction BD87, select your IDOCs and go to the IDOC-body. you have several segments there: contol, data and status ... go to the status-segment, open it and double-click on the message in red at the side of the status 51 - analyse the error, edit the IDOCs or - if that is no solution, kill them and create new ones.
    what is the error message? (just out of curiosity ...)

  • Need enhancement for KS01 Transaction for Department Filed

    Hi Gurus,
    Iam having a requirement on KS01 transaction to find enhancement for Department field.
    Here I could not find any enhancement Exit to proceed further.
    Please let know is there any alternate solution:
    Here is my comlete rquirement below:
    1.Make the u2018Departmentu2019 field, (CSKSZ-ABTEI), mandatory in the Cost Centre Master Record using   screen program name SAPLKMA1 and screen number 0300.
    2.Check the entry made in the u2018Departmentu2019 field, (CSKSZ-ABTEI), in the Cost Centre master record
    When the transaction KS01 is saved check the value in the u2018Departmentu2019 field, (CSKSZ-ABTEI), against values stored in a variable in a Z table by Controlling Area, if matched allow creation, if no match go to the first message below.
    3.Department field is not allowed to be changed once postings have been made to the Cost Centre.
    Check for transaction KS02 or KS12 when save check if u2018Departmentu2019 field has been changed, if no change continue, if changed check to see if postings have been made to the Cost Centre (table COEP), if postings have been made give the second error below, if no postings allow changes to be saved.
    Thanks & Regards
    Bhaskar

    Hi,
        Check following User Exits in SMOD all are for KS01.
      Exit Name           Description
    COCCA001            Customer enhancement to cost center authorization checks
    COCCA002            Customer Functions for Organizational Authorization Checks
    COOMEP01            CO-OM: Information system -> line item reports
    COOMKA01            Customer Fields for Cost Element Master Data
    COOMKS01            Customer Fields for Cost Center Master Data
    COOMKS02            Cost Center: Checks When Saving
    COOMKS03            Cost Center: BAPI Enhancements
    COOMLA01            Customer Fields for Activity Type Master Data
    Salil....

  • Regarding userexit for pa40 transaction for validating position and persona

    when iam entering the position and  personal area in pa40 transaction , this position is should matched with personal area of the pa13 screen,and that personal area should match with pa40 presoanl area, for this requiremetnt which userexit is suitable.
    please any one worked on this type of requirement please help me on this.

    k

  • Output for f110 transaction, for F110_IN_CHECK

    hi all,
    iam developing a SCRIPT by copying Standard program and also copy the form F11-_IN_CHECK, and iam unable to see the standard output, can any of you please send me the output of the form.
    thanks in advance

    hai
    F110 transaction used for APP (Automatic Payment Programme) First u go to the transaction F110 and maintain parameters and then execute the programme after words u come back Go to Menu bar System under that one Owns pool request there u find the Out put transaction.
    Subbu

  • Validation for FBCJ transaction  for section code

    hi
    i am trying to create validation for cash documents posted through FBCJ transaction . by using ob29 transaction i have created validation it is working fine when i am posting entry f-02 but not validating documents which posted through FBCJ .
    why documents are  ignored when i am posting through FBCJ . is there any deferent  way to validate documents posted through FBCJ ? 
    prerequisite :- based on company code
    check  :-  based on  section code ' ' (blank)
    message :- just information msg
    thanks in advance
    sachin

    hi
    i am trying to tally  the balances for AR03 with f.01 but i am unable to match it . now what difference i am getting i am not able to trace it back .because when i uploaded assets that time some difference was there because of some assets value and postings .
    now through ar03 i am getting dieffrent gross values,accumulated depreciation  , wip , net values .
    is it possible to match both transaction balance ?
    so if i have to match the balances for both the transactions what point i have to consider and which area i have to focus ,
    in asset closing procedure which trace points are available .
    like f.01 balance in fixed , now i can change in asset area only   
    thanks in advance
    sachin

Maybe you are looking for

  • Hey! "iTunes has encountered a problem, and needs to close"

    Hey all, I just got me a new iPod, a 30g video, but as soon as i finished uploading all of my music on it, iTunes has started so read "iTunes has encountered a problem, and needs to close" every time I open it. I have read all the forms on this topic

  • All portlet instances disappeared !

    and the only error i found in log file is this ####<Jul 8, 2010 3:28:45 PM EEST> <Info> <EJB> <DCVISDEVAPP3> <PortalServer> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <BEA1-041D296664FBE10BF341> <> <12

  • Anchors/links within pages

    I really need to link from one iWeb page to an anchor inside another, but can't figure out how or if this can be done. To see what I mean, go here: http://web.mac.com/wildwing1/Recipes/Index.html What I want to do is make an anchor on each of the rec

  • Get Modulus and exp from public key

    Hi friends, I'm extracting the public key from the X.509 certificate .Is there any way i can extract modulus and exponent from the public key. i'm using bouncy castle api . Any suggestions are greatly appreciated. //Generate Certificate //Extract pub

  • Modification comparison

    We are upgrading from 4.5b to 4.7. Whilst attempting to apply a SAP note, the message 'carry out modification comparison first. No changes possible' is received when attempting to modify a standard SAP program. Any suggestions how to overcome this?