In the latest HANA READINESS checks, we seem to no longer be allowed to write the simple
SELECT * FROM BSEG WHERE BUKRS = BUKRS and BELNR = BELNR and GJAHR = GJAHR.
OSS note 2431747
This is extremely frustrating since I see absolutely no changes in standard SAP code which still uses this everywhere.
The OSS note offers no simple hints as to how to pass the checks.
After many iterations, I took a stab at using the CDS view and basically reverse naming the columns for my internal references.
Surely, there is a better/simpler way here. I've read that ACDOCA-NETDT serves this purpose, but that field is blank in our system.
Thanks for any suggestions you might have.
SELECT
duecalculationbasedate AS zfbdt,
paymentterms AS zterm,
cashdiscount1days AS zbd1t,
cashdiscount2days AS zbd2t,
netpaymentdays AS zbd3t,
invoicereference AS rebzg,
invoicereferencefiscalyear AS rebzj,
invoiceitemreference AS rebzz,
followondocumenttype AS rebzt,
debitcreditcode AS shkzg,
clearingaccountingdocument AS augbl,
postingkey AS bschl,
financialaccounttype AS koart
FROM i_operationalacctgdocitem
INTO TABLE @DATA(bseg_tab)
WHERE companycode = @<acdoca>-rbukrs
AND accountingdocument = @<acdoca>-belnr
AND fiscalyear = @<acdoca>-gjahr
AND financialaccounttype = 'D'
ORDER BY accountingdocumentitem ASCENDING.
IF sy-subrc NE 0.
RETURN.
ENDIF.
READ TABLE bseg_tab INTO DATA(bseg) INDEX 1.
IF bseg-shkzg = 'H'. "Credit Memo
header-due_date = '!'. "don't display
ELSE.
CALL FUNCTION 'NET_DUE_DATE_GET'
EXPORTING
i_zfbdt = bseg-zfbdt
i_zbd1t = bseg-zbd1t
i_zbd2t = bseg-zbd2t
i_zbd3t = bseg-zbd3t
i_shkzg = bseg-shkzg
i_rebzg = bseg-rebzg
i_koart = bseg-koart
IMPORTING
e_faedt = header-due_date.
ENDIF.