Function Module to determine due date in BI form Payment Terms

Hi to all,
Can any one tell me what is the Function Module to determine due date in BI, form ZTERM ( Payment Terms ).
I am working on Accounts Receivable (AR). and need to calculate Due date.
I shall be thankful to you for this.
Regards
Pavneet Rana

Thanks For reply,
I have to do aging for Receivables and report format is like that.
                1 - 10      11 - 30        31 - 60         61 - 90       > 90     Notoverdue   Overdue
North
East
south
West
According to client requirement in first 5 bucket i need to display Receivables according to aging
and for  Notoverdue   Overdue  bucket condition is like that.
if sy-datum - vbrk-fkdat  > 0NETDUEDATE then it is under Overdue bucket
if sy-datum - vbrk-fkdat  < 0NETDUEDATE then it is under notOverdue bucket
there i have created 2 DSO , one for sales which have North,East,south,West and vbrk-fkdat using 2LIS_13_VDHDR,2LIS_13_VDITM
and other  DSO which will have 0NETDUEDATE from 0FI_AR_4 .
for Notoverdue   Overdue how i will calculate aging at query level.
also is 0p_keydt is variable for 0CALDAY which will take user entery and should i applied offcet, to get firts 5 bucket Receivables data for aging.
i shall be thankful to you for this.
Regards
Pavneet Rana

