背景:
要求根据PO单汇总金额填入表头金额分摊页签,同时拆分BSEG表和ACDOCA表
说明:两个增强点分别封装了冲销和过账函数,acdoca拆分通过memory传值
注意:凭证拆分时,ct_bseg和t_acdoca内表结构为第一行是总金额,中间行是采购订单行,最后一行是含税金额,因此拆分行涉及到行项目增多问题,新增拆分的行必须放原内表行最后;否则若系统有涉及EPIC银企直连时会影响EPIC_PROC中的付款建议
增强点: FACI --->只拆分bseg
1 FUNCTION zfi4_bseg_post_reverse. 2 *"---------------------------------------------------------------------- 3 *"*"本地接口: 4 *" IMPORTING 5 *" REFERENCE(I_BKPF) LIKE BKPF STRUCTURE BKPF OPTIONAL 6 *" TABLES 7 *" CT_BSEG STRUCTURE BSEG OPTIONAL 8 *" T_ACDOCA TYPE FINST_ACDOCA OPTIONAL 9 *"---------------------------------------------------------------------- 10 DATA:ls_tmp TYPE bseg, 11 lv_index TYPE sy-index. 12 DATA:lt_bseg_tmp TYPE TABLE OF bseg. 13 DATA:lv_paranam TYPE zeparanam, 14 lv_paraval TYPE zeparaval, 15 lv_nomatch TYPE c, 16 lt_ftaxp TYPE TABLE OF ftaxp, 17 ls_ftaxp TYPE ftaxp, 18 lv_wrbtr TYPE bseg-wrbtr, 19 lv_dmbtr TYPE bseg-wrbtr, 20 lv_dmbe2 TYPE bseg-wrbtr, 21 lv_dmbe3 TYPE bseg-wrbtr. 22 DATA:BEGIN OF ls_acdoca_reverse, 23 ebeln TYPE bseg-ebeln, 24 docln TYPE acdoca-docln, 25 buzei TYPE acdoca-buzei, 26 tsl TYPE acdoca-tsl, 27 wsl TYPE acdoca-wsl, 28 hsl TYPE acdoca-hsl, 29 ksl TYPE acdoca-ksl, 30 osl TYPE acdoca-osl, 31 END OF ls_acdoca_reverse, 32 lt_acdoca_reverse LIKE STANDARD TABLE OF ls_acdoca_reverse. 33 "BSEG拆分 34 IF ct_bseg[] IS NOT INITIAL. 35 * "获取发票金额行信息 36 READ TABLE ct_bseg[] ASSIGNING FIELD-SYMBOL(<fs_tmp>) WITH KEY koart = 'K'. 37 IF sy-subrc = 0 AND <fs_tmp>-ebeln IS INITIAL. 38 MOVE-CORRESPONDING <fs_tmp> TO ls_tmp. 39 40 DATA(lv_bukrs) = ls_tmp-bukrs. 41 "校验 42 CONCATENATE 'MIRO_AMOUNT_SPLIT:' lv_bukrs 43 INTO lv_paranam. 44 CALL FUNCTION 'Z_BC0_GET_PARA_VALUE' 45 EXPORTING 46 i_paranam = lv_paranam 47 IMPORTING 48 e_paraval = lv_paraval 49 e_nomatch = lv_nomatch. 50 IF lv_paraval = 'X'. 51 "取原凭证金额数据 52 DATA(lv_awkey) = i_bkpf-awref_rev && i_bkpf-aworg_rev. 53 54 SELECT b~ebeln,b~dmbtr,b~wrbtr,b~pswbt,b~skfbt,b~dmbe2,b~dmbe3,b~zterm 55 INTO TABLE @DATA(lt_bseg_old) 56 FROM bkpf AS a 57 INNER JOIN bseg AS b ON a~bukrs = b~bukrs AND a~belnr = b~belnr AND a~gjahr = b~gjahr 58 WHERE a~awkey = @lv_awkey 59 AND a~bukrs = @i_bkpf-bukrs 60 AND b~koart = 'K'. 61 SORT lt_bseg_old BY ebeln. 62 63 64 DESCRIBE TABLE ct_bseg[] LINES DATA(lv_count)."后续计算行项目号 65 "删除原有需要拆分行的行项目 66 DELETE ct_bseg[] WHERE koart = 'K'. 67 lt_bseg_tmp = ct_bseg[]. 68 * DELETE lt_bseg_tmp WHERE buzid NE 'W'."只保留采购订单行 69 DELETE lt_bseg_tmp WHERE ebeln IS INITIAL."只保留采购订单行 70 * "更改原有行项目号 上述删除一条数据导致行项目号改变 71 * LOOP AT ct_bseg[] ASSIGNING FIELD-SYMBOL(<fs_ct_bseg>). 72 * IF <fs_ct_bseg>-buzei > 1. 73 * <fs_ct_bseg>-buzei = <fs_ct_bseg>-buzei - 1. 74 * ENDIF. 75 * ENDLOOP. 76 * DESCRIBE TABLE lt_bseg_tmp[] LINES DATA(lv_lines)."用于计算拆分的条数 77 LOOP AT lt_bseg_tmp ASSIGNING FIELD-SYMBOL(<fs_bseg>). 78 DATA(lv_tabix) = sy-tabix. 79 READ TABLE lt_bseg_old INTO DATA(ls_bseg_old) WITH KEY ebeln = <fs_bseg>-ebeln. 80 IF sy-subrc = 0. 81 "拆分新增数据 82 "第一条数据 行项目号依然为1 后续拆分行的行项目号根据原内表行号自增1 83 *&---- 原因为拆分前内表结构是第一行为总金额koart= K,中间行为采购订单行koart=W,最后一行为含税金额,因此拆分后的多条数据要把其中一条放第一行,剩余行放含税金额行的后面 84 *&---- 行项目不这样改动会后续影响epic_proc的付款建议 85 IF lv_tabix = 1. 86 ls_tmp-buzei = 1. 87 ELSE. 88 ls_tmp-buzei = lv_count + lv_tabix - 1. 89 ENDIF. 90 ls_tmp-ebeln = <fs_bseg>-ebeln. 91 ls_tmp-wrbtr = ls_bseg_old-wrbtr . 92 93 ls_tmp-pswbt = ls_tmp-wrbtr. 94 ls_tmp-skfbt = ls_tmp-wrbtr. 95 96 ls_tmp-dmbtr = ls_bseg_old-dmbtr . 97 ls_tmp-dmbe2 = ls_bseg_old-dmbe2 . 98 ls_tmp-dmbe3 = ls_bseg_old-dmbe3 . 99 "条件码 100 SELECT SINGLE zterm INTO ls_tmp-zterm FROM ekko WHERE ebeln = <fs_bseg>-ebeln. 101 APPEND ls_tmp TO ct_bseg[]. 102 103 "记录数据,冲销使用 104 ls_acdoca_reverse-ebeln = ls_tmp-ebeln. 105 ls_acdoca_reverse-buzei = ls_tmp-buzei. 106 107 ls_acdoca_reverse-docln = ls_tmp-buzei. 108 CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' 109 EXPORTING 110 input = ls_acdoca_reverse-docln 111 IMPORTING 112 output = ls_acdoca_reverse-docln. 113 * ls_acdoca_add-docln = | { ls_acdoca_add-docln ALPHA = IN } | . 114 115 ls_acdoca_reverse-tsl = ls_tmp-pswbt. 116 ls_acdoca_reverse-wsl = ls_tmp-wrbtr. 117 ls_acdoca_reverse-hsl = ls_tmp-dmbtr. 118 ls_acdoca_reverse-ksl = ls_tmp-dmbtr. 119 ls_acdoca_reverse-osl = ls_tmp-dmbe2. 120 APPEND ls_acdoca_reverse TO lt_acdoca_reverse. 121 CLEAR:ls_acdoca_reverse. 122 ENDIF. 123 ENDLOOP. 124 FREE MEMORY ID 'MIRO_REVERSE_ID'. 125 EXPORT lt_acdoca_reverse TO MEMORY ID 'MIRO_REVERSE_ID'. 126 SORT ct_bseg[] BY buzei. 127 ENDIF. 128 ENDIF. 129 ENDIF. 130 "ACDOCA拆分 131 IF t_acdoca[] IS NOT INITIAL. 132 "删除需拆分抬头数据的行 133 DATA:ls_acdoca_split TYPE acdoca, 134 lv_docln TYPE i. 135 READ TABLE t_acdoca[] INTO DATA(ls_acdoca) WITH KEY koart = 'K'. 136 IF sy-subrc = 0. 137 DATA(lv_rbukrs) = ls_acdoca-rbukrs. 138 CONCATENATE 'MIRO_AMOUNT_SPLIT:' lv_rbukrs 139 INTO lv_paranam. 140 CALL FUNCTION 'Z_BC0_GET_PARA_VALUE' 141 EXPORTING 142 i_paranam = lv_paranam 143 IMPORTING 144 e_paraval = lv_paraval 145 e_nomatch = lv_nomatch. 146 IF lv_paraval = 'X'. 147 148 IMPORT lt_acdoca_reverse FROM MEMORY ID 'MIRO_REVERSE_ID'. 149 FREE MEMORY ID 'MIRO_REVERSE_ID'. 150 151 MOVE-CORRESPONDING ls_acdoca TO ls_acdoca_split."需拆分的数据行 将拆分行的数据赋值到临时工作区 152 DELETE t_acdoca[] WHERE koart = 'K'. 153 * "更改原有行项目号 --上一步删除了一条抬头金额的数据行 154 * LOOP AT t_acdoca ASSIGNING FIELD-SYMBOL(<fs_acdoca>). 155 * IF <fs_acdoca>-buzei > 1. 156 * CLEAR lv_docln. 157 * lv_docln = <fs_acdoca>-buzei. 158 * <fs_acdoca>-buzei = lv_docln - 1. 159 ** <fs_acdoca>-buzei = | { <fs_acdoca>-buzei ALPHA = IN } | . 160 * <fs_acdoca>-docln = <fs_acdoca>-buzei. 161 * CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' 162 * EXPORTING 163 * input = <fs_acdoca>-docln 164 * IMPORTING 165 * output = <fs_acdoca>-docln. 166 ** <fs_acdoca>-docln = | { <fs_acdoca>-docln ALPHA = IN } | . 167 * ENDIF. 168 * ENDLOOP. 169 "处理拆分行 170 LOOP AT lt_acdoca_reverse INTO ls_acdoca_reverse. 171 ls_acdoca_split-ebeln = ls_acdoca_reverse-ebeln. 172 ls_acdoca_split-buzei = ls_acdoca_reverse-buzei. 173 ls_acdoca_split-docln = ls_acdoca_reverse-docln. 174 ls_acdoca_split-tsl = ls_acdoca_reverse-tsl. 175 ls_acdoca_split-wsl = ls_acdoca_reverse-wsl. 176 ls_acdoca_split-hsl = ls_acdoca_reverse-hsl. 177 ls_acdoca_split-ksl = ls_acdoca_reverse-ksl. 178 ls_acdoca_split-osl = ls_acdoca_reverse-osl. 179 APPEND ls_acdoca_split TO t_acdoca[]. 180 ENDLOOP. 181 SORT t_acdoca[] BY docln buzei. 182 ENDIF. 183 ENDIF. 184 185 ENDIF. 186 ENDFUNCTION.bseg拆分 冲销逻辑
1 FUNCTION zfi4_bseg_post_change. 2 *"---------------------------------------------------------------------- 3 *"*"本地接口: 4 *" TABLES 5 *" CT_BSEG STRUCTURE BSEG OPTIONAL 6 *" T_ACDOCA TYPE FINST_ACDOCA OPTIONAL 7 *"---------------------------------------------------------------------- 8 DATA:ls_tmp TYPE bseg, 9 lv_index TYPE sy-index. 10 DATA:lt_bseg_tmp TYPE TABLE OF bseg. 11 DATA:lv_paranam TYPE zeparanam, 12 lv_paraval TYPE zeparaval, 13 lv_nomatch TYPE c, 14 lt_ftaxp TYPE TABLE OF ftaxp, 15 ls_ftaxp TYPE ftaxp, 16 lv_wrbtr TYPE bseg-wrbtr, 17 lv_dmbtr TYPE bseg-wrbtr, 18 lv_dmbe2 TYPE bseg-wrbtr, 19 lv_dmbe3 TYPE bseg-wrbtr. 20 DATA:BEGIN OF ls_acdoca_add, 21 ebeln TYPE bseg-ebeln, 22 docln TYPE acdoca-docln, 23 buzei TYPE acdoca-buzei, 24 tsl TYPE acdoca-tsl, 25 wsl TYPE acdoca-wsl, 26 hsl TYPE acdoca-hsl, 27 ksl TYPE acdoca-ksl, 28 osl TYPE acdoca-osl, 29 END OF ls_acdoca_add, 30 lt_acdoca_add LIKE STANDARD TABLE OF ls_acdoca_add. 31 DATA:lv_num TYPE c LENGTH 6. 32 33 IF ct_bseg[] IS NOT INITIAL. 34 CLEAR:lt_acdoca_add,ls_acdoca_add. 35 "获取发票金额行信息 36 **内表数据第一条为基本信息页签中总金额,内表最后一条数据为基本信息页签中的税额,中间数据为采购订单行项目相关信息 37 **此处增强需要根据第一条总金额计算拆分各金额字段,新增拆分的条数根据内表中间采购订单行条目数 38 READ TABLE ct_bseg[] ASSIGNING FIELD-SYMBOL(<fs_tmp>) WITH KEY koart = 'K'. 39 IF sy-subrc = 0 AND <fs_tmp>-ebeln IS INITIAL. 40 MOVE-CORRESPONDING <fs_tmp> TO ls_tmp. 41 DATA(lv_sum_wrbtr) = ls_tmp-wrbtr."需要拆分的总金额 42 DATA(lv_sum_dmbtr) = ls_tmp-dmbtr."需要拆分的总金额 43 DATA(lv_sum_dmbe2) = ls_tmp-dmbe2."需要拆分的总金额 44 DATA(lv_sum_dmbe3) = ls_tmp-dmbe3."需要拆分的总金额 45 46 DATA(lv_bukrs) = <fs_tmp>-bukrs. 47 CONCATENATE 'MIRO_AMOUNT_SPLIT:' lv_bukrs 48 INTO lv_paranam. 49 CALL FUNCTION 'Z_BC0_GET_PARA_VALUE' 50 EXPORTING 51 i_paranam = lv_paranam 52 IMPORTING 53 e_paraval = lv_paraval 54 e_nomatch = lv_nomatch. 55 IF lv_paraval = 'X'. 56 "删除原有需要拆分行的行项目 57 DESCRIBE TABLE ct_bseg[] LINES DATA(lv_count)."用于计算拆分数据的行项目号 58 DELETE ct_bseg[] WHERE koart = 'K'. 59 lt_bseg_tmp = ct_bseg[]. 60 * DELETE lt_bseg_tmp WHERE buzid NE 'W'."只保留采购订单行 61 DELETE lt_bseg_tmp WHERE ebeln IS INITIAL."只保留采购订单行 62 * "更改原有行项目号 上述删除一条数据导致行项目号改变 63 * LOOP AT ct_bseg[] ASSIGNING FIELD-SYMBOL(<fs_ct_bseg>). 64 * IF <fs_ct_bseg>-buzei > 1. 65 * <fs_ct_bseg>-buzei = <fs_ct_bseg>-buzei - 1. 66 * ENDIF. 67 * ENDLOOP. 68 DESCRIBE TABLE lt_bseg_tmp LINES DATA(lv_lines)."用于判断循环到采购订单的最后一条时,计算金额 由于内表参考标准表,所以at end或at last不适用 69 70 CLEAR:lv_wrbtr,lv_dmbtr,lv_dmbe2,lv_dmbe3,lv_index. 71 LOOP AT lt_bseg_tmp ASSIGNING FIELD-SYMBOL(<fs_bseg>). 72 lv_index = sy-tabix. 73 * IF <fs_bseg>-buzid = 'W'."采购订单行项目数据 74 * lv_count = lv_count + 1. 75 "计算金额 76 DATA(lv_mwskz) = <fs_bseg>-mwskz."税码 77 DATA(lv_bukrs1) = <fs_bseg>-bukrs."公司代码 78 SELECT SINGLE land1 INTO @DATA(lv_land1) FROM t001 WHERE bukrs = @lv_bukrs1."地区 79 "税率 80 CALL FUNCTION 'GET_TAX_PERCENTAGE' 81 EXPORTING 82 aland = lv_land1 83 datab = '99991231' 84 mwskz = lv_mwskz 85 txjcd = '*' 86 * EXPORT = ' ' 87 TABLES 88 t_ftaxp = lt_ftaxp. 89 READ TABLE lt_ftaxp INTO ls_ftaxp INDEX 1. 90 IF sy-subrc = 0. 91 ls_tmp-wrbtr = ( ( ls_ftaxp-kbetr / 1000 ) + 1 ) * <fs_bseg>-wrbtr . 92 ENDIF. 93 "最后一条的拆分金额 = 拆分前总金额 - 前几条拆分金额汇总 ---考虑差异问题 最后一条拆分金额不用税率计算得出 94 IF lv_index = lv_lines . 95 ls_tmp-wrbtr = lv_sum_wrbtr - lv_wrbtr. 96 ENDIF. 97 lv_wrbtr = lv_wrbtr + ls_tmp-wrbtr. 98 "拆分新增数据 99 "第一行数据时 行项目号为1,剩余拆分行数据的行项目号为原内表行项目自增1 100 IF lv_index = 1. 101 ls_tmp-buzei = 1. 102 ELSE. 103 ls_tmp-buzei = lv_count + lv_index - 1. 104 ENDIF. 105 ls_tmp-ebeln = <fs_bseg>-ebeln. 106 107 ls_tmp-pswbt = ls_tmp-wrbtr. 108 ls_tmp-skfbt = ls_tmp-wrbtr. 109 110 CALL FUNCTION 'GET_TAX_PERCENTAGE' 111 EXPORTING 112 aland = lv_land1 113 datab = '99991231' 114 mwskz = lv_mwskz 115 txjcd = '*' 116 * EXPORT = ' ' 117 TABLES 118 t_ftaxp = lt_ftaxp. 119 READ TABLE lt_ftaxp INTO ls_ftaxp INDEX 1. 120 IF sy-subrc = 0. 121 ls_tmp-dmbtr = ( ( ls_ftaxp-kbetr / 1000 ) + 1 ) * <fs_bseg>-dmbtr . 122 ENDIF. 123 124 IF lv_index = lv_lines. 125 ls_tmp-dmbtr = lv_sum_dmbtr - lv_dmbtr. 126 ENDIF. 127 lv_dmbtr = lv_dmbtr + ls_tmp-dmbtr. 128 129 CALL FUNCTION 'GET_TAX_PERCENTAGE' 130 EXPORTING 131 aland = lv_land1 132 datab = '99991231' 133 mwskz = lv_mwskz 134 txjcd = '*' 135 * EXPORT = ' ' 136 TABLES 137 t_ftaxp = lt_ftaxp. 138 READ TABLE lt_ftaxp INTO ls_ftaxp INDEX 1. 139 IF sy-subrc = 0. 140 ls_tmp-dmbe2 = ( ( ls_ftaxp-kbetr / 1000 ) + 1 ) * <fs_bseg>-dmbe2 . 141 ENDIF. 142 IF lv_index = lv_lines. 143 ls_tmp-dmbe2 = lv_sum_dmbe2 - lv_dmbe2. 144 ENDIF. 145 lv_dmbe2 = lv_dmbe2 + ls_tmp-dmbe2. 146 147 CALL FUNCTION 'GET_TAX_PERCENTAGE' 148 EXPORTING 149 aland = lv_land1 150 datab = '99991231' 151 mwskz = lv_mwskz 152 txjcd = '*' 153 * EXPORT = ' ' 154 TABLES 155 t_ftaxp = lt_ftaxp. 156 READ TABLE lt_ftaxp INTO ls_ftaxp INDEX 1. 157 IF sy-subrc = 0. 158 ls_tmp-dmbe3 = ( ( ls_ftaxp-kbetr / 1000 ) + 1 ) * <fs_bseg>-dmbe3 . 159 ENDIF. 160 IF lv_index = lv_lines. 161 ls_tmp-dmbe3 = lv_sum_dmbe3 - lv_dmbe3. 162 ENDIF. 163 lv_dmbe3 = lv_dmbe3 + ls_tmp-dmbe3. 164 165 "条件码 166 SELECT SINGLE zterm INTO ls_tmp-zterm FROM ekko WHERE ebeln = <fs_bseg>-ebeln. 167 APPEND ls_tmp TO ct_bseg[]. 168 169 ls_acdoca_add-ebeln = ls_tmp-ebeln. 170 ls_acdoca_add-buzei = ls_tmp-buzei. 171 172 ls_acdoca_add-docln = ls_tmp-buzei. 173 CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' 174 EXPORTING 175 input = ls_acdoca_add-docln 176 IMPORTING 177 OUTPUT = ls_acdoca_add-docln . 178 * ls_acdoca_add-docln = | { ls_acdoca_add-docln ALPHA = IN } | .. 179 ls_acdoca_add-tsl = ls_tmp-pswbt. 180 ls_acdoca_add-wsl = ls_tmp-wrbtr. 181 ls_acdoca_add-hsl = ls_tmp-dmbtr. 182 ls_acdoca_add-ksl = ls_tmp-dmbtr. 183 ls_acdoca_add-osl = ls_tmp-dmbe2. 184 APPEND ls_acdoca_add TO lt_acdoca_add. 185 CLEAR:ls_acdoca_add. 186 * ENDIF. 187 ENDLOOP. 188 FREE MEMORY ID 'MIRO_POST_ID'. 189 EXPORT lt_acdoca_add TO MEMORY ID 'MIRO_POST_ID'. 190 SORT ct_bseg[] BY buzei. 191 ENDIF. 192 ENDIF. 193 ENDIF. 194 195 196 "凭证拆分 拆分acdoca 197 IF t_acdoca[] IS NOT INITIAL. 198 "删除需拆分抬头数据的行 199 DATA:ls_acdoca_split TYPE acdoca, 200 lv_docln TYPE i. 201 READ TABLE t_acdoca[] INTO DATA(ls_acdoca) WITH KEY koart = 'K'. 202 IF sy-subrc = 0. 203 DATA(lv_rbukrs) = ls_acdoca-rbukrs. 204 CONCATENATE 'MIRO_AMOUNT_SPLIT:' lv_rbukrs 205 INTO lv_paranam. 206 CALL FUNCTION 'Z_BC0_GET_PARA_VALUE' 207 EXPORTING 208 i_paranam = lv_paranam 209 IMPORTING 210 e_paraval = lv_paraval 211 e_nomatch = lv_nomatch. 212 IF lv_paraval = 'X'. 213 214 IMPORT lt_acdoca_add FROM MEMORY ID 'MIRO_POST_ID'. 215 FREE MEMORY ID 'MIRO_POST_ID'. 216 217 MOVE-CORRESPONDING ls_acdoca TO ls_acdoca_split."需拆分的数据行 218 DELETE t_acdoca[] WHERE koart = 'K'. 219 "更改原有行项目号 --上一步删除了一条抬头金额的数据行 220 * LOOP AT t_acdoca ASSIGNING FIELD-SYMBOL(<fs_acdoca>). 221 * IF <fs_acdoca>-buzei > 1. 222 * CLEAR lv_docln. 223 * lv_docln = <fs_acdoca>-buzei. 224 * <fs_acdoca>-buzei = lv_docln - 1. 225 ** <fs_acdoca>-buzei = | { <fs_acdoca>-buzei ALPHA = IN } | . 226 * <fs_acdoca>-docln = <fs_acdoca>-buzei. 227 * CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' 228 * EXPORTING 229 * input = <fs_acdoca>-docln 230 * IMPORTING 231 * OUTPUT = <fs_acdoca>-docln . 232 ** <fs_acdoca>-docln = | { <fs_acdoca>-docln ALPHA = IN } | . 233 * ENDIF. 234 * ENDLOOP. 235 "处理拆分行 236 LOOP AT lt_acdoca_add INTO ls_acdoca_add. 237 ls_acdoca_split-ebeln = ls_acdoca_add-ebeln. 238 ls_acdoca_split-buzei = ls_acdoca_add-buzei. 239 ls_acdoca_split-docln = ls_acdoca_add-docln. 240 ls_acdoca_split-tsl = ls_acdoca_add-tsl. 241 ls_acdoca_split-wsl = ls_acdoca_add-wsl. 242 ls_acdoca_split-hsl = ls_acdoca_add-hsl. 243 ls_acdoca_split-ksl = ls_acdoca_add-ksl. 244 * ls_acdoca_split-osl = ls_acdoca_add-osl. 245 IF ls_acdoca_split-drcrk = 'H'. 246 ls_acdoca_split-tsl = ls_acdoca_add-tsl * -1. 247 ls_acdoca_split-wsl = ls_acdoca_add-wsl * -1. 248 ls_acdoca_split-hsl = ls_acdoca_add-hsl * -1. 249 ls_acdoca_split-ksl = ls_acdoca_add-ksl * -1. 250 * ls_acdoca_split-osl = ls_acdoca_add-osl * -1. 251 ENDIF. 252 APPEND ls_acdoca_split TO t_acdoca[]. 253 ENDLOOP. 254 SORT t_acdoca[] BY docln buzei. 255 ENDIF. 256 ENDIF. 257 258 ENDIF. 259 ENDFUNCTION.bseg拆分过账
acdoca拆分增强点:CL_FINS_ACDOC_POSTING_EVENTS
标签:tmp,MIRO,bseg,lv,ABAP,ls,acdoca,SAP,TYPE From: https://www.cnblogs.com/coderfarmer/p/16940800.html