cancel
Showing results for 
Search instead for 
Did you mean: 

How to write the Report Title using WebDynpro

Former Member
0 Kudos

Hi Expert,

I have created Report using ALV component. The report displaying in the browser looks good. I need to display the Title of the report at the top of the report. Can you any body help me out from the requirement.

Thanks,

S Kumar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can use the following code to set the header for the ALV

data:

lr_table_settings type ref to if_salv_wd_table_settings,

lr_header type ref to cl_salv_wd_header.

lr_header = lr_table_settings->get_header( ).

call method lr_header->set_text

exporting

value = 'Test Alv Header' .

Regards,

Shruthi R

Former Member
0 Kudos

Hi Shruthi,

I wrote this code to my program but when I try to execute the report it says that "Access via 'NULL' object reference not possible" . Do i need to pass any parameter to these methods??

Kindly help me out.

Reagrds,

Kumar S

Former Member
0 Kudos

Hi,

The error comes because, if you have copy pasted the code, table settings are not initialized.

You can directly access the table settings and get the header as follows:

l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).

l_alv_model = l_ref_interfacecontroller->get_model( ).

lr_header = l_alv_model->IF_SALV_WD_TABLE_SETTINGS~get_header( ).

Regards,

Nithya

Madhu2004
Active Contributor
0 Kudos

hi,

this will sove ur problem:

l_ref_cmp_usage = wd_this->wd_cpuse_alv_material( ).

IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.

l_ref_cmp_usage->create_component( ).

ENDIF.

l_ref_interfacecontroller = wd_this->wd_cpifc_alv_material( ).

l_value = l_ref_interfacecontroller->get_model(

).

lr_table_settings ?= l_value.

add this code and it will work

Madhu

Answers (3)

Answers (3)

Former Member
0 Kudos

<b>Please close the thread and award points if ur problem is solved</b>

Former Member
0 Kudos

you can also use a caption or label element to set the header.

Former Member
0 Kudos

Hi Kumar,

I prefer do to it the following way. I embed a report into a Group element and assign the title of the report to the Captions element that comes with the Group.