cancel
Showing results for 
Search instead for 
Did you mean: 

Amount and Date Formating Urgent !!

Former Member
0 Kudos

Hello Gurus,

I want to format Amount in the below manner , I need to put this data in a text file ,

When I read it from SAP , irrespective of whatever format

I need to write the data in the text file in the following format

999999999999.999

if the amount is 12 then

000000000012.000

if the amount is 100 then

000000000100.000

Also , I need a help on date formating

My date will always appear in the text file in the following format

YYYY.MM.DD

so irrespective of whatever user settings on has I need the format to appear in the text file as above.

Please help me Points guaranteed , please try it at your end

and please paste the code.

rgds,

Aryan

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Try out the following code for obtaining the date in YYYY.MM.DD format.

data mydate like sy-datum.

data: year(4) type c,

month(2) type c,

date(2) type c.

year = mydate(4).

month = mydate+4(2).

date = mydate+6(2).

write: / year no-gap, month no-gap, date.