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 CONVERSION

Former Member
0 Likes
626

Hi ,

I am importing data from a file in local computer into internal table.

now the date is given in the format 9/12/2007 in the text file . How can I convert this to DATS format which is SAP readable.

thank you

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
590

Try out for below FM..

<b>CONVERT_DATE_TO_INTERNAL</b>

Thanks & Regards

ilesh 24x7

4 REPLIES 4
Read only

ferry_lianto
Active Contributor
0 Likes
590

Hi,

Please try FM RP_FORMATING_DATE or CONVERT_DATE_TO_INTERN_FORMAT with DTYPE = DATS.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
591

Try out for below FM..

<b>CONVERT_DATE_TO_INTERNAL</b>

Thanks & Regards

ilesh 24x7

Read only

Former Member
0 Likes
590

Check the simple program using offset or you can use FM too.

REPORT Ztest_ytt.

data : v_date(10) type c.

data : v_date1(2) type c,

v_mon(2) type c,

v_year(4) type c.

data v_final(8) type c.

parameters p_date like v_date.

initialization.

p_date = '09/12/2007'.

start-of-selection.

v_date1 = p_date+0(2).

v_mon = p_date+3(2).

v_year = p_date+6(4).

concatenate v_mon v_date1 v_year into v_final." USA Format

write v_final.

Thanks

Seshu

Read only

Former Member
0 Likes
590

Hi try this logic out !!!!

concatenate it_input_file-doc_date6(4) it_input_file-doc_date0(2)

it_input_file-doc_date+3(2) into it_input_file-doc_date2.

I think this will help you out....

Reward points if helpful.

Thanks

Rajeev