Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Refresh Log in Custom Container

0 Likes
1,744

Hi.

Currentyl I am displaying my log in a cl_gui_custom_container on my dynpro. The problem is, that when I a want to show a brand new log in my custom control, it is not refreshing and therfore shows the old log. Is there any possibility I can refresh the custom container to show the new log?


"Custom Control defined in Top-Include:
go_dependency_log_container TYPE REF TO cl_gui_custom_container.

FORM show_log .
  DATA: ls_log_header      TYPE bal_s_lfil,
        ls_log_handle      TYPE bal_s_logh,
        ls_display_profile TYPE bal_s_prof,
        lt_log_header      TYPE balhdr_t,
        lt_log_handle      TYPE bal_t_logh,
        lv_control_handle  TYPE balcnthndl.

  ls_log_handle-sign = 'I'.
  ls_log_handle-option = 'EQ'.
  ls_log_handle-low = gv_log_handle.

  APPEND ls_log_handle TO ls_log_header-log_handle.

  IF go_dependency_log_container IS NOT INITIAL.
    CLEAR go_dependency_log_container.
  ENDIF.

  "search log, which needs to be displayed
  CALL FUNCTION 'BAL_DB_SEARCH'
    EXPORTING
      i_client       = sy-mandt
      i_s_log_filter = ls_log_header
    IMPORTING
      e_t_log_header = lt_log_header
    EXCEPTIONS
      OTHERS         = 1.
  IF sy-subrc <> 0.
    MESSAGE i057(/dematic/dep_check) DISPLAY LIKE 'E'.
    RETURN.
  ENDIF.

  "load log
  CALL FUNCTION 'BAL_DB_LOAD'
    EXPORTING
      i_t_log_header = lt_log_header
      i_client       = sy-mandt
    IMPORTING
      e_t_log_handle = lt_log_handle
    EXCEPTIONS
      OTHERS         = 1.
  IF sy-subrc <> 0.
    MESSAGE e058(/dematic/dep_check) DISPLAY LIKE 'E'.
    RETURN.
  ENDIF.

  IF go_dependency_log_container IS INITIAL.
    go_dependency_log_container = NEW cl_gui_custom_container( container_name = 'GO_DEPENDENCY_LOG_CONTAINER' ).
  ENDIF.

  "get display profile
  CALL FUNCTION 'BAL_DSP_PROFILE_NO_TREE_GET'
    IMPORTING
      e_s_display_profile = ls_display_profile.

  "create control
  CALL FUNCTION 'BAL_CNTL_CREATE'
    EXPORTING
      i_container         = go_dependency_log_container
      i_s_display_profile = ls_display_profile
      i_t_log_handle      = lt_log_handle
    IMPORTING
      e_control_handle    = lv_control_handle
    EXCEPTIONS
      OTHERS              = 1.
  IF sy-subrc <> 0.
    MESSAGE i059(/dematic/dep_check) DISPLAY LIKE 'E'.
    RETURN.
  ENDIF.


  CALL METHOD cl_gui_cfw=>flush.

ENDFORM.
1 ACCEPTED SOLUTION
Read only

1,562

I have solved it. Just call the free method of cl_gui_custom_container.

In this case:

  IF go_dependency_log_container IS NOT INITIAL.
    go_dependency_log_container->free( ).
  ENDIF.
2 REPLIES 2
Read only

1,563

I have solved it. Just call the free method of cl_gui_custom_container.

In this case:

  IF go_dependency_log_container IS NOT INITIAL.
    go_dependency_log_container->free( ).
  ENDIF.
Read only

1,562

Indeed, it looks very much similar to a recent issue.