cancel
Showing results for 
Search instead for 
Did you mean: 

Condition editor

Former Member
0 Kudos

I have a task that returns a multi-line container element. The element contains records from a table. I need to check each record and set my condition to true if any record in the table has an 'A' in a certain field. What is the best/easiest way to accomplish this?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

best way would be do it in your BOR and then pass the result bck to the WF.

Former Member
0 Kudos

Thanks for the reply. I did as you suggested and it worked great.

I did take me awhile to figure out exactly HOW to do it though 😃 I've been doing workflow for about a month now. My training consists of this forum and google. For any fellow newcomers who might run across something similar, I will explain in a little more detail what I had to do.

First I created a subtype of BUS2012 called ZBUS2012.

Then I added a new attribute to ZBUS2012 called assetflag. This will return a value of T (True) if any line item of the purchase order has an A in the assignment category. This means a purchase order line item that requires a fixed asset in the account assignment.

My assetflag field is defined within ZBUS2012 with the following code:

TABLES EKPO.

GET_PROPERTY ASSETFLAG CHANGING CONTAINER.

" Set flag to false initially

SWC_SET_ELEMENT CONTAINER 'assetflag' 'F'.

SELECT * FROM EKPO client specified

WHERE MANDT = SY-MANDT

AND EBELN = OBJECT-KEY-PURCHASEORDER.

if EKPO-KNTTP = 'A'.

SWC_SET_ELEMENT CONTAINER 'assetflag' 'T'.

Exit.

endif.

endselect.

END_PROPERTY.

Delegate BUS2012 to ZBUS2012 and you're all set.

Pretty simple once you know how to do it. If any line item has an A, the flag is set to true and I use a user decision as the first step in my workflow and check for the flag to be true. If not, end the workflow. I tried a start condition on the start event but it didn't seem to work. I've read that virtual attributes like this can be flaky in triggering events so it was easier to just use a user decision.

At any rate, thanks for pointing me in the right direction.

Answers (0)