2012 May 30 7:15 AM
Hello experts,
I have developed a Vendor Aging report for open items and calculation of due date and credit days. It is working fine
except one problem. In fbl1n, if we input any date in open items at key date, then the output shows the open items and also
the items with clearing date and clearing document number if the key date is less than the clearing date. But i am unable
to show the items with clearing date and clearing document number if the key date is less than the clearing date in my
report.
My Code Snippet is :
SELECT BUKRS LIFNR UMSKZ BUDAT BLDAT BLART BSCHL XBLNR DMBTR AUGDT AUGBL BELNR BUZEI SHKZG REBZG REBZZ GJAHR GSBER ZTERM
ZBD1T ZBD2T ZBD3T ZFBDT FROM BSIK
INTO CORRESPONDING FIELDS OF TABLE IT_BSIK
FOR ALL ENTRIES IN IT_LFB1
WHERE BUKRS in CO_CODE
AND UMSKZ in GL_IND
and SHKZG = 'H'
AND GSBER in BUS_AREA
AND BLDAT LE K_DATE
AND LIFNR = IT_LFB1-LIFNR.
ENDIF.
IF SY-SUBRC = 0.
SELECT BUKRS LIFNR UMSKZ BUDAT BLDAT BLART BSCHL XBLNR DMBTR AUGDT AUGBL BELNR BUZEI SHKZG REBZG REBZZ GJAHR GSBER ZTERM
ZBD1T ZBD2T ZBD3T ZFBDT FROM BSAK
INTO CORRESPONDING FIELDS OF TABLE IT_BSAK
FOR ALL ENTRIES IN IT_LFB1
WHERE LIFNR = IT_LFB1-LIFNR
AND AUGDT GE K_DATE.
ENDIF.
LOOP AT IT_BSIK INTO WA_BSIK.
MOVE-CORRESPONDING WA_BSIK TO WA_FINAL.
READ TABLE IT_BSAK INTO WA_BSAK WITH KEY BUKRS = WA_FINAL-BUKRS
LIFNR = WA_FINAL-LIFNR.
IF SY-SUBRC = 0.
MOVE WA_BSAK-AUGDT TO WA_FINAL-AUGDT.
ENDIF.
APPEND WA_FINAL TO IT_FINAL.
ENDLOOP.
Can you suggest any changes in the coding?
Thanks and regards,
Satvik
2012 May 30 7:30 AM
Hi, use the function module "BAPI_AP_ACC_GETOPENITEMS".
This may serve your purpose.
2012 May 30 7:30 AM
Hi, use the function module "BAPI_AP_ACC_GETOPENITEMS".
This may serve your purpose.