For a list of different Infotypes the selected infotype can be displayed as a popup. The popup must be dynamically adjusted at each call.

For this requirement you can use the Method GET_DEFAULT_CONFIG of the feeder class. But this method is called only once per instance. With each new selection of Inftotypen the columns of the first infotypes are displayed.

Therefore, the ID of the instance must be changed at each call.


Method GET_DEFAULT_CONFIG of Tree GUIBB Popup



method if_fpm_guibb_tree~get_default_config.

     data lo_mod_austap type ref to z_mod_austap.
     data ls_lead_selection type z_mod_austap=>ty_austap_list.
     data lo_struc_descr type ref to cl_abap_structdescr.
     data ls_components like line of lo_struc_descr->components.
     data l_pnnn type string.
     data l_name_komp type name_komp.

     try.

         lo_mod_austap = z_mod_austap=>get_instance( ).

         ls_lead_selection = lo_mod_austap->get_lead_selection( ).

         l_pnnn = 'P' && ls_lead_selection-infty.

         lo_struc_descr ?= cl_abap_structdescr=>describe_by_name( p_name = l_pnnn  ).

         loop at lo_struc_descr->components into ls_components.

           l_name_komp = ls_components-name.


           "BEGDA muss vor ENDDA sein
           if l_name_komp = 'ENDDA'.

             io_layout_config->add_column( iv_name = 'BEGDA'
                                                   iv_display_type = if_fpm_guibb_constants=>gc_display_type-text_view "'TV'
 *                                        iv_header = ls_components-name
                                                                  ).

             io_layout_config->add_column( iv_name = l_name_komp
                                                  iv_display_type = if_fpm_guibb_constants=>gc_display_type-text_view "'TV'
 *                                        iv_header = ls_components-name
                                                                 ).
           elseif l_name_komp = 'BEGDA'.
             "Keine Aktion
           else.
             io_layout_config->add_column( iv_name = l_name_komp
                                               iv_display_type = if_fpm_guibb_constants=>gc_display_type-text_view "'TV'
 *                                        iv_header = ls_components-name
                                                              ).

           endif.

         endloop.



         io_layout_config->set_settings(
 *      EXPORTING
 *                                                         iv_visible_row_counts         =
 *                                                         iv_visible_column_counts      =
 *                                                         iv_sel_event_type             =
 *                                                         iv_selection_mode             =
 *                                                         iv_selection_change_behaviour =
             iv_title                      = `Pernr ` && ls_lead_selection-pernr && ` Infotyp ` && ls_lead_selection-infty
 *                                                         iv_check_mandatory            =
 *                                                         iv_tree_width                 = '1000'
 *                                                         iv_initial_lead_selection     =
 *                                                         iv_fixed_columns              =
 *                                                         iv_display_empty_rows         =
 *                                                         iv_ctxt_menu_id               =
 *                                                         iv_suppress_selection_buttons =
 *                                                         iv_show_no_data_default_text  = ABAP_TRUE
 *                                                         iv_no_data_text               =
                                                          iv_allow_personalization      = abap_true
 *                                                         iv_allow_creating_views       =
 *                                                         iv_allow_sorting              =
 *                                                         iv_height_mode_ats            =
                                                              iv_fit_to_table_width         = abap_true
 *                                                         iv_row_height_ats             =
 *                                                         iv_export_to_excel            =
 *                                                         iv_sel_event_type_ats         =
         ).


       catch cx_root.

         message 'X' type 'X'.

     endtry.

   endmethod.  




Method OVERRIDE_EVENT_OVP of Tree GUIBB Popup

Every time the popup is closed, the ID of the Insatz must be changed so that the Mehtod GET_DEFAULT_CONFIG is called again.


method if_fpm_ovp_conf_exit~override_event_ovp.

     data lt_uibb type if_fpm_ovp=>ty_t_uibb.
     data ls_uibb like line of lt_uibb.

     data l_primary_attribute type fpm_element_id.

     data lo_fpm type ref to if_fpm .
     data lo_fpm_ovp type ref to if_fpm_ovp.

     data l_event_id type fpm_event_id.

     l_event_id = io_ovp->get_event( )->mv_event_id.

     if l_event_id = if_fpm_constants=>gc_event-close_dialog. "FPM_CLOSE_DIALOG

       lo_fpm = cl_fpm_factory=>get_instance( ).
       lo_fpm_ovp ?= lo_fpm->get_service( iv_service_key = cl_fpm_service_manager=>gc_key_cnr_ovp ).


       try.
           lo_fpm_ovp->get_uibbs(
             exporting
               iv_content_area = 'DF_BEF_AFT'
 *    iv_section      =
             importing
               et_uibb         = lt_uibb
           ).
 *  CATCH cx_fpm_floorplan.    "

           loop at lt_uibb into ls_uibb.

             lo_fpm_ovp->remove_uibb( ls_uibb-fpm_primary_attribute ).
             ls_uibb-instance_id = ls_uibb-instance_id + 1.

             lo_fpm_ovp->add_uibb(
               exporting
                 iv_content_area          = 'DF_BEF_AFT'
 *                iv_section               =
                 is_uibb                  = ls_uibb
 *                iv_add_uibb_to_new_stack = ABAP_FALSE
               importing
                 ev_primary_attribute     = l_primary_attribute
             ).
 *              CATCH cx_fpm_floorplan.    "

           endloop.

         catch cx_root.

       endtry.


     endif.

   endmethod. 

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply