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: 

Program error while accessng data from table

Former Member
0 Kudos
247

Hi all,

In report , while accessing data for Sales order printing for Export, in sales order the NETWR is

1,070,000 (same as in sales order) but in Cond.table it is diplaying KAWRT and KBETR as

10,700.00. In program in select query for VBAK , it is taking the value 10,700.00. could any one tell me what has to be done ?

Thanks,

15 REPLIES 15

Former Member
0 Kudos
204

HI Khushi

This problem comes when the currency is zero decimal (Yen, Won, etc).

Before using KAWRT and KBETR do


WRITE kwart CURRENCY <currkey> TO lv_kwart.
eg
WRITE kwart CURRENCY 'JPY' TO lv_kwart.

Pushpraj

0 Kudos
204

Hi Pushpraj,

The currency value is 39.90 .

thanks

0 Kudos
204

Hi Khushi

I didn't get what you meant by curency value being 39.90

Check in VBAK for the currency for the sales order you refer to

and use that in the WRITE statement at the proper place.

0 Kudos
204

Hi,

It is sales order for export ie for JPY currency and field value for KONV-KKURS is 39.90.

thanks

0 Kudos
204

Hi Khushi

That is the exchange rate.

That sghouldn't have anything to do with your problem. I have faced the same issue in the past and the value are indeed stored like 2398 as 23.98 in VBAK when the currency is JPY. All you have to do is that when you show the value from this table do it after the WRITE statement so that 23.98 becomes 2398 again.

Pushpraj

0 Kudos
204

Hi pushpraj,

Thanks .

but what will be the data type of lv_kwert.

0 Kudos
204

Hi

DATA lv_kwert(13) TYPE c.

Pushpraj

0 Kudos
204

hi,

i wrote the same but it is throwing it is throwing an error Unable to interpret " 1,070,000 " as a number.

the foll.is statement.

tot = lv_kwert * TCURR-UKURS.

0 Kudos
204

Hi

Forget that

try this



REMOVE ALL OCCURRENCES OF ',' IN lv_kwert.
tot = lv_kwert * TCURR-UKURS.

Pushpraj

Edited by: Pushpraj Singh on Feb 24, 2009 12:14 PM

krishnannarayanan_nampoot
Active Participant
0 Kudos
204

Please check the Reference Currency Field in VBAK table and then check the value in the reference field for the data. Reference Field is there in tab Currency / Quantity Fields.

Please check if this solves your problem.

Thanks.

former_member195383
Active Contributor
0 Kudos
204

these number displays depend on your SU3 settings .

go to transaction

su3 --> Defaults ---> Currency/Number formats .

There you can see what is set , that same format comes for all the currency fields .

Reg: your problem, can you be more specific on, what exactly is needed..

Regards

Rudra

0 Kudos
204

Hi Rudra,

I want to calculate the value for sales order ( konv-kwert * currency (JPY - 39.90)) but as kwert is

taking 10,700.00 instead of 1,070,000(vbak-netwr). why in VBAK it is taking 1,070,000 and in KONV with decimal places and also in program while accessing VBAK table , it is displaying the value netwr as 10,700 instead of 1,070,000.

Former Member
0 Kudos
204

Hi Khushi,

I am not recollecting the exact field right now. But what you will have to do is take KBETR and divide it by that field. Just observe in KONP table the filed with value 10 for that condition. It will work. Already I have worked on such type of requirement.

Let me know if any further explanation is required.

Regards,

Anil

Former Member
0 Kudos
204

>

> In report , while accessing data for Sales order printing for Export, in sales order the NETWR is

> 1,070,000 (same as in sales order) but in Cond.table it is diplaying KAWRT and KBETR as

> 10,700.00. In program in select query for VBAK , it is taking the value 10,700.00.,

kwart need not be same that of netwr.netwr is in a way final taxable amount.Provide appropriate condition type while fetching from KONV .

Cheers

Former Member
0 Kudos
204

thanks