on ‎2024 Mar 14 1:34 PM
We are using BAdI SD_BIL_DATA_TRANSFER to calculate a value for a custom field with data from a work package.
This is causing the billing document to not properly determine billing date (field is empty) and also the sales tax determination in the pricing procedure is not executed correctly (getting a 208 error)
I can add the billing date manually and when re-pricing the document, it determines sales tax correctly.
Any idea what causes this behaviour?
This is the code for the custom logic:
SELECT
SINGLE wbselementinternalid
FROM i_projectbillingelemententry AS ent
INNER JOIN i_projectbillingelemententrflw AS flw
ON flw~projbillgelmntentritmuuid = ent~projbillgelmntentritmuuid
WHERE flw~projectbillingrequest = @bil_doc_item-referencesddocument
AND flw~billingdocrequestitemreference = @bil_doc_item-referencesddocumentitem
INTO @DATA(lv_wbs) PRIVILEGED ACCESS.
SELECT
SINGLE yy1_monthlymax_cpd, yy1_quarterlymax_cpd, yy1_annualmax_cpd
FROM i_workpackage AS fnl
INNER JOIN i_wbselementbasicdata AS wbs
ON fnl~workpackage = wbs~wbselement
WHERE wbs~wbselementinternalid = @lv_wbs
INTO @DATA(ls_thresholds) PRIVILEGED ACCESS.
IF sy-subrc = 0.
IF bil_doc_item-billingquantity < ls_thresholds-yy1_monthlymax_cpd.
bil_doc_item_res-YY1_TOBEBILLED_QTY_BDI = '0'.
ELSE.
bil_doc_item_res-YY1_TOBEBILLED_QTY_BDI = bil_doc_item-billingquantity - ls_thresholds-yy1_monthlymax_cpd.
ENDIF.
bil_doc_item_res-YY1_TOBEBILLED_QTY_BDIU = bil_doc_item-BASEUNIT.
ENDIF.SELECT
SINGLE wbselementinternalid
FROM i_projectbillingelemententry AS ent
INNER JOIN i_projectbillingelemententrflw AS flw
ON flw~projbillgelmntentritmuuid = ent~projbillgelmntentritmuuid
WHERE flw~projectbillingrequest = @bil_doc_item-referencesddocument
AND flw~billingdocrequestitemreference = @bil_doc_item-referencesddocumentitem
INTO @DATA(lv_wbs) PRIVILEGED ACCESS.
SELECT
SINGLE yy1_monthlymax_cpd, yy1_quarterlymax_cpd, yy1_annualmax_cpd
FROM i_workpackage AS fnl
INNER JOIN i_wbselementbasicdata AS wbs
ON fnl~workpackage = wbs~wbselement
WHERE wbs~wbselementinternalid = @lv_wbs
INTO @DATA(ls_thresholds) PRIVILEGED ACCESS.
IF sy-subrc = 0.
IF bil_doc_item-billingquantity < ls_thresholds-yy1_monthlymax_cpd.
bil_doc_item_res-YY1_TOBEBILLED_QTY_BDI = '0'.
ELSE.
bil_doc_item_res-YY1_TOBEBILLED_QTY_BDI = bil_doc_item-billingquantity - ls_thresholds-yy1_monthlymax_cpd.
ENDIF.
bil_doc_item_res-YY1_TOBEBILLED_QTY_BDIU = bil_doc_item-BASEUNIT.
ENDIF.
Request clarification before answering.
| User | Count |
|---|---|
| 36 | |
| 26 | |
| 20 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.