14.01.2020 Views

ABAP_to_the_Future

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

10

ALV SALV Reporting Framework

METHOD if_salv_csqt_content_manager~fill_container_content.

*---------------------------------------------------------------*

* This gets called from function SALV_CSQT_CREATE_CONTAINER PBO

* module

* which creates a screen and a container, and passes us that container

*---------------------------------------------------------------*

* Local Variables

FIELD-SYMBOLS: <lt_data_table> TYPE ANY TABLE.

ASSIGN mt_data_table->* TO <lt_data_table>.

prepare_display_data(

EXPORTING

id_report_name = md_report_name " Calling program

id_variant = ms_variant-variant

io_container = r_container

it_user_commands = mt_user_commands

CHANGING

ct_data_table = <lt_data_table> ). " Data Table

ENDMETHOD.

Listing 10.24 FILL_CONTAINER_CONTENT Method

10.3.3 Changing the INITIALIZE Method

Now, you have to make some changes in the INITIALIZE method, as shown in

Listing 10.25, to accommodate the facts that (a) you now have a container being

passed in and (b) you want to add some user commands programmatically

The table of user commands is passed in from the calling program via the CREATE_

CONTAINER_PREP_DISPLAY method, which fills up global table MT_USER_COMMANDS

before calling the function module.

In the FILL_CONTAINER_CONTENT method, this table is passed into the

DISPLAY_DATA method, which in turn calls the INITIALIZE method.

PREPARE_

Exhausted after all this travel, the table of user commands finally arrives inside

the INITIALIZE method in the form of importing parameter table IT_USER_COM-

MANDS.

In Listing 10.25, if you have a container, then the factory method of CL_SALV_

TABLE is called, this time passing in the container object. Next, the program has

to specifically ask for the basic toolbar to appear at the top of the screen; SALV

will not do this automatically.

444

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!