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 Conversion Problem

Former Member
0 Likes
414

Hi All,

I need to upload data from Excel file to SAP. I need to convert date filed which is in the format MMDDYYYY from Excel file into SAP filed with TYPE C.

The problem is, when i am entering date ' 08112007' in excel sheet, it is not accepting the zero and it is storing as '8112007' which is then being entered in to SAP filed, which is not accepted by the system.

Can anypne please provide me with the code of how to convert this so that the system will accept?

For good solution, REWARD POINTS will be there

Thanks,

Harish

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
386

hI hARISH

check in program

loop at itab.

str = itab-date.

length = strlen ( str ).

if length = 7.

concatenate '0' str into string.

itab-date = string.

modify itab index sy-tabix.

endif.

endloop.

Reward points to helpful answers,

kiran.M

2 REPLIES 2
Read only

Former Member
0 Likes
387

hI hARISH

check in program

loop at itab.

str = itab-date.

length = strlen ( str ).

if length = 7.

concatenate '0' str into string.

itab-date = string.

modify itab index sy-tabix.

endif.

endloop.

Reward points to helpful answers,

kiran.M

Read only

Former Member
0 Likes
386

Hi Harish,

This is another solution.

Check this code

DATA V_STR(8) TYPE N.

loop at itab.

MOVE itab-date TO V_STR.

modify itab index sy-tabix.

endloop.

Thanks,

Vinay