cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_SCEC_CREATE - how to get the shopping cart to go to our workflow

Former Member
0 Kudos

Dear experts,

When a shopping cart is created using BAPI_SCEC_CREATE, it will get approved automatically. We want the shopping cart to go through our approval workflow. Is there any way to achieve this? I saw threads on similar question but there's no solution. It seems to be related to Sourcing relevant indicator (SOURCE_REL_IND) in table BBP_PDIGP. I've tried executing BAPI_SCEC_CREATE followed by BAPI_TRANSACTION_COMMIT and then BBP_PDIGP_DB_DIRECT_UPDATE to reset the SOURCE_REL_IND. However, it didn't work.

Does anyone know how to get the shopping cart created by BAPI_SCEC_CREATE to go to a workflow?

Thanks,

Lara

Accepted Solutions (0)

Answers (1)

Answers (1)

laurent_burtaire
Active Contributor
0 Kudos

Hello Lara,

(...)

When a shopping cart is created using BAPI_SCEC_CREATE, it will get approved automatically. We want the shopping cart to go through our approval workflow. Is there any way to achieve this?

(...)

Have a look at SRM article below:

[Enable SRM Workflow for External Purchase Requisitions|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/5082a622-7310-2c10-1a9b-ef31dd69a770]

(...)

It seems to be related to Sourcing relevant indicator (SOURCE_REL_IND) in table BBP_PDIGP.

(...)

Check your customizing:

(in SRM 7.0) SAP Supplier Relationship Management > SRM Server > Sourcing > Define Sourcing for Product Categories

Depending on product category you used when creating your SC, its items are relevant or not for Sourcing.

Regards.

Laurent.

Former Member
0 Kudos

Hi Laurent,

Thanks for your message. The product category I'm using definitely uses a workflow. We have a workflow that is fully functional for this product category. If I create a shopping cart manually in the SRM portal, it will go to status "Awaiting Approval". It needs approval from vendor followed by some people in our company. However, using BAPI_SCEC_CREATE, the shopping cart will go to status "Approved" straight away. That's why I'm thinking that there might be something I need to set in the import parameter of BAPI_SCEC_CREATE so that the SC will go to workflow, or else there is another FM or BAPI that I can call to achieve what we want.

Rgds

Lara

ps: Thanks for the link to the article ! I'll check it out to see whether I can find my answer there

Former Member
0 Kudos

Hi,

I managed to solve my problem by simply emptying the SUBTYPE parameter in I_HEADER of BAPI_SCEC_CREATE. I found that if the SUBTYPE is set to ER, the workflow will not be triggered and the shopping cart will have approved status as this is how it works with external requirement, it assumes that it's been approved. But if the SUBTYPE is left empty, the shopping cart is created with "Awaiting Approval" status and it goes through our workflow.

However, I wonder now whether it's the right solution. When I execute BAPI_SCEC_CREATE with I_TESTRUN = x, there will be an error mesage 'Required field OBJ_KEY was not transferred in parameter PURCHASEREQUI". However, despite the error message, the shopping cart is created if I turn off the I_TESTRUN. In this case, no error is returned.

Why is it that the shopping cart gets created although the test run shows an error ? Is SUBTYPE a mandatory field ?

Thanks,

Lara