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 formating

Former Member
0 Likes
972

Hi All,

I want to display only DATE and MONTH of a particular date.What ever be the date format stored in TABLE I need to display it as 22.03 ( DD.MM ).( display only date and month )

Ex- 20070322 or any format , i need to display as 2203( DD.MM ).

Please help me out in this

Regards

Avi.........

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
947

hi avi,

do this way ...

data : v_date like sy-datum value '20070327',
         v_date1(10) type c.

 v_date = sy-datum.
 v_date1 = v_date.

concatenate v_date1+4(2)  '.' v_date1+6(2) into v_date1.

write : v_date1.

Regards,

Santosh

8 REPLIES 8
Read only

Former Member
0 Likes
947

Hi,

Day = date+4(2).

month = date+6(2).

Regards

Sudheer

Read only

Former Member
0 Likes
947

data : day(2),

mon(2).

data : dates like sy-datum value '20070322'.

data : daymon(4).

day = dates+6(2).

mon = dates+4(2).

concatenate day mon into daymon.

write : / daymon

regards

shiba dutta

Message was edited by:

SHIBA DUTTA

Read only

Former Member
0 Likes
948

hi avi,

do this way ...

data : v_date like sy-datum value '20070327',
         v_date1(10) type c.

 v_date = sy-datum.
 v_date1 = v_date.

concatenate v_date1+4(2)  '.' v_date1+6(2) into v_date1.

write : v_date1.

Regards,

Santosh

Read only

Former Member
0 Likes
947

Take a Character FIeld of 4 length and use that

DATA: DATE(4).

DATE = sy-datum+4(4).

WRITE: DATE.

Read only

Former Member
0 Likes
947

Hi Avi,

Use this function module <b>HR_IN_GET_DATE_COMPONENTS</b>.

It will return you Day and Month of the date.

Thanks & Regards,

Siri.

Read only

Former Member
0 Likes
947

CONVERT_DATE_FORMAT

try this data v_date type d. v_date = '20071001'. data v_format type char4. write v_date to v_format using no edit mask. write v_format use WRITE TO <d> statement

write sy-datum to ZIE02-DATSL DDMM

reward all helpfull answers

Message was edited by:

sunil kumar

Message was edited by:

sunil kumar

Read only

0 Likes
947

Day = sy-datum+4(2).

month = sy-datum+6(2).

write: \ day month or month day.

regards,

Read only

Former Member
0 Likes
947

Hey Avi,

Let it be any format for display but date format in which it is available in a variable with data type as Date is always in YYYYMMDD.

Day = date+4(2).

month = date+6(2).

write: / day, month.

So you can extract the date and month from this variable and then go ahead with display..it will display date and month properly....

Regards,

Kunjal