on ‎2011 Mar 17 7:47 PM
I have a requirement to get a list of all the approvers a shopping cart is going to be routed through in Workflow.
I've figured out that I can query table SWW_WI2OBJ to get the Workflow item ID using the shopping cart number (INSTID = shopping cart #) and then use that to query SWWUSERWI to the the user ID of the approver the Workflow is currently on.
A shopping cart can have multiple approvers though. I can't figure out how to get the full list of all approvers a shopping cart is going to be routed through. How can I find out who else, besides the current approver, a shopping cart is going to be routed through for approval?
Request clarification before answering.
Hi,
Can you use transaction BBP_PD and enter the shopping cart no in the object id field. This will give you list of all the approvers with which shopping cart is awaiting approval.
Regards,
Nisha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nisha,
I am able to get into BBP_PD, but I don't see where the approvers are listed in there. I see there is a section for Workflow Item, but its doesn't tell me much more than the ID of a Workflow item, which I'm already able to get. I'm also going to need to get this information from inside a program, so what I'm really after are the database tables I can query or a function module I can run to get this information.
Thanks,
Seth
Hi,
I needed to do the same. This is how I solved it. You only need the GUID of the shopping cart.
REPORT
zmsz_teszt.
DATA:
lv_sc_id TYPE crmd_orderadm_h-object_id,
lv_sc_guid TYPE crmd_orderadm_h-guid,
ls_wf_hist TYPE /sapsrm/s_wf_process.
FIELD-SYMBOLS:
<ls_prolevlist> TYPE LINE OF /sapsrm/s_wf_process-process_level_list,
<ls_decision> TYPE LINE OF /sapsrm/t_wf_decisionset_s,
<ls_wi_list> TYPE LINE OF /SAPSRM/T_WF_WORKITEM_S.
lv_sc_id = '6800003658'.
lv_sc_guid = '0050568602601ED299E0575227599CF4'.
/sapsrm/cl_wf_apv_facade=>retrieve_process_history( EXPORTING iv_document_guid = lv_sc_guid
iv_agent_id = ''
iv_language = ''
IMPORTING es_process = ls_wf_hist ).
*ls_wf_hist
WRITE: / 'USER Decision'.
LOOP AT ls_wf_hist-process_level_list ASSIGNING <ls_prolevlist>.
LOOP AT <ls_prolevlist>-decisionset_list ASSIGNING <ls_decision>.
LOOP AT <ls_decision>-workitem_list ASSIGNING <ls_wi_list>.
WRITE: / <ls_wi_list>-agent, <ls_decision>-status.
ENDLOOP.
ENDLOOP.
ENDLOOP.
Cheers,
Misi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
You could try FM BBP_WFL_DIN_APPR_CONTAINER_GET, providing as input parameter the workitem ID.
Regards,
Ricardo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ricardo,
I had read about function module BBP_WFL_DIN_APPR_CONTAINER_GET previously and gave it a try. Unfortunately, when I input the Workflow ID I find associated with my shopping cart (which is the one I find in BBP_PD and when I query table SWW_WI2OBJ), it doesn't return anything. All the output parameters and tables are empty after the function module run.
Thanks,
Seth
Hi Rowan,
I am not understanding your requirement. With BBP_PD you are getting the workflow item and the id of the person with whom the shopping cart is lying for approval.
It is showing the entire approval list of the persons who are going to approve the shopping carts. You want to have the list of shopping cart approvers for a particular shopping cart or you wants to have the list of shopping cart approvers present in the system.
Regards,
Nisha
Hi Nisha,
Actually, no. BBP_PD gives me a Workflow item, but it does not give me the names of any approvers for the shopping cart. I am able to use that Workflow item ID (which I actually get from table SWW_WI2OBJ using the shopping cart number in field INSTID, since I can't use BBP_PD in an ABAP program) to query table SWWUSERWI. This gives me the name of the current approver, but I also want to find the subsequent approvers. I just want the list of approvers for a particular shopping cart.
Let me try explaining another way:
A shopping cart is created that needs to be approved by both Alice and Bob. The cart is going to route to Alice first, and then it will route to Bob after Alice approves it. At the moment, it is still sitting in Alice's box. I want to write an ABAP program tofind the full list of approvers; that is, I want to find out that both Alice and Bob are approvers for this cart. Using the method I described above, I can find Alice since she is the current approver. What I am having trouble with is finding Bob. Does this make sense?
Workflow knows that the cart needs to route to Bob next, so i know the data has to be in there somewhere. I just don't know where to find it.
Thanks,
Seth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.