I created a 2 custom containers one for Heading and the other for displaying data as below . For displaying the header content I created a reference variable HEAD1 of the class CL_DD_DOCUMENT. Later i build the content of the content of the header using method ADD_TABLE and displayed the header using MERGE and DISPLAY_DOCUMENT and placed in the custom container HEADING1.
Now my issue is i want to change the content of the header dynamically based on the PUSH button but using the same code. Means i want to display different content inthe header when i toggle a push button in the previous screen .I even refreshed the reference varaible once i come back ftom this screen. But the content is not getting refreshed. I am making a major mistake somewhere. Please help to corect this.
HEADING1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
CUSTOM_CONTAINER1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
HEAD1 TYPE REF TO CL_DD_DOCUMENT,
CALL METHOD HEAD1->ADD_TABLE
CALL METHOD HEAD1->MERGE_DOCUMENT.
CALL METHOD HEAD1->DISPLAY_DOCUMENT
CONTAINER = 'HEADING1'.