Skip to Content
author's profile photo Former Member
Former Member

BAPI_TRANSACTION_COMMIT in select

Hi Gurus,

I've written following code

select * from ztable

perform create_bom.

endselect

in create_bom ive written a bapi to create bom and immediatley calling BAPI_TRANSACTION_COMMIT. However the program crashes giving dump saying that i cant have commit within my database cursor.

Im i remove the BAPI_TRANSACTION_COMMIT outside ot create_bom subroutine and place it after endsleect everything works fine.

Can any one guide me what is happening ?

Why cant i have a BAPI_TRANSACTION_COMMIT within a select endselect loop.

Thanks !

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 10, 2008 at 01:04 PM

    BAPI_TRANSACTION_COMMIT is similar to COMMIT WORK.

    As COMMIT WORK is not allowed within SELECT...ENDSELECT, so you are geting dump.

    You can replace SELECT..ENDSELECT with SELECT..INTO ITAB..

    LOOP AT ITAB.

    perform create_bom.

    COMMIT WORK.

    ENDLOOP.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 10, 2008 at 12:53 PM

    Store first all entries of ZTABLE in internal table I_ZTABLE.

    Then loop over internal table and do your perform create_bom.

    regards,

    hans

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 10, 2008 at 01:02 PM

    Please do an F1 on select and you will learn the set of instructions that you cannot have in between a SELECT / ENDSELECT loop.

    COMMIT WORK is not possible and will give a dump.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 06:52 AM

    thanks guys

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.