SAP MDG: TAX classification based on country and tax type

Table of contents


Process:

Method – DERIVE_DATA

Code:

METHOD if_mdg_bs_bp_access_handler~derive_data.

DATA : ls_data_upd TYPE REF TO data,
           ls_data_del TYPE REF TO data,
           ls_data_mod TYPE REF TO data,
           ls_data_ins TYPE REF TO data,
           ls_upd_comp TYPE usmd_flg.

    CALL METHOD io_changed_data->read_data
      EXPORTING
        i_entity      = 'BP_CUSTAX'
*       i_struct      =
      IMPORTING
        er_t_data_ins = ls_data_ins
        er_t_data_upd = ls_data_upd
        er_t_data_del = ls_data_del
        er_t_data_mod = ls_data_mod.

    FIELD-SYMBOLS <fs_data> TYPE ANY TABLE.

    ASSIGN ls_data_upd->* TO <fs_data>.

    IF <fs_data> IS ASSIGNED.
      LOOP AT <fs_data> INTO ls_tax_indicator.
        IF  ls_tax_indicator-aland = 'OM' AND ls_tax_indicator-tatyp = 'TTX1'.
          ls_tax_indicator-taxkd = 1.
          APPEND ls_tax_indicator TO lt_tax_indicator.
        ENDIF.
      ENDLOOP.

      io_write_data->write_data( i_entity = 'BP_CUSTAX' it_data = lt_tax_indicator ).
      me->if_mdg_bs_bp_access_handler~buffer_derived_data( io_model = io_model iv_entity = 'BP_CUSTAX'
  it_data_ins = lt_tax_indicator ).

    ENDIF.

ENDMETHOD.

Thank You :)

0
Subscribe to my newsletter

Read articles from sowmya surekha manukonda directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

sowmya surekha manukonda
sowmya surekha manukonda