cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
Read only

SetUserStatus Method

GeorgeOk
Explorer
0 Likes
705

Hello,

I want to know how the SetUserStatus workflow task 
TS90400041
is working. Where do I have to maintain the user status name I want to set to the document.
Thank you

Accepted Solutions (0)

Answers (2)

Answers (2)

GeorgeOk
Explorer
0 Likes

In continuation of my previous reply what I've realized is that the business object BUS2005 doesn't have an attribute for status profile or user status. Or maybe I cannot find it. So that's why I don't understand how I will be able to change this field in the object from the workflow (binding) if it doesn't appear.

GeorgeOk_0-1725631233672.png

For example the attribute order type can be modified by saying "bus2005.ordertype" but this might not be possible for a field such as user status and status profile. So maybe this task works a different way and I can assign the user status I want to change from somewhere else in this task.

At the end I want to use this function to change the user status for an inquiry, so if it works here I will ask for abap to duplicate it for custom object bus2032 that will be for inquiry

GeorgeOk
Explorer
0 Likes

Hello, thanks for the contribution

The method is called SetUserStatus, and that's what the task is using. It is assigned to Object type BUS2005 but I ve also find it in other objects. 

GeorgeOk_0-1725630403620.png
After my research it is using the SAP Function Module BAPI_PRODORD_SETUSERSTATUS
This is what chatgpt is saying about it

GeorgeOk_1-1725630546066.png

From my understanding the job is done in binding of the task, because I cannot find how else I can insert the user status I want to be implemented.

GeorgeOk_2-1725630620327.png
The user status get predefined and then assigned to the object type. Maybe the first binding is not required.
I have pre-assigned the values of the status profile and user status having the same name as configured in the system.

GeorgeOk_3-1725630706210.png

GeorgeOk_4-1725630727849.png

In general, I want to understand how to work with this task. My goal is to automatically change the user status in a document after a user decision.
I tried to be as much detailed as I can. Thank you again

keohanster
Active Contributor
0 Likes
So that standard task executes the SAP method SetUserStatus. I don't see why you can't use this task to set a user status (assuming you've defined one). What happens if you attempt to test this task? Can you try building a test custom WF that incorporates this task? Or copy the template you're using to a custom one. That will allow you to go in and change the call to TS90400041 to be a dialog task (delivered to you) and then you'll be able to debug it.
GeorgeOk
Explorer
0 Likes

Can you give me a small explanation on how to do this: "That will allow you to go in and change the call to TS90400041 to be a dialog task (delivered to you) and then you'll be able to debug it"
I have created a custom workflow to test this task. When I test it it works fine (workflow completed) but nothing changes in the production order. The user status is still the same.

keohanster
Active Contributor
0 Likes

I would put a breakpoint in the method, and change the task to untick the background processing box. Then, back in the WF builder, I would enter my own user name in the Agents.  But then I'm very accustomed to copying SAP tasks and templates in order to make them my own.

However, you will probably be good to go with this blog, assuming there is a dialog task that precedes the background task.

https://community.sap.com/t5/technology-blogs-by-members/how-to-debug-a-background-sap-workflow-meth...