cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to derive data on a WF background step?

former_member276384
Participant
0 Kudos

Hi experts,

my requirement is to complete some data when the user approval process has finished and just before the replication process.


Is it possible to derive entity data on a workflow background step?


Best regards,

Jordi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I really wouldn't do this, both from a technical and a business perspective: You cannot react on errors / messages from the validation logic in the background step, and especially for Material (MDG-M), changes to classification would be totally unchecked until activation - which will then fail w/ hard to debug errors. Furthermore, the changed data is not what the last user has approved, which goes pretty much against the idea of MDG.

I'd rather read out the MDG Application Context (class CL_USMD_APP_CONTEXT) in your derivation and then run some derivations only at the start of the last approval step. The API tells you the WF step number and such things.

Alternative is brute writing data in the background step using the Convenience API (CL_USMD_MDG_CONV_API).

Answers (1)

Answers (1)

d024348
Employee
Employee
0 Kudos

Hi, I assume that you have a

  • Separate replication step in your WF (meaning that the replication is not triggered within the activation step)
  • Reuse data model (flex entities can't be changed without an open CR)

In that case, you can wedge another task between activation and replication, then hard-code the necessary derivations using the respective backend APIs/BAPIs.

Sounds a bit ominous though, as defaulting data after CR activation would mean that these changes somewhat bypass the governance.

Regards, Ingo Bruß

former_member276384
Participant
0 Kudos

Hi Ingo,

thanks for your answer, I will try to explain better my scenario.

Nowadays there is a nightly background process in ERP that mantains the companies assigned to a supplier according to his country. For instance, if the supplier country is UK and the user has assigned only a company of UK, the background process will assign the rest of companies of UK, say five companies more.

This background process should be implemented in our new MDG-S hub (flex option) in some step between the last user approval and the user activation, completing the BP_COMPNY entity data.

Best regards,

Jordi

former_member188878
Active Contributor
0 Kudos

Jordi,

try to give the if condition based on the SAPFMDM_CREQUEST_STEP and try to drive the rest of the values.

d024348
Employee
Employee
0 Kudos

Hi, you are using MDG-S in Flex mode (not reuse)? That would be a modification to the MDG-S solution as shipped by SAP.

After CR activation, you can't edit an entity without creating a new CR.

And (as stated above) you can't edit Flex entities without a CR.

So you'd need to create a new CR in the background WF step

Regards, Ingo Bruß

Former Member
0 Kudos

You should use cross-entity derive BAdi for this. Your rule fires whenever the country changes, and then you create the company code level view(s).

You get old and new value in the CE Derive, so when changing, you also delete all the old countries company codes.

The above will work for the CREATE process. If you need this in CHANGE process as well, then you additionally need to check which company codes are already in primary persistence and NOT delete those of course.