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

Take date from the text variable.

Hi Experts,

I am a BW consultant and I have one requirement please help .

i have one transparent table where i have a text field where i have a date stored in it.

I want this date in the date varaible.

If i am directly reading this tabel and putting it inyo the date varaible IT gives me error

as : Target field and source field are mismatched.

Please help me put this date in the date variable from the text varaible.

Regards,

RG

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 26, 2009 at 06:51 AM

    HI,

    You need to use the Offset to get the date into Date varaible from text variable.

    EX : 25-03-2009 is in text varable then 
    
    data :l_date type sy-datum
    You need to write this way..
    l_date = l_text+6(4).              " Year
    l_date+4(2) = l_text+3(2).      " Month
    l_date+6(2) = l_text(2).          " Day

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 26, 2009 at 06:52 AM

    Hi

    declare your variable the same type as the transparent table where you have the text field which stores date.

    Eg:

    if ztab is the table, and date is the field in the table, in your program, declare the variable as

    DATA: l_date like ztab-date.

    In the logic, move the data like

    l_date = ztab-date

    regards,

    Arun

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 26, 2009 at 06:52 AM

    Hi RG,

    Does this date always come at the same position. Then you can use offset to access it.

    Something like

    v_date = v_text+4(8).

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 26, 2009 at 06:53 AM

    In addition to Avinash's comment: This depends on the format of the date in the text field.

    Avinash's comment is correct if, and only if the date in the text field is formatted like this:

    20082603

    YYYYMMDD

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 26, 2009 at 09:01 AM

    Thanks for your help

    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.