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 in ALV

former_member182354
Contributor
0 Likes
3,662

Hi abap gurus,

I have an ALV report in which I want the output dates to have format DD-MMM-YYYY . The input date format is MM/DD/YYYY.

Its an Urgent requirement plz suggest me an solution

Best Regards,

Argz

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,880

use offsets to do this

supposet the variable is w_var

then

w_var + 12/31/9999

concatenate w_var3(2) '.' w_var(2) '.' w_var6(4) into w_var1.

Your var1 will have 31.12.9999

Pass var1 to your ALV

Regards,

Himanshu

Hi abap gurus,

I have an ALV report in which I want the output dates to have format DD-MMM-YYYY . The input date format is MM/DD/YYYY.

Its an Urgent requirement plz suggest me an solution

Best Regards,

Argz

7 REPLIES 7
Read only

Former Member
0 Likes
1,881

use offsets to do this

supposet the variable is w_var

then

w_var + 12/31/9999

concatenate w_var3(2) '.' w_var(2) '.' w_var6(4) into w_var1.

Your var1 will have 31.12.9999

Pass var1 to your ALV

Regards,

Himanshu

Read only

Former Member
0 Likes
1,880

Hi..,

use this function module to convert the date into DD.MMM.YYYY format..

<b>CONVERSION_EXIT_SDATE_OUTPUT.</b>

and take the output into a text variable of size 11 say w_date.

use this statement to get DD-MMM-YYYY format..

translate w_date using '.-'.

u will get the date in DD-MMM-YYYY format.. now send this to ALV function module..

reward all helpful answers..

regards,

sai ramesh

Read only

Former Member
0 Likes
1,880

Hi,

You can use the EDIT MASK for this one.

Take a Date field. and move your date to this field, then use the edit mask

DATA: date type sy-datum.

Move: your_date-Field to DATE.

Write DATE to Your_alv_field USING EDIT MASK '__/__/____.

Regards

Sudheer

Read only

Former Member
0 Likes
1,880

Hi raghvendra,

use this FM....<b>CONVERT_DATE_FORMAT</b>

<b>Reward points if this helps,</b>

Regards,

Tejas

Read only

Former Member
0 Likes
1,880

Hi,

Try out the following logic.

Declare three variable as char2, char3 and char4 and one with char10.

Use the SPLIT command to split the date at the seperator used in the date format. In this case, it is '-'.

e.g SPLIT dd-mmm-yyyy AT '-' INTO char2 char3 char4.

After this use the concatenate command.

e.g. CONCATENATE char3 char2 char4 into char10 seperated by '/'.

I hope this will solve your query.

reward if useful.

Read only

Former Member
0 Likes
1,880

Hi Raghavender,

select the date format in table usr01.

<b>CONVERT_DATE_TO_EXTERNAL </b>Converts date from system storage format to users specified display format

or second method wud be

DATA: V_INPUT(10) VALUE '09.04.2007'.

DATA: V_OUTPUT(10).

<b>CONCATENATE V_INPUT(2) '/' V_INPUT3(2) '/' V_INPUT6(4)

INTO V_OUTPUT.</b>

WRITE: / V_OUTPUT.

Read only

Former Member
0 Likes
1,880

You can specify the edit_mask property for the fieldcatalogue of that date field as

fieldcat-edit_mask = '__-__-____'

Regards,

Ravi