Application Development 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: 

Posting Illegal Statement Error

Former Member
0 Kudos

Hi..

Can anyone help me with my problem. It's like this. I have an output type ZRD3 in billing document (VF01) which performs special function (8). this output type calls my routine to perform automatic posting of credit memo request. I used call transaction (for BDC) and submit command but the error says:

POSTING_ILLEGAL_STATEMENT

This program is triggered in the update task. There, the following ABAP/4 statements are not allowed:

- CALL SCREEN

- CALL DIALOG

- CALL TRANSACTION

- SUBMIT

If I would delete the call transaction and submit command, my program would work but i need the 2 commands for my program to run correctly and perform its function. Any suggestions?

Thanks..

5 REPLIES 5

Former Member
0 Kudos

bump

0 Kudos

.

christian_wohlfahrt
Active Contributor
0 Kudos

Hi!

You have an error in your transaction logic. You try to trigger in your output message a new transaction - but the first transaction (VF01) is not finished.

Especially calling in an update task causes a dump.

You have to separate this into two independent steps. Without changing your whole logic (and coding), fastest way might change the execution of your message to 'manual' or 'job' (dispatch time 1, 2 or 3, but not 4 - immediately).

Then you can use report RSNAST00 to execute your message outside of the update task.

Regards,

Christian

0 Kudos

I can't use dispatch time 4 - immediately? But my program should auto create credit memo request after saving the document. Thus, using RSNAST00 manually is not possible. Do you have any suggestions on how to implement this one?

Former Member
0 Kudos

As mentioned, do not use 4-immediate processing. Create an event, using tcode SM62. Raise it in your code in the special function using BP_RAISE_EVENT.

Define a job to be triggered, after the event is raised and do all that you want to do in the job.

Srinivas