cancel
Showing results for 
Search instead for 
Did you mean: 

Different output in different systems

Former Member
0 Kudos

I have a question that when I write the following LOC in my smart form the output is correctly visible in the development system (my system) but not in the user system (a different server):

"here>> g_po and w_curr_desc is

"of type vbak-vbeln and vbak-waerk

"respectively.

-


set country space.

g_po = wa_vbak-vbeln.

w_curr_desc = wa_vbak-waerk.

select single dcpfm from usr01 into (w_dec_note)

where bname = sy-uname.

-


" here>>W_DEC_NOTE TYPE XUDCPFM

" here>> l_char type char20

-


<i>MOVE w_total_vat to l_char.</i>

condense l_char no-gaps.

if w_dec_note = 'X'.

replace all occurences of ',' in l_char with ''.

elseif w_dec_note = 'Y'.

replace all occurences of ',' in l_char with '.'.

condense l_char no-gaps.

elseif w_dec_note = space.

replace all occurences of '.' in l_char with ''.

replace all occurences of ',' in l_char with '.'.

endif.

condense l_char no-gaps.

-


Now instead of the code line mentioned above in italics I write the following code-linethe problem goes away,I did that to recrify the problem but dont know the reason for it:

<i>write w_total_vat to l_char currency wa_vbak-waerk.</i>

1.Can anybody please explain me the reason for exactly what happened before and after theis change is made?

If the output is say as '180' 'currency' which we see on our systems.The user sees it as '18000' 'currency'.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Whenever currency is involved, the system determines the number of decimal places in the output according to the currency , say C, If the contents of C exist in table TCURX as currency key CURRKEY, the system sets the number of decimal places according to the entry CURRDEC in TCURX. Otherwise, it uses the default setting of two decimal places. This means that table TCURX must contain only exceptions where the number of decimal places is unequal to 2.

The output format for currencies does not depend on the decimal places of a number that may exist in the program. The system uses only the sequence of digits. This sequence of digits thus represents an amount specified in the smallest unit of the currency in use, for example Cents for US Dollar (USD) or Francs for Belgian Francs (BEF). For processing currency amounts in ABAP programs, SAP therefore recommends that you use data type P without decimal places.

I think that for the currencies you use, there is an entry in your TCURX table and none in your client end, may be thats why this addition of two zeros occur.

Former Member
0 Kudos

Hi Vasanth,

You mean to say that for calculations based on currency I need to take them into variables that are of TYPE P? Will that help?

Former Member
0 Kudos

Yes

Former Member
0 Kudos

Check this demo program, may be it can help you better DEMO_LIST_WRITE_CURRENCY

Former Member
0 Kudos

Hi Vasanth ,

I have asked the client whether he has any entry for the currency SKK in his system the one I am using now.In my system its not there.

Answers (0)