Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

VA05 Transaction Userexit Division Problem

Former Member
0 Kudos

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

9 REPLIES 9

Former Member
0 Kudos

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

0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

Do the calculation like this

lvbmtv-zzsetrem = ( lvbmtv-zzdpntwt * 100 ) / lvbap-ntgew.

instead of "lvbmtv-zzsetrem = ( lvbmtv-zzdpntwt / lvbap-ntgew ) * 100."

0 Kudos

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.

0 Kudos

Were you able to work it out?. or still having problems

Varun

Former Member
0 Kudos

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.

0 Kudos

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.

Former Member
0 Kudos

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