cancel
Showing results for 
Search instead for 
Did you mean: 

date format in lsmw

Former Member
0 Kudos

Dear All,

I need to upload flat file data through lsmw MR21 recording. I have DATE field in flat file in the format of YYYYMMDD.

So, in the final step of LSMW process, the date is coming to the MR21 transaction in the same format of YYYYMMDD and it's saying Invalid date.

Please let me know how to get the correct DATE format in MR21 screen.

Thanks in Advance,

Ranjan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

as you are doing recording, date format must be according your user profile. Check your profile for date format. if date format is in ddmmyyyy then you have to change to flat file to ddmmyyyy. or u can do the programv in the lsmw to convert to yyyymmdd to ddyymmmm.

Regards,

Sudhakar.

Former Member
0 Kudos

Hi,

as you are doing recording, date format must be according your user profile. Check your profile for date format. if date format is in ddmmyyyy then you have to change to flat file to ddmmyyyy. or u can do the programv in the lsmw to convert to yyyymmdd to ddmmyyyy.

Regards,

Sudhakar.

Answers (4)

Answers (4)

former_member188685
Active Contributor
0 Kudos

Hi,

ideally what ever you did is correct. is it for all records it is giving the same error.and mostly check your flat file date fields, even date is not valid it gives the same error. suppose if you give the date in the file as 2004<b>13</b>12 (month greater than 12) or

200401<b>34</b> (date greater than 30or31) then it will say the same error. make sure the flatfile dates are valid.

Regards

vijay

Former Member
0 Kudos

Get the Format from the User settings. ie got to SU01D TCODE, you could see the date format which is used there. of you can select the date fromat from USRxx table.

In the <b>Maintain field mapping and conversion rules</b> in Change mode, you double click of the respective field name and get into the editor screen. There you can validate the date or convert the date into your format.

And Again in the <b>Read data</b> you can Check the format also, while uploading data. It will automaticly converts.

hope this will helps you.

Rgds,

TM.

former_member214131
Active Contributor
0 Kudos

Hello,

In the convert data step:

choose 'Display Variant' from menu and enable all the check boxes; now you will be able to see the coding in the LSMW; Declare a global variable ( Char 10 ) to hold the date in 'dd.mm.yyyy' format.

in the field level coding you can use the FM: CONVERT_DATE_FORMAT

for converting the date from yyyymmdd to dd.mm.yyyy format

hope this helps.

regards, Murugesh AS

Former Member
0 Kudos

HI,

Using Abap code u can change the date format as per your requirement. Goto, 5 Maintain Field Mapping and Conversion Rules, position the cursor on field and select Rule, there u fine Abap code. In this editor change the format.

Ravikumar.

Former Member
0 Kudos

Hi,

You can change the date format in "CONVERT DATA" step.

remove the tick for Date.

Regards,

Shashank