Application Development and Automation 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: 
Read only

Problem while displaying currency field

Sijin_Chandran
Active Contributor
0 Likes
2,281

Hello all,

I have an issue while displaying DMBTR field in one of zreport using basic list display.

DMBTR field is with 2 decimals but the output is coming with 4 decimals , resulting in display of wrong figures.

eg . instead of 621,000.00 rs 6,210.0000 is been shown.

I debugged and checked the type of output variable its coming right in debugger but in list display its getting wrong.

Thanks n regards ,

Sij.

9 REPLIES 9
Read only

prince_isaac
Active Participant
0 Likes
1,639

Hi

Just check the number of decimal points that are assigned to the currency that is referencing your amount field that you have typed to DMBTR. You can check in table TCURX.

regards

Prince Isaac

Read only

Former Member
0 Likes
1,639

Hi

Please check whether the final table [ which u pass to display ] DMBTR type is also type P decimal 2.

If this is correct please let me know .

Simple solution might be have the DMBTR value as Text for final table type. DMBTR TYPE TEXT.

Thanks

hariharan

Read only

Varamanoj
Participant
0 Likes
1,639

hi Sij,

Are you wrinting the amount on to the list from DMBTR field direclty or moving it to some varibale and wrintg the same, can you please post your code for reference.

Meanwhile you also check with following FMs which can help you in formating amounts.

1.HRCM_STRING_TO_AMOUNT_CONVERT

2.BAPI_CURRENCY_CONV_TO_EXTERNAL

3. CONVERT_AMOUNT_TO_CURRENCY

4.CURRENCY_AMOUNT_DISPLAY_TO_SAP

5. CURRENCY_AMOUNT_SAP_TO_DISPLAY

Best Regards

Manoj

Read only

Sijin_Chandran
Active Contributor
0 Likes
1,639

hello ,

Thanks for ur prompt replies.

This is the write statement :

write : GS_BSID-Z_WRBTR_S CURRENCY GS_BSID-WAERS LEFT-JUSTIFIED, "Debit Amount.

and GS_BSID-Z_WRBTR_S is of type bsid-dmbtr which is of 2 decimal type.

Currency type is INR.

Read only

0 Likes
1,639

Hi

As you are currency this probelm will come .

give this code before write

SET COUNTRY SPACE.

Please try this and let me know

Thanks

hariharan

Read only

Former Member
0 Likes
1,639

Hi

You can also control it via field catalog.

GW_FCAT-FIELDNAME = 'DMBTR'.
  GW_FCAT-COL_POS = '1'.
  GW_FCAT-TABNAME = 'GT_FINAL3'.
  GW_FCAT-SELTEXT_L = TEXT-120.
  *GW_FCAT-decimals_out = 2.*
  APPEND GW_FCAT TO GT_FCAT.
  CLEAR GW_FCAT.

Thanks

Hariharan

Read only

Sijin_Chandran
Active Contributor
0 Likes
1,639

Hariharan sir,

I am using Basic list display.

And the requirement of this report is in Basic list display itself.

Edited by: sapuser09 on Aug 11, 2011 12:17 PM

Read only

Sijin_Chandran
Active Contributor
0 Likes
1,639

Dear all,

I got the solution actually instead of WRBTR i need to display DMBTR which i did. Coz in wrbtr the field was in USD and the requirement was to display the report in INR which is in DMBTR.

Now the INR field was displayed in USD format because of the below statement

GS_BSID-Z_WRBTR_S CURRENCY GS_BSID-WAERS LEFT-JUSTIFIED

since in WAERS the value was USD.

So i set the value WAERS as INR (default )

Read only

0 Likes
1,639

Hi

yes u need to use DMBTR that is for Local Currency

Thanks

Hariharan