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 report date format problem

Former Member
0 Kudos

Hi

My internal table date filed display like yyyy/mm/dd format.

But alv report date format changed to dd.mm.yyyy format.

I need to change yyyy/mm/dd.

Pls help me

1 ACCEPTED SOLUTION

Former Member

Hi Kumar,

The display of the date in the ALV should be as per the user's setting.

You just define the internal table field as type sy-datum and then SAP will take care of the conversion while displaying in ALV.

Regards,

Atish

11 REPLIES 11

Former Member
0 Kudos

Edit_mask (field formatting): To apply the report output formatting options same as

in the WRITE statement in report writing.

Value set: SPACE, template.

Sample Code

DATA: time TYPE s_fltime,

seconds TYPE i,

msk TYPE string.

DESCRIBE FIELD time EDIT MASK msk.

seconds = 333.

WRITE seconds USING EDIT MASK msk.

Mainly I t will be used to convert different date foramats like dd/mm/yyyy mm/dd/yy ,dd-mm-yyyy ..........

OR

there are no prior conditions to be applied u can directly use

write sy-datum using edit mask '__/__/____' to sydatum.

Check these out

http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm

http://help.sap.com/saphelp_erp2004/helpdata/en/33/206bc8012e11d3b495006094192fe3/content.htm

Reward points..

Former Member

Hi Kumar,

The display of the date in the ALV should be as per the user's setting.

You just define the internal table field as type sy-datum and then SAP will take care of the conversion while displaying in ALV.

Regards,

Atish

0 Kudos

Hi Atish

i changed the file type to sy-datum. but it still displaying as wrong format

0 Kudos

Hi Kumar,

The display of the date format is user specific.

Just go to transaction SU3 and change the format for yourself.

Save the changes then log off and log in.

Now you will see the date in the required format.

Regards,

Atish

0 Kudos

Thanks Atish. It is working fine.

I have one more issue. I am downloading this data to excel using gui_download. But excel date format is DD/MM/YYYY. how to change this to YYYY/MM/DD

0 Kudos

Hi Kumar,

Excel should have the same format as in the ALV. Is it not same?

Regards,

Atish

0 Kudos

Hi Atish

it is not the same format. Just now i checked the format's in Excel. YYYY/MM/DD format is not available in my excel. Is this the reason?

0 Kudos

It works , thanks

former_member387317
Active Contributor
0 Kudos

Hi Kumar,

Set user date setting from SU01...

As data in excel shd be in the same format as it is appering in ALV...

Check it once more after doing changes ...

Chk out the date formats available in EXCEL as well...

Hope it will solve your problem...

Reward points if useful...

Thanks & Regards

ilesh 24x7

0 Kudos

PLS HELP ME

former_member387317
Active Contributor
0 Kudos

Hi Kumar,

Check out the sy-subrc value...

and wht says that dump analysis ??

If you are using GUI_DOWNLOAD in background then....

There is one limitation of this download and upload FMs ...

We can not use it in Background...

So ... Because of this limitation on FMs ur background job is getting cancelled...

Try out alternative ways to get it done...

Better you use OPEN DATASET CLOSE DATASET and write the data in Application server.

Or if you are generating a List then it will create Spool when executed in Background. Which you can download later from SP01.

Please go through the following link for implementing download of a file in background.

http://sapabap.iespana.es/sap/info/rfcexec/rfcexec_e.htm

Also have a look on below link...

http://www.sap-img.com/ab003.htm

Hope it will solve your problem..

Reward points if useful..

Thanks & Regards

ilesh 24x7