on 2007 Mar 01 5:28 PM
Friends,
I need to configure a start condition for a custom workflow that is triggered by J1B1N (Object BUS2143).
But this WF is triggered even we don't need to work with it, because we need it to start only if the field J_1BNFDOC-DOCTYP = 3 or 5. But this field doesn't exists on the object.
How can I add and populate the field in the triggering event so I would create a start condition with this field ?
Release 46C.
Hello Glauco,
basically you need to extend the original business object BUS2143 with new attributes that you can then use in the event start condition for evaluation.
If you're not familiar with workiten on business objects and really need a quick solution, it is best to use a CHECK FUNCTION MODULE.
Get the signature from some other event coupling where you can find one. The import parameters that you would like to use is OBJKEY that provides the full primary key of the underlaying database table. Depending on what and when the application exactly raises the workflow event, you should find the entry on the db table and check the entry.
If you don't want the event to be processed, just raise any exception within that function module, which then will stop the event processing.
If you'd like a more elaborated solution, you should basically follow the following steps:
- Go into the object editor (SWO1) and create a new subtype of BUS2143, naming it e.g. ZBUS2143
- Edit this new object type and create new attributes as appropriate. You could use the wizard "database attribute" giving the primary key fields of the database table. If this is a 1:1 relationship to the object's key fields, the coding will work out found.
- Put your cursor on the new attribute and push the "program" button.
- The system asks you, if it should generate the neccessary coding here, and answer it with "yes".
- Now back in the overview set the attribute's status to "implemented" (somewhere in the menu).
- Generate the business object.
- To substitute the original BUS2143 with the one that you've just created, you have to create a system wide delegation for it: In the entry screen of the Object Builder (SWO1) use the menu for Delgation-->System wide, enter the object type BUS2143 and as it's delegate your newly created one.
For further information about how to create and maintain business objects I would like to advice to search the forum or the SAP help here, first.
Best wishes,
Florin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Florin,
There is a misunderstood.
I know these steps to create, modify and delegate objects and I think I had wrote things wrong.
But the project here we needed to do on this way I had explained. e.g. the standard triggers the workflow.
My doubt is about the start condition, because there isn't a attribute I need and my object is a zObject and I know that we have to create this attribute on the object, but how can I create the start condition if there isn't this attribute filed on the moment the WF is triggered.
I think there isn't any way to do it with the way I used to trigger the WF, because the standard cod doesn't fill up the attribute that I need to put on start condition so I can put it on start condition logic.
I'm waiting for any help.
thanks,
Glauco
Hello Glauco,
if you have coded the attribute of your business object and you have delegated that one and you used this attribute in the start condition (by using the father's object type) your coding will be processed.
Mayhaps having an event parameter could solve your problem the same way, when you use the event-parameter function module on change-documents, if you're using this one, or you create the event in a user-exit or business add-in.
Best wishes,
Florin
Hi Glauco,
You are correcty.
If there's no way to get the value of the attribute when you instantiate the object you then can't use this in the condition editor.
But hen I don;t understand why the attribute exists in the first place.
Maybe you're doing it wrong?
In your subtype create a (virutal ) attribute which holds the data (very importantly: known at the moment of instantiation) after creating AND generating en releasing the attribute, you then check if the delegation is set up correctly. Now you can use this attrivute in SWB_COND for the standard event.
If, as I said the data is known after instantiation, you just have to create your custom workflow where the check is made.
Kind regards, Rob Dielemans
But how can I test a start condition ?
I'm testing on the transaction that starts this wf or directly on the object on swo1.
Now I've just copied the wf (because it has the standard object to the trigering event tab) to another and changed triggering object/event to zObject and I'll test now.
I'll giver you the test result as soon as possible.
It didn't work.
1-Now I have an zObject, delegated;
2-A WF with zObject/event configured on triggering event tab on pftc.
3-The link (zObject/new wf copied) is ok on SWE2.
But it's not working. On swel I only see the standard object triggered event without an receiver (because I deactivated the triggering event on the other wf, because I had copied to a new to do this test with the new zObject).
3-Do I have to back my configuration (with standard object/event on the old wf triggering event tab) ?
Rob, do you know another thing to test ?
Glauco
Rob,
I activated both of them (wf and its copy, link and its copy start condition and its copy).
These two WF's are the same but the second is a copy of another, but I'm using the xObject/event to triggering the wf.
A question. Why the second WF is configured with triggering event zObject/event but it isen't appearing on swel ???
I think the first has to work fine, but its starting to all DOCTYP values. But I want it to start only to 3 or 5.
Why can I test the start condition ?
If I test directly on SWO1, it works fine. But not when I use the transaction.
Message was edited by:
Glauco Kubrusly
Hi,
You have a change document object " NOTAFISCAL " for your scenario.
Go to transaction SCDO and open the NOTAFISCAL change document and
check the J_1BNFDOC as ' copy as internal table ' and then proceed with the
following.
Go to transaction SWEC and make a new entry for the above mentioned
change document object with the corresponding business object and event.
Followed by specifying field restrictions -
1. click on the conditions editor and enter the values for the
doctype with the logical "OR" condition.
This will solve your problem and reward with points if the solution is helpful.
Regards,
Manikandan R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have faced the problem of the virtual attributes not populated once the workflow is started.
What I usually do in the case of the Virtual attributes is to put a condition within the workflow and not as a start event. The workflow will start anyway but you can put this as the first condition in the workflow.
Hope this helps,
Sudhi
Ok, but talking about system performance is it better than start condition ?
I'm thinking of not let WF standard tables grow too much.
And on my tests with swue (with a existing document, sure), the start condition worked fine. It blocked an document with field doctype = 1 (the virtual attribute was filled up correctly) and didn't let the WF starts as I expected.
ps.: How can I see if the virtual attribute was populated if I'm test from transaction ???
Message was edited by:
Glauco Kubrusly
To my understanding this is not that much of a performance hit. It is just a condition that is checked in the start of the workflow. Also you need not fiddle around with the receiver function module.
In the case of virtual attributes I have faced that problem many times. I guess the buffer is not updated as soon as the event is raised. I have always included a condition in the start of the workflow when I am dealing with virtual attributes.
Hope this helps,
Sudhi
User | Count |
---|---|
68 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.