Skip to Content

BRF Plus DDIC binding refresh

Hello All,

Requirement : I have a Decision table with DDIC structure as result data object. I would like to add new fields to the structure + refresh the binding at the same time during execution.

I am able to add new fields to DDIC structure but method SET_DDIC_BINDING is not refreshing the binding. Any hints to achieve the binding refresh.

P.S: I have found couple of threads with same problem but were not answered.

Thanks,

Mohammad

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jan 24 at 02:01 PM

    As Christian said, there was an issue from my side..Refreshing binding using APIs is very simple and straight forward..

    DATA :lo_fdt_structure TYPE REF TO cl_fdt_structure,
          lt_dd03p         TYPE STANDARD TABLE OF dd03p.
    
    *--Step 1: Get Instance using Application ID
    DATA(lo_fdt_factory) = cl_fdt_factory=>if_fdt_factory~get_instance( '0050568B37E21ED7BC82ACD66B077540' ).
    
    TRY.
    *--Step 2: Get Instance using Result Structure ID
        DATA(lo_data_object) = lo_fdt_factory->get_data_object( 
                                            EXPORTING iv_id          = '0050568B37E21ED7BC8322C9555AB5E3'
                                                      iv_data_object_type = if_fdt_constants=>gc_data_object_type_structure ).
      CATCH cx_fdt_input INTO DATA(lo_fdt_input).
    ENDTRY.
    
    lo_fdt_structure ?= lo_data_object.
    
    *--Step 3: Get the DDIC structure bound to Result structure
    TRY.
        DATA(l_ddic_binding) = lo_fdt_structure->if_fdt_data_object~get_ddic_binding( ).
      CATCH cx_fdt_input INTO lo_fdt_input.
    ENDTRY.
    
    *--Step 4: Change the DDIC structure
    CALL FUNCTION 'DDIF_TABL_GET'
      EXPORTING
        name      = CONV ddobjname( l_ddic_binding )
      TABLES
        dd03p_tab = lt_dd03p.
    
    APPEND INITIAL LINE TO lt_dd03p ASSIGNING FIELD-SYMBOL(<fs_dd03p>).
    <fs_dd03p>-tabname   = 'ZCOE_RESULT_STRUCTURE'.
    <fs_dd03p>-fieldname = 'RESULT4'.
    <fs_dd03p>-position  = '0004'.
    <fs_dd03p>-rollname  = 'CHAR10'.
    <fs_dd03p>-domname   = 'CHAR10'.
    
    CALL FUNCTION 'DDIF_TABL_PUT'
      EXPORTING
        name      = CONV ddobjname( l_ddic_binding )
      TABLES
        dd03p_tab = lt_dd03p.
    COMMIT WORK.
    CALL FUNCTION 'DDIF_TABL_ACTIVATE'
      EXPORTING
        name     = CONV ddobjname( l_ddic_binding )
        excommit = 'X'.
    
    CALL FUNCTION 'DB_COMMIT'.
    
    *--Step 5: Refresh the Result Structure binding
    TRY.
        lo_fdt_structure->if_fdt_data_object~set_ddic_binding( EXPORTING iv_ddic_typename = l_ddic_binding
                                                               IMPORTING ets_object_id    = DATA(lt_fresh_list) ).
      CATCH cx_fdt_input INTO lo_fdt_input.
    ENDTRY.
    
    Add comment
    10|10000 characters needed characters exceeded

  • Jan 16 at 10:44 AM

    Hi Mohammed,

    can you please check if the system recognizes that the DDIC binding is not up-to-date? You can do that by calling the method IS_BINDING_UP_TO_DATE of the class CL_FDT_STRUCTURE (as you are dealing with a structure, right?)

    If this method states that the binding is up to date, you have to debug why this is the case

    If the method states that the binding is not up to date, I am afraid that you have to debug into the method DERIVE_DATA_OBJECT_INTERNAL of CL_FDT_STRUCTURE.

    Cheers,

    Christian

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Mohammad,

      if the report works (updates the DDIC binding) there must be a deviation between your code and the one of the report. So some debugging from your side is necessary to find that out.

      Best regards,

      Christian

  • Jan 15 at 04:39 PM

    Not sure I understand the problem. This is not possible at the same time. Go to your structure and click on refresh binding, this should add the new fields. Save, activate, and go to your DT and it should have the new fields available in your results column.

    Add comment
    10|10000 characters needed characters exceeded