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 changes

Former Member
0 Likes
1,417

Hi,

There is one date field , to that field recently time is also added.

Previously when iam fetching the data on that time based up on sy-datum iam fetching data i.e.

Select * from zghar_tab into

table GI_ghar where zapp_date = sy-datum.

Now the problem is for 'zapp_date ' this field 'HHMMSS' are added.

Now the field length is 14 in the format of 'YYYYMMDDHHMMSS'.

Now what changes i have to do from my side here for this format adding.

Please help.

Thanks

Ali

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,390

Hi

Try using this function module 'CACS_DATE_GET_TIMESTAMP' for adding timestamp to ur 'zapp_date'

Thanks

Vasudha

13 REPLIES 13
Read only

Former Member
0 Likes
1,390

Hi,

Use offset upto 8 chars in the date while retriving the data.

Satish

Read only

0 Likes
1,390

Please send me that in example

Read only

0 Likes
1,390

hi ,

i have just checked .

we cannot do the way i suggested as offwset cannot be put in the where clause

Read only

Former Member
0 Likes
1,390

take a char variable

data : dat(9).

concatenate sy-datum '%' into dat

Select * from zghar_tab into

table GI_ghar where zapp_date like dat.

regards

shiba dutta

Read only

Former Member
0 Likes
1,393

Hi

Try using this function module 'CACS_DATE_GET_TIMESTAMP' for adding timestamp to ur 'zapp_date'

Thanks

Vasudha

Read only

Former Member
0 Likes
1,390

hi ALI,

just in the select query write :

Select * from zghar_tab into

table GI_ghar

where zapp_date(8) = sy-datum

Read only

0 Likes
1,390

in program flow the date in sy-datum is of type yyyyddmm

20071031

reward and close thread if answered

thank you,

taher

Read only

0 Likes
1,390

I wrote like this but error message is coming.

Error'Field is unknown' like this

Please check this and help me

Read only

Former Member
0 Likes
1,390

Try this...

data:

w_date type zapp_date. "(CHAR14)

w_date = sy-datum.

concatenate w_date

'%'

into w_date.

Select * from zghar_tab into

table GI_ghar where zapp_date LIKE w_date.

Now the problem is for 'zapp_date ' this field 'HHMMSS'

Read only

0 Likes
1,390

Why you wrote like this what is the problem with that field.

Plese tell me

Read only

andreas_mann3
Active Contributor
0 Likes
1,390

look commands in abap-help:

   CONVERT TIME STAMP wa-timestamp
              TIME ZONE tzone
              INTO DATE bdate TIME btime.

A.

Read only

Former Member
0 Likes
1,390

hi ahammad,

try it.

Select * from zghar_tab into

table GI_ghar where zapp_date+0(8) = sy-datum.

Regards

Allan Cristian

Read only

Former Member
0 Likes
1,390

hi ahammad,

try it plx,

maybe can help u solver ur problem...

select * from ZGHAR_TAB into table GI_ghar.

loop at GI_ghar.

if GI_ghar-ZAPP_DATE(8) <> sy-datum.

DELETE GI_ghar INDEX sy-tabix.

endif.

endloop.

plx, post urs results here...

Regards

Allan Cristian