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

How to Get List of Shopping Cart Approvers

Former Member
0 Likes
1,858

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?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

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

Former Member
0 Likes

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

Answers (2)

Answers (2)

Former Member
0 Likes

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

Former Member
0 Likes

Thanks Mihai. This helped me get SC item approval status that I was trying to fetch.

ricardo_cavedini
Product and Topic Expert
Product and Topic Expert
0 Likes

Hello,

You could try FM BBP_WFL_DIN_APPR_CONTAINER_GET, providing as input parameter the workitem ID.

Regards,

Ricardo

Former Member
0 Likes

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

Former Member
0 Likes

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

Former Member
0 Likes

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

Former Member
0 Likes

Seth,

Were you able to get the list of all approves for the SC? I am looking for the same information, it would help if you can share what you've done to work around this.