Application Development and Automation 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: 
Read only

lsmw date format problem

Former Member
0 Likes
5,846

hi,

using lsmw i'm reciving an error :

"Enter date in format __-__-____"

My source field is DYMD and I have for example "20041010" as a date. (DYMD is 8 lenght).

Any idea what is wrong?

Lukasz

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,160

hi Lukasz Gruca

TRY THESE fUNCTION MODULES.MIGHT BE THEY SOLVE YOUR PROBLEM.

  • CONVERTING DATE(10) TO DATE(8)

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

DATE_EXTERNAL = VAR_DATE1

IMPORTING

DATE_INTERNAL = VAR_INDAT.

CONVERT_DATE_TO_EXTERNAL

This Function module Converts date from system storage format to users specified display format

cheers,

Vijay Raheja.

5 REPLIES 5
Read only

Vinod_Chandran
Active Contributor
0 Likes
2,160

Hi,

The date format depends upon the date format specified in the user master. Check the user in SU01 transaction. It seems the field expects a format 'DD-MM-YYYY'. Try passing either '20041010' or '10-10-2004'.

Cheers

Vinod

Read only

sergey_korolev
Active Contributor
0 Likes
2,160

Hi Lukasz,

That's likely because your LSMW project uses BDC as an input method and the corresponding field excpects external date format.

Try to use external date format with length 10 (DD.MM.YYYY)

Read only

Former Member
0 Likes
2,161

hi Lukasz Gruca

TRY THESE fUNCTION MODULES.MIGHT BE THEY SOLVE YOUR PROBLEM.

  • CONVERTING DATE(10) TO DATE(8)

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

DATE_EXTERNAL = VAR_DATE1

IMPORTING

DATE_INTERNAL = VAR_INDAT.

CONVERT_DATE_TO_EXTERNAL

This Function module Converts date from system storage format to users specified display format

cheers,

Vijay Raheja.

Read only

Former Member
0 Likes
2,160

thx Vijay Raheja.

That's solved my problem.

cheers

Lukasz Gruca

Read only

0 Likes
2,160

hi Lucas

I have the same problem with date for my LSMW asset load. Could you explain how you used the function.

If possible can you send me detailed documentation if you have any.

Thanks much

Krishna