on 07-30-2009 5:10 AM
Dear All
Greeting for the Day !!
I have created my own smart form for billing document and i kept the same standard driver program, it was running nice, but after that our consultants opted for customized pricing procedure in the prg. RV64A902 with form name FRM_KONDI_WERT_902.
DATA: WORKFIELD(16) TYPE P DECIMALS 2,
WORKFIELD1 LIKE KOMP-FACTOR,
WORKFIELD2 LIKE KOMP-FACTOR,
WORKFIELD3 LIKE KOMP-FACTOR,
WORKFIELD4 LIKE KOMP-FACTOR.
CLEAR: XKWERT .
READ TABLE XKOMV WITH KEY KSCHL = 'ZMRP'.
IF SY-SUBRC = 0.
WORKFIELD1 = xkomv-kbetr.
workfield3 = xkomv-kwert.
endif.
READ TABLE XKOMV WITH KEY KSCHL = 'JEXP'.
IF SY-SUBRC = 0.
if WORKFIELD1 le 19000.
if komp-VRKME = 'MT'.
WORKFIELD2 = 23 * KOMP-MGAME.
else.
WORKFIELD2 = 23 / 20 * KOMP-MGAME.
endif.
Else.
workfield2 = workfield3 * 8 / 100 .
workfield4 = workfield2.
workfield4 = ( workfield4 * 1000 ) / komp-mgame. ""<----
error
if workfield4 gt 90000.
workfield2 = ( 900 * komp-mgame ) / 10.
endif.
ENDIF.
endif.
CHECK WORKFIELD2 NE 0.
XKWERT = WORKFIELD2.
Now the problem is when iam executing my smart form the it is giving the divided by zero error where i have marked,
What & where changes to be made in my driver prg. so that i can run my smartform
Thanks & Regards
K Hari Shankar.
hi,
You just have to check whether komp-mgame is not equal to 0. if it is not equal to zero then only it has to go for the division.
workfield4 = workfield2.
workfield4 = ( workfield4 * 1000 ) / komp-mgame. ""<----
error
if workfield4 gt 90000.
replace above code with this.
workfield4 = workfield2.
if komp-mgame ne 0.
workfield4 = ( workfield4 * 1000 ) / komp-mgame. ""<----
error
endif.
if workfield4 gt 90000.
regards
Veeresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.