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

invalid date format

HI,

I am using a BDC to create an SO and the data is fetched from a table.

If i am entering the date in the format 20071001(yyyyddmm) in the table, i am getting the output as 10.01.0720 where as i should get as 10.01.2007. can anybody suggest a work around for the same

shyam

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 11:31 AM

    data v_date type d.

    v_date = '20071001'.

    data v_format type char10.

    <b>write v_date to v_format using no edit mask.</b>

    write v_format

    use WRITE <S> TO <d> statement

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 11:39 AM

    Dear Peri,

    This is a common problem, when carrying out BDC.

    For example, while recording you met with the field --> MKPF-BUDAT.

    • Go to SE11 --> MKPF --> Search for BUDAT --> Double click on the Data Element i.e. BUDAT --> Double Click on the domain DATUM --> You can see under the block Output Characteristics : Output Length = 10.

    While declaring the TYPES Structure, make it CHAR(10).

    Consider this technique as the Rule-of-Thumb while doing BDC.

    Regards,

    Abir

    ***********************************

    • Don't forget to award points *

                                                                      Regards,

                                                                      Abir

                                                                      ************************************

                                                                      • Don't forget to award Points *

                                                                                                                                          Add a comment
                                                                                                                                          10|10000 characters needed characters exceeded

                                                                                                                                        • author's profile photo Former Member
                                                                                                                                          Former Member
                                                                                                                                          Posted on Jan 10, 2007 at 11:08 AM

                                                                                                                                          try using the statement

                                                                                                                                          write w_date to f_date.

                                                                                                                                          w_ date of type datum

                                                                                                                                          f_date(10) type c.

                                                                                                                                          or you can try using FM 'CONVERSION_EXIT_BEGDA_OUTPUT'

                                                                                                                                          Add a comment
                                                                                                                                          10|10000 characters needed characters exceeded

                                                                                                                                        • author's profile photo Former Member
                                                                                                                                          Former Member
                                                                                                                                          Posted on Jan 10, 2007 at 03:38 PM

                                                                                                                                          try this one

                                                                                                                                          write sy-datum to ZIE02-DATSL DDMMYY

                                                                                                                                          Add a comment
                                                                                                                                          10|10000 characters needed characters exceeded

                                                                                                                                        • author's profile photo Former Member
                                                                                                                                          Former Member
                                                                                                                                          Posted on Jan 10, 2007 at 03:44 PM

                                                                                                                                          ur system format is mm.dd.yyyy

                                                                                                                                          sap format is always yyyymmdd

                                                                                                                                          data: v_date like sy-datum.

                                                                                                                                          write date into v_date.

                                                                                                                                          use v_date in ur program which will be converted according to logon date set in profile.

                                                                                                                                          Add a comment
                                                                                                                                          10|10000 characters needed characters exceeded

                                                                                                                                        • author's profile photo Former Member
                                                                                                                                          Former Member
                                                                                                                                          Posted on Jan 10, 2007 at 07:32 PM

                                                                                                                                          Hi,

                                                                                                                                          Try this code.

                                                                                                                                          Data: v_date(8) type c value '20070101'.

                                                                                                                                          Data: v_temp type sy-datum,

                                                                                                                                          v_final(10) type c.

                                                                                                                                          v_temp = v_date.

                                                                                                                                          write v_temp to v_final.

                                                                                                                                          Regards,

                                                                                                                                          Aman

                                                                                                                                          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.