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

DATE format error

vallamuthu_madheswaran2
Active Contributor
0 Likes
713

Hi Friends,

I am create one upload program using bdc.

the I/P Text file has one date field(MM/DD/YYYY).

in internal table i declared DATE field is like sy-datum.

while uploadig it removes the last 2 chr of Year.

please explain 1. how to declare in internal table?

2. While uploading it automatically convert the system format or

SAP owndata format.

Thnakz & Regards,

Vallamuthu.M

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
640

Hi,

Declare ur date field in internal table as 10 characters.

pass the date u got from file to FM convert_ date_ to_ internal

this will convert the date to internal format.

then use WRITE TO statement so that the date will converted to user format.

4 REPLIES 4
Read only

Former Member
0 Likes
640

Declare the internal table's date field as date(10) type c.

else, pass 8 character date field from the text file.

M S DhanaLakshmi

Read only

Former Member
0 Likes
640

Try following :

1. use function module ' ISH_DATE_CONVERT_I2E ' to convert the date format.

or

2. check if field type ur useing is having any conversion exit.

if yes then u can use the same for format conversion.

Read only

Former Member
0 Likes
640

hi,

It may not be uploading but check with debugger that even in the program before uploading the date value might be missing the last 2 digits of the year,

try this out: declare the variable as datum

after u have read the data from screen

use function convert_ date_ to_ internal .

exporting = variable having screen value of date

importing = variable declared above as datum

if useful do not forget to reward points.

Read only

Former Member
0 Likes
641

Hi,

Declare ur date field in internal table as 10 characters.

pass the date u got from file to FM convert_ date_ to_ internal

this will convert the date to internal format.

then use WRITE TO statement so that the date will converted to user format.