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: 

ALV Header

former_member423024
Participant
0 Kudos
230

Hi Gurus,

I'm using SET_TABLE_FOR_FIRST_DISPLAY for displaying the data in GRID.

While displaying the header,Header Field Text is not displayed in right position when changing either screen size or font size.

Code: CALL METHOD im_ob_doc_id->add_text

EXPORTING

text = lv_text_hdr.

Could anyone kindly let me know what is the reason for this, Do I need to populate any extra parameters while calling this method.

Kindly provide the solution.

Thanks

Natasha SS.

1 ACCEPTED SOLUTION

former_member585060
Active Contributor
0 Kudos
151
FORM top_of_page_split USING lc_top TYPE REF TO cl_dd_document.

  DATA: lt_tab TYPE sdydo_text_table,
  lc_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: lt_text TYPE TABLE OF tab_text.
  DATA: w_text TYPE tab_text.

  CALL METHOD lc_top->initialize_document.

  CALL METHOD lc_top->vertical_split
    EXPORTING
      split_area  = lc_top
      split_width = '80%'
    IMPORTING
      right_area  = lc_area.

  CONCATENATE sy-datum+4(2) ' / ' sy-datum+6(2) ' / ' sy-datum(4) INTO date1.
  CONCATENATE 'DATE' date1 INTO w_text-text SEPARATED BY ':'.
  APPEND w_text TO lt_text.

  lt_tab[] = lt_text[].

  CALL METHOD lc_area->add_text
    EXPORTING
      text_table   = lt_tab
      fix_lines    = 'X'
      sap_fontsize = cl_dd_document=>medium
      sap_emphasis = cl_dd_document=>strong.

  CALL METHOD lc_top->add_gap
    EXPORTING
      width = 80.

  text = 'REPORT HEADING'.
  CALL METHOD lc_top->add_text
    EXPORTING
      text         = text
      sap_emphasis = 'STRONG'.

  CALL METHOD lc_top->new_line.

ENDFORM.                    "TOP_OF_PAGE_SPLIT

Edited by: Bala Krishna on Aug 6, 2010 3:54 PM

3 REPLIES 3

Former Member
0 Kudos
151

Create table first by using methods add rows and add colums and then add the text in respective column

former_member585060
Active Contributor
0 Kudos
152
FORM top_of_page_split USING lc_top TYPE REF TO cl_dd_document.

  DATA: lt_tab TYPE sdydo_text_table,
  lc_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: lt_text TYPE TABLE OF tab_text.
  DATA: w_text TYPE tab_text.

  CALL METHOD lc_top->initialize_document.

  CALL METHOD lc_top->vertical_split
    EXPORTING
      split_area  = lc_top
      split_width = '80%'
    IMPORTING
      right_area  = lc_area.

  CONCATENATE sy-datum+4(2) ' / ' sy-datum+6(2) ' / ' sy-datum(4) INTO date1.
  CONCATENATE 'DATE' date1 INTO w_text-text SEPARATED BY ':'.
  APPEND w_text TO lt_text.

  lt_tab[] = lt_text[].

  CALL METHOD lc_area->add_text
    EXPORTING
      text_table   = lt_tab
      fix_lines    = 'X'
      sap_fontsize = cl_dd_document=>medium
      sap_emphasis = cl_dd_document=>strong.

  CALL METHOD lc_top->add_gap
    EXPORTING
      width = 80.

  text = 'REPORT HEADING'.
  CALL METHOD lc_top->add_text
    EXPORTING
      text         = text
      sap_emphasis = 'STRONG'.

  CALL METHOD lc_top->new_line.

ENDFORM.                    "TOP_OF_PAGE_SPLIT

Edited by: Bala Krishna on Aug 6, 2010 3:54 PM

Former Member
0 Kudos
151

Hi Natasha,

Try like this


 CALL METHOD im_ob_dyndoc_id->add_text
    EXPORTING
      text         = lv_text
      sap_style    = cl_dd_area=>list_heading_int
      sap_color    = cl_dd_area=>list_heading_int
      sap_emphasis = cl_dd_area=>heading.

Regards,

Pravin