Skip to Content
author's profile photo Former Member
Former Member

calculate the balance

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 06:24 AM

    check this bapi may be helpful for you....

    BAPI_AP_ACC_GETSTATEMENT

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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...

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 06: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 06: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>.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.