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: 

abap doubt

Former Member
0 Kudos

hi this is satish,

how to change the date formate in the alv report.Actually the values are coming from the table.In the table the date format be yyyymmdd.but How to change the date formate in alv like ddmmyyyyy.Any one can send the code to change that format

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

All you have to do is modify properties for this field in your fieldcatalog by setting the data type :

fieldcat-datatype = 'DATS'.

Then in your ALV report, system will automatically handle the output format for the field according to the user settings.

Regards,

Nicolas.

15 REPLIES 15

Former Member
0 Kudos

Hi,

You can use FM CONVERSION_EXIT_PDATE_OUTPUT.

Thanks,

Sriram Ponna.

0 Kudos

what is that exactly can u tell me

former_member188829
Active Contributor
0 Kudos

Hi,

Use FM:

CONVERT_DATE_TO_EXTERNAL

Former Member
0 Kudos

Hi Satish,

IN DB tables date format will be always YYYYMMDD only..in front end depending upon settings it dispalys in particular format....

still you need solutions there are....


 WRITE <datefld>  DD/MM/YYYY to <var>.

"OR
DATA : date LIKE sy-datum.
DATA : date2 TYPE CHAR10.
date = sy-datum.
CONCATENATE date+6(2) date+4(2)   date+0(4) INTO date2 SEPARATED BY '.'.
write 😕 date2.
 

former_member680493
Participant
0 Kudos

hi,

you can use too:

data new_date type sy-datum.

WRITE your_date TO new_date DD/MM/YYYY.

I hope its help.

naimesh_patel
Active Contributor
0 Kudos

Set the edit_mask in the field catalog for that field.

fcat-edit_mask = 'ddmmyyyy'.

Regards,

Naimesh Patel

0 Kudos

fcat-edit_mask = 'ddmmyyyy'.

where we have to give this

in the fcat date is we r giving therre

0 Kudos

You need to do like this for your DATE field

LOOP AT FCAT WHERE FIELDNAME = 'DATE'.
  LS_FCAT-EDIT_MAST = 'DDMMYYYY'.
  MODIFY FCAT FROM LS_FCAT.
  CLEAR LS_FCAT.
ENDLOOP.

Regards,

Naimesh Patel

0 Kudos

actually that is alv report.

the values are coming from table(In pbo module fetch data from select query into inernal table)But the date is in the format yyyymmdd.Now i want to change the date in alv report that ddmmyyyy.Please send code/

0 Kudos

This setting which I had provided you are for the ALV only.

In your ALV, you are filling up the feild cataloge. Just add the code which I have provided you.

Regards,

Naimesh Patel

0 Kudos

Hi..

Try this code ,i had hardcode the date in yyyymmdd format but the output is coming in ddmmyyyy format itself..

REPORT ZBA_ALV.

type-pools slis.

data : begin of itab occurs 0,

date type d ,

end of itab,

it_fieldcat type slis_t_fieldcat_alv,

wa_fieldcat type slis_fieldcat_alv.

start-of-selection.

itab-date = '20071121'.

append itab.

wa_fieldcat-fieldname = 'DATE'.

append wa_fieldcat to it_fieldcat.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = sy-repid

IT_FIELDCAT = it_fieldcat

TABLES

t_outtab = itab.

Post for further queries.

Regards

Bala.

Former Member
0 Kudos

Satish,


REPORT  ZTEST_TEST.

DATA : date type sy-datum.
data : date1(10) type c.
break akumar.
date = '20070321'.

write : date.

CONCATENATE date+6(2)  date+4(2)  date+0(4) into date1.

write /: date1.

Regards

Aneesh.

Former Member
0 Kudos

Hi.

Try like this.

CLEAR l_s_field_cat.

l_s_field_cat-fieldname = 'Date'.

<b> l_s_field_cat-edit_mask = '__,__%'.</b>

APPEND l_s_field_cat TO p_tab_field_cat.

Regards

Bala.

Former Member
0 Kudos

Hi,

All you have to do is modify properties for this field in your fieldcatalog by setting the data type :

fieldcat-datatype = 'DATS'.

Then in your ALV report, system will automatically handle the output format for the field according to the user settings.

Regards,

Nicolas.

Former Member
0 Kudos

ya finnay i solved this