cancel
Showing results for 
Search instead for 
Did you mean: 

Get List of approvers who approved a shopping cart

Former Member
0 Kudos

Hi experts,

I have a requirement to develop a report which will give details of the approvers who approved a shopping cart. Even if i get the last approver who approve the cart and the description in the "process determination" column for this approver it should be good enough for me. I need this since we have issues in workflow when sometimes carts get self approved and we need to track such carts. I have attached the screenshot which shows the "process determination" column details i need.

Your expert help is highly appreciated.

Regards,

Pawan

Accepted Solutions (1)

Accepted Solutions (1)

former_member185167
Active Contributor
0 Kudos

Hello,

There was nothing attached to your post, but in any case you should first look at the SAP_WAPI_* function modules to see if any of those can help you. If not, you shoudl be able to get the user ids of the approval agents out of table SWWLOGHIST, with some programming.

regards

Rick Bakker / hanabi technology

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Pawan,

I needed to do the same. You only need the GUID of the shopping cart. This is how I solved it:

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 Kudos

Hi Rick,

Couldnt find any useful FM in the SAP_WAPI_* series.The table SWWLOGHIST is helpful in getting who completed the approval but since lass process step is always defined as automatic approval in config it always shows WF-Batch in this table for the workitem. I also need the previous approval steps which does not give. Anything else i can try ??

Hi Laurent,

i was able to get till method /SAPSRM/IF_PDO_DO_APV_EXT ~ GET_PROCESS_INFO but when i enter the IV_item_guid in GET_PROCESS_INFO i am not getting anthing in the export parameters. Can you please advise if i am missing anything..

Hi Suresh,

Your suggestion gives me the data which i can also get through SWI6 but the question is cani use any FM or table to get this data because i have to make a report out of it ??

Regards,

Pawan.

former_member185167
Active Contributor
0 Kudos

Hello,

Once you've narrowed down the dialog step, SAP_WAPI_GET_WORKITEM_DETAIL will tell you who the actual agent was, no need to dig that out of the underlying table yourself.

If you're doing automatic approval then WF-BATCH is the actual approver. If you want to replace that with the approver of the previous level then some (not too complicated) programming will be needed.

regards

Rick Bakker / hanabi technology

laurent_burtaire
Active Contributor
0 Kudos

Hello Pawan,

Pawan Agrawal wrote:

(...)
i was able to get till method /SAPSRM/IF_PDO_DO_APV_EXT ~ GET_PROCESS_INFO but when i enter the IV_item_guid in GET_PROCESS_INFO i am not getting anthing in the export parameters. Can you please advise if i am missing anything..
(...)

Do not populate any importing parameter.

Regards.

Laurent.

Former Member
0 Kudos

Thanks Laurent and Rick...Meanwhile i have also found a way of getting approver details using table SWWWIHEAD.

Use table SWW_WIOBJ to find TOP_WI_ID. Use this TOP_WI_ID as input parameter TOP_WI_ID of table SWWWIHEAD.Also choose the WI_TYPE as W which will give only the dialog steps.

I can alos use FM SIN_WF_OUT_PREVIEW_HTML_BIUILD

However i have couple of questions

1) If the last approval was done by a substitute how do i get to know that it was approved by the substitute and not the actual approver in the workflow chain.

2) If the last approval step is ADHOC Agent how can i know that. It would be great if we can retrive the data in "Agent Detremination" column which we see in approval preview in portal.

Thanks again for your time.

Regards,

Pawan

_

former_member185167
Active Contributor
0 Kudos

Hello,

"1) If the last approval was done by a substitute how do i get to know that it was approved by the substitute and not the actual approver in the workflow chain."

The workflow log will show you the actual approver, it doesn't behave differently for substitutes.

"2) If the last approval step is ADHOC Agent how can i know that. It would be great if we can retrive the data in "Agent Detremination" column which we see in approval preview in portal."

That approval preview is almost certainly just showing you what it's reading from the workflow log.

regards

Rick

suresh_subramanian2
Active Contributor
0 Kudos

Hello Pawan !

           Go to transaction BBP_PD. Enter the GUID and execute. New screen appears wherein at the title bar, you would find "Services for object". Click Services for object -> Workflow -> Workflow overview. Under agent column, you will get who approved it.

Regards,

S.Suresh.

laurent_burtaire
Active Contributor
0 Kudos

Hello Pawan,

try to get SC instance (method GET_INSTANCE from /SAPSRM/CL_PDO_FACTORY_SC_ADV class) in DISPLAY mode.

Then, down cast instance in order to get SC process info with method /SAPSRM/IF_PDO_DO_APV_EXT~GET_PROCESS_INFO from /SAPSRM/CL_PDO_BO_SC_ADV class.

Regards.

Laurent.