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: 

Date & currency Format

Former Member
0 Kudos

Hi Experts,

Right now i have the date format like : MM.DD.YYYY

and i want it in the output as : DD.MM.YYYY

For currency right now i have the format(USA) 1,49,999.000.

i need to display in the European country format like: 149,999.99

Please suggest me how to do this.

Thanks

Dany

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You can display output format as you expected

Just go SU01 Transaction -> enter your user id -> Click on change button -> see the tab called default -> here you can change what ever you want.

if you do not want change the user profile then use below code

Date logic :

data g_date like sy-datum.

g_date = sy-datum.

CONCATENATE g_date6(2) '.' g_date4(2) '.' g_date+0(4) INTO g_date.

write:\ g_date.

Edit_mask is To apply the report output formatting options same as in the WRITE statement in report writing.

wa_fcat-edit_mask = '__:__:__'.

wa_fcat-edit_mask = 'DD/MM/YYYY'.

Cuurency format :

data:

lv_price TYPE bseg-dmbtr VALUE '123.45-',

lv_price2 TYPE bseg-dmbtr VALUE '123.45'.

WRITE:

/ lv_price USING EDIT MASK 'RRV__________.__',

/ lv_price2 USING EDIT MASK 'RRV__________.__'.

Thanks

Seshu

9 REPLIES 9

Former Member
0 Kudos

You can display output format as you expected

Just go SU01 Transaction -> enter your user id -> Click on change button -> see the tab called default -> here you can change what ever you want.

if you do not want change the user profile then use below code

Date logic :

data g_date like sy-datum.

g_date = sy-datum.

CONCATENATE g_date6(2) '.' g_date4(2) '.' g_date+0(4) INTO g_date.

write:\ g_date.

Edit_mask is To apply the report output formatting options same as in the WRITE statement in report writing.

wa_fcat-edit_mask = '__:__:__'.

wa_fcat-edit_mask = 'DD/MM/YYYY'.

Cuurency format :

data:

lv_price TYPE bseg-dmbtr VALUE '123.45-',

lv_price2 TYPE bseg-dmbtr VALUE '123.45'.

WRITE:

/ lv_price USING EDIT MASK 'RRV__________.__',

/ lv_price2 USING EDIT MASK 'RRV__________.__'.

Thanks

Seshu

0 Kudos

Hi,

Thanks for the reply.

Well i dont have authorization to SU01, please tell me If i use the code below i need not make any config changes/settings irrespective of the user logon.

Date logic :

data g_date like sy-datum.

g_date = sy-datum.

CONCATENATE g_date6(2) '.' g_date4(2) '.' g_date+0(4) INTO g_date.

write:\ g_date.

Do i need to use edit mask now..as i want to display it in a script layout?

Please reply

Thanks

0 Kudos

Hi Dan,

If you do not have auth ,then use program logic to perform

Use below logic:

Date logic :

data g_date like sy-datum.

g_date = sy-datum.

CONCATENATE g_date6(2) '.' g_date4(2) '.' g_date+0(4) INTO g_date.

write:\ g_date.

Use below logic to get Currency format

Edit mask

Thanks

Seshu

abdul_hakim
Active Contributor
0 Kudos

Hi

For date use WRITE DATE DD/MM/YYYY.

For currency try the below FM.

CONVERT_TO_FOREIGN_CURRENCY

Cheers,

Hakim

Former Member
0 Kudos

HI

Use the following code for date conversion.

data: v_date(8) type c.

call function 'CONVERT_DATE_TO_INTERNAL'

exporting

date_external = '12.12.2006'

importing

date_internal = v_date.

write:/ v_date.

or else.

Look at the Function modules CONVERT_DATE_TO_INTERNAL or CONVERT_DATE_TO_EXTERNAL.

If the aboe are not useful, then you need to do it manually. just take date, Month and year in 3 fields and concatenate the same into another date field with the correct format.

For currency

Please check these FM.

CONVERT_TO_LOCAL_CURRENCY

ISB_CONVERT_TO_LOCAL_CURRENCY

Reward me if its useful.

Regards

Ravi

Former Member
0 Kudos

Hi

For date

Write sy-datum DD/MM/YYYY.

This will write the as DD.MM.YYYY if your personal settings for date separator is DOT.

write v_value CURRENCY <country>. "You can get the country code from table TCURX.

Regards

Navneet

Former Member
0 Kudos

for changing the cuurency format only you have to go SU01 tcode but for date purpose you can use...

data : idate(10) value '12.31.2006',

vdate(10).

concatenate idate3(2) idate0(2) idate+6(4) into vdate separated by '.'.

for currency format you can use

set country 'DE'. or your country name it may work...

regards

shiba dutta

Former Member
0 Kudos

Hi Dan,

For currency format display...

GoTo SU01 User settings -> check for the currency formats

Thanks.

Hari krishna

Former Member
0 Kudos

Hi Dan,

Use the Function Module : CONVERT_TO_FOREIGN_CURRENCY for currency conversion.

Use Statement: WRTIE with extension of Date format in DD.MM.YYYY.

This will certainly help.