Skip to Content
author's profile photo Former Member
Former Member

Amount and Date Formatting Urgent !!

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Jan 28, 2008 at 07:16 AM

    hi, take the amount variable as numeric data type (N).

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 11:00 AM

    hi

    use UNPACK AMOUNT TO TEXT.

    for date use SET COUNTRY.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi!!

      check this out if it helps...

      REPORT ztestdate.

      DATA:lv_day TYPE c LENGTH 2,

      lv_month TYPE c LENGTH 2,

      lv_year TYPE c LENGTH 4,

      lv_string TYPE c LENGTH 10.

      *formatting the date into requested type.

      lv_day = sy-datum+6(2).

      WRITE:/ sy-datum+6(2).

      lv_month = sy-datum+4(2).

      WRITE:/ sy-datum+4(2).

      lv_year = sy-datum(4).

      WRITE:/ sy-datum(4).

      CONCATENATE lv_year lv_month lv_day INTO lv_string SEPARATED BY '/'.

      WRITE:/ lv_string.

      Thanks & regards

      @mit.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.