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: 

ALV

Former Member
0 Kudos
129

Hi....,

I have to display the system date as 06-Feb-2008 in the ALV Report in header part.

Is there any function in ALV which will convert the system date in the required format...?

6 REPLIES 6

Former Member
0 Kudos
105

Use the following code,

DATA : L_DATE LIKE SY-DATUM,

L_DAT(09), L_MON(03).

L_DATE = SY-DATUM.

CONCATENATE L_DATE+06(02) '-' INTO L_DAT.

SELECT SINGLE LTX FROM T247

INTO L_MON

WHERE MNR = L_DATE+04(02)

AND SPRAS = SY-LANGU.

CONCATENATE L_DAT L_MON '-' INTO L_DAT.

CONCATENATE L_DAT L_DATE+02(02) INTO L_DAT.

WRITE L_DAT.

Reward appropriate points.

Regards,

Mansi.

Former Member
0 Kudos
105

Use FM CONVERSION_EXIT_IDATE_OUTPUT

You will get the output for 01/01/2007 as 01JAN2007.

Former Member
0 Kudos
105

Hi,

Use the FM : MONTH_NAMES_GET to get the month name.Then use concatenate statement to get in the desired format.

Reward if helpful.

Thanks,

Dishant

Former Member
0 Kudos
105

Hi

Use this Logic

DATA: dd(2), mm(2), mmm(3), yyyy(4),

DDMMYYYY TYPE DATUM,

DDMMMYYYY TYPE CHAR11.

MOVE ddmmyyyy+6(2) TO dd.

MOVE ddmmyyyy+4(2) TO mm.

MOVE ddmmyyyy+0(4) TO yyyy.

CASE mm.

WHEN '01'. mmm = 'Jan'.

WHEN '02'. mmm = 'Feb'.

WHEN '03'. mmm = 'Mar'.

WHEN '04'. mmm = 'Apr'.

WHEN '05'. mmm = 'May'.

WHEN '06'. mmm = 'Jun'.

WHEN '07'. mmm = 'Jul'.

WHEN '08'. mmm = 'Aug'.

WHEN '09'. mmm = 'Sep'.

WHEN '10'. mmm = 'Oct'.

WHEN '11'. mmm = 'Nov'.

WHEN '12'. mmm = 'Dec'.

ENDCASE.

CONCATENATE dd mmm yyyy INTO ddmmmyyyy SEPARATED BY space.

Anbu

Former Member
0 Kudos
105

use this function module

CONVERSION_EXIT_IDATE_OUTPUT

pass the date in sap internal format ie year month and date

it will give date month year format into a varibale .

pass that to list header of the alv.

Former Member
0 Kudos
105

hi

u can use function module...

ONVERSION_EXIT_SDATE_OUTPUT