<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Custom container problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-container-problem/m-p/931231#M60896</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;This is strange. I've a screen 100 with an alv grid displayed in the custom container. It is like the program BCALV_GRID_04 with the LEDs in the display. On the double click event of a line, another screen 200 is displayed with the same style, but fetching the line item details with LEDs. For the first time it works fine, but on going back to screen 100 again and then selecting another header line item, the container of 200 is not geting initialized and due to this the new contents are not displayed on the screen 200 correctly but the old contents still remain though i clear it.&lt;/P&gt;&lt;P&gt;Is there a way to initialize the container while leaving the screen?? I've tried Flush and refresh table display as below...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any clues on where i went wrong?&lt;/P&gt;&lt;P&gt;code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of gt_outtab1 occurs 0.&lt;/P&gt;&lt;P&gt;        include structure ZPYT_ED_LINE.&lt;/P&gt;&lt;P&gt;data:   light type c.&lt;/P&gt;&lt;P&gt;data:  end of gt_outtab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PBO of screen 200.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if custom_container2 is initial.&lt;/P&gt;&lt;P&gt;    PERFORM BUILD_LINE_DATA TABLES GT_LINE[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    create object custom_container2&lt;/P&gt;&lt;P&gt;        exporting&lt;/P&gt;&lt;P&gt;            container_name = cont_for_line&lt;/P&gt;&lt;P&gt;        exceptions&lt;/P&gt;&lt;P&gt;            cntl_error = 1&lt;/P&gt;&lt;P&gt;            cntl_system_error = 2&lt;/P&gt;&lt;P&gt;            create_error = 3&lt;/P&gt;&lt;P&gt;            lifetime_error = 4&lt;/P&gt;&lt;P&gt;            lifetime_dynpro_dynpro_link = 5.&lt;/P&gt;&lt;P&gt;    if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;      call function 'POPUP_TO_INFORM'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          titel = g_repid&lt;/P&gt;&lt;P&gt;          txt2  = sy-subrc&lt;/P&gt;&lt;P&gt;          txt1  = 'The control could not be created'(510).&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create an instance of alv control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    create object grid2&lt;/P&gt;&lt;P&gt;           exporting i_parent = custom_container2.&lt;/P&gt;&lt;P&gt;    clear: gs_layout2.&lt;/P&gt;&lt;P&gt;    gs_layout2-grid_title = 'Records details'(101).&lt;/P&gt;&lt;P&gt;    gs_layout2-CWIDTH_OPT = 'X'.&lt;/P&gt;&lt;P&gt;    gs_layout2-excp_fname = g_lights_name2.&lt;/P&gt;&lt;P&gt;    perform mask_columns tables gt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call method grid2-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;         exporting&lt;/P&gt;&lt;P&gt;                   is_layout        = gs_layout2&lt;/P&gt;&lt;P&gt;         changing  it_fieldcatalog  = gt_fieldcat[]&lt;/P&gt;&lt;P&gt;                   it_outtab        = gt_line.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call method grid2-&amp;gt;refresh_table_display&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      i_soft_refresh = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endif.                               "IF grid2 IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method cl_gui_control=&amp;gt;set_focus&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      control = grid2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method grid2-&amp;gt;refresh_table_display.&lt;/P&gt;&lt;P&gt;  clear gt_outtab1[].&lt;/P&gt;&lt;P&gt;  call method cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;  if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call function 'POPUP_TO_INFORM'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        titel = g_repid&lt;/P&gt;&lt;P&gt;        txt2  = sy-subrc&lt;/P&gt;&lt;P&gt;        txt1  = 'Error in FLush'(500).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 11 Sep 2005 13:56:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-09-11T13:56:39Z</dc:date>
    <item>
      <title>Custom container problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-container-problem/m-p/931231#M60896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;This is strange. I've a screen 100 with an alv grid displayed in the custom container. It is like the program BCALV_GRID_04 with the LEDs in the display. On the double click event of a line, another screen 200 is displayed with the same style, but fetching the line item details with LEDs. For the first time it works fine, but on going back to screen 100 again and then selecting another header line item, the container of 200 is not geting initialized and due to this the new contents are not displayed on the screen 200 correctly but the old contents still remain though i clear it.&lt;/P&gt;&lt;P&gt;Is there a way to initialize the container while leaving the screen?? I've tried Flush and refresh table display as below...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any clues on where i went wrong?&lt;/P&gt;&lt;P&gt;code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of gt_outtab1 occurs 0.&lt;/P&gt;&lt;P&gt;        include structure ZPYT_ED_LINE.&lt;/P&gt;&lt;P&gt;data:   light type c.&lt;/P&gt;&lt;P&gt;data:  end of gt_outtab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PBO of screen 200.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if custom_container2 is initial.&lt;/P&gt;&lt;P&gt;    PERFORM BUILD_LINE_DATA TABLES GT_LINE[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    create object custom_container2&lt;/P&gt;&lt;P&gt;        exporting&lt;/P&gt;&lt;P&gt;            container_name = cont_for_line&lt;/P&gt;&lt;P&gt;        exceptions&lt;/P&gt;&lt;P&gt;            cntl_error = 1&lt;/P&gt;&lt;P&gt;            cntl_system_error = 2&lt;/P&gt;&lt;P&gt;            create_error = 3&lt;/P&gt;&lt;P&gt;            lifetime_error = 4&lt;/P&gt;&lt;P&gt;            lifetime_dynpro_dynpro_link = 5.&lt;/P&gt;&lt;P&gt;    if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;      call function 'POPUP_TO_INFORM'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          titel = g_repid&lt;/P&gt;&lt;P&gt;          txt2  = sy-subrc&lt;/P&gt;&lt;P&gt;          txt1  = 'The control could not be created'(510).&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create an instance of alv control&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    create object grid2&lt;/P&gt;&lt;P&gt;           exporting i_parent = custom_container2.&lt;/P&gt;&lt;P&gt;    clear: gs_layout2.&lt;/P&gt;&lt;P&gt;    gs_layout2-grid_title = 'Records details'(101).&lt;/P&gt;&lt;P&gt;    gs_layout2-CWIDTH_OPT = 'X'.&lt;/P&gt;&lt;P&gt;    gs_layout2-excp_fname = g_lights_name2.&lt;/P&gt;&lt;P&gt;    perform mask_columns tables gt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call method grid2-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;         exporting&lt;/P&gt;&lt;P&gt;                   is_layout        = gs_layout2&lt;/P&gt;&lt;P&gt;         changing  it_fieldcatalog  = gt_fieldcat[]&lt;/P&gt;&lt;P&gt;                   it_outtab        = gt_line.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call method grid2-&amp;gt;refresh_table_display&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      i_soft_refresh = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endif.                               "IF grid2 IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method cl_gui_control=&amp;gt;set_focus&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      control = grid2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method grid2-&amp;gt;refresh_table_display.&lt;/P&gt;&lt;P&gt;  clear gt_outtab1[].&lt;/P&gt;&lt;P&gt;  call method cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;  if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call function 'POPUP_TO_INFORM'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        titel = g_repid&lt;/P&gt;&lt;P&gt;        txt2  = sy-subrc&lt;/P&gt;&lt;P&gt;        txt1  = 'Error in FLush'(500).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Sep 2005 13:56:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-container-problem/m-p/931231#M60896</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-11T13:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Custom container problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-container-problem/m-p/931232#M60897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Samuel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looks like its a silly mistake. You have a IF statement where you are checking for CUSTOM CONTAINER2 has been created or not. For the first time it goes in and creates the container and also gets the new data. However when you come for the next time the container already exists and the whole IF cond. will be bypassed because of which the new line item details are not fetched.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest that you put your PERFORM BUILD_LINE_DATA TABLES GT_LINE[], outside the IF statement and it should be working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : Please reward points if the answers have been helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2005 03:51:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-container-problem/m-p/931232#M60897</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-12T03:51:34Z</dc:date>
    </item>
  </channel>
</rss>

