Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Invalid COMMIT WORK in an update function module. in VKM1 Tcode

Madhurivs23
Participant
0 Likes
5,495

Hi All,

I am getting the short dump with message "Invalid COMMIT WORK in an update function module. "

Calling a COMMIT WORK in an update process is not allowed

because the function modules triggered in a Logical Unit

of Work cannot then be processed correctly.

in FM : SO_DOCUMENT_SEND_API1

Prev. it was giving error in one of my driver program where I had written the commi Work after calling FM for sending fax :

"CONVERT_OTF_AND_FAX" .


call function 'CONVERT_OTF_AND_FAX'
    exporting
      FAXOPTIONS = W_ITCPP
      USER       = NAST-USNAM
    importing
      MSGID      = W_MSGID
      MSGNO      = W_MSGNO
      MSGV1      = W_MSGV1
      MSGV2      = W_MSGV2
      MSGV3      = W_MSGV3
      MSGV4      = W_MSGV4
    tables
      OTF        = IT_OTF.
if sy-subrc eq 0.
  commit work.
  submit RSCONN01 with MODE = 'FAX' and return.
endif.
  

Please explain me where and how I can change my code so that this error should not come?

Rgds.

MAdhuri

1 ACCEPTED SOLUTION
Read only

former_member194416
Contributor
0 Likes
3,379

Hi,

Create a function module as update module. Call this fm and process your code in this fm without "commit work" statement. It will be committed then with the standard commit.

Regards,

9 REPLIES 9
Read only

former_member194416
Contributor
0 Likes
3,380

Hi,

Create a function module as update module. Call this fm and process your code in this fm without "commit work" statement. It will be committed then with the standard commit.

Regards,

Read only

0 Likes
3,379

Hi Madhuri,

When calling the FM - SO_DOCUMENT_SEND_API1, do not pass an "X" to commit work parameter, this should fix your issue.

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

document_data =

COMMIT_WORK = ' '

Regards,

Chen

Read only

0 Likes
3,379

Even if for the output type in whose driver program, that commit work is given, is given the option "Send with application own transaction", its calling the RSNAST00 program , and through that its calling the driver program, and I think this one is creating a problem.

I am trying with ur solution. This error is happening in Quality system only.

Hi Chen,

If I remove the commit_work = 'X'. its not sending the email to the corresponding addresses.

Edited by: madhuri sonawane on Apr 20, 2010 6:00 PM

Read only

0 Likes
3,379

Hi,

Did you check if entry exist in SOST with out commit = 'X'? If yes, then you can RSCONN01 program as 5 min batch job for dispatching the entries in waiting state.

Thanks,

Vinod.

Read only

0 Likes
3,379

HI ,

I am facing same issue . i am working on object to send email with smartform PDF with attachemts.

email is not going when i check in SOST its not going in queu i am geting error message still no entry in queue (Message S0672) .

I tryied to put COMMIT WORK. But its getting dump on Quality server.

Read only

0 Likes
3,379

I wants to call a bapi to create a order inside a badi. But immediately after the Order is created I need to do goods movement for the same order ,(which means I need the details of the order i created for further steps), Before actual commit is going to happen, I need data. is there any way to execute a piece of code after commit happens?? Or any other ways.

My question is I have done the same as u said, created UPDATE fm and called in update task but then my database is not getting updated and showing error goods movement not possible since data not found.

Read only

0 Likes
3,379
Hello, While we're happy that you've come to SAP Community to get an answer to your question, you posted your question as an answer in an old thread. Posting in older threads is not the best way to get guidance.If you're looking for help, you should ask a new question: https://answers.sap.com/questions/ask.html.Best regards,
Anne
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,379

Hello Madhuri,

Note from SAP documentation says:

Whilst processing an update function module in the update work process, the statements SUBMIT, CALL DIALOG, CALL SCREEN, CALL TRANSACTION, COMMIT WORK, ROLLBACK WORK, as well as all other statements which create a database commit, must not be executed.

Source: [http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_UPDATE.htm]

Are you getting this dump in a standard func. module or a custom one ?

BR,

Suhas

Read only

Former Member
0 Likes
3,379

Hello, Suhas!

I am getting the short dump with message "Invalid COMMIT WORK in a COMMIT WORK or ROLLBACK WORK."

Short text

    Invalid COMMIT WORK in a COMMIT WORK or ROLLBACK WORK.

What happened?

    Error in the ABAP Application Program

    The current ABAP program "CL_FDT_CC_SERVICES============CP" had to be
     terminated because it has
    come across a statement that unfortunately cannot be executed.

Error analysis

    The call of a COMMIT WORK in a FORM, that will not be executed until
    the commit or rollback point of the caller using the variant
    PERFORM ... ON COMMIT or PERFORM ... ON ROLLBACK is not permitted.

etc.

Could you help me to solve the issue?

Regards,

Kseniya Tsyganchuk