01-02-2009 4:00 PM
i wish to display in the top of page as..e.g-03-Nov-08 06.53.39 AM and not the one coming from sy-datum and sy-uzeit.
kindly help me on this format conversion for the date and time.
thanks
01-02-2009 4:04 PM
Check out syntax on write statement. You can specify the format.
Press F1 on write statement.
01-02-2009 4:09 PM
Try FM CONVERSION_EXIT_IDATE_OUTPUT to get the Date in DDMMMYYYY format
Regards,
Naimesh Patel
01-02-2009 4:13 PM
Check this [WIKI on month in words date in number|https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/month%252bin%252bwords%252bdate%252bin%252bnumber]
[WIKI to accomplish Manually thru code|https://www.sdn.sap.com/irj/scn/wiki?path=/display/bi/code%252bsample%252bto%252bconvert%252bdate%252byyyymmdd%252binto%252bdd-mmm-yy%252bformat]
01-02-2009 7:11 PM
Hi Tanish.. check my code specially writen for ur requirement... I hope Mods have any issue when I write the code.. rather than copying and pasting..
FORM html_top_of_page USING document TYPE REF TO cl_dd_document.
DATA: text TYPE sdydo_text_element.
CALL METHOD document->add_gap
EXPORTING
width = 100.
text = 'Jay custom ALV'.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'HEADING'.
CALL METHOD document->new_line.
CALL METHOD document->new_line.
CALL METHOD document->new_line.
text = 'User Name : '.
CALL METHOD document->add_text
EXPORTING
text = text
sap_emphasis = 'Strong'.
CALL METHOD document->add_gap
EXPORTING
width = 6.
text = sy-uname.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'Key'.
CALL METHOD document->add_gap
EXPORTING
width = 50.
text = 'Date : '.
CALL METHOD document->add_text
EXPORTING
text = text
sap_emphasis = 'Strong'.
CALL METHOD document->add_gap
EXPORTING
width = 6.
DATA: zword TYPE string, zdd TYPE string, zmmm TYPE string,
zyyyy TYPE string, zfin TYPE string.
CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'
EXPORTING
input = sy-datum
IMPORTING
output = zword.
zdd = zword+3(2).
zmmm = zword+0(3).
zyyyy = zword+7(2).
CONCATENATE zdd '-' zmmm '-' zyyyy INTO zfin.
text = zfin.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'Key'.
CALL METHOD document->add_gap
EXPORTING
width = 50.
text = 'Time : '.
CALL METHOD document->add_text
EXPORTING
text = text
sap_emphasis = 'Strong'.
CALL METHOD document->add_gap
EXPORTING
width = 6.
text = sy-uzeit.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'Key'.
CALL METHOD document->new_line.
CALL METHOD document->new_line.
ENDFORM. "HTML_TOP_OF_PAGE