Skip to Content
avatar image
Former Member

Changing fonts in Screen painter

Hi experts,

I have a screen, that displays information. I need to display the information in a different font than usual, e.g. Bold or Italic.

Could you please let me know the ways to change the FONTS in screen painter.

Is it feasible to do so?

Thanks,

Abhay

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Sep 24, 2008 at 01:58 PM

    It is not possible. But you make them to appear in the Blue color. Set the Intensified property of the field to make them appear in Blue color.

    Regards,

    Naimesh Patel

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 24, 2008 at 07:30 PM

    It is not possible.

    SAP has a statical interface. At this moment you can use web application like BSP ,SAP portals that let us define interfaces with more details

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 24, 2008 at 07:49 PM

    Check out this code:

    create a screen 100, PF-STATUS '0100' and custom container 'CONT'

    *&---------------------------------------------------------------------*
    *& Report  ZZ_SOURAV_DYNAMIC_DOCUMENTS
    *&
    *&---------------------------------------------------------------------*
    *&
    *&
    *&---------------------------------------------------------------------*
    
    REPORT  zz_sourav_dynamic_documents.
    TYPE-POOLS: sdydo.
    
    DATA:
    container TYPE REF TO cl_gui_docking_container,
    doc TYPE REF TO cl_dd_document,
    ok_code TYPE syucomm.
    DATA form1 TYPE REF TO cl_dd_form_area.
    DATA text TYPE sdydo_text_element.
    DATA value TYPE sdydo_value.
    DATA button1 TYPE REF TO cl_dd_button_element.
    DATA input1 TYPE REF TO cl_dd_input_element.
    DATA first_display VALUE 'X'.
    DATA opt_tab TYPE sdydo_option_tab.
    DATA select1 TYPE REF TO cl_dd_select_element.
    *----------------------------------------------------------------------*
    *       CLASS cl_my_event_handler DEFINITION
    *----------------------------------------------------------------------*
    *
    *----------------------------------------------------------------------*
    CLASS cl_my_event_handler DEFINITION.
      PUBLIC SECTION.
        METHODS:
     handle_input FOR EVENT  entered OF cl_dd_input_element
                                                           IMPORTING sender,
     handle_submit_buttons FOR EVENT clicked OF cl_dd_button_element
                                                           IMPORTING sender,
      use_new_resources FOR EVENT resources_changed OF cl_gui_resources.
    ENDCLASS.                    "cl_my_event_handler DEFINITION
    
    *----------------------------------------------------------------------*
    *       CLASS cl_my_event_handler IMPLEMENTATION
    *----------------------------------------------------------------------*
    *
    *----------------------------------------------------------------------*
    CLASS cl_my_event_handler IMPLEMENTATION.
      METHOD handle_input.
        MESSAGE i001(00) WITH input1->value.
      ENDMETHOD.                    "handle_submit_buttons
      METHOD handle_submit_buttons.
        MESSAGE i001(00) WITH input1->value.
      ENDMETHOD.                    "handle_submit_buttons
      METHOD use_new_resources.
        IF first_display IS INITIAL.
    * initialize documents
          CALL METHOD doc->initialize_document.
    * merge documents
          CALL METHOD doc->merge_document.
    * display documents
          CALL METHOD doc->display_document
            EXPORTING
              reuse_control      = 'X'
              reuse_registration = 'X'.
        ENDIF.
      ENDMETHOD.                    "use_new_resources
    ENDCLASS.                    "cl_my_event_handler IMPLEMENTATION
    
    START-OF-SELECTION.
    
      DATA: my_handler TYPE REF TO cl_my_event_handler.
      CREATE OBJECT my_handler .
    
    END-OF-SELECTION.
    
      CALL SCREEN 100.
    
    
    *&---------------------------------------------------------------------*
    *&      Module  STATUS_0100  OUTPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    MODULE status_0100 OUTPUT.
      SET PF-STATUS '0100'.
    *  SET TITLEBAR 'xxx'.
      SET HANDLER my_handler->use_new_resources.
      CREATE OBJECT doc
         EXPORTING
    *    style  =
         background_color = cl_dd_area=>col_background_level2
    *    bds_stylesheet =
    *    no_margins =
          .
      PERFORM add_html_code.
    
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&---------------------------------------------------------------------*
    *&      Module  USER_COMMAND_0100  INPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    MODULE user_command_0100 INPUT.
      CASE ok_code.
        WHEN 'BACK'.
          SET SCREEN 00.
          LEAVE SCREEN.
    
    
      ENDCASE.
    
    
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&---------------------------------------------------------------------*
    *&      Form  add_html_code
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM add_html_code .
      IF first_display = 'X'.
        text = 'Line1'.
        CALL METHOD doc->add_text
           EXPORTING
             text          = text
    *    text_table    =
    *    fix_lines     =
         sap_style     = cl_dd_document=>heading
    *    sap_color     = cl_dd_document=>LIST_POSITIVE_INT
         sap_fontsize  = cl_dd_document=>medium
    *    sap_fontstyle = cl_dd_document=>SANS_SERIF
    *    sap_emphasis  = cl_dd_document=>
    *    style_class   = cl_dd_document=>WARNING
    *  CHANGING
    *    document      =
            .
        CALL METHOD doc->new_line
          EXPORTING
            repeat = 1.
    
        text = 'Line2'.
        CALL METHOD doc->add_text
           EXPORTING
             text          = text
    *    text_table    =
    *    fix_lines     =
    *     sap_style     = cl_dd_document=>heading
        sap_color     = cl_dd_document=>list_key_inv
    *     sap_fontsize  = cl_dd_document=>medium
    *    sap_fontstyle = cl_dd_document=>SANS_SERIF
    *    sap_emphasis  = cl_dd_document=>
    *    style_class   = cl_dd_document=>WARNING
    *  CHANGING
    *    document      =
            .
    
        CALL METHOD doc->new_line
          EXPORTING
            repeat = 1.
    
        text = 'Line3'.
        CALL METHOD doc->add_text
           EXPORTING
             text          = text
    *    text_table    =
    *    fix_lines     =
    *     sap_style     = cl_dd_document=>heading
    *    sap_color     = cl_dd_document=>list_key_inv
    *     sap_fontsize  = cl_dd_document=>medium
    *    sap_fontstyle = cl_dd_document=>SANS_SERIF
    *    sap_emphasis  = cl_dd_document=>
    *    style_class   = cl_dd_document=>WARNING
    *  CHANGING
    *    document      =
            .
    
        CALL METHOD doc->display_document
           EXPORTING
    *      reuse_control      = 'X'
    *      reuse_registration = 'X'
             container          = 'CONT'
    *    parent             =
          EXCEPTIONS
            html_display_error = 1
            OTHERS             = 2
                .
    
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CLEAR first_display.
      ENDIF.
    ENDFORM.                    " add_html_code
    

    Add comment
    10|10000 characters needed characters exceeded