cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a new attribute to BUS2121 and related expression in SRM_WF

0 Kudos

Hi there everyone,

We are implementing SRM 7.00 and we have a requirement to determine if a approval needs to be performed depending on the contents of the SC.

I am new to BRF and I need to introduce a new expression (such a ZHAS_SOFTWARE) and use that to determine if the related approval step needs to be executed.

This what I've done.

- Created subtype ZBUS2121 and delegated it.

- Added custom attribute ZHasSoftware

- The logic to determine that is using the existing attribute "MaterialGroupList" and checking against a custom table to see if any of MaterialGroups in the SC is identified as "SOFTWARE". If so, a "Y" is returned, else returns a "N"

- The existing attribute "MaterialGroupList" is extracted within ZHasSoftware via the SWC_GET_TABLE_PROPERTY

- When I test the BUS2121 I see that the new attribute returns the proper result.

- I created an expresion in SWM_WF using Class: /SAPSRM/CL_WF_RULE_CONTXT_SC > 0C_C2_C_GET_PROPERTY > ZC_ZSOFTWARE

- That expresion is used in B expression that simple says "oftware Flag = 'Y'"

- I added that to the proper processing level and it is behaving like the value is not being returned at all. When I change the expression to say "Software Flag <> 'Y'" just to make sure that the approval level shows up and it does.

Am I missing a step? Does "GET_PROPERTY" work when the SC is being created?

Thanks in advance for your help.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Oops!

Partially working...

I am now able to pass the value from the BOR to the BRF expression (proved that by using a hardcoded result), however, the logic is not able to determine the proper value since the attribute "MaterialGroupList" apparently is not populated while the cart is being created, therefore I'm unable to retrieve its value using SWC_GET_TABLE_PROPERTY within the BUS2121 BOR so that I can use it in the logic.

Any input would be greatly appreciated.

Regards,

0 Kudos

Yes, it is working properly (sort of)

The process level is properly invoked when the shopping has a line item with the material group that equates to "SOFTWARE", however, in the "Display / Edit Agents" preview it does not get reflected until the cart is saved

Which is curious since it displays the agent determination fine when standard field "Total Value" is changed before the cart is saved and that determines the number of levels.

The issue now is how can the preview "Display / Edit Agents" display the agents correctly when custom fields are used in the mix?

I will start a new thread with that and see if anyone has come across this before.

0 Kudos

Problem solved!

Issue was with the naming convention for the attribute parameter to /SAPSRM/CL_WF_RULE_CONTXT_SC

Changed it from ZC_ZSOFTWARE to Z0C_C3_C_ZSOFTWARE to conform to BRF naming convention.

Discovered that thanks to this thread:

Thanks!