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

remove '.' from date

hi,

i am passing a date field in my program as 23.09.2008, but i want to remove the '.' before process it. can any one advice what is the code to remove '.'? i believe there is but i already forgotten of it. thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2008 at 07:21 AM

    hi...

    use replace

    regards

    vivek

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 23, 2008 at 07:24 AM
    REPLACE all occurences of '.' in date_field with ''.
    
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2008 at 07:24 AM
    DATA: w_var(10) TYPE c.
    w_var = '31.12.2008'.
    
    REPLACE ALL OCCURRENCES OF '.' in w_var WITH '' .
    WRITE / w_var.
    
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2008 at 07:28 AM

    Hi ben,

    Replace will only remove .(dots) and give the date as 23092008 but the internal date format is 20080923.

    So use the FM CONVERT_DATE_TO_INTERNAL to convert a date to internal format.

    Revert Back if you have doubts.

    Regards

    Karthik d

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 23, 2008 at 07:31 AM

    hi

    DATA :
       w_d TYPE d,
       w_d1 TYPE sy-datum.
    
    
    w_d1 = sy-datum.
    
    CONCATENATE w_d1+0(4) w_d1+4(2) w_d1+6(2) INTO w_d.
    
    WRITE :
      / w_d.

    Regards

    Pavan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2008 at 07:34 AM

    Hi,

    Try like this:

    data: fld1(12) type c,

    fld2(12) type c,

    fld3(2) type c,

    fld4(2) type c,

    fld5(4) type c.

    fld1 = '23.09.2008'.

    fld3 = fld1+0(2).

    fld4 = fld1+3(2).

    fld5 = fld1+6(4).

    concatenate fld3 fld4 fld5 into fld2.

    write: / fld1,

    / fld2.

    Regards,

    Bhaskar

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 23, 2008 at 07:50 AM
    believe there is but i already forgotten of it

    But SDN database is still Active and Up so you need to just search nothing else 😊

    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.