cancel
Showing results for 
Search instead for 
Did you mean: 

WF for MVKE-SCMNG

karuna_gangireddy
Contributor
0 Kudos

Hi All,

I have a requirement to trigger a WF upon changing MVKE-SCMNG(Delivering unit) and MVKE-ZZCARTONQTY(Web Qty). I checked in BUS1001 (SAP Material BOR) but did not find these fields in attributes.

I tried adding a virtual attribute to ZBUS1001. But that did not work. Because i was not able to trigger the WF from SWEC upon changing MVKE-SCMNG(Delivering unit).

The other option i was thinking of is to create a custom BOR (MVKE-SCMNG(Delivering unit) and MVKE-ZZCARTONQTY(Web Qty).

Can anyone please let me know if there is other way to

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try to check whether there are any BADI or exits available..

If you found a suitable BADI or exit then using one of the below FM you can trigger your workflow..

SAP_WAPI_START_WORKFLOW

SWE_EVENT_CREATE ..

Regards,

Bharath

karuna_gangireddy
Contributor
0 Kudos

Thank you very much. But what BO can we use? Because the BUS1001 (Material) does not have the fields i am looking for. Is custom BO the only option for this?

Thanks in advance,

Karuna.

former_member185167
Active Contributor
0 Kudos

Hello,

No, you would use a delegated subtype (an extension of a standard BO) instead of a custom BO. It's unlikely you'll find a standard BO with all the fields you want.

Don't use SWE_EVENT_CREATE, use SAP_WAPI_CREATE_EVENT.

regards

Rick Bakker

hanabi technology

karuna_gangireddy
Contributor
0 Kudos

Hi All,

Sorry for getting back so late. Could you please confirm if i understood right? What i did was:

1. For the BO BUS10019(Material) I added web qty and delivery qt. But since these are not from MARA table i had to add them as

VIRTUAL attributes. [ Am i correct so far? ]

2. I tried to trigger from SWEC with field restrictions on these fields. But the WF did not trigger.

What you'll are suggesting is to trigger the WF with SAP_WAPI_CREATE_EVENT.

3. Now I need to find a place like BADI/User Exit and check if the fields i am looking for were changed and if so then trigger the WF.

Could you please let me know if i am on right direction/

Thanks in advance,

Karuna.

former_member185167
Active Contributor
0 Kudos

Hello,

Sounds right.

"i had to add them as VIRTUAL attributes" - I assume you mean to a delegated (Z) BOR object.

regards

Rick Bakker

hanabi technology

suresh_subramanian2
Active Contributor
0 Kudos

Hello Karuna !

Your requirement is to trigger the workflow when there is a change in SCMNG(Delivering unit) and ZZCARTONQTY(Web Qty). of MVKE table.

I belive the business object BUS1001006 should work.Create a database attribute for the above two fields in its subtype and delegate it to business object BUS1001006.Also, ensure that you have implemented,released and generated the business object.

For triggering, I hope you should go either BAdI or user exit provided no events are raised in event trace(when trace is switched-on) when changes to above fields are saved and correct change documnet is configured in SWEC.

Can you share with us the tranaction code where the the field values are changed ?Is it MM02 ?

Regards,

S.Suresh

karuna_gangireddy
Contributor
0 Kudos

Hi,

Yes. We material will be changed in MM02. I have a question. I justed the BO BUS1001006 (Std. Material). How is this different from BUS1001 (material)? Both these BO are based on MARA.

When i said 'VIRTUAL Attributes' - what i was thinking is any fields that are not from the base table of the BO should be defined as VIRTUAL.

Ex: THe BO BUS1001 (material) is based on MARA. But my fields SCMNG and ZZCARTONQTY are not from MARA.

Thanks,

Karuna.

suresh_subramanian2
Active Contributor
0 Kudos

Hello Karuna !

BUS1001 is older version to BUS1001006.

Some methods and events in BUS1001 is obsolete.In BUS1001006, those methods does exist with improved functionalities.For example, you could see CREATE method as BAPI.

I believe creation of database attribute atleast for SCMNG should work as MATNR is foreign key field against the check table MARA.

But, virtual attributes must work for both the fields SCMNG and ZZCARTONQTY..Can you please share the code developed for virtual attributes ?

Regards,

S.Suresh

karuna_gangireddy
Contributor
0 Kudos

Hi All,

Thank you very much for helping me with this issue. I was successfully able to trigger the WF for SCMNG and ZZCARTONQTY. But i am getting duplicates. What i mean is i am getting two emails sent on every change. I did look around and found that it could be if the server is slow but that is not in our case. The WF ran in a split of a sec.

It works fine in DEV but sends two emails in PRODUCTION. Does any one know the reason for this behavior?

Thanks in advance,

Karuna.

karuna_gangireddy
Contributor
0 Kudos

Hi All,

Please ignore my previous post. I got it fixed. I anyways need a clarification please.

Lets say we have a WF triggering on a BOR ZBUS1001 without calling explicitly thru any FM. Later we are triggering the same WF using 'SAP_WAPI_CREATE_EVENT' in either a BADi/user exit. Can we do this? The reason is i called the WF using ''SAP_WAPI_CREATE_EVENT'' and i am not sure why but the former is not triggering.

Any ideas?

Thanks in advance,

Karuna.

former_member185167
Active Contributor
0 Kudos

Hello,

"Lets say we have a WF triggering on a BOR ZBUS1001 without calling explicitly thru any FM"

How are you triggering a workflow without using an FM?

"Later we are triggering the same WF using 'SAP_WAPI_CREATE_EVENT' in either a BADi/user exit. Can we do this?"

You can do whatever you want, but why are you doing this? Do you mean you're creating the same event again?

It will, of course, start a second workflow instance.

regards

Rick Bakker

hanabi technology

Answers (0)