cancel
Showing results for 
Search instead for 
Did you mean: 

WWI issue: function module with symbol doesn't work in conditional output

Former Member
0 Kudos

Hi,

I have created a function module to be used in combination with a symbol that represents the quantity of a composition item in a composition. In some cases a average quantity is not filled and the function module calculates the quantity based on the lower and upper limit of the composition item. This function works perfectly if managed in customising with a symbol or called with a symbol in WWI. When displaying the result of the symbol in a WWI word template it shows the expected value.


However when I use the symbol with a function module (or the customised symbol with function module) in a conditional output expression, the value it represents in the expression is always equal to zero. It seems that a symbol value that is calculated using a functional module is not calculated properly when used in a conditional output expression. Setting a break in the functional module always shows the correct value, but the value as I already told, is not seen by the conditional output expression. Within the expression the value is always equal to zero.

Does anyone know if this is a known issue in WWI? Is there any solution to handle this problem? I hope anyone can help.

Thanks,

Paul

Accepted Solutions (1)

Accepted Solutions (1)

christoph_bergemann
Active Contributor
0 Kudos

Dear Paul

I believe you need (or should use) a different approach. I am not sure (and based on your results) if the "condition" topic will work for "calculated" values; but never tried this way in real life. It is highly recommended to avoid such "calculations" in WWI and simply prepare "maintenance" guidelines so that either upper, lower, or average value are present.

In any case: i believe you can use "nested" conditional approach (may you have  done that?). and then as the "last" choice use your "symbol".

E.g. like: if lower value is there: print it; if upper value is there print it; if average value is there print it (this done in sequence as you are looking for). But to "calculate something in WWI is, as mentioned, not recommended. Any may be there is no value there in any case (empty loqer, upper or average value) => what is the reaction??).

May be using "stack" approach you might get a solution.

provides some references to threads in which the "stack" approach has been used. NIce option but as well tricky in WWI.

I can recommend to use this option: during maintenance actions and if "save" button is hit you can use a BADI implemetation (please check options ! there are enough !). Now based on this e.g. if user has maintained lower limit, upper limit but no average and hit now the "save" button you just start your "function module" to calculate the average and then during the "save" action this value can be immediately stored in data base without user interaction. This avoids any calculation in WWI. This approach is highly recommended (/e.g. if you use additional rule sets etc.).

There are aditional reasons why you should solve the problem during maintenance activities and not in WWI:

In WWI report you will see a calculated value but by using standarg CG02 options you will never be able to execute queries" like "show me if ingrendient is containd like .." in data based as the value is not stored in database.

C.B.

Former Member
0 Kudos

Dear Christoph,

Thank you for the quick reaction. At this moment the composition item could contain an average vale or low limit/high limit values or both. Unfortunately I have to calculate something if I only have a low limit/high limit value.

I already looked at the stack solution, but I always get an error message that value list is not saved. I think stack is not working well in a master slave repeating group.

Finally I think your last remark is very true. Standard reports will not work very if you also make use of calculated values.

Regards,

Paul

christoph_bergemann
Active Contributor
0 Kudos

Dear Paul,

only some add on high level ideas:

if you look at:

Example: Layout of an Abridged Material Safety Data Sheet - Basic Data and Tools (EHS-BD) - SAP Libr...

you find the standard example of SAP for master and slave group:

2  <11BRG003 (M,SAP_EHS_1012_004;*)>

3  <03EHS_L_TEXT(CED

  -SDB-01.002)> ¤

<03EHS_L_TEXT(CED-

SDB-02-07)> ¤

<03EHS_L_TEXT(CED-

SDB-02-05)> ¤

4  <11BRG002 (S:POS;*)> ¿

5 <01GESTRIDENT(I:NAM,

6  IUPAC,;*)> <11ERG002>¤

7

8

9

<11BRG002 (S:POS; *)> ¿

<01G1023001R2(C;*)

><11ERG002>¤

<11BRG002 (S:POS;*)> ¿

<01GESTVPRECL>

<01GESTVCOMPL(N:" ZZ9,9")>

<01GESTVCOMPE>

<11ERG002> ¤

10  <11ERG003>

The "issue" is that you need to analyse by "line" of POS group; or precisely: it is easy to print lower, upper and average value if it exists.

In conditional output this example is shown in SAP help:

