***************************************************************** * Mandatory step for all implementations: * Move the importing parameters to the changing parameters. MOVE-CORRESPONDING bil_doc TO bil_doc_res. MOVE-CORRESPONDING bil_doc_item TO bil_doc_item_res. MOVE-CORRESPONDING bil_doc_item_contr TO bil_doc_item_contr_res. ***************************************************************** DATA: l_ni_stock TYPE abap_bool VALUE abap_false, lr_ni TYPE RANGE OF regio. lr_ni = VALUE #( ( sign = 'I' option = 'EQ' low = 'ABC' ) ( sign = 'I' option = 'EQ' low = 'AND' ) ( sign = 'I' option = 'EQ' low = 'ANN' ) ( sign = 'I' option = 'EQ' low = 'BFS' ) ( sign = 'I' option = 'EQ' low = 'CCG' ) ( sign = 'I' option = 'EQ' low = 'DRS' ) ( sign = 'I' option = 'EQ' low = 'FMO' ) ( sign = 'I' option = 'EQ' low = 'LBC' ) ( sign = 'I' option = 'EQ' low = 'MEA' ) ( sign = 'I' option = 'EQ' low = 'MUL' ) ( sign = 'I' option = 'EQ' low = 'NMD' ) ). * Check if UK is involved in the business process IF bil_doc_item-departurecountry = 'GB' OR bil_doc-country = 'GB' OR bil_doc-taxdeparturecountry = 'GB' AND bil_doc_item-servicesrendereddate >= '20210101'. * Check if the plant is in Northern Irland NIP or GB Mainland (England or Scotland or Wales) * and service rendered date is after the BREXIT transition phase has ended and supply of goods IF bil_doc_item-plantregion IN lr_ni AND bil_doc_item-servicesrendereddate <= '20241231'. SELECT SINGLE producttaxclassification1 FROM i_salesdocumentitem WHERE salesdocument = @bil_doc_item-salesdocument AND salesdocumentitem = @bil_doc_item-salesdocumentitem INTO @DATA(l_producttaxclassification1). IF l_producttaxclassification1 CA '123'. l_ni_stock = abap_true. bil_doc_res-billingdoccombinationcriteria = 'NIS'. ENDIF. ENDIF. * Check if it isnĀ“t a supply of goods and if it is an EU triangual deal IF l_ni_stock = abap_false AND bil_doc-iseutriangulardeal = 'X'. billgdocitmrejectionreasontext = |Indicator Triangular Deal Within the EU is set BUT not allowed if GB is involved.|. billingdocumentitemisrejected = abap_true. EXIT. ENDIF. ENDIF.