on 10-30-2009 3:04 PM
Hi Forum,
I have the following self defined condition structure in my pricing scheme:
Z001 <- defined as x % of NETWR
Z100 <- x % of Z001
Z101 <- x % of Z001
Z102 <- x % of Z001
Z103 <- x % of Z001
Z104 <- x % of Z001
Z105 <- x % of Z001
My question is now: How can I implement a check, that it is not possible to enter more than a sum of 100% to the conditions Z100 to Z105?
At the moment I created two sum lines for direct compare of the Z001 and sum of Z100 to Z105. But that does not solve the problem.
Any help or just hints are welcome.
Thanks
Dennis
Please try to configure pricing procedure "Reqt", you code in the routine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I solved it now by using two sum lines in the pricing scheme.
The first summary line sums up the "100%" max lines.
The second summary line calculates the difference from the assigned values and the maximum assignable value using a user defined formula.
If this does not match I set the komp-prsok field to ''.
If this field is not 'X' it produces a pricing error.
Thanks for your help.
FORM FRM_KONDI_WERT_920.
DATA: WA_xkomv like LINE OF xkomv.
DATA: my_available like xkwert,
my_assigned like xkwert.
READ TABLE xkomv into WA_xkomv WITH KEY MANDT = XKOMV-MANDT
KNUMV = XKOMV-KNUMV
KPOSN = xkomv-KPOSN
STUNR = XSTUNR
KAPPL = xkomv-KAPPL.
IF sy-subrc = 0.
my_available = WA_xkomv-kwert.
ENDIF.
READ TABLE xkomv into WA_xkomv WITH KEY MANDT = XKOMV-MANDT
KNUMV = XKOMV-KNUMV
KPOSN = xkomv-KPOSN
STUNR = XSTUN2
KAPPL = xkomv-KAPPL.
IF sy-subrc = 0.
my_assigned = WA_xkomv-kwert.
ENDIF.
ENDFORM.
IF my_assigned <= my_available.
xkwert = my_available - my_assigned .
ELSE.
xkwert = my_available - my_assigned.
clear komp-prsok.
ENDIF.
ENFORM.
This is possible through User Exit. In User Exit, you will have to provide the logic to Abaper as under:
It will have to first read the value of Z001 and store it in field 'A' in temporary table.
Next it should read the values from Z100 to Z105 and sum up and store the same in field 'B' in temporary table.
Next the value is to be compared of Fiels 'A' and field 'B'. If the field 'B' value is greater, it should through a error message, say 'Z001 is less than combination of Z100 to Z105'.
Discuss the same with Abaper and she/he will be able to provide additional input on the same.
Regards,
Rajesh Banka
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think this is only possible in a user exit. The minimum/maximu limits may be defined in configuration only for each individual condition, not for a sum of conditions.
We perform a similar check in the USEREXIT_SAVE_DOCUMENT_PREPARE in MV45AFZZ in our system. Even though it's a bit too late, I couldn't find a better place for it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.