How to rollback a MQ transaction in distributed transactions..

Hi frnds,
i am doing distributed txn from a java code in which i am writing the msg strign on MQ and doing some DB updates...
the code works fine in case user transaction get committed successfully. also when exception is caused the DB updates gets rolled back but MSG on MQ doesnt get rolled back from Queue.
i am using a two phase connection from WAS 5.1 also the MQ properties in WAS is XA compatible..
pls help.........
try {
usertxn.begin();
l_con = openConnection ();
manageTran = true;
l_btid = l_rs.getString("btid");
l_accountno = l_rs.getString("accountno");
if(!getProccAcctStatus(l_accountno,l_con)){
logPorcessingAcctToDB(l_btid,l_con,l_accountno);
//write the message into MQ, starts
l_message = new IdentifiedMessage (
identity,
getControlMessage(l_currentRow));
l_queueSender.writeString (l_message);
System.out.println("R-[JMSSenderMasterThread][processRequest]...MSG Sucessfully PUT on QUEUE ");
//write the message into MQ, ends
updateRecord(l_currentRow,l_con,STATUS_ABH);
else{
System.out.println("R-[JMSSenderMasterThread][processRequest]..Acct is in proc State ");
break ;
usertxn.commit();
if (manageTran){
l_con.commit();
} catch (Exception e) {
// TODO: handle exception
System.out.println("R-[JMSSenderMasterThread][processRequest].......Exception in usertxn.begin()" );
e.printStackTrace();
l_con.rollback();
usertxn.rollback();

Hi,
Anirudh,
In my case... I am using a synchronus bpel process which inserts data into six different tables.. so i am using 6 db adapters for inserting into the tables... There is no dependency in between these tables... If any of the table is droped or removed then the transaction has to fail and the data has to be rolled back... and i have succeeded in rolling back the data.... But if all the tables are available for inserting the data... the problem is the data is not getting populated in the last table and i can c the instance in the bpel console... i dont know where the problem is???
Can u suggest a solution?
Regard
Surya
Edited by: ayrus on Jun 22, 2009 11:21 PM

Similar Messages

  • Cmp 2.0 how to rollback all related transactions

    Hi,
    As to rollback in cmp 2.0, I'm wondering:
    1. how to make a rollback (is call rollbackOnly the only way)?
    2. how to define within same transactions when an exception caught, rollback all other trans?
    3. modify in descriptor or in code, how? what's diff
    Thanks
    John

    Hi,
    As to rollback in cmp 2.0, I'm wondering:
    1. how to make a rollback (is call rollbackOnly the
    only way)?Yes. Entity beans can only have Container-managed transactions,
    so the only way to tell the container to mark the tx as rollback only
    is to call EntityContext.setRollbackOnly().
    >
    2. how to define within same transactions when an
    exception caught, rollback all other trans?There is no such behavior in EJB or J2EE. There is
    no special relationship/association like this
    between J2EE transactions. E.g., there are no
    nested transactions in J2EE. All transactions are
    independent and peers of one another.
    >
    3. modify in descriptor or in code, how? what's diff
    Thanks
    John

  • How to rollback previous transaction in a series of Adapters in BPEL

    in Bpel process we integrate 3 db adapters,
    2 adapters are successfully complted,3rd adpter failed.
    inthis situation how we rollback the 3 adapter transaction with out using of compensate handling

    hey,i have made the code plz chk it and do rep soon as ma project sbmission date is very near =((
    i am snaping an image from the web cam then comparing it with the red colored jpg image made in paint.
    the jpg image is converted  to give input image to imaq match vi.but after the comparison it gives the same output.
    on the front pannel the snapped image is displayed,the red colored image that is converted in to its respective pixels is displayed and the image that is obtained after cheking the image in the draw fails vi...the pic converted to pixels is all the time displayed.and the pass/fail icon always denotes one pass led on..plz chk the code =((.
    also can u provide me some guide line for using thr hough transform for the red color detection in lab view..i dont have to import the matlab code..i have to purely make it using the lb view libraries.
    also one more request pl rep me regularly as i really need your golden piece of advice for ma success.
    thnx
    Attachments:
    picture to image(BY ME).vi ‏102 KB
    untitled.JPG ‏3 KB

  • How to rollback all rows after inserted by OracleBulkCopy()

    Hello,
    I have tried to roll back external transaction and also tried to abort OracleBulkCopy() but it still inserted all rows. Anyone knows how to do this?
    Case 1: Didn't work. All row inserted anyway.
    OracleConnection connection = new OracleConnection(ConnectionString);
    connection.Open();
    OracleTransaction trans = connection.BeginTransaction();
    OracleBulkCopy bulkCopy = new OracleBulkCoopy(connection, OracleBulkCopyOptions.Default);
    bulkCopy.DestinationTableName = "SomeTable";
    bulkCopy.WriteToServer(SomeDataTable);
    trans.Rollback();
    Case 2: Use OracleRowsCopiedEventHandler delegate and in this callback set Oracle.RowsCopiedEventsArgs.Abort to true and then rollback on the transaction in catch block. Didn't work either.
    Thank you.
    Hoang

    OK, I have gotten the answer from Oracle. Transaction is not supported with OracleBulkCopy() currently.

  • How to monitor a specific transaction in Solution Manager ?

    Hi all,
    I have configured the Service Level Reporting and it works correctly.
    But i don't know how to monitor a specific transaction like SM21, DB02, FB01N etc... ?
    In the SL Reports configuration steps, we can configure this option : Select Business Processes For SL Report. I did a lot of tests but it does not work.
    Have i to configure the Business Process Monitoring ?
    Thanks.

    Hello,
    it depends a little on what you want to do. If you use the pure CCMS monitoring with the table ALTRAMONI you get average response time per instance and you only get new measurements once the status changes from green to yellow or red.
    In order to get continuous measurements you should look into Business Process Monitoring and the different documentations under https://service.sap.com/bpm --> Media Libary --> Technical Information. E.g. the PDF Setup Guide for Application Monitoring describes this "newer" dialog performance monitor. Probably you have to click on the calendar sheet in the Media Libary to also see older documents as well. As the Business Process Monitoring integrates with BW (there is also a BI Setup Guide in the Media LIbrary) you can get trendlines there. This BW integration also integrates back with SL Reporting.
    Some guidance for SL Reporting is probably given under https://service.sap.com/rkt-solman but I am not 100% sure.
    Best Regards
    Volker

  • How to find out the Transactions used per month & the USER who used that

    Hi,
    1)How to find out the Transactions used per month & the USER who used that?
    2)and can i get the above same for minimum 20 month?
    System : SAP- Enterprise Core Component.

    You can use my program...
    *& Report  Z_ABAP_TCODE_MONITOR
    *****&  Program Type          : Report                                 *
    *****&  Title                 : Z_ABAP_TCODE_MONITOR                   *
    *****&  Transaction code      : ZTCODE_USAGE                           *
    *****&  Developer name        : Shailendra Kolakaluri                  *
    *****&  Deveopment start date : 26 th Dec 2011                         *
    *****&  Development Package   : ZDEV                                   *
    *****&  Transport No          : DEVK906086                                       *
    *****&  Program Description   : This program is to display
    *List all tcodes executed during previous day.
    *& Show the number of users executing tcodes
    *& Modification history
    REPORT  Z_ABAP_TCODE_MONITOR.
    *& List all tcodes executed during previous day.
    *& Show the number of users executing tcodes
    TYPE-POOLS : slis.
    DATA: ind TYPE i,
          fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          layout TYPE slis_layout_alv,
          variant TYPE disvariant,
          events  TYPE slis_t_event WITH HEADER LINE,
          heading TYPE slis_t_listheader WITH HEADER LINE.
    *REPORT  z_report_usage.
    TYPES: BEGIN OF zusertcode,
      date   TYPE swncdatum,
      user   TYPE swncuname,
      mandt     TYPE swncmandt,
      tcode     TYPE swnctcode,
      report TYPE swncreportname,
      count     TYPE swncshcnt,
    END OF zusertcode.
    *data   : date type n.
    DATA: t_usertcode  TYPE swnc_t_aggusertcode,
          wa_usertcode TYPE swncaggusertcode,
          wa           TYPE zusertcode,
          t_ut         TYPE STANDARD TABLE OF zusertcode,
          wa_result    TYPE zusertcode,
          t_result     TYPE STANDARD TABLE OF zusertcode.
    PARAMETER: month TYPE dats DEFAULT sy-datum.
    *PARAMETER: date TYPE dats.
    *select-options : username for wa_usertcode-account.
    START-OF-SELECTION.
    PERFORM get_data.
    PERFORM get_fieldcatalog.
      PERFORM set_layout.
    PERFORM get_event.
    PERFORM get_comment.
      PERFORM display_data.
    FORM get_data .
    *date = sy-datum - 2 .
    After start-of-selection add this line (parameter Month required 01 as day).
      concatenate month+0(6) '01' into month.
      CALL FUNCTION 'SWNC_COLLECTOR_GET_AGGREGATES'
        EXPORTING
          component     = 'TOTAL'
          ASSIGNDSYS    = 'DEV'
          periodtype    = 'M'
          periodstrt    = month
        TABLES
          usertcode     = t_usertcode
        EXCEPTIONS
          no_data_found = 1
          OTHERS        = 2.
      wa-date  = month.
    *wa-date  = date.
      wa-mandt = sy-mandt.
    wa_usertcode-account = username.
      LOOP AT t_usertcode INTO wa_usertcode.
        wa-user = wa_usertcode-account.
        IF wa_usertcode-entry_id+72 = 'T'.
          wa-tcode  = wa_usertcode-entry_id.
          wa-report = space.
        ELSE.
          wa-tcode  = space.
          wa-report = wa_usertcode-entry_id.
        ENDIF.
        COLLECT wa INTO t_ut.
      ENDLOOP.
      SORT t_ut BY report ASCENDING.
      CLEAR: wa, wa_result.
    endform.
    FORM get_fieldcatalog .
    fcat-tabname     = 't_ut'.
    fcat-fieldname   = 'DATE'.
    fcat-seltext_l   = 'Date'.
    fcat-key         = 'X'.
    APPEND fcat.
      CLEAR fcat.
      fcat-tabname     = 't_ut'.
      fcat-fieldname   = 'MANDT'.
      fcat-seltext_l   = 'Client'.
      fcat-key         = 'X'.
      APPEND fcat.
      CLEAR fcat.
      fcat-tabname     = 't_ut'.
      fcat-fieldname   = 'USER'.
      fcat-seltext_l   = 'User Name'.
      fcat-key         = 'X'.
      APPEND fcat.
      CLEAR fcat.
      fcat-tabname     = 't_ut'.
      fcat-fieldname   = 'TCODE'.
      fcat-seltext_l   = 'Transaction Code'.
      fcat-key         = 'X'.
      APPEND fcat.
    ENDFORM.
    *&      Form  SET_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM set_layout .
      layout-colwidth_optimize = 'X'.
    ENDFORM.                    " SET_LAYOUT
    *&      Form  GET_EVENT
          text
    -->  p1        text
    <--  p2        text
    *FORM get_event .
    events-name = slis_ev_top_of_page.
    events-form = 'TOP_OF_PAGE'.
    APPEND events.
    *ENDFORM.                    " GET_EVENT
    **&      Form  GET_COMMENT
          text
    -->  p1        text
    <--  p2        text
    *FORM get_comment .
    DATA: text(30).
    text = 'Billing Report'.
    heading-typ = 'H'.
    heading-info = text.
    APPEND heading.
    *ENDFORM.                    " GET_COMMENT
    **&      Form  top_of_page
          text
    -->  p1        text
    <--  p2        text
    *FORM top_of_page .
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
       EXPORTING
         it_list_commentary       = heading[]
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
    *ENDFORM.                    " top_of_page
    *&      Form  DISPLAY_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM display_data .
      sort t_ut[].
    DELETE ADJACENT DUPLICATES FROM t_ut[] COMPARING ALL FIELDS.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-cprog
          is_layout          = layout
          it_fieldcat        = fcat[]
          i_save             = 'A'
          is_variant         = variant
          it_events          = events[]
        TABLES
          t_outtab           = t_ut
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " DISPLAY_DATA

  • HOW TO ROLLBACK ENCUMBRANCE BALANCE

    제품 : FIN_GL
    작성날짜 : 2003-11-24
    HOW TO ROLLBACK ENCUMBRANCE BALANCE
    ===================================
    PURPOSE
    balance table의 data 에 corrput 가 발생했을 경우 예산 가집행에 대한 rollback script를 제공한다.
    Explanation
    1. 관련 data를 모두 backup 받아 놓는다.
    2. data가 corrupt 된 기간을 확인한다.
    3. gl_balance table에서 corrupt 된 data를 delete한다.
    delete from GL_BALANCES
    where set_of_books_id = <set of books id which has the corruption >
    and actual_flag = 'E'
    and encumbrance_type_id = <Encumbrance type id of the corrupt balances>
    and period_year >= <Fiscal year which has the corruption >
    4. GL_SETS_OF_BOOKS table 을 update 한다.
    Update gl_sets_of_books
    set latest_encumbrance_year = <last correct encumbrance year>
    where set_of_books_id = <set of books id>
    5. Encumbrance Year 를 재오픈한다.
    Period 화면에서 해당 encumbrance year를 재오픈한다.
    6. Journal Status를 update 한다.
    update GL_JE_BATCHES set status = 'U', status_verified = 'N'
    where default_period_name in <List of periods in the
    corrupt fiscal year starting with the first period in that year
    up to the latest open for that encumberance type>
    and actual_flag = 'E'
    and set_of_books_id = <set of books id which has the corruption>
    and je_batch_id in
    (SELECT je_batch_id
    from GL_JE_HEADERS
    where encumbrance_type_id = <Corrupt encumbrance type id>
    and actual_flag = 'E'
    and set_of_books_id = <Corrupt Set of books Id>
    and period_name in <List of corrupt periods starting
    with the first period in the corrupt fiscal year
    up to the latest open for that encumbrance type>
    update GL_JE_HEADERS set status = 'U'
    where period_name IN <List of periods in the corrupt fiscal year
    starting with the first period in that year up to the latest
    open for that encumbrance>
    and actual_flag = 'E'
    and encumberance_type_id = <Corrupt encumbrance type id>
    and set_of_books_id = <Corrupt set of books id>
    update GL_JE_LINES
    set status = 'U'
    where period_name IN <<List of periods in the corrupt fiscal year
    starting with the first period in that year up to the latest
    open for that encumbrance>
    and set_of_books_id = <Corrupt set of books id>
    and je_header_id IN
    (select je_header_id
    from GL_JE_HEADERS
    where period_name in <List of periods in the corrupt fiscal
    starting with the first period in that year up to the latest
    open for that encumbrance>
    and actual_flag = 'E'
    and encumberance_type_id = <Corrupt Encumbrance Type Id>
    and set_of_books_id = <Corrupt Set of Books Id>
    7. encumbrance journal 들을 repost 한다.
    Example
    Reference Documents
    Note 99415.1

    If you want to load balances at the time of go live.
    Create a clearing account like data take over A/c
    MM will upload material balances using tcode MB1C and movement type 561
    it will generate the following accounting entry
    Finished goods stock a/c          Debit
    Semi-Finished goods stock a/c Debit
    Raw Material stock a/c             Debit
    Packing Material stock a/c        Debit
    Stores and spares a/c              Debit
    Data take over                          Credit
    Customer a/c (not recon G/l) Debit
    Data takeover a/c                  Credit
    Data takeover a/c                Debit
    Vendor a/c (not recon GL) Credit
    For Asset - tcode OASV
    Plant and Machinery a/c          Dr
    Accumulated depreciation a/c Credit
    Data takeover a/c                    Credit
    Cash balance through FBCJ
    G/L Tcode F-02,
    Data takeover a/c     Debit  (Balancing figure)
    Bank a/c                    Debit
    Advances                 Debit
    Share capital a/c       Credit
    Short term Loan a/c   Credit
    Long term loan a/c     Credit

  • HOW TO ROLLBACK BUDGET BALANCE

    제품 : FIN_GL
    작성날짜 : 2005-05-10
    HOW TO ROLLBACK BUDGET BALANCE
    ==============================
    PURPOSE
    GL Budget Balance 의 Period 설정이 잘 못 되었거나 Budget Balance 가 잘 못 지정되었을 경우에 아래와 같은 step으로 Budget Balance 를 Roll back 한다.
    Problem Description
    고객이 Budget 화면에서 End Date 설정을 잘 못 하여 Period 가 잘못 지정되었는데 Budget Journal이 생성된 후에 End Date 설정을 강제로 변경 하고자 할 경우나 Budget Balance 자체에 문제가 있을 때 아래와 같은 Step 으로 Rollback 한다.
    Solution Description
    Step 1. 관련 데이타는 미리 Back up 받아 놓는다.
    Step 2. Delete 할 Period를 결정한다.
    Step 3. GL_BALANCES table에서 해당 period 의 budget balance 를 Delete 한다.
    DELETE from GL_BALANCES
    where set_of_books_id = <set of books id which has the corruption >
    and actual_flag = 'B'
    and budget_version_id = <Budget version id of the corrupt budget >
    and period_year >= <Fiscal year which has the corruption >
    Step 4. Journal Statuses 를 Update 한다.
    UPDATE GL_JE_BATCHES set status = 'U', status_verified = 'N'
    where default_period_name in <List of periods in the
    corrupt fiscal year starting with the first period in that year
    up to the latest open for that budget>
    and actual_flag = 'B'
    and set_of_books_id = <set of books id which has the corruption>
    and je_batch_id in
    (SELECT je_batch_id
    from GL_JE_HEADERS
    where budget_version_id = <Corrupt budget version id>
    and actual_flag = 'B'
    and set_of_books_id = <Corrupt Set of books Id>
    and period_name in <List of corrupt periods starting
    with the first period in the corrupt fiscal year
    up to the latest open for that budget>
    UPDATE GL_JE_HEADERS set status = 'U'
    where period_name IN <List of periods in the corrupt fiscal year
    starting with the first period in that year up to the latest
    open for that budget>
    and actual_flag = 'B'
    and budget_version_id = <Corrupt budget version id>
    and set_of_books_id = <Corrupt set of books id>;
    update GL_JE_LINES set status = 'U'
    where period_name IN <<List of periods in the corrupt fiscal year
    starting with the first period in that year up to the latest
    open for that budget>
    and set_of_books_id = <Corrupt set of books id>
    and je_header_id IN
    (select je_header_id
    from GL_JE_HEADERS
    where period_name in <List of periods in the corrupt fiscal
    starting with the first period in that year up to the latest
    open for that budget>
    and actual_flag = 'B'
    and budget_version_id = <Corrupt budget version Id>
    and set_of_books_id = <Corrupt Set of Books Id>
    Step 5. Latest Open Budget Period 를 update 한다.
    UPDATE GL_BUDGETS
    set latest_opened_year = <Year prior to the corrupt fiscal year>,
    last_valid_period_name = <last period for the year prior to the
    corrupt fiscal year>
    where budget_name = <Budget name of the corrupt budget>
    and budget_type = 'standard'
    and set_of_books_id = <Corrupt set of books id>;
    DELETE from GL_BUDGET_PERIOD_RANGES
    where budget_version_id = <Corrupt budget version id>
    and period_year = <Corrupt budget fiscal year >;
    Step 6. Budget Year 를 Reopen한다.
    GL Responsibility 로 Applications에 접속하여 Budget Year를 Open
    Step 7. Budget Journals 을 Repost 한다.
    해당 Budget Journals 를 Repost 처리 한다.

    If you want to load balances at the time of go live.
    Create a clearing account like data take over A/c
    MM will upload material balances using tcode MB1C and movement type 561
    it will generate the following accounting entry
    Finished goods stock a/c          Debit
    Semi-Finished goods stock a/c Debit
    Raw Material stock a/c             Debit
    Packing Material stock a/c        Debit
    Stores and spares a/c              Debit
    Data take over                          Credit
    Customer a/c (not recon G/l) Debit
    Data takeover a/c                  Credit
    Data takeover a/c                Debit
    Vendor a/c (not recon GL) Credit
    For Asset - tcode OASV
    Plant and Machinery a/c          Dr
    Accumulated depreciation a/c Credit
    Data takeover a/c                    Credit
    Cash balance through FBCJ
    G/L Tcode F-02,
    Data takeover a/c     Debit  (Balancing figure)
    Bank a/c                    Debit
    Advances                 Debit
    Share capital a/c       Credit
    Short term Loan a/c   Credit
    Long term loan a/c     Credit

  • How To Perform Lot Split Transactions Using Transaction Open Interface (MTI)

    Can anyone give me some guidance on how to perform lot split transaction using MTI?
    I am using the following code:
    DECLARE
    l_transaction_type_id NUMBER := 83;
    l_transaction_action_id NUMBER := 41;
    l_transaction_source_type_id NUMBER := 13;
    l_org_id NUMBER := 1884;
    l_txn_header_id NUMBER;
    l_txn_if_id1 NUMBER;
    l_txn_if_id2 NUMBER;
    l_txn_if_id3 NUMBER;
    l_parent_id NUMBER;
    l_sysdate DATE;
    l_item_id NUMBER :=287996;
    l_user_id NUMBER;
    l_distribution_account_id NUMBER;
    l_exp_date DATE;
    BEGIN
    --For Lot Merge, there should be only one resultant lot.
    --The transaction_quantity populated in MTI/MTLI should be the entire
    --quantity that is available to transact for the org/sub/item/locator/LPN in
    --that particular lot number.
    --Get transaction_header_id for all the MTIs
    SELECT APPS.mtl_material_transactions_s.NEXTVAL
    INTO l_txn_header_id
    FROM sys.dual;
    --Get transaction_interface_id of resultant record
    SELECT APPS.mtl_material_transactions_s.NEXTVAL
    INTO l_txn_if_id1
    FROM sys.dual;
    l_parent_id := l_txn_if_id1;
    l_sysdate := SYSDATE;
    l_user_id := -1; --substitute with a valid user_id
    l_distribution_account_id := NULL; --needed for lot translate
    l_exp_date := NULL; --set if required
    --Populate the MTI record for resultant record
    INSERT INTO MTL_TRANSACTIONS_INTERFACE
    transaction_interface_id,
    transaction_header_id,
    Source_Code,
    Source_Line_Id,
    Source_Header_Id,
    Process_flag,
    Transaction_Mode,
    Lock_Flag,
    Inventory_Item_Id,
    revision,
    Organization_id,
    Subinventory_Code,
    Locator_Id,
    Transaction_Type_Id,
    Transaction_Source_Type_Id,
    Transaction_Action_Id,
    Transaction_Quantity,
    Transaction_UOM,
    Primary_Quantity,
    Transaction_Date,
    Last_Update_Date,
    Last_Updated_By,
    Creation_Date,
    Created_By,
    distribution_account_id,
    parent_id,
    transaction_batch_id,
    transaction_batch_seq,
    lpn_id,
    transfer_lpn_id
    VALUES
    l_txn_if_id1, --transaction_header_id
    l_txn_header_id, --transaction_interface_id
    'INV', --source_code
    -1, --source_header_id
    -1, --source_line_id
    1, --process_flag
    3, --transaction_mode
    2, --lock_flag
    l_item_id, --inventory_item_id
    null, --revision
    l_org_id, --organization_id
    'EACH', --subinventory_code
    1198, --locator_id
    l_transaction_type_id, --transaction_type_id
    l_transaction_source_type_id, --transaction_source_type_id
    l_transaction_action_Id, --l_transaction_action_id
    100000, --transaction_quantity
    'EA', --transaction_uom
    100000, --primary_quantity
    l_sysdate, --Transaction_Date
    l_sysdate, --Last_Update_Date
    l_user_id, --Last_Updated_by
    l_sysdate, --Creation_Date
    l_user_id, --Created_by
    l_distribution_account_id, --distribution_account_id
    l_parent_id, --parent_id
    l_txn_header_id, --transaction_batch_id
    2, --transaction_batch_seq
    NULL, --lpn_id (for source MTI)
    NULL --transfer_lpn_id (for resultant MTIs)
    --Insert MTLI corresponding to the resultant MTI record
    INSERT INTO MTL_TRANSACTION_LOTS_INTERFACE(
    transaction_interface_id
    , Source_Code
    , Source_Line_Id
    , Process_Flag
    , Last_Update_Date
    , Last_Updated_By
    , Creation_Date
    , Created_By
    , Lot_Number
    , lot_expiration_date
    , Transaction_Quantity
    , Primary_Quantity
    VALUES (
    l_txn_if_id1 --transaction_interface_id
    , 'INV' --Source_Code
    , -1 --Source_Line_Id
    , 'Y' --Process_Flag
    , l_sysdate --Last_Update_Date
    , l_user_id --Last_Updated_by
    , l_sysdate --Creation_date
    , l_user_id --Created_By
    , 'Q0000.1' --Lot_Number
    , l_exp_date --Lot_Expiration_Date
    , 100000 --transaction_quantity
    , 100000 --primary_quantity
    INSERT INTO MTL_TRANSACTIONS_INTERFACE
    transaction_interface_id,
    transaction_header_id,
    Source_Code,
    Source_Line_Id,
    Source_Header_Id,
    Process_flag,
    Transaction_Mode,
    Lock_Flag,
    Inventory_Item_Id,
    revision,
    Organization_id,
    Subinventory_Code,
    Locator_Id,
    Transaction_Type_Id,
    Transaction_Source_Type_Id,
    Transaction_Action_Id,
    Transaction_Quantity,
    Transaction_UOM,
    Primary_Quantity,
    Transaction_Date,
    Last_Update_Date,
    Last_Updated_By,
    Creation_Date,
    Created_By,
    distribution_account_id,
    parent_id,
    transaction_batch_id,
    transaction_batch_seq,
    lpn_id,
    transfer_lpn_id
    VALUES
    l_txn_if_id1, --transaction_header_id
    l_txn_header_id, --transaction_interface_id
    'INV', --source_code
    -1, --source_header_id
    -1, --source_line_id
    1, --process_flag
    3, --transaction_mode
    2, --lock_flag
    l_item_id, --inventory_item_id
    null, --revision
    l_org_id, --organization_id
    'EACH', --subinventory_code
    1198, --locator_id
    l_transaction_type_id, --transaction_type_id
    l_transaction_source_type_id, --transaction_source_type_id
    l_transaction_action_Id, --l_transaction_action_id
    100000, --transaction_quantity
    'EA', --transaction_uom
    100000, --primary_quantity
    l_sysdate, --Transaction_Date
    l_sysdate, --Last_Update_Date
    l_user_id, --Last_Updated_by
    l_sysdate, --Creation_Date
    l_user_id, --Created_by
    l_distribution_account_id, --distribution_account_id
    l_parent_id, --parent_id
    l_txn_header_id, --transaction_batch_id
    3, --transaction_batch_seq
    NULL, --lpn_id (for source MTI)
    NULL --transfer_lpn_id (for resultant MTIs)
    --Insert MTLI corresponding to the resultant MTI record
    INSERT INTO MTL_TRANSACTION_LOTS_INTERFACE(
    transaction_interface_id
    , Source_Code
    , Source_Line_Id
    , Process_Flag
    , Last_Update_Date
    , Last_Updated_By
    , Creation_Date
    , Created_By
    , Lot_Number
    , lot_expiration_date
    , Transaction_Quantity
    , Primary_Quantity
    VALUES (
    l_txn_if_id1 --transaction_interface_id
    , 'INV' --Source_Code
    , -1 --Source_Line_Id
    , 'Y' --Process_Flag
    , l_sysdate --Last_Update_Date
    , l_user_id --Last_Updated_by
    , l_sysdate --Creation_date
    , l_user_id --Created_By
    , 'Q0000.1' --Lot_Number
    , l_exp_date --Lot_Expiration_Date
    , 100000 --transaction_quantity
    , 100000 --primary_quantity
    --Get transaction_interface_id of Source record-1
    SELECT APPS.mtl_material_transactions_s.NEXTVAL
    INTO l_txn_if_id2
    FROM sys.dual;
    --Populate the MTI record for Source record-1
    INSERT INTO MTL_TRANSACTIONS_INTERFACE
    transaction_interface_id,
    transaction_header_id,
    Source_Code,
    Source_Line_Id,
    Source_Header_Id,
    Process_flag,
    Transaction_Mode,
    Lock_Flag,
    Inventory_Item_Id,
    revision,
    Organization_id,
    Subinventory_Code,
    Locator_Id,
    Transaction_Type_Id,
    Transaction_Source_Type_Id,
    Transaction_Action_Id,
    Transaction_Quantity,
    Transaction_UOM,
    Primary_Quantity,
    Transaction_Date,
    Last_Update_Date,
    Last_Updated_By,
    Creation_Date,
    Created_By,
    distribution_account_id,
    parent_id,
    transaction_batch_id,
    transaction_batch_seq,
    lpn_id,
    transfer_lpn_id
    VALUES
    l_txn_if_id2, --transaction_header_id
    l_txn_header_id, --transaction_interface_id
    'INV', --source_code
    -1, --source_header_id
    -1, --source_line_id
    1, --process_flag
    3, --transaction_mode
    2, --lock_flag
    l_item_id, --inventory_item_id
    null, --revision
    l_org_id, --organization_id
    'EACH', --subinventory_code
    1198, --locator_id
    l_transaction_type_id, --transaction_type_id
    l_transaction_source_type_id, --transaction_source_type_id
    l_transaction_action_Id, --transaction_action_id
    -200000, --transaction_quantity
    'EA', --transaction_uom
    -200000, --primary_quantity
    l_sysdate, --Transaction_Date
    l_sysdate, --Last_Update_Date
    l_user_id, --Last_Updated_by
    l_sysdate, --Creation_Date
    l_user_id, --Created_by
    l_distribution_account_id, --distribution_account_id
    l_parent_id, --parent_id
    l_txn_header_id, --transaction_batch_id
    1, --transaction_batch_seq
    NULL, --lpn_id (for source MTI)
    NULL --transfer_lpn_id (for resultant MTIs)
    --Insert MTLI corresponding to the Source record-1
    INSERT INTO MTL_TRANSACTION_LOTS_INTERFACE(
    transaction_interface_id
    , Source_Code
    , Source_Line_Id
    , Process_Flag
    , Last_Update_Date
    , Last_Updated_By
    , Creation_Date
    , Created_By
    , Lot_Number
    , lot_expiration_date
    , Transaction_Quantity
    , Primary_Quantity
    VALUES (
    l_txn_if_id2 --transaction_interface_id
    , 'INV' --Source_Code
    , -1 --Source_Line_Id
    , 'Y' --Process_Flag
    , l_sysdate --Last_Update_Date
    , l_user_id --Last_Updated_by
    , l_sysdate --Creation_date
    , l_user_id --Created_By
    , 'Q0000' --Lot_Number
    , l_exp_date --Lot_Expiration_Date
    , -200000 --transaction_quantity
    , -200000 --primary_quantity
    END;

    the first MTI record should be the source record ...ie. it should have transaction quantity as negative.
    new set of MTI records should have positive transaction quantities.
    Also ensure that sum of transaction quantities for the set should be 0...
    What is the error that you are getting?
    Thanks,
    Hrishi.

  • HOW TO Create  variants for transaction MASS on LFA1 object?

    hOW TO Create  variants for transaction MASS on LFA1 object?
    Edited by: cheppalliakr on Nov 10, 2011 1:09 PM
    Moderator message: please do more research before asking, show what you have done yourself and provide more information when asking.
    Edited by: Thomas Zloch on Nov 10, 2011 3:10 PM

    Hi Oscar ,
    You need to create optional date prompt variable  in BW which fills your requirement .
    Ex : If you require report should always run for 1st of the month to last of month .Then create Optional date variable in BW with interval .write customer exit ,
    if from date is left blank it should take 1st of the month and if todate is left blank it should take last of the month .
    when creating webi schedules , leave prompts as blank.

  • How to Run a Custom Transaction in Back Ground after give the Input?

    Hi,
        I have problem that how to execute a Custom Transaction in Back Ground after end user will save a variant for input. In my Transaction there is no menu to save a Variant & to Execute in Back Ground.
    Please suggest me how to do this in my Custom Transaction.

    Hi Ramana,
    what kind of report you want to  execute? the report is Executable Report or Modulepool prog. ??
    if it is a executable program so when u execute (F8) from SE38 when u find the selection-screen in the menu bar ->Program ->Execute in Background( F9) option exits there u can schedule your report in Background or else use toce SM36 ( Define Background Job).
    Why you want to run it in background with transaction code if you have this options?
    Regards,
    Sunil kairam.

  • HT1918 How can I see ALL transaction history in my account.  Specifically, I would like to see the gift cards I have redeemed for my account.  I know I have over $200 in my account but it is not showing the balance anywhere.  Any ideas?!?!?

    How can I see ALL transaction history in my account.  Specifically, I want to review the gift cards I have redeemed but the amounts are not showing up in my account.  I know I have over $200 in my account and I am unable to access it.  The site wants me to pay by credit card and I don't want to do that.  Any ideas how I can recover the money in my account?

    You can only view your account's purchase history, you can't view a history of card redemptions.
    My account's balance shows at the top left of the store's page on my computer's iTunes, and by logging in to view my account via the Store > View Account menu option. On my iOS devices it shows at the bottom of, for example, the Featured tab in the App Store app under my account id (or you can view your account via Settings > iTunes & App Stores and it should show on the screen that you are taken to).
    To view your purchase history : log into your account on your computer's iTunes via the Store > View Account menu option, you should then see a Purchase History section with a 'see all' link to the right of it. Click on that and you should then see a list of your purchases.
    You've tried logging out and back into your account to see if your balance then shows ? If not, and you can't see where it might have been spent, then you could try contacting iTunes Support and see if they can help : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • How to get the current transaction variant ?

    dear guru,
    could you please tell me how to get the current transaction variant?
    i tried the following method:
      DATA l_tcvariant TYPE tcvariant.
      CALL 'DY_GET_TX_VARIANT'
         ID 'VARIANT' FIELD l_tcvariant.
    but it failed.
    best regards.
    zj

    Try something like this
    DATA:  VARIANT LIKE SHDTVCIU-TCVARIANT.
      CLEAR VARIANT.
      CALL FUNCTION 'RS_HDSYS_GET_TC_VARIANT'
       IMPORTING
         TCVARIANT                     = VARIANT
    *     FLAG_CLIENT_INDEPENDENT       =
    *     RC                            =
    *   TABLES
    *     T_SCREEN_VARIANTS             =
    *     T_INACTIVE_FUNCTIONS          =

  • How do I view the transaction log in SQL Server 2008?

    Hello,
    I want to know how to view all the transactions taken during a particular period of time. I know there is a log file, ending with .ldf, created for each database. But how do I view this file?
    Is there any tool in the SQL Server studio that can enable me to view the transactions for a given time period?
    The reason for me wanting to view the log file is that, last week during a power outage, certain amount of data was not written. And one my friend had also messed up some of the data (unfortunately, she doesn't remember what she did).
    Thanks in advance.

    Hi,
     It enables you to read from you transaction log which contains very valuable information about stuff that is happening in your database.
    select
    * from fn_dblog (null,null) ..
    EXAMPLE:
    SELECT
    FROM
    ::fn_dblog(NULL, NULL)
    WHERE
    operation = 'LOP_DELETE_SPLIT'
    Thanks,
    Leks

  • How to update the FB01L transaction using the FM  bapi_acc_document_post

    Hi All,
            How to update the FB01L transaction using the bapi_acc_document_post but there is no ledger group field in the bapi function module.
    Please help me how to do it.

    hi,
    use batch input method for the same.
    check this.
    [https://forums.sdn.sap.com/click.jspa?searchID=19107237&messageID=884744]

Maybe you are looking for

  • Multiple rows to multiple column

    I have a table TableA containing 2 columns ( Name and Value). Here I know what are the values for column Name TABLEA ======= Name Parameter Nexus 11 GPlay 21 Demo 31 I need a query which provides the below output Desired Output: ====== First Second T

  • Error in data loads-Error occured in the data seletion

    Hi, We have to do an init load for Period 10 from data source 0EC_PCA_3. When the period changes we usually copy the previous infopack and change the fiscal yesr period and do an init load. This time we have to change the fiscal period to 010, we cre

  • Error #1009 !! Can't solve :(

    Hi, guys . I made an interactive movie ( or i'm making....) Check it out :http://mr-agu.deviantart.com/#/d2s1vfc The PROBLEM is that the Error #1009 comes up. Here is the actionscript I used. home_btn.addEventListener(MouseEvent.CLICK, home); functio

  • Connecting ABAP tool with Portal..

    Hi All, I have one requirement where i have to connect ABAP tool, that is developed in WebDynpro ABAP. Now i am connecting that with Url iview, that is working fine. But my problem arises when i have to pass userid and his pwd to that iview. That ivi

  • Safari randomly closes?

    Safari closes at random times. How do I fix this?