cancel
Showing results for 
Search instead for 
Did you mean: 

BBP_DOC_CHECK_BADI: check the approved items

Former Member
0 Kudos

Hello experts,

we use the badi BBP_DOC_CHECK_BADI.

In the BADI we call the function BBP_PD_SC_GETDETAIL and check all positions of the shopping cart (Tables: e_item).

Now we want to check only the approved items. And not the rejected item. Is it possible?

System: SRM 7 EHP 1

Regards,

Florian

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Yes it is possible. You can find the status of the shopping cart line items in the table "E_STATUS" in the FM "BBP_PD_SC_GETDETAIL".

With Regards,

Malay

Former Member
0 Kudos

Hi Malay,

thank you for your reply!

In the table "E_STATUS" we received the following values:

1          5091B51739CB65CDE100000002886807   I1015

2          5091B51739CB65CDE100000002886807   I1021

3          5091B51739CB65CDE100000002886807   I1038

4          5091B51739CB65CDE100000002886807   I1106

E_STATUS : The guid and the status is from the header (not from the item?).

We have a shopping cart with two items. One item was approved and the other item was rejected. The shopping cart is partially approved. Can we check the status of the item separately?

Regards,

Florian

Former Member
0 Kudos

Hi Florian,

How is your workflow set up in SRM 7.0? Application controlled or Process Controlled? Also, Do you guys have workflow defined at line item level? If one line item is approve then create PR or PO? While other one goes into requester inbox to accept rejection?

Because if you do not have that line item level workflow feature then other workflow if one line item rejected it goes into requester inbox for accept / reject and once requester make decision lets say accept the rejection of one line item that line item gets deleted and Del_IND is set. You can find that in the Function module.

There is one FM you can try which give details on line item level BBP_PD_SC_ITEM_GETDETAIL where you have to give GUID of line item not SC.

Thank you

Ritesh

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi experts!

We have solved this problem!

Enclosed you find the solution:

System/Settings:

SRM 7 EHP 1

WF: Process Controlled (line item level)

Code:

DATA:

dummy               TYPE  /sapsrm/wf_agent_id,

header_guid        TYPE  guid,
es_process         TYPE  /sapsrm/s_wf_process.

header_guid = ......

CALL METHOD /sapsrm/cl_wf_apv_facade=>get_current_process_state
   EXPORTING
      iv_document_guid  = header_guid
     iv_agent_id            = dummy
     iv_language           = sy-langu
*    iv_workitem_id       =
IMPORTING
     es_process           = es_process.

Result:

The item status is located in the following deep-structure:

es_process-> DECISIONSET_LIST-> ITEM_STATUS_LIST-> ITEM_STATUS

ITEM_STATUS:

APPROVED

REJECTED

INQUIRED

OPEN

<null>

Many thanks for your help!

Regards,

Florian

konstantin_anikeev
Active Contributor
0 Kudos

Hi Florian,

check the fields DEDUCT_IND and REJECT_WI.

Should be not empty until requester accepts rejection.

Best Regards

Konstantin

ravindra_mantri2
Active Participant
0 Kudos

Hi Florian,

There is another workaround to find out whether shopping cart item is approved or not.

If Shopping cart line item is approved, then follow-on document will get created immediately.

If shopping cart line item is not approved, then follow-on document object for that line will not be available in the system.

So you can retrieve SC line item GUID from CRMD_ORDERADM_I table.

Then input it in BBP_PDBEI table to check whether any value exist in BE_OBJ_ITEM or BE_OBJECT_TYPE or BE_OBJECT_ID. If no value exist, that means line item is awaiting approval or not approved or rejected.

Using this you can filter out line items which are approved.

Hope this helps,

Cheers,

Ravi