Application Development 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: 

Please see ths

Former Member
0 Kudos
113

hi all,

i am uploading data from a flat file to my internal table which is updating the database table qmel.

the date feilds like erdat(example) are coming in the same format as are in my

flat file , now i am updating the data in my database table qmel.

my flat file got date as dd.mm.yyyy

my internal table got date as dd.mm.yyyy

now do i need to convert the data in yyyy.mm.dd because the date in the database is havng this format only if its like that then can u tell me how to

do that.

or the database will accept it in that form?

please tell m e

high points for good answer assured

thnkx

bhanu

7 REPLIES 7

Former Member
0 Kudos
71

Hi Bhanu,

Yes you need to convert date to the format YYYYMMDD.

Use CONVERT_DATE_TO_INTERNAL for the same.

Regards,

Atish

Former Member
0 Kudos
71

HI,

Before Uploading Convert it into yyyy/mm/dd Format using the below code,

DATA : L_DATE TYPE DATS,

L_NEW_DATE TYPE SY-DATUM.

CONCATENATE L_DATE4(4) L_DATE2(2) L_DATE+0(2)

INTO L_NEW_DATE.

Regards,

Padmam.

Former Member
0 Kudos
71

Hello,

Check this:


PARAMETERS: P_DATE LIKE SY-DATUM.

DATA: LV_DATUM(10).

CONCATENATE P_DATE+0(4) P_DATE+4(2) P_DATE+6(2) INTO  LV_DATUM
 SEPARATED
 BY '.'.
 WRITE: LV_DATUM.

Vasanth

Former Member
0 Kudos
71

Hi,

suppose your internal table date dd.mm.yyyy

ex 16.07.2007

itab-date = 16.07.2007

now do like this

data: v_date like sy-datum.

concatenate itab-date4(4) itab-date2(2) itab-date+0(2) into v_date.

Former Member
0 Kudos
71

Hi Bhanu,

Convert the date into the format the transaction accepts.

use date+0(2) to get the day

date+3(2) to get the month

date+6(4) to get the year

Then use concatenate statement to get the required format.

Regards

Arun

Former Member
0 Kudos
71

Hi Bhanu,

you can do one thing, you can store them in a date variable after seperating and concatenating them in a date variable.

let say you have your date in <b>w_tab-erdat</b>.

data : l_date type d,

lc_date(8) type c.

concatenate w_tab-erdat6(4) w_tab-erdat3(2) w_tab-erdat+0(2) into lc_date.

l_date = lc_date.

move l_date to w_tab-erdat.

then do continue with your process.

<b>Reward point is this helps,</b>

Kiran

Former Member
0 Kudos
71

thnkx all its done