01-07-2008 6:19 AM
hi
i need some information regarding how to calculate
the vendor balances,
i.e., from present date to last 15 monthhs vendor balace i need to calculate.
select options are lifnr and bukrs. table is LFC1.
can any one please help how to calculate its urgent.
thanks in advance.
01-07-2008 6:24 AM
check this bapi may be helpful for you....
BAPI_AP_ACC_GETSTATEMENT
01-07-2008 7:33 AM
to calculate vendor balances if i use the following function module please tell me how to pass the fields.
i am new to this ,please help me how to pass fileds.
CALL FUNCTION 'BAPI_AP_ACC_GETSTATEMENT'
EXPORTING
companycode =
vendor =
date_from =
date_to =
NOTEDITEMS = ' '
IMPORTING
RETURN =
tables
lineitems =
01-07-2008 7:44 AM
Hi,
FUNCTION ZSP_AP_ACC_GETSTAMT.
*"----
""Local interface:
*" IMPORTING
*" VALUE(COMPANYCODE) LIKE BAPI3008_1-COMP_CODE
*" VALUE(VENDOR) LIKE BAPI3008_1-VENDOR
*" VALUE(DATE_FROM) LIKE BAPI3008-FROM_DATE
*" VALUE(DATE_TO) LIKE BAPI3008-TO_DATE
*" VALUE(SPRAS) LIKE T008T-SPRAS
*" EXPORTING
*" VALUE(RETURN) LIKE BAPIRETURN STRUCTURE BAPIRETURN
*" TABLES
*" LINEITEMS STRUCTURE SUPP_BAPI3008_2
*"----
DATA: BEGIN OF XLINEITEMS OCCURS 10.
INCLUDE STRUCTURE BAPI3008_2.
DATA: END OF XLINEITEMS.
CALL FUNCTION 'BAPI_AP_ACC_GETSTATEMENT'
EXPORTING
COMPANYCODE = COMPANYCODE
VENDOR = VENDOR
DATE_FROM = DATE_FROM
DATE_TO = DATE_TO
IMPORTING
RETURN = RETURN
TABLES
LINEITEMS = XLINEITEMS.
add language specific information to all open items
Todo: replace select statements
LOOP AT XLINEITEMS.
CLEAR LINEITEMS.
MOVE-CORRESPONDING XLINEITEMS TO LINEITEMS.
IF NOT XLINEITEMS-REASON_CDE IS INITIAL.
SELECT TXT20 FROM T053S INTO LINEITEMS-RSTGRT WHERE
BUKRS = COMPANYCODE AND
RSTGR = XLINEITEMS-REASON_CDE AND
SPRAS = SPRAS.
ENDSELECT.
ENDIF.
IF NOT XLINEITEMS-PYMT_METH IS INITIAL.
SELECT TEXT1 FROM T042Z INTO LINEITEMS-ZLSCHLT WHERE
LAND1 = XLINEITEMS-COUNTRY AND
ZLSCH = XLINEITEMS-PYMT_METH.
ENDSELECT.
ENDIF.
SELECT TEXTL FROM T008T INTO LINEITEMS-ZAHLST WHERE
ZAHLS = XLINEITEMS-PMNT_BLOCK AND
SPRAS = SPRAS.
ENDSELECT.
IF NOT XLINEITEMS-POST_KEY IS INITIAL.
SELECT LTEXT FROM TBSLT INTO LINEITEMS-BSCHLT WHERE
BSCHL = XLINEITEMS-POST_KEY AND
UMSKZ = XLINEITEMS-SP_GL_IND AND
SPRAS = SPRAS.
ENDSELECT.
ENDIF.
APPEND LINEITEMS.
ENDLOOP.
ENDFUNCTION.
+++++++++++++++++++++++++++++++
Please change according to your reqt in the above fm.
Regds
Sivaparvathi
Please reward points if helpful...
01-07-2008 6:42 AM
Hai,
In your coding add the bello code :
DATA: gv_date TYPE sy-datum.
CALL FUNCTION 'CCM_GO_BACK_MONTHS'
EXPORTING
currdate = sy-datum
backmonths = 15
IMPORTING
newdate = gv_date.
And in your selection check the dates :
select ...... from ...
into ....
where ... <= sy-datum
and ... >= gv_date.
Regards,
Nagaraju.
01-07-2008 6:49 AM
Hi,
as u said 15 months is the fixed one or you given the date range?
if so, give the given input value into the mention table and retrieve the value.
additionally u give the date parameter in your selection range
Select * from LFC1 into table itab_lfc where <date>.