Skip to Content
0
Oct 15, 2020 at 04:07 PM

Issue in Top-0f-page Split ...Spaces issues

37 Views

Below is the code.and the top-of-page is displaying with spaces.

How to avoid spaces in top-of-page split command?

In picture attached, yellow space I want to eliminate

 CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program          = sy-cprog
*     i_callback_top_of_page      = 'TOP-OF-PAGE'  "see FORM
      i_callback_html_top_of_page = 'TOP_OF_PAGE_SPLIT'
      is_layout                   = gd_layout
      it_fieldcat                 = fieldcatalog[]
      i_save                      = abap_true
    TABLES
      t_outtab                    = lt_output[]
    EXCEPTIONS
      program_error               = 1
      OTHERS                      = 2.
  IF sy-subrc <> 0.
    WRITE :/ 'Error in Alv output'.
  ENDIF.

ENDFORM.
*-----------------------------------------------------------------------
* build header for alv
*-----------------------------------------------------------------------
FORM top_of_page_split USING r_top TYPE REF TO cl_dd_document.
  DATA: date1 TYPE char10.
  DATA: s_tab  TYPE sdydo_text_table,
        c_area TYPE REF TO cl_dd_area,
        text   TYPE sdydo_text_element.
  TYPES: BEGIN OF tab_text,
           text TYPE sdydo_text_element,
         END OF tab_text.

  DATA: i_text TYPE TABLE OF tab_text.
  DATA: w_text TYPE tab_text.

  CALL METHOD r_top->initialize_document.

  CALL METHOD r_top->vertical_split
    EXPORTING
      split_area  = r_top
      split_width = '80%'
    IMPORTING
      right_area  = c_area.

  WRITE sy-datum TO date1 MM/DD/YYYY.

  CONCATENATE 'DATE '
  date1
  INTO w_text-text
  SEPARATED BY ':'.
  APPEND w_text TO i_text.
  CONCATENATE 'user: ' sy-uname INTO w_text .
  APPEND w_text TO i_text.
  s_tab[] = i_text[].

  CALL METHOD c_area->add_text
    EXPORTING
      text_table   = s_tab
      fix_lines    = 'X'
      sap_fontsize = cl_dd_document=>table_heading
      sap_emphasis = cl_dd_document=>list_normal.

*  CALL METHOD r_top->add_gap
*    EXPORTING
*      width = 20.

  text = 'Date Range:'.
  DATA: temp_d1 TYPE char10, temp_d2 TYPE char10.
  WRITE pn-begda TO temp_d1 MM/DD/YYYY.
  WRITE pn-endda TO temp_d2 MM/DD/YYYY.
  text = |{ text } { temp_d1 } to { temp_d2 }|.
  CONDENSE text.
  CALL METHOD r_top->add_text
    EXPORTING
      text         = text
      sap_emphasis = 'NORMAL'.


  CALL METHOD r_top->add_gap
    EXPORTING
      width = 70.


  text = 'Flex Balance Report'.
  CONDENSE text.
  CALL METHOD r_top->add_text
    EXPORTING
      text         = text
      sap_style    = cl_dd_document=>heading
      sap_color    = cl_dd_document=>list_heading_int
      sap_fontsize = cl_dd_document=>large
      sap_emphasis = cl_dd_document=>strong.

*  CALL METHOD r_top->new_line.




ENDFORM. "TOP_OF_PAGE_SPLIT

Attachments

issue-with-sap.jpg (80.2 kB)