Hi gurus.
I am trying to do an datasource enhancement via cmode. The idea is: I have data in structure LS_GLPCW. I need a document number from BKPF where fields AWKEY starts with the same value as LS_GLPCW-REFDOCNR.
Code:
LOOP AT C_T_DATA INTO LS_GLPCW.
L_TABIX = SY-TABIX.
*******LS_GLPCW-REFDOCNR is 1352000016
CONCATENATE LS_GLPCW-REFDOCNR '%' INTO LV_AWKEY. – fills LV_AWKEY "1352000016%"
SELECT SINGLE BELNR FROM BKPF – sy-subrc = 4, nothing found, but there is an document with AWKEY 1352000016CSAH2013
INTO LV_BELNR
WHERE AWKEY EQ LV_AWKEY
AND BUKRS EQ LS_GLPCW-RBUKRS
AND GJAHR EQ LS_GLPCW-REFRYEAR.
.....
How to write it that way it should find this document?