Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

invalid date format

Former Member
3,588

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

1 ACCEPTED SOLUTION

Former Member
2,018

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

6 REPLIES 6

Former Member
2,018

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'

Former Member
2,019

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

Former Member
2,018

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 *

Former Member
2,018

try this one

write sy-datum to ZIE02-DATSL DDMMYY

Former Member
2,018

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.

Former Member
0 Kudos
2,018

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