2009 Feb 17 7:27 AM
In the ALv Grid display report using CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
I am displaying DATE, TIME and CLIENT.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'DATE'.
WA_LISTHEADER-INFO = SY-DATUM.
APPEND WA_LISTHEADER TO IT_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'TIME'.
WA_LISTHEADER-INFO = SY-UZEIT.
APPEND WA_LISTHEADER TO IT_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'CLIENT'.
WA_LISTHEADER-INFO = SY-MANDT.
APPEND WA_LISTHEADER TO IT_LISTHEADER.
CLEAR WA_LISTHEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = IT_LISTHEADER. "it_listheader.
It will now appear on the top of the report as
DATE 20090216
TIME 144810
CLIENT 400
It should display as follow:
DATE 02/16/2009
TIME 14:48:10 UTC <- Add UTC
CLIENT 400
*Date and Time should be displayed in the user system format.*
*If user date format on his sys is set to mm.dd.yyyy then it should display as follows* :
DATE 02.16.2009
TIME 14:48:10 UTC <- Add UTC
CLIENT 400
ANy suggestions will be appreciated.
Regards,
Kittu
2009 Feb 17 7:40 AM
Hi,
Use the code below, THIS WILL WORK FOR SURE..
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'DATE'.
" WA_LISTHEADER-INFO = SY-DATUM.
WRITE SY-DATUM TO WA_LISTHEADER-INFO.
APPEND WA_LISTHEADER TO IT_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'TIME'.
" WA_LISTHEADER-INFO = SY-UZEIT.
WRITE SY-UZEIT TO WA_LISTHEADER-INFO.
APPEND WA_LISTHEADER TO IT_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'CLIENT'.
WA_LISTHEADER-INFO = SY-MANDT.
APPEND WA_LISTHEADER TO IT_LISTHEADER.
CLEAR WA_LISTHEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = IT_LISTHEADER. "it_listheader.
Regards,
Siddarth
2009 Feb 17 7:31 AM
Hi,
Do like this...
parameters:
p_date like sy-datum.
data:
w_date1(10) type c.
w_date = sy-datum.
write w_date to w_date1.
write: w_date1.
just add this code whereever required..
It will conver according to the user format..
Regards
Kiran
2009 Feb 17 7:32 AM
Use below FM to format date & time
DATUMSAUFBEREITUNG u2013 Formats date as per the user settings .
RKE_TIMESTAMP_CONVERT_OUTPUT u2013 Converts TIMESTAMP fields for display
2009 Feb 17 7:34 AM
hi
As you are using Sy-Datum , SY-uzeit u will get the date time in system format only
. if not check the system fomat .
Navigation : from menu bar of SAP screen
SYSYTEm-> user profile-> owndata
there u can fond date formats
If u change the format you have to restart the sap system to effect the changes .
Try with this u will get resolved .
make sure u have sufficient length for date and time
Date : 10 chars time 8 chars
For this use wa_fieldcat-outputlen = '10' for each field this is for eg .
Edited by: KAMESH G on Feb 17, 2009 8:34 AM
2009 Feb 17 7:36 AM
Hi,
Check FM DATUMSAUFBEREITUNG or use CONCATENATE to make date and time in ur desired format.
ex: CONCATENATE sy-datum6(2) '/' sy-datum4(2) '/' sy-datum+0(4) INTO v_date.
2009 Feb 17 7:38 AM
Hi Kittu,
DATA: l_date(10) TYPE c,
l_time(8) TYPE c.
WRITE: sy-datum TO l_date MM/DD/YYYY,
sy-uzeit TO l_time USING EDIT MASK
' __:__:__'.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'DATE'.
WA_LISTHEADER-INFO = l_date.
APPEND WA_LISTHEADER TO IT_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'TIME'.
WA_LISTHEADER-INFO = l_time.
APPEND WA_LISTHEADER TO IT_LISTHEADER.
This will work as u required...
2009 Feb 17 7:40 AM
Hi,
Use the code below, THIS WILL WORK FOR SURE..
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'DATE'.
" WA_LISTHEADER-INFO = SY-DATUM.
WRITE SY-DATUM TO WA_LISTHEADER-INFO.
APPEND WA_LISTHEADER TO IT_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'TIME'.
" WA_LISTHEADER-INFO = SY-UZEIT.
WRITE SY-UZEIT TO WA_LISTHEADER-INFO.
APPEND WA_LISTHEADER TO IT_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'CLIENT'.
WA_LISTHEADER-INFO = SY-MANDT.
APPEND WA_LISTHEADER TO IT_LISTHEADER.
CLEAR WA_LISTHEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = IT_LISTHEADER. "it_listheader.
Regards,
Siddarth
2009 Feb 20 7:27 AM
Hi All,
Thank you for your response!
My issue is fixed!
Thanks & Regards,
Krishna
2021 Oct 27 10:42 AM
How to display system date and time with every row in a alv report?