Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8635

Re: Issue with End Routine_adding new fields

$
0
0

*************************************************************************************

DATA: ta_result_package TYPE STANDARD TABLE OF _ty_s_tg_1,

          wa_result_package LIKE LINE OF ta_result_package.


    DATA: it_dist   TYPE SORTED TABLE OF /bic/arcdds100
                        WITH UNIQUE KEY employee
                                        /bic/zpycc
                                        /bic/zsdat
                                        /bic/zedat,
          wa_dist   LIKE LINE OF it_dist.

    SORT RESULT_PACKAGE BY employee calday ASCENDING.

    LOOP AT RESULT_PACKAGE INTO <result_fields>.

*****************************************************************
      wa_result_package-/bic/zxavg = <result_fields>-/bic/zxavg.
      "retain KF values for DSO entries
*****************************************************************
      SELECT * FROM /bic/arcdds100 INTO TABLE it_dist
        WHERE
       employee = <result_fields>-employee
        AND
      /bic/zsdat LE <result_fields>-calday
        AND
      /bic/zedat GE <result_fields>-calday.

      IF it_dist IS NOT INITIAL.

        LOOP AT it_dist INTO wa_dist.

          <result_fields>-/bic/zpycc = wa_dist-/bic/zpycc.
          <result_fields>-/bic/zdiscc = wa_dist-/bic/zdiscc.

          <result_fields>-/bic/zxavg =
<result_fields>-/bic/zxavg * wa_dist-/bic/zcdper / 100.

          APPEND <result_fields> TO ta_result_package.

*****************************************************************
          <result_fields>-/bic/zxavg =
          wa_result_package-/bic/zxavg.
*****************************************************************
        ENDLOOP.

      ELSE.
*        <result_fields>-/bic/zpycc = <result_fields>-mast_cctr.
        APPEND <result_fields> TO ta_result_package.

      ENDIF.
    ENDLOOP.


    REFRESH RESULT_PACKAGE.
    APPEND LINES OF ta_result_package TO RESULT_PACKAGE.
    SORT RESULT_PACKAGE BY employee fiscvarnt calday /bic/zrepx
    /bic/zlv_cd /bic/zpycc   ASCENDING.
    DELETE ADJACENT DUPLICATES FROM RESULT_PACKAGE.

*************************************************************************************

Each entry in Result package will have multiple rows in Target DSO.

 

... But it works successfully if the package size is reduced to 10, or even in debug mode.


Viewing all articles
Browse latest Browse all 8635

Trending Articles



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