04-30-2009 2:05 PM
Hi All,
I have a problem during division for VA05 Transaction.
I had appended few fields in VBMTV structure.
Fieldname Data Element Data type length Decimal Refernce table Refernce field
ZZSETREM ZSETREM QUAN 13 3 VBMTV VRKME
ZZDPNTWT ZDPNTWT QUAN 13 3 VBMTV VRKME
Now in the program V05TZZMO,
I am calculating as lvbmtv-zzsetrem = ( lvbmtv-zzdpntwt / lvbap-ntgew ) * 100.
During debugging lvbmtv-zzdpntwt = 20.000 and lvbap-ntgew = 950.000.But still no calculation takes place and lvbmtv-zzsetrem = 0.00. For a lesser value say ( 2/4 ) * 100...calculation does takes place.
I declared the same in a Z program and gave those values it was working perfectly. But in this program the division fails. I tried all the different data types but unsuccessful. Due to some reason the division never takes place. Kindly guide me on this issue.
Thanks n regards,
Vinayan
04-30-2009 2:10 PM
Hi,
while doing division for currencies you should always use three fields of same type...
check the field NTGEW field and move that field in to above curreecy type ..
hope it will work..
Regards,
Prabhudas
05-01-2009 5:51 AM
Hi Prabhu,
Thanks for your reply. But before posting in SDN I tried everything. Using ntgew and also tried with different data types but all were unsuccessful.
05-01-2009 7:29 AM
Hi Prabhu Das,
Before posting the query in the SDN I tried with the NTGEW and all data types, but still it is not working.
Edited by: siva kumar on May 1, 2009 12:22 PM
05-04-2009 7:06 AM
Do the calculation like this
lvbmtv-zzsetrem = ( lvbmtv-zzdpntwt * 100 ) / lvbap-ntgew.
instead of "lvbmtv-zzsetrem = ( lvbmtv-zzdpntwt / lvbap-ntgew ) * 100."
05-04-2009 7:20 AM
get the values and move to user-defined variables with 3 decimals type (or chk the table field length). Then, do your calculation and finally move to your required fields.
05-04-2009 9:01 AM
05-05-2009 12:19 PM
Hi All,
Thanks for your response. As said by u all i tried all the steps.
In Tripati's answer it is found that when i tried :
lvbmtv-zzsetrem = ( lvbmtv-zzdpntwt * 100 ) / lvbap-ntgew.
This method gave me an answer in computation but the problem faced is:
if lvbmtv-zzdpntwt = 20.000 and
lvbap-ntgew = 950.000
The actual answer based on above calculation should be 2.105.
But in my program V05TZZMO,after calculation the result in lvbmtv-zzsetrem comes as 0.002
Kindly give a suggestion on this.
05-05-2009 12:37 PM
try increasing decimal size of zzsetrem 25 decimal 10, after calculation multiply by 10000.
lvbmtv-zzsetrem = ( lvbmtv-zzdpntwt * 100 ) / lvbap-ntgew.
lvbmtv-zzsetrem = lvbmtv-zzsetrem * 10000.
05-05-2009 1:37 PM
Hi All,
Thank you all for ur replies. I finally had to create a z function module to calculate the values and get a correct output in the userexit. I have rewarded useful suggestions accordingly.
Regards,
Vinayan