cancel
Showing results for 
Search instead for 
Did you mean: 

WWI Spec Multiple Status Conditional Output

nick_valeriano
Explorer
0 Kudos

Hello Experts,

In the system I'm working in we can have multiple status' per specification:

In WWI we want to only output a section of data only if ALL status' = "ZRE".

This is my code to output all status' - this is not the data we want to output but this is what I use to see the status' in testing:

This is the data output:

I have tried to use Conditional Output to output only if LK (Text Comparison) to "ZRE". I have also tried to use the opposite, (if symbol LK "ZIP" OR "ZSR" OR "ZIA" etc [all other possible status' not in Released]).

However because of the Repeating group, which was necessary to output all possible status' on the spec per an SAP note, the conditional output will cycle through each value, rather than looking at all values at the same time.

Is there a way to always check the most recent value first, potentially by using the WWI stack method to always pull the most recent date's Status? Or are there other options for this, i.e. custom symbol or a development?

Thanks in advance,

Nick

Accepted Solutions (1)

Accepted Solutions (1)

Ralph_P
Advisor
Advisor
0 Kudos

Hi Nick,

If I understand correctly, you only want an output if all status are ZRE.In that case it may work using the stack function. Read in all status into the stack and sort the stack in descending order. Then ZSR (if it exists) should be on top of the stack, else ZRE will be on top.  If the top item is ZRE, output, else not. Maybe this approach wil do the trick.

Ralph

nick_valeriano
Explorer
0 Kudos

Hey Ralph,

Thanks for your response, I had thought of this, however we have several other status' that a specification could potentially could be in:

ZIP

ZSW

ZSR

ZIA

ZTM

ZRE

Because some of the status' would fall below ZRE this could not work, however it is good to know that the Stack Method can be used with alphanumeric letters.

Former Member
0 Kudos

I think this is the right answer and just needs a little more logic to work as required.   My thinking would be to loop through the statuses and do conditional check to see if the status is "LK" ZRE.  If so, do nothing.  Otherwise, using the alternative of the condition, append the stack with a "flag" indicating a status other than ZRE was found. 

Now by checking the stack to see if it's empty(empty = all statues were ZRE, not empty =  other statuses were found), you can tell whether all the statuses were "ZRE" or not.

nick_valeriano
Explorer
0 Kudos

That's a very good point Peter. How would you set the conditional output within the stack method? Also, how would you output a set of data based on having a stack method as empty?

Former Member
0 Kudos

Loop through the scope.  Have a condition logic check for the status "ZRE".  If found, do nothing.  But have an alternative which would set the flag.  This can be done by using the status symbol with the processing method "C14N_SYMBOL_STACK_PUSH".  

Once you have gone through all of the statuses, you can use a blank compression on the same symbol but use the method "C14N_SYMBOL_STACK_TOP" to check if a value exists on the stack.  If it does, then you know another status besides "ZRE" was maintained.   If not, you can use an alternative on the blank compression to perform the logic necessary when all statuses are "ZRE".

Before all this make sure you call "C14N_SYMBOL_STACK_NEW" using the status symbol to initialize the stack. 

nick_valeriano
Explorer
0 Kudos

Great thinking, I'll run a test and let you know how it goes. Thanks Peter.

christoph_bergemann
Active Contributor
0 Kudos

Dear Nick

I still have problems with your scenario., But your topic was such interesting that I started a new document: check:

In my opinion I would say you should start  OSS dialog. This is the reason behind my thinking:

In the screen shot you have shown three status are present. These have been maintained using a change number. Now if you use now the "current day" as the selection criteria

then the output "

is in my opnion wrong The reason is: only the last Status is valid and therefore in my opinion the repeating group should not show two times ZRE but only ZSR. But as mentioned: because of complexity reasons we do not use the "Status".on spec level8but the use is "facinating" and can help in data maintenacen if you have a good ! business concept)

Ralph: as your are as well an WWI expert: my expectation is that the code shown above shouid really print  only "ZSR". Do you have different thinking here? The change numnber must be reflected in my opinion in the printing (or the "change number construc" can not work properly with WWI reports (my test in use of changes numebrs are quite a long time ago).)

May you can explain why the repating group "ignore" the change numbers; from my point of view: this is an error.

C.B.

PS: in my opinion as well the approach of using two WWI template "should" not work; but this assumption depends on the answer why the repating group ignore the change numbers

PPS: to make it short; in my opinion you have inly one valid "Status" (for all rating in combinaiton with REG_WORLD; the other are not valid any more)

Ralph_P
Advisor
Advisor
0 Kudos

Hi Christoph,

Nick's WWI code does exactly what it's supposed to do: Loop through all entries and output them. Nowhere is specified that change numbers or validity dates are to be taken into account, so I see, as of now, no reason for an OSS. And please don't ask me how the code should look like if change numbers or validity dates are to be respected 🙂

Ralph

christoph_bergemann
Active Contributor
0 Kudos

Dear Ralph

I can not confirm your findings/statements. Any WWI report is considering the "change number"; I need not to specify something in WWI code. This is done "automatic". Without that Change numbers are "useless". From my point of view based on screen shot: there is only one current Status (with "All Ratings"/Reg_World combination)-

E.g. if you change the color from black to green using a change number the WWI report will display (based on key date) either  black or green. Even if you have more that one data record this would happen like that.

Is the repeating group used to loop on "Status" herefore "special"? (never tried to output that data)?

Long ago we have done "testing" using change numbers. And SAP standard was "fine" (but the use of the change number is "very tricky")

But may be you have some additional arguments why the system is working as you expect. Thanks.

C..B

Answers (1)

Answers (1)

christoph_bergemann
Active Contributor
0 Kudos

Dear Nick

the "Status" on specification hearder is used rarely in the context of WWI. First I recommend that you should read the onlien SAP help (and how data is retrieved in WWi report based on Status).

The topic is "very complex" it  belongs to scenarios not easy to understand in context of WWI

The topic is most worse as you seem to use "change numbers"

I have never seen such a "complex" scenario; at t is not easy to explain the "relations" between WWi, Status, and Change numbers.

May be check:

and e.g. this link:

Generation Not Permitted - Basic Data and Tools (EHS-BD) - SAP Library

It is very imprortant to understand the relation of data maintained on spec level and the definition of the generation variant.

May be check:

Generation Variant - Basic Data and Tools (EHS-BD) - SAP Library

So it is very difficult to explain to you all the "relations" if you are using at the same time:

"Change numbers"

and "Status"

This combination is very tricky in relation to WWI reports; personally I have no experience.

Please read first the SAP help; may be you get a clue how it worksit takes a lot of time to really understand it !

Regarding use of "Change numebers" may be read:

My recommendation would be: try to simplyfiy your maintenance approach; your approach is very very tricky (and is really not easy for endusers as well)

C.B:

nick_valeriano
Explorer
0 Kudos

Hello Christoph,

Thanks for the information, because of the complexity, like you helped explain, we have decided to manage this through a 2 Template - Business Process solution, one with the signature and one without.

Those links you provided were very helpful, in the end it was too complex without a custom solution.

Thanks,

Nick