SHARE
TWEET

Untitled

a guest Nov 25th, 2019 157 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. FUNCTION zfin_bte_1030.
  2. *"----------------------------------------------------------------------
  3. *"*"Lokalny interfejs:
  4. *"  IMPORTING
  5. *"     VALUE(I_BKDF) LIKE  BKDF STRUCTURE  BKDF
  6. *"     VALUE(I_UF05A) LIKE  UF05A STRUCTURE  UF05A
  7. *"     VALUE(I_XVBUP) LIKE  OFIWA-XVBUP DEFAULT 'X'
  8. *"  TABLES
  9. *"      T_AUSZ1 STRUCTURE  AUSZ1 OPTIONAL
  10. *"      T_AUSZ2 STRUCTURE  AUSZ2 OPTIONAL
  11. *"      T_AUSZ3 STRUCTURE  AUSZ_CLR OPTIONAL
  12. *"      T_BKP1 STRUCTURE  BKP1
  13. *"      T_BKPF STRUCTURE  BKPF
  14. *"      T_BSEC STRUCTURE  BSEC
  15. *"      T_BSED STRUCTURE  BSED
  16. *"      T_BSEG STRUCTURE  BSEG
  17. *"      T_BSET STRUCTURE  BSET
  18. *"      T_BSEU STRUCTURE  BSEU
  19. *"----------------------------------------------------------------------
  20.  
  21.   " Kopia SAMPLE_INTERFACE_00001030
  22.  
  23.  
  24. ************************************************ Rozwiązanie dla tworzenia RMK ************************************************
  25.  
  26.   DATA: ls_bseg                  TYPE  bseg,
  27.         ls_bkpf                  TYPE bkpf,
  28.         ls_assignments           TYPE  ace_assignments,
  29.         lt_accounts              TYPE  aceds_accounts_t,
  30.         ls_accounts              LIKE LINE OF lt_accounts,
  31.         lt_params                TYPE  aceds_param_t,
  32.         ls_params                LIKE LINE OF lt_params,
  33.         ld_effdate               TYPE  ace_effdate,
  34.         ls_post_params           TYPE  aceps_manual_posting_params,
  35.         ld_testrun               TYPE  ace_testrun,
  36.         ls_object                TYPE  acac_object_header_ext,
  37.         lt_object_items          TYPE  aceds_items_t,
  38.         ls_object_items          LIKE LINE OF lt_object_items,
  39.         id_comp                  TYPE ace_comp,
  40.         it_generic_selopt        TYPE  ace_field_ranges_t,
  41.         is_generic_selopt        LIKE LINE OF it_generic_selopt,
  42.         it_accrual_params        TYPE  ace_field_ranges_t,
  43.         id_transfer_purpose      TYPE  ace_data_transfer_purpose,
  44.         id_results_list_required TYPE  flag,
  45.         lt_return                TYPE  bapiret2_t,
  46.         id_testrun               TYPE flag,
  47.         ls_selopt                TYPE LINE OF ace_generic_range_t.
  48.  
  49.  
  50.   FIELD-SYMBOLS:   <lt_results_list>    TYPE  STANDARD TABLE.
  51.  
  52. "break pbednarski.
  53.  
  54.   id_comp = 'ACAC'.
  55.   id_transfer_purpose = 'T'.
  56.   id_results_list_required = 'X'.
  57.   id_testrun = ''.
  58.  
  59.   ls_selopt-sign = 'I'.
  60.   ls_selopt-option = 'EQ'.
  61.  
  62.   LOOP AT t_bseg INTO ls_bseg.
  63.  
  64. * ZMIANA WKLEPCZYNSKA 10.10.2018 - ZMIANA RODZAJU DOKUMENTU RMK Z 'PR' NA 'RK'
  65.     IF ls_bseg-zzdtfr IS NOT INITIAL AND ls_bseg-zzdtto IS NOT INITIAL AND ls_bseg-hkont CP '00004*' and ls_bkpf <> 'RK'.
  66.  
  67.       CLEAR: it_generic_selopt, ls_object, lt_object_items, lt_params, ls_params, ls_assignments, lt_accounts, ls_accounts, lt_return, ld_effdate, ls_post_params.
  68.  
  69. * ASSIGNMENTS
  70.       ls_assignments-profit_ctr = ls_bseg-prctr.
  71.       ls_assignments-costcenter = ls_bseg-prctr.
  72.  
  73.       ls_accounts-acrtype = '640100'. "ls_bseg-hkont+4(6).
  74.       ls_accounts-accrule = 'ALL'.
  75.       ls_accounts-per_start_accnt = ls_bseg-hkont.
  76.       APPEND ls_accounts TO lt_accounts.
  77.  
  78. * PARAMAS
  79.       ls_params-param_name = 'ZVBUND'.
  80.       ls_params-content = ''.
  81.       APPEND ls_params TO lt_params.
  82.  
  83.       ls_params-param_name = 'ZZCIT1'.
  84.       ls_params-content = '1'.
  85.       APPEND ls_params TO lt_params.
  86.  
  87. * POST_PARAMS
  88.       CLEAR ls_post_params.
  89.  
  90. * OBJECT
  91.       ls_object-bukrs = ls_bseg-bukrs.
  92. "      SHIFT ls_bseg-hkont LEFT DELETING LEADING '0'.
  93.       ls_object-acac_objtype = '640100'. "ls_bseg-hkont.
  94.  
  95.       CONCATENATE ls_bseg-belnr ls_bseg-gjahr ls_bseg-buzei INTO ls_object-acac_objnumber SEPARATED BY '/'.
  96.  
  97.       CLEAR ls_object-date_from.
  98.  
  99.       READ TABLE t_bkpf INTO ls_bkpf WITH KEY bukrs = ls_bseg-bukrs belnr = ls_bseg-belnr gjahr = ls_bseg-gjahr.
  100.       IF sy-subrc = 0.
  101.  
  102.         ls_object-text = ls_bkpf-xblnr.
  103.         ls_object_items-currency = ls_bkpf-hwaer.
  104.  
  105. * EFFDATE
  106.         ld_effdate = ls_bkpf-budat.
  107.  
  108.       ENDIF.
  109.  
  110.       ls_object-acac_resperson = sy-uname.
  111.  
  112.       ls_object-vality_from = ls_bseg-zzdtfr+6(4) && ls_bseg-zzdtfr+3(2) && ls_bseg-zzdtfr(2).
  113.       ls_object-vality_to = ls_bseg-zzdtto+6(4) && ls_bseg-zzdtto+3(2) && ls_bseg-zzdtto(2).
  114.  
  115. * OBJECT ITEM
  116. "      UNPACK ls_bseg-zzacac TO ls_object_items-acrtype.
  117.       SHIFT ls_bseg-hkont LEFT DELETING LEADING '0'.
  118.       ls_object_items-acrtype = ls_bseg-hkont.
  119.       ls_object_items-accrule = 'ALL'.
  120.       ls_object_items-amount = ls_bseg-dmbtr.
  121.       ls_object_items-quantity = 0.
  122.       CLEAR ls_object_items-unit.
  123.       ls_object_items-acrmethod = 'KOMFORT'.
  124.       CLEAR: ls_object_items-svality_from, ls_object_items-svality_to.
  125.       APPEND ls_object_items TO lt_object_items.
  126.  
  127.       CALL FUNCTION 'ZFIN_ACAC_OBJECT_MODIFY_EXT' IN UPDATE TASK
  128.         EXPORTING
  129.           is_assignments  = ls_assignments
  130.           it_accounts     = lt_accounts
  131.           it_params       = lt_params
  132.           id_effdate      = ld_effdate
  133.           is_post_params  = ls_post_params
  134.           id_testrun      = id_testrun
  135.           cs_object       = ls_object
  136.           ct_object_items = lt_object_items.
  137.  
  138. * URUCHOMIENIE BEZ UPDATE TASK
  139.  
  140. *  DATA: ed_data_created  TYPE  flag,
  141. *        ed_data_changed  TYPE  flag,
  142. *        et_docitems      TYPE  aceps_ace_doc_extended_t,
  143. *        et_return        TYPE  bapiret2_t,
  144. *        et_accdoc_return TYPE  ace_accdoc_return_t.
  145. *
  146. *      CALL FUNCTION 'ACAC_OBJECT_MODIFY_EXT'
  147. *        EXPORTING
  148. *          is_assignments   = ls_assignments
  149. *          it_accounts      = lt_accounts
  150. *          it_params        = lt_params
  151. *          id_effdate       = ld_effdate
  152. *          is_post_params   = ls_post_params
  153. *          id_testrun       = id_testrun
  154. *        IMPORTING
  155. *          ed_data_created  = ed_data_created
  156. *          ed_data_changed  = ed_data_changed
  157. *          et_docitems      = et_docitems
  158. *          et_return        = et_return
  159. *          et_accdoc_return = et_accdoc_return
  160. *        CHANGING
  161. *          cs_object        = ls_object
  162. *          ct_object_items  = lt_object_items.
  163.  
  164. "      BREAK pbednarski.
  165.  
  166.       COMMIT WORK.
  167.  
  168.     ENDIF.
  169.  
  170.   ENDLOOP.
  171.  
  172. ****************************************** Koniec Rozwiązanie dla tworzenia RMK Koniec ******************************************
  173.  
  174. ******************************************                  BKPF-ZZDOPE                ******************************************
  175.  
  176. "break pbednarski.
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183. ENDFUNCTION.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top