Escolar Documentos
Profissional Documentos
Cultura Documentos
Left-Hand Column:
Report Source Code: ZPS_MASS_SETTLEMENT_RULE_BPC active version
Local System: R3Q
Request: R3DK951587 03/03/2015 ZDF0017
Text: DEV:C29238 Change for ZPS_MASS_SETTLEMENT_RULE_BPC
Right-Hand Column:
Report Source Code: ZPS_MASS_SETTLEMENT_RULE_BPC active version
Remote system: R3P
Request: R3DK942180 12/24/2012 YKY0005
Text: FICO:CRQ3502 ZMPC_SETTLE
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
------------------------
Contents Unchanged:
1 1
************************************************************************
2 2 * Title : Upload Settlement Rules for BPC
*
3 3 *
*
4 4 * Program : ZPS_MASS_SETTLEMENT_RULE_BPC
*
Differing Lines:
5 * Transaction : ZMPC_SETTLE
*
5 * Transaction : ZPS_BPC_SR
*
Contents Unchanged:
6 6 *
*
7 7 * Program Desc: This program
*
8 8 * 1. Uploads input file from application server.
*
... ... ...
49 49
*----------------------------------------------------------------------*
50 50 * 12/20/2012 | YKY0005 | Increase wait time CRQ 3502
*
51 51
*----------------------------------------------------------------------*
Contents Unchanged:
56 52 REPORT zps_mass_settlement_rule_bpc
57 53 LINE-SIZE 180
58 54 LINE-COUNT 65
... ... ...
72 68 * T Y P E S
*
73 69
*----------------------------------------------------------------------*
74 70 TYPES: BEGIN OF ty_in_file,
Differing Lines:
75 project(20), "project
76 spend_type(20), "Spend Type from BPC
77 artnr(18), "product "R3DK951587
78 customer(10), "customer "R3DK951587
79 country(20), "country
80 amount(40), "amount
71 project(20), "project
72 spend_type(20), "Spend Type from BPC
73 promo_grp(20), "product hierarchy/Promogroup
74 cust_grp(20), "customer group
75 country(20), "country
76 amount(40), "amount
Contents Unchanged:
109 77 END OF ty_in_file.
110 78
111 79 TYPES: BEGIN OF ty_srule,
Differing Lines:
112 pspid TYPE proj-pspid, "project
113 posid TYPE prps-posid, "WBS element
114 artnr TYPE ce41000-artnr, "product
115 customer TYPE ce41000-kndnr, "customer
116 country TYPE ce41000-land1, "country
80 pspid TYPE proj-pspid, "project
81 posid TYPE prps-posid, "WBS element
82 cust_grp TYPE ce41000-kdgrp, "customer group
83 promo_grp TYPE ce41000-paph5, "product hierarchy
84 country TYPE ce41000-land1, "country
Contents Unchanged:
118 85 * Begin of change for CTS: R3DK928679
119 86 * Changed the type from n to p with decimals
120 87 * per(3) TYPE n, "Settlement
percentage
Differing Lines:
121 per TYPE cobrb-prozs,
88 per TYPE cobrb-prozs,
Contents Unchanged:
122 89 * End of change for CTS: R3DK928679
Differing Lines:
123 spend_type(20) TYPE c, "Spend Type from BPC
124 amount TYPE cobrb-bmeng, "quantity
125 tot_amt TYPE cobrb-bmeng, "total WBS quantity
126 nlag_mat TYPE mara-matnr, "NLAG material
127 prctr TYPE marc-prctr, "profit center
90 spend_type(20) TYPE c, "Spend Type from BPC
91 amount TYPE cobrb-bmeng, "quantity
92 tot_amt TYPE cobrb-bmeng, "total WBS quantity
93 nlag_mat TYPE mara-matnr, "NLAG material
94 prctr TYPE marc-prctr, "profit center
Contents Unchanged:
158 95 END OF ty_srule.
159 96
Contents Unchanged:
160 105
161 106
162 107
*----------------------------------------------------------------------*
... ... ...
165 110 DATA: t_in_data TYPE STANDARD TABLE OF ty_in_file WITH HEADER
LINE.
166 111 DATA: t_srule TYPE STANDARD TABLE OF ty_srule WITH HEADER LINE.
167 112 DATA: t_unique_wbs TYPE STANDARD TABLE OF ty_srule WITH HEADER
LINE.
Contents Unchanged:
168 115 DATA: t_cobra TYPE STANDARD TABLE OF cobra WITH HEADER LINE,
169 116 t_cobrb TYPE STANDARD TABLE OF cobrb WITH HEADER LINE.
Differing Lines:
181 pspnr TYPE prps-pspnr,
182 posid TYPE prps-posid,
183 objnr TYPE prps-objnr,
125 pspnr TYPE prps-pspnr,
126 posid TYPE prps-posid,
127 objnr TYPE prps-objnr,
Contents Unchanged:
184 128 END OF t_prps.
185 129
186 130 DATA: BEGIN OF t_marc OCCURS 0,
Differing Lines:
187 matnr TYPE marc-matnr,
188 prctr TYPE marc-prctr,
131 matnr TYPE marc-matnr,
132 prctr TYPE marc-prctr,
Contents Unchanged:
189 133 END OF t_marc.
190 134
191 135 DATA: current_fy TYPE t009b-bdatj, "current Fiscal year
... ... ...
194 138 startdt_fp TYPE t009b-poper. "start date Fiscal Period
195 139
196 140 DATA: error_flag TYPE c.
Differing Lines:
197 DATA: w_record_read TYPE i, "Total no.of records in the file
198 w_cnt_wbs_read TYPE i, "Total no.of unique WBS elements
199 w_cnt_wbs_failed TYPE i, "Total no.of unique WBS elements
failed
200 w_cnt_wbs_correct TYPE i, "Total no.of unique WBS elements
updated
201 w_records_correct TYPE i, "Total no.of records uploaded
202 w_records_failed TYPE i. "Total no.of records failed
141 DATA: w_record_read TYPE i,"Total no.of records in the file
142 w_cnt_wbs_read TYPE i,"Total no.of unique WBS elements
143 w_cnt_wbs_failed TYPE i,"Total no.of unique WBS elements
failed
144 w_cnt_wbs_correct TYPE i,"Total no.of unique WBS elements
updated
145 w_records_correct TYPE i,"Total no.of records uploaded
146 w_records_failed TYPE i."Total no.of records failed
Contents Unchanged:
203 147
204 148 DATA: c_lfilei1 LIKE filename-fileintern VALUE
205 149
'ZPS_F7069_SRULES_IN'.
... ... ...
208 152
*----------------------------------------------------------------------*
209 153 * C O N S T A N T S
*
210 154
*----------------------------------------------------------------------*
Differing Lines:
211 CONSTANTS : c_x TYPE c VALUE 'X',
212 c_00(2) VALUE '00'. "Message ID
155 CONSTANTS : c_x TYPE c VALUE 'X',
156 c_00(2) VALUE '00'. "Message ID
Contents Unchanged:
213 157
214 158
215 159
*----------------------------------------------------------------------*
... ... ...
227 171
*----------------------------------------------------------------------*
228 172 SELECTION-SCREEN BEGIN OF BLOCK info1 WITH FRAME TITLE text-t01.
229 173 SELECTION-SCREEN SKIP.
Differing Lines:
230 PARAMETERS: p_test AS CHECKBOX DEFAULT 'X', "test mode flag
174 PARAMETERS: p_test AS CHECKBOX DEFAULT 'X', "test mode flag
Contents Unchanged:
231 175 p_mode(1) TYPE c DEFAULT 'N'. "mode of execution
for BDC
232 176
233 177
... ... ...
264 208 START-OF-SELECTION.
265 209
*---------------------------------------------------------------------*
266 210 *- read Input file
Contents Unchanged:
268 211 PERFORM read_input_file.
269 212
270 213 CHECK error_flag IS INITIAL.
... ... ...
394 337
*----------------------------------------------------------------------*
395 338 FORM read_input_file.
396 339
Differing Lines:
397 DATA: wa_file_data(300) TYPE c.
340 DATA: wa_file_data(150) TYPE c.
Contents Unchanged:
398 341
399 342 REFRESH: t_in_data[].
400 343
... ... ...
408 351 IF sy-subrc EQ 0.
409 352 SPLIT wa_file_data AT '|' INTO t_in_data-project
410 353 t_in_data-spend_type
Differing Lines:
411 t_in_data-artnr
"R3DK951587
412 t_in_data-paph5
"R3DK951587
354 t_in_data-promo_grp
355 t_in_data-cust_grp
Contents Unchanged:
414 356 t_in_data-country
Differing Lines:
415 t_in_data-amount
357 t_in_data-amount.
Contents Unchanged:
455 358 APPEND t_in_data.
456 359 ELSE.
457 360 EXIT. "do
... ... ...
500 403 IMPORTING
501 404 output = t_srule-posid.
502 405
Differing Lines:
503 * CONCATENATE 'X' t_in_data-promo_grp INTO t_srule-nlag_mat.
"R3DK951587
406 CONCATENATE 'X' t_in_data-promo_grp INTO t_srule-nlag_mat.
Contents Unchanged:
505 407 APPEND t_srule.
506 408
507 409 ENDLOOP.
... ... ...
512 414 SORT t_unique_wbs BY posid.
513 415 DELETE ADJACENT DUPLICATES FROM t_unique_wbs COMPARING posid.
514 416
Differing Lines:
515 * total number of unique WBS elements in the input file
417 * total number of unique WBS emelemnts in the input file
Contents Unchanged:
516 418 DESCRIBE TABLE t_unique_wbs LINES w_cnt_wbs_read.
517 419
518 420
519 421 ENDFORM. " read_input_file
Contents Unchanged:
544 422
545 423
*&---------------------------------------------------------------------*
546 424 *& Form OBTAIN_WBS_PRPS
... ... ...
609 487 DATA: wbs_flag TYPE c.
610 488 DATA: wbs_objnr TYPE prps-objnr.
611 489 DATA: total_wbs_amount TYPE cobrb-betrr.
Differing Lines:
612 DATA: wa_err_msg TYPE string,
613 err_flag(1) TYPE c.
490 DATA: wa_err_msg TYPE string,
491 err_flag(1) TYPE c.
Contents Unchanged:
614 492 DATA: wa_tmp_rule_cnt TYPE i.
615 493
616 494 CLEAR: w_cnt_wbs_failed, w_cnt_wbs_correct,
... ... ...
747 625 USING p_posid
748 626 CHANGING p_err_flag p_err_message.
749 627 * Begin of change for CTS: R3DK928679
Differing Lines:
750 DATA lv_temp(132) TYPE c.
628 data lv_temp(132) TYPE c.
Contents Unchanged:
751 629 * End of change for CTS: R3DK928679
752 630 CLEAR: p_err_flag, p_err_message.
753 631 REFRESH t_bdcdata[].
... ... ...
766 644
767 645 PERFORM bdc_dynpro USING 'SAPLKOBS' '0100'.
768 646 PERFORM bdc_field USING 'BDC_OKCODE' '=COBL_XERGO'.
Differing Lines:
769 * Start of R3DK951587
647
Contents Unchanged:
770 648 PERFORM bdc_dynpro USING 'SAPLKEAK' '0300'.
Differing Lines:
771 PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
772
649 PERFORM bdc_field USING 'RKEAK-FIELD(15)' temp_srule-prctr.
"Profit center Eg.M0190.
650 PERFORM bdc_field USING 'BDC_OKCODE' '=P+'.
Contents Unchanged:
809 651
Contents Unchanged:
814 652 PERFORM bdc_dynpro USING 'SAPLKEAK' '0300'.
Contents Unchanged:
815 655
Contents Unchanged:
851 656 PERFORM bdc_dynpro USING 'SAPLKEAK' '0300'.
Differing Lines:
852
853 *
657 PERFORM bdc_field USING 'RKEAK-FIELD(01)' temp_srule-
promo_grp. "Prod Hier Eg.24AVA12R890001.
658 PERFORM bdc_field USING 'RKEAK-FIELD(02)' temp_srule-
country. "Country Eg.US.
Contents Unchanged:
867 659 PERFORM bdc_field USING 'BDC_OKCODE' '=WEIT'.
Contents Unchanged:
869 660
870 661 PERFORM bdc_dynpro USING 'SAPLKOBS' '0100'.
871 662 PERFORM bdc_field USING 'COBRB-PERBZ' 'FUL'.
Differing Lines:
956 DATA: wa_tmp_msg_cnt TYPE i,
746 DATA: wa_tmp_msg_cnt TYPE i,
Contents Unchanged:
957 747 wa_tmp_rule_cnt TYPE i.
958 748
959 749 DESCRIBE TABLE temp_srule LINES wa_tmp_rule_cnt.
... ... ...
1032 822 * if there are any unsettled rules - scenario 3
1033 823 DATA: wa_unstrule TYPE c.
1034 824
Differing Lines:
1035 DATA: wa_err_msg TYPE string,
1036 err_flag(1) TYPE c.
825 DATA: wa_err_msg TYPE string,
826 err_flag(1) TYPE c.
Contents Unchanged:
1037 827
1038 828 DATA: wa_tmp_rule_cnt TYPE i.
1039 829
... ... ...
1160 950 EXPORTING
1161 951 tabname = w_tabname
1162 952 varkey = w_varkey.
Differing Lines:
1163 CALL FUNCTION 'DEQUEUE_ALL'
1164 EXPORTING
1165 _synchron = ' '.
953 CALL FUNCTION 'DEQUEUE_ALL'
954 EXPORTING
955 _SYNCHRON = ' ' .
Contents Unchanged:
1166 956
1167 957
1168 958 ENDIF.
... ... ...
1179 969 FORM convert_amt_percent TABLES tmp_srule LIKE t_srule[]
1180 970 USING p_total_amount.
1181 971 * Begin of addition for CTS: R3DK928679
Differing Lines:
1182 DATA: lwa_srule TYPE ty_srule,
972 DATA: lwa_srule TYPE ty_srule,
Contents Unchanged:
1183 973 lv_per_total TYPE p DECIMALS 2,
1184 974 lv_per_difference TYPE p DECIMALS 2,
Differing Lines:
1185 "R3DK930985 lv_index TYPE n.
1186 lv_index TYPE i.
"R3DK930985
975 "R3DK930985 lv_index TYPE n.
976 lv_index TYPE i. "R3DK930985
Contents Unchanged:
1187 977
1188 978
1189 979 CONSTANTS: lc_100 TYPE p DECIMALS 2 VALUE '100.00'.
... ... ...
1204 994 ENDLOOP.
1205 995 * Begin of addition for CTS: R3DK928679
1206 996 * Adjusting percentage to 100.00
Differing Lines:
1207 IF lv_per_total <> lc_100.
1208 lv_per_difference = lc_100 - lv_per_total.
1209 READ TABLE tmp_srule INTO lwa_srule INDEX lv_index.
1210 lwa_srule-per = lwa_srule-per + lv_per_difference.
1211 MODIFY tmp_srule FROM lwa_srule INDEX lv_index TRANSPORTING
per.
1212 ENDIF.
997 if lv_per_total <> lc_100.
998 lv_per_difference = lc_100 - lv_per_total.
999 READ TABLE tmp_srule INTO lwa_srule INDEX lv_index.
1000 lwa_srule-per = lwa_srule-per + lv_per_difference.
1001 MODIFY tmp_srule FROM lwa_srule INDEX lv_index TRANSPORTING
per.
1002 endif.
Contents Unchanged:
1213 1003 * End of addition for CTS: R3DK928679
1214 1004
1215 1005 ENDFORM. " CONVERT_AMT_PERCENT
... ... ...
1311 1101
1312 1102 * if there are errors, write the error messages to output and
1313 1103 * adjust the failure counts
Differing Lines:
1314 DATA: wa_tmp_msg_cnt TYPE i,
1104 DATA: wa_tmp_msg_cnt TYPE i,
Contents Unchanged:
1315 1105 wa_tmp_rule_cnt TYPE i.
1316 1106
1317 1107 DESCRIBE TABLE t_srule LINES wa_tmp_rule_cnt.
... ... ...
1342 1132 CONCATENATE 'Error Message:' t_messtab-msgid t_messtab-msgnr
'-' p_err_message INTO p_err_message SEPARATED BY space.
1343 1133 ENDIF.
1344 1134
Differing Lines:
1345 COMMIT WORK AND WAIT. "R3DK933630 10/11/2011
1135 COMMIT WORK AND WAIT. "R3DK933630 10/11/2011
Contents Unchanged:
1346 1136
1347 1137 ENDFORM. " MODIFY_RULES
1348 1138
... ... ...
1379 1169
1380 1170
1381 1171 LOOP AT p_data.
Differing Lines:
1382 WRITE:/1(8) 'Project:' , 9(15) p_data-pspid
LEFT-JUSTIFIED,
1383 24(13) ', Spend Type:', 38(5) p_data-
spend_type LEFT-JUSTIFIED,
1384 43(17) ', Product:', 61(2) p_data-artnr
LEFT-JUSTIFIED, "R3DK951587
1385 63(13) ', Customer:', 77(15) p_data-customer
LEFT-JUSTIFIED, "R3DK951587
1386 89(10) ', Country:', 100(3) p_data-country
LEFT-JUSTIFIED,
1387 104(9) ', Amount:', 114(15) p_data-amount
LEFT-JUSTIFIED,
1388 129(8) ', % Cal:', 138(4) p_data-per
LEFT-JUSTIFIED.
1172 WRITE:/1(8) 'Project:' , 9(15) p_data-pspid LEFT-
JUSTIFIED,
1173 24(13) ', Spend Type:', 38(5) p_data-spend_type
LEFT-JUSTIFIED,
1174 43(17) ', Customer Group:', 61(2) p_data-cust_grp
LEFT-JUSTIFIED,
1175 63(13) ', Promogroup:', 77(15) p_data-promo_grp
LEFT-JUSTIFIED,
1176 89(10) ', Country:', 100(3) p_data-country
LEFT-JUSTIFIED,
1177 104(9) ', Amount:', 114(15) p_data-amount
LEFT-JUSTIFIED,
1178 129(8) ', % Cal:', 138(4) p_data-per LEFT-
JUSTIFIED.
Contents Unchanged:
1390 1179
1391 1180 ENDLOOP.
1392 1181
... ... ...
1496 1285
1497 1286
1498 1287 ENDFORM. " GET_START_DATE_FP_FY