Similar Messages

  • Function module to get due date by terms of payment

    Hi,
    Is there any function module which can give me the due date when I pass
    1) Terms of payment
    2) Baseline date
    Read the terms of payment and use the properties of the terms of payment ( Like Fixed date )  to get to the due date.
    Thanks in advance.,
    Raj

    Hi,
    I had the same problem, as J_1A_SD_CI_DUEDATE_GET does not work when FI document is not created yet.
    This is the way I used and it works:
        CALL FUNCTION 'FI_TERMS_OF_PAYMENT_PROPOSE'
          EXPORTING
            i_bldat               = sy-datum        "if baseline is filled, value here is ignored
            i_budat               = sy-datum
            i_cpudt               = sy-datum
            i_zfbdt               = vbdkr-zfbdt    "baseline due date
            i_zterm               = vbdkr-zterm   "payment terms
          IMPORTING
            e_zbd1t               = lv_zbd1t
            e_zbd2t               = lv_zbd2t
            e_zbd3t               = lv_zbd3t
            e_zfbdt               = lv_zfbdt
          EXCEPTIONS
            terms_not_found       = 1
            OTHERS                = 2.
        IF sy-subrc <> 0.
        ELSE.
          CALL FUNCTION 'J_1B_FI_NETDUE'
               EXPORTING
                    zfbdt   = lv_zfbdt
                    zbd1t   = lv_zbd1t
                    zbd2t   = lv_zbd2t
                    zbd3t   = lv_zbd3t
               IMPORTING
                    duedate = z_duedate.
        ENDIF.
    Hope it helps.
    Regards,
    Fernando

  • Function module to determine the date for the nth weekday of the mth month

    Hey folks,
    Is there a function module which determines the date for the mth weekday of the nth month in the pth year.
    For instance, if I input 2nd thursday of the 4th month in 2008, it should return me, 04/10/2008  (MM/DD/YYYY).
    Thanks and Best Regards,
    Puja.

    Hi Ravi,
    Hadn't been able to work on this lately...You solution was quite close, but did not work for a few scenarios....I tweaked the logic a bit to take care of them as well...
    So here goes the code:
    ================================================
      DATA first_day_of_month TYPE datum.
      DATA day TYPE p.
      CONCATENATE year month '01' INTO first_day_of_month.
      CALL FUNCTION 'DAY_IN_WEEK'
        EXPORTING
          datum = first_day_of_month
        IMPORTING
          wotnr = day.
      DATA day_number TYPE numc2.
      IF day = weekday.
        IF recur = 1.
          DATA ls_date(10) TYPE c.
          CONCATENATE month '/01/' year INTO ls_date.
          CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
            EXPORTING
              date_external                  = ls_date
           IMPORTING
             date_internal                  = date.
        ELSE.
          day_number =  ( ( recur - 1 ) * 7 )  + 1.
        ENDIF.
      ELSEIF day < weekday.
        day_number = ( ( recur - 1 ) * 7 ) + ( weekday - day ) + 1.
      ELSE.
        day_number = ( ( recur - 1 ) * 7 ) + ( 7 - day ) + weekday + 1.
      ENDIF.
      IF date IS INITIAL.
        CONCATENATE year month day_number INTO date.
      ENDIF.
    ====================================
    There still could be some loopholes in this....am not sure....but it sure did seem to work for a couple of random checks that I performed.
    Brownie points to you for giving me a direction.
    Thanks,
    Puja.

  • Function Module to Calculate Due Date from Payment Terms?

    I'm writing an aged debtor report as the SAP standard one isn't quite right for our requirements.  Is there a function module that will calculate the payment due date if I give it the payment terms and the base line date?
    I did a search in SE37 but couldn't see one which fitted my requirements (I was searching on CALCDUEDATE and variantions of).
    Any suggestions welcome, thanks.
    Gill

    Hi,
    Use the FM FI_TERMS_OF_PAYMENT_PROPOSE for calculating the Payment due date
    call function 'FI_TERMS_OF_PAYMENT_PROPOSE'
      exporting
        i_bldat         = gv_bldat
        i_budat         = gv_budat
        i_cpudt         = sy-datum
        i_zfbdt         = gv_zfbdt
        i_zterm         = gv_terms_paym
        i_bukrs         = gv_comp_code
      importing
        e_zbd1t         = gv_zbd1t
        e_zbd1p         = gv_zbd1p
        e_zbd2t         = gv_zbd2t
        e_zbd3t         = gv_zbd3t.
    Regards,
    Dwaraka.S

  • Function module to calculate due date of FI document

    Hi All
    I need a function module to calculate the due date of FI document considering BSId Zterm ( Payment terms ) Document date , Basline date .
    Regards,
    chitra

    call function 'FI_TERMS_OF_PAYMENT_PROPOSE'
      exporting
        i_bldat         = gv_bldat
        i_budat         = gv_budat
        i_cpudt         = sy-datum
        i_zfbdt         = gv_zfbdt
        i_zterm         = gv_terms_paym
        i_bukrs         = gv_comp_code
      importing
        e_zbd1t         = gv_zbd1t
        e_zbd2t         = gv_zbd2t
        e_zbd3t         = gv_zbd3t.
    faede-shkzg = 'H'.
      faede-koart = 'K'.
      faede-zfbdt = gv_zfbdt.
      faede-zbd1t = gv_zbd1t.
      faede-zbd2t = gv_zbd2t.
      faede-zbd3t = gv_zbd3t.
      faede-bldat = gv_bldat.
      call function 'DETERMINE_DUE_DATE'
        exporting
          i_faede = faede
        importing
          e_faede = faede.
    *    if sy-subrc eq 0.
      duedate = faede-netdt. <<<<<< ------

  • Function module  to determine the credit balance or if there is an open ite

    Hi All ,
    Can anyone please let me is there any function module  to determine the credit balance orr if there is an open standing request / open standing request /paid but not yet refunded security deposit .
    Requirement :
    Purpose -This report shows a list of u201Cinactiveu201D contract accounts and the amounts to be refunded (credit balance, paid security deposit) to customers.  This report also shows any open standing requests in customersu2019 contract accounts.
    Note:  SAP does not have a concept of u201Cinactiveu201D contract accounts.  All contract accounts are active in SAP.   
    We do have customers who pay several months in advance (when they are out of town and donu2019t want to have their services disconnected). 
    Logic to retrieve the u201Cinactiveu201D accounts:
    The inactive accounts can be identified by the Move-In/Out dunning procedure. If the mov-in/out dunning procedure is not empty, that means this account has moved out and the account is inactive.
    Business Logic and Flow
    For each contract account
    Go through each installation and check if it is disconnected
         If (one is active)
    move to the next contract account
    else (all is disconnected)
         check to see if there is a credit balance or if there is an open standing request
         If (credit balance)
    {Display contract account, customer number and information, and credit balance for refund}
    If (open standing request)
    {Display contract account, customer number and information, standing request number to be closed}
    If (paid but not yet refunded security deposit)
    {Display contract account, customer number and information, current balance and security deposit amount}
    Thanks in advance
    Rahul

    Hi Rahul,
    To find out the credit balance relating to security deposits you can use BAPI_ACCOUNT_GETBALANCES. On execution of this BAPI with BP and Contract Account Number, it will return the net balance with different segments like open, due, credit and likewise security deposit amount.
    To find out if there is any open standing request standing against the customer you can use BAPI_CTRACCONTRACTACCOUNT_GOI. You have to execute this BAPI by providing BP or Contract Account number in Main Selections  table and Main and Sub Transaction of Security Deposit Request transaction in Value Selection table. This BAPI will fetch all open items with the main and sub transactions specified and display.
    Thanks
    Ganesh

  • Any function module to calculate delivery date?

    Hello all,
    I think BAPI_PO_CREATE doesn't have ability to determine the delivery date by itself and needs delivery date be fed to it instead. I have a requirement to create a STO with a feed from a 3rd party system that doesn't specify the delivery date at the receiving plant. Could anyone help me identify a function module that returns the delivery date?
    Thanks,
    Rohit

    Hi Rohit,
    It is the same function module that is also called by the form MEPO_DEFAULT_DELIVERY_DATE. I thought that it would be better to call the whole form, since it performs more checks than just calling MD_CHECK_DELIVERY_DATE.
    MD_CHECK_DELIVERY_DATE is called with E_DISPODATUM = sy-datlo, i.e. the local date of the user.
    BR
    Raf

  • Terms of Payment to determine due date as last date of the month

    Hi Experts,
    Does any one know how to configure a Terms of Payment to determine due date as last date of the month ?
    I tried by puting fixed date as 31 in the Terms of Payment in FI but when I am creating in FI-CA it gives me an error "_Term of payment Z003 is inconsistent/not planned_"
    Please advice.
    Thanks & Regards
    Satyajeet

    Hi Satyajeet,
    It seems the settings that you have maintained in FI are correct.
    When you are assigning the payment terms in FI-CA, you need to assign a factory calendar as well to the payment terms in the following config-
    IMG->Financial Accounting ->Contract Accounts Receivable and Payable->Postings and Documents->Document->Maintain Payment Terms
    If you have already assigned the factory calendar and still the problem persists, can you give the message ID and the message number of the error that you are getting?
    Thanks,
    Amlan

  • Function Module to determine the number of pages in a pdf file

    Hi All,
    Is there any standard function module to determine the number of pages in a pdf file?
    Thanks,
    Sai

    Hi unk2,
    There's no functionality in the Acrobat.com online services to do a character count. But, you could use ExportPDF to convert your PDF file to Word format, and then do your character count in Word.
    Please let us know if you need additional assistance.
    Best,
    Sara

  • Function module for access OM Data from infotype 1001

    We had a function module for accessing OM data viz. Infotype 1001. Could you let me know.
    Advanced thanks,
    Dasaradh kosana

    Hi Dasaradh,
          Do you want the fm which fetches the data from HRP1001 , if this is the case you can use this FM RH_READ_INFTY_1001.
    Reward Points if it is helpful
    Regards,
    Kiran I

  • FUNCTION MODULE CREATION FOR GENERIC DATA SOURCE

    Hi BI gurus,
    I am creating function module for generic datasource. For that I followed below mentioned steps
    Steps
    1.     Created s structure with the fields that needed.
    2. Created FM by copying the standard Function module
    " RSAX_BIW_GET_DATA_SIMPLE " and Give a New name starting With
    Y or Z .
    3. IN SE37 ->Your Function module name -> Change, In table tab given structure
    name by deleting the associated type given in “E_T_DATA “.
    And inserted the required code given below
          PROGRAM 'ZHU_BALANCE'.
    *& Report  ZHU_BALANCE
    TABLES: VEKP, VEPO.
    DATA: BEGIN OF T_DISPLAY,
          DATE   LIKE SY-DATUM,
          EXIDV  LIKE VEKP-EXIDV,
          LGORT  LIKE VEPO-LGORT,
          WERKS  LIKE VEKP-WERKS,
          END OF T_DISPLAY.
    DATA: ITAB_DISPLAY LIKE TABLE OF T_DISPLAY.
    DATA: WA_ITAB_DISPLAY LIKE LINE OF ITAB_DISPLAY.
    SELECT VEKPEXIDV VEPOLGORT VEPO~WERKS
           INTO CORRESPONDING FIELDS OF TABLE ITAB_DISPLAY
           FROM VEKP AS VEKP INNER JOIN VEPO AS VEPO
             ON  VEKPVENUM = VEPOVENUM
             AND VEKPWERKS = VEPOWERKS
           WHERE VEKP~VSTEL = SPACE
             AND VEKP~VEGR1 = '401'
             AND VEKP~VPOBJ = '12'
             AND VEKP~STATUS = '0020'
             AND VEPO~VEPOS = '000001'.
    LOOP AT ITAB_DISPLAY INTO WA_ITAB_DISPLAY.
    WA_ITAB_DISPLAY-DATE = SY-DATUM.
    MODIFY ITAB_DISPLAY FROM WA_ITAB_DISPLAY TRANSPORTING DATE.
    ENDLOOP.
    WRITE:/ 'DATE', 20 'EXIDV', 40 'LGORT', 60 'WERKS'.
    ULINE.
    LOOP AT ITAB_DISPLAY INTO WA_ITAB_DISPLAY.
    WRITE:/ WA_ITAB_DISPLAY-DATE, 20 WA_ITAB_DISPLAY-EXIDV , 40 WA_ITAB_DISPLAY-LGORT, 60 WA_ITAB_DISPLAY-WERKS.
    ENDLOOP.
    While checking the function module it’s populating the syntax error as
    THE TYPE “SRSC_S_IF_SIMPLE” IS UNKOWN. (Though this is commented in program)
    So pls suggest
    Regards,
    praful

    hi indira,
    thanx for ur reply we have created the funcion module successfuly it is also showing the output correct. But when we put that function module in the generic data source and try to extract data in RSA3 it shows the correct output of function module but with the msg ' 0 entries found in customer enhancement' and therfore zero records in the display list.
    is there any correction or steps to be followed in data extraction
    pls suggest
    regards,
    praful

  • Function Module to Delete ODS Data based on Request

    Hi All,
    Is there any specific function module to delete ODS data based on Request.
    I found the program RS_DEL_ODS_1 which is using the FM RSAR_ODS_API_DEL.
    But this FM is deleting the request at PSA level.
    Is there any alternate FM?Or is there any ABAP Program or so?

    Hi,
    Deletion of specific request is not perimitted for ODS objects. You can delete the most recent request, but if you delete any previous requests, all the requests up to that request will also be deleted.
    You can do it by write an ABAP program to identify the specific requests to be deleted for ODS.
    Regards
    CSM Reddy

  • Is there any function module to convert the date format

    Dear ABAPers,
    Is there any function module to convert the date format from dd.mm.yyyy to dd-mmm-yyyy.
           I want to convert the date format from dd.mm.yyy to dd.mmm.yyy Eg.from 10.03.2008 to 10-mar-2009.
    Thanks & Regards,
    Ashok.

    hi,
    create custom function module or copy the below code in the report ..and use it
    the out put for below is :----Convert a DATE field into a full format date eg. March 23, 2000
    FUNCTION Z_CONVERT_DATE_INTO_FULL_DATE.
    ""Local interface:
    *"       IMPORTING
    *"             VALUE(DATE) LIKE  SY-DATUM
    *"       EXPORTING
    *"             VALUE(FORMATTED_DATE)
    *"       EXCEPTIONS
    *"              INVALID_DATE
    TABLES: TTDTG.
    DATA: BEGIN OF T_DATE,
            YYYY(4) TYPE C,
            MM(2) TYPE C,
            DD(2) TYPE C,
          END OF T_DATE.
    DATA: DAY(3) TYPE N.
    DATA: VARNAME LIKE TTDTG-VARNAME.
    IF DATE IS INITIAL.
      CLEAR FORMATTED_DATE.
      EXIT.
    ENDIF.
    check document date format
    CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
      EXPORTING
        DATE = DATE
      EXCEPTIONS
        PLAUSIBILITY_CHECK_FAILED = 1.
    IF SY-SUBRC NE 0.
      RAISE INVALID_DATE.
    ENDIF.
    MOVE DATE TO T_DATE.
    CONCATENATE '%%SAPSCRIPT_MMM_' T_DATE-MM INTO VARNAME.
    SELECT SINGLE * FROM TTDTG WHERE SPRAS = 'EN' AND VARNAME = VARNAME.
    WRITE T_DATE-DD TO DAY.
    CONCATENATE DAY ',' INTO DAY.
    CONCATENATE TTDTG-VARVALUE DAY T_DATE-YYYY INTO FORMATTED_DATE
      SEPARATED BY SPACE.
    ENDFUNCTION.
    the output is :--Convert a DATE field into a full format date eg. March 23, 2000
    Regards,
    Prabhudas

  • Function module to fine closest date among given date

    Hi All,
    Is there any function module to find closest date among given dates?
    Thanks in advance

    Hi
    I think there is no FM module available which will satisy this requirement...
    But You can develope one ZFM or You can write a code for it...
    Logic will be
    Check out below code...
    PARAMETERS : P_DATE TYPE SY-DATUM DEFAULT '20090909'.
    DATA : BEGIN OF WA_ITAB,
            DATE TYPE SY-DATUM,
           END OF WA_ITAB.
    DATA : ITAB LIKE STANDARD TABLE OF WA_ITAB.
    DATA : IND TYPE SY-TABIX,
            IND2 TYPE SY-TABIX,
            IND3 TYPE SY-TABIX,
            DATE1 TYPE SY-DATUM,
            DATE2 TYPE SY-DATUM,
            DIFF1 TYPE I,
            DIFF2 TYPE I,
            UTTER_CLOSE TYPE SY-DATUM.
    CLEAR : WA_ITAB, ITAB[].
    WA_ITAB-DATE = '20090824'.
    APPEND WA_ITAB TO ITAB.
    CLEAR : WA_ITAB.
    WA_ITAB-DATE = '20090901'.
    APPEND WA_ITAB TO ITAB.
    CLEAR : WA_ITAB.
    WA_ITAB-DATE = '20090912'.
    APPEND WA_ITAB TO ITAB.
    CLEAR : WA_ITAB.
    WA_ITAB-DATE = '20090930'.
    APPEND WA_ITAB TO ITAB.
    CLEAR : WA_ITAB.
    WA_ITAB-DATE = '20091011'.
    APPEND WA_ITAB TO ITAB.
    CLEAR : WA_ITAB.
    WA_ITAB-DATE = P_DATE. " P_DATE ==> Your Key Date
    APPEND WA_ITAB TO ITAB.
    CLEAR : WA_ITAB.
    SORT ITAB BY DATE.
    DELETE ADJACENT DUPLICATES FROM ITAB COMPARING DATE.
    READ TABLE ITAB INTO WA_ITAB WITH KEY DATE = P_DATE.
    IF SY-SUBRC = 0.
      IND = SY-TABIX.
    ENDIF.
    IND2 = IND - 1.
    IND3 = IND + 1.
    READ TABLE ITAB INTO WA_ITAB INDEX IND2.
    IF SY-SUBRC = 0.
      DATE1 = WA_ITAB-DATE.
    ENDIF.
    READ TABLE ITAB INTO WA_ITAB INDEX IND3.
    IF SY-SUBRC = 0.
      DATE2 = WA_ITAB-DATE.
    ENDIF.
    CLEAR : DIFF1 , DIFF2.
    DIFF1 = P_DATE - DATE1.
    DIFF2 = P_DATE - DATE2.
    IF DIFF1 = DIFF2. 
    UTTER_CLOSE = DATE1. " or date2 either
    ELSEIF DIFF1 > DIFF2.
      UTTER_CLOSE = DATE2.
    ELSEIF DIFF1 < DIFF2.
      UTTER_CLOSE = DATE1.
    ENDIF.
    WRITE : / 'Key Date ' , P_DATE.
    WRITE : / 'Lower Closest Date ' , DATE1.
    WRITE : / 'Upper Closest Date ' , DATE2.
    WRITE : / 'Utter Close Date based on key date ', P_DATE , ' is ' , UTTER_CLOSE.
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya
    Edited by: ilesh 24x7 on Sep 19, 2009 3:54 PM

  • Function module to predict the date for a given date

    hi friends,
    is there any function module to predict the date
    means  for example if i enter one date  , what will be the date
    after 4 months(say)  to the given date.
    my requirement is when a person is hired today (10.06.2008)
    and if he is under probationary for 6 months, then on what date he comes into the permenant employee's list(predicted date after date 6 months)

    Date calculations
    DATE_COMPUTE_DAY Returns a number indicating what day of the week the date falls on. Monday is returned as a 1, Tuesday as 2, etc.
    DATE_IN_FUTURE Calculate a date N days in the future.
    RP_CALC_DATE_IN_INTERVAL Add days/months to a date
    RP_CALC_DATE_IN_INTERVAL Add/subtract years/months/days from a date
    SD_DATETIME_DIFFERENCE Give the difference in Days and Time for 2 dates
    MONTH_PLUS_DETERMINE Add or subtract months from a date. To subtract a month, enter a negative value for the 'months' parameter.
    DATE_CREATE Calculates a date from the input parameters:
    Example: DATE_CREATE
    CALL FUNCTION 'DATE_CREATE'
    EXPORTING
       anzahl_jahre  = 1
       anzahl_monate = 2
       anzahl_tage   = 3
       datum_ein     = '20010101'
    IMPORTING
       datum_aus     = l_new_date.
       Result:
       l_new_date = 20020304
    Example: MONTH_PLUS_DETERMINE
    data: new_date type d.
    CALL FUNCTION 'MONTH_PLUS_DETERMINE'
    EXPORTING
    months = -5 " Negative to subtract from old date, positive to add
    olddate = sy-datum
    IMPORTING
    NEWDATE = new_date.
    write: / new_date.

Maybe you are looking for

  • How to submit the report in Background job.

    Hello Friends, In the selection screen I have 2 radio buttons one for background Process & other for foreground processing. if the user selects the background processing the program should execute in background and output need to be sent to SAP Inbox

  • How to Restore a file In Yosemite's Time Machine?

    Since upgrading to Yosemite, I am having difficulty figuring out how to restore a file using Time Machine.  When I select a file, and click on a recent date, the selected date does Not remain selected, and the "Restore" button is grayed out.  How do

  • Witholding tax tables

    Hi all, Can anyone tell me what table name and detail i can give to ABAP people for the check printout so that they can include the Withhold tax.? I mean, can anyone help me to know the technical specification of the Withhold tax, so that i can give

  • Incremental backup - how ?

    Hi, I want to use Rescue & Recovery for backup on a Readynas server using wireless network. The first backup seems to be OK. I understand that the next backup, using the same server address is a incremental backup, but this backup takes for ever to m

  • Let rows with long texts break between pages in tables.

    I just spent the entire day trying to figure out how to do this very simple task, and just found out in the forum that the only way to do it is to manually create new rows whenever text is too long to fit. Even Word does this routinely. Now I have to