Skip to Content
avatar image
Former Member

Creating header in printout of ALV report in WD4A

Hi

I have created one alv report in WD4A. When I click on the "print version" button, the report appears in pdf format.

I want to create header on that pdf output. Please let me know how can i do that ? . it is coming on alv but not on pdf.

The code follows:

DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.

l_ref_cmp_usage = wd_this->wd_cpuse_ztime( ).

IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.

l_ref_cmp_usage->create_component( ).

ENDIF.

DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .

l_ref_interfacecontroller = wd_this->wd_cpifc_ztime( ).

DATA:

l_value TYPE REF TO cl_salv_wd_config_table.

l_value = l_ref_interfacecontroller->get_model(

).

*set header for the table

data: lr_table_settings type ref to if_salv_wd_table_settings.

data: lr_header type ref to CL_SALV_WD_HEADER.

lr_table_settings ?= l_value.

lr_header = lr_table_settings->get_header( ).

lr_header->set_text( 'ATTANDENCE LIST' ).

*PDF output header

data: pdf_header TYPE REF TO IF_SALV_WD_PDF_SETTINGS.

pdf_header ?= l_value.

data: lv_head type abap_bool.

call METHOD pdf_header->set_export_no_tol( 'X' ).

lv_head = pdf_header->get_export_no_tol( ).

regards

Vishal kapoor

Message was edited by:

vishal kapoor

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Nov 28, 2007 at 01:33 PM

    if you're still having this problem, try this (given your own code sample):

    data: 
      lv_header type string.
    
    pdf_header ?= l_value .
    
    CONCATENATE 'My header text' INTO lv_header RESPECTING BLANKS .
    
    pdf_header->set_header_left_freetext( lv_header ).
    pdf_header->set_header_left( if_salv_wd_c_pdf_settings=>text_free ).
    

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 18, 2011 at 12:57 PM

    closed

    Add comment
    10|10000 characters needed characters exceeded