Application Development and Automation 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: 
Read only

list header in alv oops

Former Member
0 Likes
525

Hi,

I want to display page no in list header through ALV OOPS. I'm using splitter class for separating top and grid.


CREATE OBJECT w_DYNDOC_ID
EXPORTING STYLE = 'ALV_GRID'.
*create custom container object and pass your contaoner name here
    CREATE OBJECT go_custom_container
      EXPORTING
        container_name = 'CONTOL_ALV'.  "CONTOL_ALV
* Create Splitter for custom_container
    CREATE OBJECT w_splitter
      EXPORTING
        parent  = go_custom_container
        rows    = 1
        columns = 1.

    CALL METHOD w_splitter->get_container
      EXPORTING
        row       = 1
        column    = 1
      RECEIVING
        container = w_parent_top.

    CALL METHOD w_splitter->get_container
      EXPORTING
        row       = 2
        column    = 1
      RECEIVING
        container = w_parent_grid.

* Set height for g_parent_html
    CALL METHOD w_splitter->set_row_height
      EXPORTING
        id     = 1
        height = 1.

But I'm unable to print any text in Header

Code Formatted by: Alvaro Tejada Galindo on Jan 13, 2010 4:27 PM

Hi,

I want to display page no in list header through ALV OOPS. I'm using splitter class for separating top and grid.


CREATE OBJECT w_DYNDOC_ID
EXPORTING STYLE = 'ALV_GRID'.
*create custom container object and pass your contaoner name here
    CREATE OBJECT go_custom_container
      EXPORTING
        container_name = 'CONTOL_ALV'.  "CONTOL_ALV
* Create Splitter for custom_container
    CREATE OBJECT w_splitter
      EXPORTING
        parent  = go_custom_container
        rows    = 1
        columns = 1.

    CALL METHOD w_splitter->get_container
      EXPORTING
        row       = 1
        column    = 1
      RECEIVING
        container = w_parent_top.

    CALL METHOD w_splitter->get_container
      EXPORTING
        row       = 2
        column    = 1
      RECEIVING
        container = w_parent_grid.

* Set height for g_parent_html
    CALL METHOD w_splitter->set_row_height
      EXPORTING
        id     = 1
        height = 1.

But I'm unable to print any text in Header

Code Formatted by: Alvaro Tejada Galindo on Jan 13, 2010 4:27 PM

3 REPLIES 3
Read only

Former Member
0 Likes
456

Hi,

The following pattern might help you to display any text or logo in the header, but dynamically displaying page numbers is not possible yet, i believe.


DATA: go_document       TYPE REF TO cl_dd_document.
...
...
  CALL METHOD go_document->add_text
    EXPORTING
      text         = lv_text
      sap_emphasis = gc_strong.
...
...
  CALL METHOD go_document->merge_document.
  CALL METHOD go_document->display_document
    EXPORTING
      parent = *bold* w_parent_top *bold* .

Read only

0 Likes
456

Hi Ranjan,

I have already written out those statement. see below code


  call method p_dyndoc_id->add_text
    EXPORTING
      text         = 'Demo Top'
      sap_style    = cl_dd_area=>heading
      sap_fontsize = cl_dd_area=>large
      sap_color    = cl_dd_area=>list_heading_int.

*    p_dyndoc_id = w_dyndoc_id.
 CALL METHOD p_dyndoc_id->merge_document.
  CALL METHOD p_dyndoc_id->display_document
    EXPORTING
      reuse_control      = 'X'
      parent             = w_parent_top
    EXCEPTIONS
      html_display_error = 1.
  IF sy-subrc NE 0.
    MESSAGE i398(00) WITH 'Error in displaying top-of-page'(036).
  ENDIF.
ENDFORM.                    " EVENT_TOP_OF_PAGE

Still text is not comming in header.

Code Formatted by: Alvaro Tejada Galindo on Jan 13, 2010 4:27 PM

Read only

Former Member
0 Likes
456

Please check [Alv with page number|http://www.henrikfrank.dk/abaptips/abap%20language/other%20stuff/alv%20grid%20-%20page%20numbering%20problem.html]