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

Workflow identification in Sales Order Exit

Former Member
0 Likes
1,155

Hi,

In my Sales order exit, under some conditions Iam raising an error message, when the order is being created in background this order will move to workflow. Now if any one process this order through the workflow i want to allow the order to get posted with out raising my exception.

So I would like to know how I can identify whether my order is being posted through the workflow or directly, in the Sales order exit code.

Thanks in advance friends,

Anvitha.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
966

Hi Anvitha,

if the workflow-handled order is posted in the background, can't you just check the posting user ID? If it's WF-BATCH (or other workflow RFC user), then it's workflow and if it's something else then it's directly posted.

Regards,

Mikko

Hi,

In my Sales order exit, under some conditions Iam raising an error message, when the order is being created in background this order will move to workflow. Now if any one process this order through the workflow i want to allow the order to get posted with out raising my exception.

So I would like to know how I can identify whether my order is being posted through the workflow or directly, in the Sales order exit code.

Thanks in advance friends,

Anvitha.

5 REPLIES 5
Read only

Former Member
0 Likes
967

Hi Anvitha,

if the workflow-handled order is posted in the background, can't you just check the posting user ID? If it's WF-BATCH (or other workflow RFC user), then it's workflow and if it's something else then it's directly posted.

Regards,

Mikko

Read only

Former Member
0 Likes
966

You might try looking at the sytem fields for a background processing indicator. I don't have access to a system at the moment and I don't remember the name of the field (maybe sy-batch?) but somewhere in those fields there should be some indicator of the run mode.

Under some circumstances it will contain an 'X' if it's running in the background mode.

Good luck

Brent

Read only

0 Likes
966

Hi friends,

Thanks for your response.

Checking whether the order is posted in Background or foreground doesn't solve my problem, because my order may be posted in Background or foreground. But when the order is processed through workflow, the processing option depends on the configuration of the Workflow object type. So SY-BATCH doesn't serve my purpose.

Coming to using SY-UNAME, I observed that the value during the Order process through Workflow is the UserID who process it. So i can't distinguish it.

Friends, any one had any other option to identify whether the order is being posted through Workflow.

please help me out.

Regards,

Anvitha.

Read only

0 Likes
966

Hi!

Check FM GET_WORKFLOW_ID.

Regards,

Maxim.

Read only

0 Likes
966

Hi Anvitha,

have you tried passing the order creation task a workflow-specific document type or another parameter that could differentiate it from the dialog transaction created orders?

If you want to directly distinguish between orders created by a user through a workflow task and orders created directly in a transaction, I'm afraid that's not possible since the same functionality is called by the same user.

-Mikko