<15BIF001(AND:01G1013005VA GE 1)><01G1013005VA(;*/TL)[D:Value]>

<15CIF001><03EHS_L_TEXT(CUST-100000000000031)[D:Density is less than 1]>

<15EIF001>


I believe you need a "clever" nesting together with your customer symbol


E.g. you need first "test" the contents of the three values and decide about result


The easiest way could be to use a "table" structure as above.


Just use column header "lower"; "average"; "upper" value. Then you need to ask your self in which situation what need to printed.

If you use the table structure and you print just what is there and leave simply lower / upper limit "field" empty if it does not exists (what is bad with this?) you need only this "conditional" output topic done for average value. You could check for: if value > 0.0001 then print the value (as then there is a value); if not use the report symbol in which you calculate something. In my opinion it is worth to try it.

It is known that you can check "numeric values by using conditional output. I belive tis cintional one des work as well with the "composition" values (lwoer, upper, average),

May be this approach might help.

The "stack" examples which are discussed in SAP help and in the links shown are related to "characteristic" values of classes and not for composition ones.


C.B.


PS: If this really works you can clearly extend your solution. E.g. if lower value is empty may be print "0", If upper valus is empty may be print "100" etc. (or prepare a further costumer symbol calculating something).

Former Member
0 Kudos

Hi Christoph,

Thanks you for looking in at the problem. Your approach could be a solution. Unfortunately I still have the situation that there is a low limit value and a high limit value without an average value. In some cases it is not desired to have the average value calculated and maintained in the composition directly (according to the product steward). In that situation I still have to calculate an average value on the fly when generating a document.

The document is not a MSDS but some kind of custom form that customers request about the composition (f.e. only the non volatile components of a product).

Another solution is to build a smartform for this. Then you don't have the limitations of WWI.

Regards,

Paul

Ralph_P
Advisor
Advisor
0 Kudos

Hi Paul,

I'm not sure conditional output will work here. reason is that the upper and lower limit could be any number between 0 and 100, however, in the conditions you have to specify a value to be checked for.

Your FM doesn't work because (I think) at the time of the check the value is not yet handed over to the symbol, it's still only in the variable of the FM. Consequently the conditional output doesn't find the value that would fulfill the condition.

So I think you need to do the whole calculation including the decision which value to print within the FM and not put the corresponding symbol within a conditional output expression. The FM calculates the average content and decides whether this value or the upper/lower limit is handed over to the symbol.

Ralph

Former Member
0 Kudos

Hi Ralph,

I was also thinking that at the time the output condition is evaluated, the symbol value is yet not available/calculated (the FM is triggered so that is not the problem). To my opinion this is a bug, because WWI accepts the FM in the output condition, but can't handle it.

It is an interesting approach to make the calculation and decision in the FM. However I think it will not work, because I still have to check the master/slave repeating group for each component if the calculated symbol is available for output. I can't print empty lines, so I have to do a check on the calculated value and will have the same problem as I have now.

Regards,

Paul

christoph_bergemann
Active Contributor
0 Kudos

Dear Paul

I believe using "condition" techniques in combination with your customer report symbol: you can do the job (e.g. based on my proposal; i have done a short check and it does work (not using customer specific symbol clealry) and it was quite easy to prepare WWi layout)

Once again I would like to give you hints in the "cons" of this approach (and there is from my point of view no "pro"):

a.) using WWI techniques you can not search for the data shown in the report in CG02 =>> clear con

b.) during any generation of a WWI report the calculation is done once again. E.g. imagine that you prepare today a report in "FR" and tomorrow in "EN" and in the meantime somebody has added/changed data (so that now average value is maintained): you will not get this "explained" in short time (that means contentof WWi report one in comparison to two). => clear con

c.) depending on the vaculation rules you are using you might have a "lot"of trouble. How to "intepret" an "empty" value? Imagine that no average is maintained nor lower value but upper value only.What is the result of calculating the average in your approach? => clear con

So from my perspecitve. there is no "pro" (ok the user might feel to be supported but if you really discuss with him/her than he/she should be "unhappy" soon with this solution.

So either by using "maintenance" rules or by using the BADIs which I have mentioned you should solve your problem in maintenance process. If you use e.g. expert rulesets in any case this is the right option to look for.

C.B.

Answers (0)