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

Date Format

Hi all,

My Input date format 02-aug-08 which is coming from oracle, I am getting output has ug/-0/12-a.

But i need my output has mm/dd/yyyy.

aug should be converted to 07

08 should be converted to 2008.

Can any one give me some inputs any function Module.

Thanks,

Kiran.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 15, 2010 at 04:23 AM

    hi kiran,

    what is the date value you are seeing in the PSA?

    you need to write custom code to get data as per your requirement... should be a simple

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      it is acheck point...here if the year may be in 1970 or 1980...so in that case we do check here that whether the year is less than 60...then we concatenat with 20..to get the value as 2010,2011,2012 etc...

      but if it is in the year 1987 say....then you need to concatenate with 19...so that has been done here...

      As said by raghavendara it is not advisable to write a code, you can ask your oracle team to create a view and convert the date to standard SAP format and then use the view...

      rgds, Ghuru

  • author's profile photo Former Member
    Former Member
    Posted on Dec 15, 2010 at 05:00 AM

    you can use the below code in your routine..Hope it helps.

    DATA :  EXT_CALDAY(9) TYPE C,
    	EXT_DATE(2) TYPE C,
    	EXT_MONTH(3) TYPE C,
    	EXT_YEAR(2) TYPE C.
    	INT_MONTH(2) TYPE C,
    	INT_YEAR(2) TYPE C,
    	INT_CALDAY(8) TYPE C,
    	CALDAY TYPE SY-DATUM.
    
    EXT_CALDAY = '02-aug-08'.
    
    EXT_DATE = EXT_CALDAY+0(2).
    EXT_MONTH = EXT_CALDAY+3(3).
    EXT_YEAR = EXT_CALDAY+7(2).
    
    IF EXT_YEAR LT '60'.
    
    CONCATENATE '20' EXT_YEAR INTO INT_YEAR.
    
    ELSE.
    
    CONCATENATE '19' EXT_YEAR INTO INT_YEAR.
    
    ENDIF.
    
    CASE EXT_MONTH.
    
    WHEN 'JAN'.
    
    INT_MONTH = '01'.
    
    WHEN 'FEB'.
    
    INT_MONTH = '02'.
    
    WHEN 'MAR'.
    
    INT_MONTH = '03'.
    
    WHEN 'APR'.
    
    INT_MONTH = '04'.
    
    WHEN 'MAY'.
    
    INT_MONTH = '05'.
    
    WHEN 'JUN'.
    
    INT_MONTH = '06'.
    
    WHEN 'JUL'.
    
    INT_MONTH = '07'.
    
    WHEN 'AUG'.
    
    INT_MONTH = '08'.
    
    WHEN 'SEP'.
    
    INT_MONTH = '09'.
    
    WHEN 'OCT'.
    
    INT_MONTH = '10''.
    
    WHEN 'NOV'.
    
    INT_MONTH = '11'.
    
    WHEN 'DEC'.
    
    INT_MONTH = '12'.
    
    ENDCASE.
    
    CONCATENATE INT_YEAR INT_MONTH EXT_DATE INTO INT_CALDAY.
    
    CALDAY = INT_CALDAY.
    
    RESULT = CALDAY.
    

    Add a comment
    10|10000 characters needed characters exceeded

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.