on 05-06-2014 2:46 PM
Hi All,
I am new to SAP IP and have to create a planning function to check the total of a key figure distribution equal to 100 percent.
Data like :
ColumnA CloumnB ColumnC ColumnD ColumnD Keyfigure
abc def ghi a11 b11 30
abc def ghi a22 b22 40
abc def ghi a33 b33 30
I have to add the keyfigure for the combination of abc, def and ghi. In case the total is not 100, then display error.
Any pointers will be of great help.
Thanks in advance,
Priyanka
The sample data would be like
ColumnA ColumnB ColumnC ColumnD ColumnE Keyfigure
abc def ghi a11 b11 60
abc def ghi a22 b22 40
abc def opq a33 b33 30
abc def opq a44 b55 70
The column A and B will be constant for a particular planning session. Defined in the selection screen before entering the Layout(WAD Template). Need not consider Column D and E.
Need to group only Column C and check for a particular characteristic value if the value is hundred.
In the ex, ghi should be checked for 100 value, and opq should be checked for 100.
In case for value is not 100 for any group in Column C, then error message should be displayed.
Kindly provide your inputs.
Thanks and regards,
Priyanka
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tried the following.
In characteristic usage, checked the ColumnA,ColumnB,ColumnC.
OPERAND : {KEYFIGURE,COLUMNC,COLUMNA,COLUMNB}
Fox Code as follows.
DATA TOTAL_VALUE TYPE F.
DATA VAR_A TYPE COLUMNA.
DATA VAR_B TYPE COLUMNB.
DATA VAR_C TYPE COLUMNC.
TOTAL_VALUE = 0.
FOREACH VAR_A,VAR_B.
FOREACH VAR_C.
TOTAL_VALUE = TOTAL_VALUE + { KEYFIGURE, VAR_C,VAR_A,VAR_B}.
ENDFOR.
IF TOTAL_VALUE <> 100.
MESSAGE E001(UPF) WITH ' ERROR IN THE VALUES, TOATL NOT EQUAL TO 100'.
ENDIF.
TOTAL_VALUE = 0.
ENDFOR.
The above fox code, treats each and every row for the FOR loop. The logical grouping of data for the columns selected in the Characteristic usage is not being considered.
Could you please let me know the reason.
Thanks,
Priyanka
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.