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: 

format conversion for sy datum and sy-uzeit.

Former Member
0 Kudos

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

4 REPLIES 4

former_member191735
Active Contributor
0 Kudos

Check out syntax on write statement. You can specify the format.

Press F1 on write statement.

naimesh_patel
Active Contributor
0 Kudos

Try FM CONVERSION_EXIT_IDATE_OUTPUT to get the Date in DDMMMYYYY format

Regards,

Naimesh Patel

former_member156446
Active Contributor
0 Kudos

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]

former_member156446
Active Contributor
0 Kudos

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