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: 

date format change

Former Member
0 Kudos

hi,

i m working with alv grid display.

in my report i m using slis_t_listheader.

in that i m printing a select option date, means whatever i will select in select option that date range will be printed there.

it is working fine but my problem is that format is yyyy/mm/dd and i wanna to print in dd/mm/yyyy.

plz help me for that.

thanks and regards

vijay kumar dwivedi

rewards will b sure for helpfull answer*

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi

in the top-of-page form, code like this

DATA: GD_DATE(10), HD_DATE(10).

WA_HEADER-TYP = 'S'.

IF S1_BUDAT-LOW IS NOT INITIAL AND S1_BUDAT-HIGH IS NOT INITIAL.

WRITE S1_BUDAT-LOW TO GD_DATE DD/MM/YYYY.

WRITE S1_BUDAT-HIGH TO HD_DATE DD/MM/YYYY.

CONCATENATE 'Posting Date :' GD_DATE 'to' HD_DATE INTO WA_HEADER-INFO SEPARATED BY SPACE.

APPEND WA_HEADER TO T_HEADER.

CLEAR: WA_HEADER, GD_DATE, HD_DATE .

if helpful, reward

Sathish. R

4 REPLIES 4

Former Member
0 Kudos

hi

in the top-of-page form, code like this

DATA: GD_DATE(10), HD_DATE(10).

WA_HEADER-TYP = 'S'.

IF S1_BUDAT-LOW IS NOT INITIAL AND S1_BUDAT-HIGH IS NOT INITIAL.

WRITE S1_BUDAT-LOW TO GD_DATE DD/MM/YYYY.

WRITE S1_BUDAT-HIGH TO HD_DATE DD/MM/YYYY.

CONCATENATE 'Posting Date :' GD_DATE 'to' HD_DATE INTO WA_HEADER-INFO SEPARATED BY SPACE.

APPEND WA_HEADER TO T_HEADER.

CLEAR: WA_HEADER, GD_DATE, HD_DATE .

if helpful, reward

Sathish. R

Former Member
0 Kudos

DATA : TEXT(10)

CONCATENATE S_DATE6(2) S_DATE4(2) S_DATE+0(4) INTO TEXT SEPARATED BY '/'.

WLISTHEADER-INFO = TEXT.

NOW PASS THAT TO COMMENTARY WRITE

REGARDS

SHIBA DUTTA

Former Member
0 Kudos

HI Vijay,

Try This Function Module,

CONVERT_DATE_TO_INTERN_FORMAT.

Sample Code is,

data: yymmdd(6) type c value '170109'.

data: yyyymmdd type sy-datum.

data: mmddyy(6) type c.

mmddyy0(2) = yymmdd2(2).

mmddyy2(2) = yymmdd4(2).

mmddyy4(2) = yymmdd0(2).

call function 'CONVERT_DATE_TO_INTERN_FORMAT'

exporting

datum = mmddyy

dtype = 'DATS'

importing

  • ERROR =

idate = yyyymmdd.

  • MESSG =

  • MSGLN =

write:/ yyyymmdd.

Thanks.

Reward If helpful.

Former Member
0 Kudos

You declare a variable. Change the date format and pass it.

Ex:

data: l_date1(10) type c,
        l_date2(10) type c.

l_date1 = 'yyyy/mm/dd'.


concatenate l_date1+8(2) l_date1+6(2) l_date1(4) into l_date2 separated by '/'.

write: l_date2.

and pass l_date2 to the alv.