hello everyone
once again i need ur help guys.
in the vendor ageing report i am getting data for only one document type and not of other.
ex- see i have two documents type-
1.KD 2. EJ
so i am getting data for document type KD only.
so how to get the data of document type EJ along with KD.
below is my code .
so tell what modifications i have to made .
&----
*& Report Z_VENDOR AGEING *
*& *
&----
*& in this repoet I am calculating the vendor ageing
which is depending on formula
AGEING = Current Date(or any date entered by user) Bline Date(BSIK-ZFBDT) *
*& *
&----
REPORT z_vendor NO STANDARD PAGE HEADING
LINE-SIZE 200
LINE-COUNT 65(3).
TABLES : bsik.
DATA : BEGIN OF t_out OCCURS 0,
bukrs LIKE bsik-bukrs,
saknr LIKE bsik-saknr,
bldat LIKE bsik-bldat,
wrbtr LIKE bsik-wrbtr,
lifnr LIKE bsik-lifnr,
zfbdt like bsik-zfbdt,
zbd1t like bsik-zbd1t,
ageing type i,
END OF t_out.
parameters : p_date1 type d.
SELECT-OPTIONS : s_bukrs FOR bsik-bukrs,
s_saknr FOR bsik-saknr,
s_lifnr FOR bsik-lifnr.
SELECT bukrs saknr bldat wrbtr lifnr zfbdt zbd1t
FROM bsik
INTO TABLE t_out
WHERE saknr IN s_saknr
AND bukrs IN s_bukrs
AND lifnr IN s_lifnr.
Loop at t_out.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = p_date1
i_datum_von = t_out-zfbdt
I_KZ_EXCL_VON = '0'
I_KZ_INCL_BIS = '0'
I_KZ_ULT_BIS = ' '
I_KZ_ULT_VON = ' '
I_STGMETH = '0'
I_SZBMETH = '1'
IMPORTING
E_TAGE = t_out-ageing
EXCEPTIONS
DAYS_METHOD_NOT_DEFINED = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Modify t_out.
Clear t_out.
Endloop.
LOOP AT T_OUT.
IF T_OUT-SHKZG = H.
T_OUT-WRBTR = T_OUT-WRBTR * -1.
T_OUT-WRBTR = T_OUT-DMBTR * -1.
ENDIF.
DATA: TOTAL(16) TYPE P DECIMALS 2.
TOTAL = TOTAL + T_OUT-DMBTR.
Endloop.
LOOP AT t_out.
WRITE : / t_out-saknr,
t_out-lifnr,
t_out-wrbtr,
t_out-zfbdt,
T_OUT-DMBTR,
t_out-ageing.
AT LAST.
WRITE:/ TOTAL.
CLEAR TOTAL.
ENDAT.
ENDLOOP.
Message was edited by: sanjeev singh