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

Former Member
0 Likes
1,410

when i m selecting date from database table in internal table it selects in the format as "20080218"

but i want to assign this date to a variable as "18.02.2008"

so how to change date format while assining from internal table field to variable ??

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,302

Hi

use FM CONVERSION_EXIT_PDATE_OUTPUT

Regards

Aditya

10 REPLIES 10
Read only

Former Member
0 Likes
1,303

Hi

use FM CONVERSION_EXIT_PDATE_OUTPUT

Regards

Aditya

Read only

Former Member
0 Likes
1,302

Hi ,

use CONVERSION_EXIT_PDATE_OUTPUT

reward points if helpful

Read only

Former Member
0 Likes
1,302

you can either use a date conversion exit.

e.G. the above described.

but a simple write to statement should help you as well.

Just declare youself a variable of type char length 10, and then write your dats variable to this char variable.

the conversion exit should be processed automatically.

Read only

Former Member
0 Likes
1,302

Hi

paas the value to conversiondateoutput function module it will convert the same into user set date format

or user write to dd/mm/yyyy

refer this

http://www.abapcode.sapbrainsonline.com/2008/03/write-output-formatting-options-abap.html

regards

Shiva

Read only

Former Member
0 Likes
1,302

Hi,

Have a look on the folowing example code.You can get some idea.

data: date1 type sy-datum value '20080325'.

data: date2 type d value '20080326'.

write:/ date1.

write:/ date2.

Reward,if it is useful.

Thanks,

Chandu

Read only

Former Member
0 Likes
1,302

HI,

user OFFSET Operater like this.

Concatenate sy-datum8(2) '.'  sy-datum6(2) '.'  sy-datum0(4)  .

Regards,

S.Nehru.

Read only

Former Member
0 Likes
1,302

Hi use the code.

Data : var like sy-datum.

date(10).

start-of-selection.

concatenate var6(2) '.' var4(2) '.' var+0(4) into date.

write : /1 date.

Reward if useful.

Regards,

Sankar.

Read only

Former Member
0 Likes
1,302

Hi Santhosh,

U can use the following code.

date = 20080218

declare new variable date1 of type ur database field type

concatenate date6(2) '.' date4(2) '.' date(4) into date1.

Read only

Former Member
0 Likes
1,302

reward points for useful answers !

Read only

Former Member
0 Likes
1,302

Try this way

data v_date type sydatum.

v_date = '20080218'.

data v_date1 type string.

concatenate v_date6(2) '.' v_date4(2) '.' v_date+0(4) into v_date1.

write v_date1.