Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8419

help with rule in tranformation

$
0
0

Hello experts.

 

I have transformation between InfoCube and table Open Hub through InfoSource.

 

In the transfer rules, I need to fill characteristic- Amount4, based on the values ​​4 key figure - 0CALYEAR, IMP_VERS, IMP_YEAR, IM_0ITEM and 0AMOUNT (picture №1 in the attachment).

 

In routines i have:

 

*   Rule specific types

    TYPES:

      BEGIN OF _ty_s_SC_1,

*      InfoObject: 0CALYEAR Календарный год.

        CALYEAR           TYPE /BI0/OICALYEAR,

*      InfoObject: IMP_YEAR Год ИП.

        /BIC/IMP_YEAR           TYPE /BIC/OIIMP_YEAR,

*      InfoObject: IM_0ITEM Статья.

        /BIC/IM_0ITEM           TYPE /BIC/OIIM_0ITEM,

*      InfoObject: 0AMOUNT Сумма.

        AMOUNT           TYPE /BI0/OIAMOUNT,

*      Field: RECORD.

        RECORD           TYPE RSARECORD,

      END   OF _ty_s_SC_1.

    TYPES:

      BEGIN OF _ty_s_TG_1,

*      InfoObject: AMOUNT5 Всего в 2-й год.

        /BIC/AMOUNT5           TYPE /BIC/OIAMOUNT5,

      END   OF _ty_s_TG_1.

 

METHODS

      compute_AMOUNT5

        IMPORTING

          request                  type rsrequest

          datapackid               type rsdatapid

          SOURCE_FIELDS              type _ty_s_SC_1

        EXPORTING

          RESULT                   type _ty_s_TG_1-/BIC/AMOUNT5

          monitor                  type rstr_ty_t_monitor

        RAISING

          cx_rsrout_abort

          cx_rsrout_skip_record

          cx_rsrout_skip_val.

    METHODS

      invert_AMOUNT5

        IMPORTING

          i_th_fields_outbound         TYPE rstran_t_field_inv

          i_r_selset_outbound          TYPE REF TO cl_rsmds_set

          i_is_main_selection          TYPE rs_bool

          i_r_selset_outbound_complete TYPE REF TO cl_rsmds_set

          i_r_universe_inbound         TYPE REF TO cl_rsmds_universe

        CHANGING

          c_th_fields_inbound          TYPE rstran_t_field_inv

          c_r_selset_inbound           TYPE REF TO cl_rsmds_set

          c_exact                      TYPE rs_bool.

 

 

i writen code:

 

data:

      stst type n LENGTH 8,

      impyear type n LENGTH 4,

      calyear type n LENGTH 4.

     

        stst = SOURCE_FIELDS-/BIC/IM_0ITEM.

        impyear = SOURCE_FIELDS-/BIC/IMP_YEAR + 1.

        calyear = SOURCE_FIELDS-CALYEAR.

       

    IF STST = '600' AND impyear = CALYEAR.

            RESULT = SOURCE_FIELDS-AMOUNT.

    ENDIF.

 

But after the transformation I have all zeros in the Amount5 (picture №2 and №3 in the attachment).

 

I hope I distinctly described a problem .. What am I doing wrong??


Viewing all articles
Browse latest Browse all 8419

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>