Subroutine in sapscript for net due date

Hi,
This is the first time I am creating a subroutine for sapscript and I could not get it to work. I need to calculate the net due date using the baseline date plus cash discount days. But the form is just printing out 0000000. I am just trying to extract one due date here but I will have to get it for all line items then sort descending to get the latest one. Can anyone help me to see the gap why this is not working?
In the sapscript I have the following:
DEFINE &BASEDATE& = &REGUP-ZFBDT&
DEFINE &PAYTERMS& = &REGUP-ZBD1T&
PERFORM NET_DUE_DATE IN PROGRAM Z_SAPSCRIPT_FUNCTIONS
USING &BASEDATE&
USING &PAYTERMS&
CHANGING &DUEDATE&
ENDPERFORM
In program Z_SAPSCRIPT_FUNCTIONS
Thanks in advance!
Cholen

Hi Raju!
I am really getting close! I did the conversion for all variables, however for VBLNR, it does not work. It gives leading zeroes but the value starts with a 'P' before the zeroes and the numeric value. I tried to remove that from the where clause and my select finally got something. However the output on the form is in the internal format. I suppose I should use CONVERT_DATE_TO_EXTERNAL which I tried doing after out_tab-value = lv_netduedate which is the variable I am passing to the form. 
Raju Shrestha wrote:
Hi Cholen,
I believe your lv_laufd is a 10 character field in format MM/DD/YYY or DD/MM/YYYY. You should move that data to a 8 character variable (say lv_date) in YYYYDDMM format.
Please try this conversion
    CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
      EXPORTING
        date_external            = lv_laufd
      IMPORTING
        date_internal            = lv_date
      EXCEPTIONS
        date_external_is_invalid = 1
        OTHERS                   = 2.
Check in debug, you should get lv_date in YYYYMMDD. Now use lv_date in your WHERE clause.
If you still do not get data after lv_date eq YYYYMMDD, check your LIFNR and KUNNR. They should be 10 charaters with leading zeroes if not 10 .
If needed use the conversion for lv_lifnr and lv_kunnr.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        date_external            = lv_lifnr
      IMPORTING
        date_internal            = lv_lifnr.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        date_external            =  lv_kunnr
      IMPORTING
        date_internal            =  lv_kunnr.
Cheers,
Raju.

Similar Messages

  • Payment term net due date as 15th of month

    Hi Tea,
    I have created a payment term Z005 for net due date is 15th of the month, while doing testing I found that it's calculating wrongly, while posting the invoice I have given the document date as 10th of April, for this net due date is calculating as 15 of April, it's correct if i give the document date as 18th of April, for this also system is calculating the net due date as 15th of April it's wrong, it should calculate as 15th of may.
    Can you please help me to fix this one?
    Thanks
    Nenu

    Hi Nenu
    You should use day limit in term of payment.
    As per your concern bill enter upto 14th of the month net due date will be 15th of the month, and bill enter between 15th to 30th, due date will be 15th of next month.
    T Code - OBB8
    New entry -
    pmt term - Z005
    Day limit - 14
    Fixed Day - 15
    save
    back
    New entry
    Pmt term - Z005
    Day limit - 31
    Fixed day - 15
    Additional months - 1
    Save
    Thanks
    Nakula Das

  • Which table for the field "Net due date" of customer line items?

    Hi All,
    In which table could I find the field "Net due date" of customer line items?
    Thanks
    Gandalf

    I don't think there is a field for that.  In various SAP screens where you see this field, I think it is a calculated value (baseline date ZFBDT + days ZBD*T).

  • Table name for the field FAEDT(net due date)

    hi every body,
    plz can any body tell me the table name for the field net due date(FAEDT).
    its very very urgent
    thanq.

    Hi mark chalfen,
    thanq very much ur reply.
    actually my client want to change the payment term for all the vendor invoices.so wt we did is... we created aprogram to change the old payment term to new payment term in the vendor line items(fbl1n).
    when we run the program its changing the payment term and the base line date and the NO of days in the vendor linitems.but it not changing the net due date based on the new baseline date.
    i think with out changing the net due date only changing the payment term is use less.coz the item again show as due in the same date.
    so how can we change the net due date based on the new baseline date.?from which table we can take the field FAED and update with the new date.
    plz advise me?
    thanq.

  • Table for field net due date

    Hi,
    In which table we will find field net due date.
    Regards,

    Hi
    ZFBDT is the field for the Baseline date and ZBD1T, ZBD2T, ZBD3T are the days for disc.calculations....you can caluculate the Net due date based (ZFBDT  + [ZBD1TZBD2TZBD3T]) and accordingly the discounts(ZBD1P, ZBD2P) also
    VVR

  • Fields for Arrear and Net due date in FBL5n

    Dear FI expert,
    In FBL5n I need the fields for "Arrear" & "Net due date".
    Can anybody tell me exactly the fields and tables?
    Or any other FM for getting those?
    Thanks & Best regards
    Bishnu
    06/04

    hi
    check whether this spro path can help
    Financial Accounting (New) --> Accounts Receivable and Accounts Payable --> Customer Accounts --> Line Items --> Display Line Items --> Display Line Items without ALV --> Define Additional Fields for Line Item Display

  • F110 payment only possible 8 days after net due date, why?

    Hi all,
    When we try to post a payment in F110 by choosing a next p/date as for example 24 April all invoices with net due date up to that date will be included. In payment proposal only invoices with net due date up to 15 April is included, not invoices with net due date 16 April and after. There is something with a tolerance of 8 days but I don´t know where this configuration is set. Payment terms is 30 days net and there I can´t find anything about any tolerance days and i can´t find anything in FBZP either. Does anyone know where I can find these days set?
    We want to create the payment per net due date. We don´t work with payment order.
    BR L

    Hi,
    Check in transaction code FBZP, all company codes. Double click on the company code, you will the find the tolerance days for payable.
    Thanks
    Aravind

  • FINT interest calculation on cust overdue items from net due date required

    Hi.
    I am running FINT option i am running interest calculation from net due date onwards whereas the system is calculating the interest from Next date of due date.
    For example: Customer invoice is raised on 01.01.2011 and Net due date is 01.01.2011. I gave the option in the interest calculation - SPRO - FINANCIAL ACCOUNTING(NEW) - ACCOUNTS RECEIVABLE AND ACCOUNTS PAYABLE - BUSINESS TRANSACTIONS - INTEREST CALCULATION - PREPARE ITEM INTEREST CALCULATION, Ref date as as 1 - Value date (Baseline date from Net Payment).
    Still the system is calculating the interest from 02.01.2011 instead of from 01.01.2011.
    Can anyone help me in this regard.
    Regards,
    Padmavathi

    Hi,
    We can calculate interest on items cleared with in the calculation period.
    When you are calculating interest on open items, system will check open items as on the Calculation Date.
    But if you want to calculate Interest on items cleared with in the calculation period., you have to check Calculate Interest on Cleared Items also.
    For Instance: If you are calculating Interest on 31st July for the period of 01.07.2009 to 31.07.2009, in this case
    some open items are already cleared with in this calculation period, even though you have to calcuate interest for those cleared items for that many days. System will calculate interest for that many days.
    Try with this option, still if you need any help please let me know.
    Thanks
    Chandra

  • Interest calculation based on Net Due Date

    Hi guys: I want the interest calculation based on net due date and not document date or posting date.
    I tried to check the box "ALWAYS CALCULATE INT FROM NET DUE DATE in prepare item interest calculation step, but system gives me message
    "Do not select "Calc.intrst from net due date" for this int.calc.type
    Message no. F7128"
    Here are my questions:
    1- how can i make the system to calculate interest only after the item is due for payment - right now its calculating anyday after the document date
    2- Is this the correct place in configuration to do this?  (ALWAYS CALCULATE INT FROM NET DUE DATE )
    3- Also in T code FINT, how can i run interest posting for only one item rather than all that show up in test run? I tried selecting/highlighting only one but it posts all.
    thanks much
    brian

    HI,
    The system always calculates the interest from the document date of the invoice,
    as of my knowledge there is no setting for the interest calculation from the net due date, so
    what u need to do is when u are running the open item interest run u specify the period of only the date
    from the net due date to required date as of u.
    if u  want to calculate the interest to paticular invoice and  having two invoices
    then u can run  as per the document date and other thing is u can block the invoice for dunnig.
    Regards,
    Padma

  • Net Due Date - FBL5N

    Hi All
    There is a request to change the net due date at the report FBL5N : if the net due date is on a weekend or holiday, it is necessary to change it to the next business day..
    I realized that this field is calculated using FM DETERMINE_DUE_DATE (when running FBL5n).
    Questions:
    -  Is it possible to change this date as requested? If yes, is it an ABAP issue?
    -  Modifying this net due date at this point, may affect the integrity of other reports or transactions?
    Thanks in advance.
    Regards.
    Gaia

    HI,
    As per SAP standard, it is not possible to link the due date calculation
    to a calendar so as to avoid having the due date fall on a holiday or
    weekend.  There is no provision in standard SAP to enable this.
    Only for automatic payment and dunning purposes, you can use a calendar
    to avoid payments on Saturdays, Sundays, and Holidays. Please see
    customizing transaction OBBA.
    One suggestion could be to use the substitution functionality, where
    you can substitute and change several fields from BKPF and BSEG. By a
    user exit you will calculate the adequate baseline date to avoid due
    date on Saturdays, Sundays or Holidays.
    Regards
    Madhu M

  • Credit memo net due date is not correct

    Hi experts,
    In most cases the net due date of customers credit memos (posting key 11) is correct based on payment terms but sometimes itu2019s not (e.g. payment terms 30 days end of month but net due date is the same as document date).
    Any ideas why?
    I checked payment terms in customer master data and in FI and they are the same.
    Thanks for your help,
    Ben

    The general rule is that the due date of a credit memo is the baseline date.
    There are 2 exceptions: if you put the number of an invoice in the field BSEG-REBZG (Number of the Invoice the Transaction Belongs to), the due date of the credit memo is the due date of the invoice.
    2nd exception: if you put the constant 'V' in this field REBZG (you can do it thru a substitution rule), the due date will be calculated the same way as for an invoice.
    You can see this in the documentation of the data element REBZG:
    A special rule applies to credit memos which have a "V" in this field.
    The due date is determined in the same way as for an invoice. If the field is empty (containing neither a document number nor a "V") the due date is the baseline date for payment.

  • How to change value date from posting date to net due date

    Hi Gurus,
    My client wants to change value date from posting date to net due date. currently posting date is considered as value date but in future client wants to change value date to net due date of documents.
    1. what configurations need to be maintained to change value date from posting date to net due date.
    2. Will these changes effect automatic payment run.
    Thanks and Regards,
    Suresh

    Hi Suresh,
    In Future
    While posting the documents you can mention the value date as due date of the documents.
    For already posted documents
    You can change the value date to net due date.
    If the value date is display mode i.e. if you are not able to change the value date in FB02 (Document Change Mode), use OB32 transaction and make value date field as eidtable (BSEG-VALUT).
    In OB32 transaction enter all the required fields like Account type, transaction type, company code and finally activate the Field can be changed check box.
    But not sure, whether we can change the value date to previous date or not?
    This would help you..
    Regards,
    Praisty
    Edited by: Praisty on Jul 28, 2009 9:56 AM

  • How to see (net due date + payment term's days) in fbl5n as a date

    hi experts.
    i need some informations about fbl5n fields
    i can see net due date and i can see terms of payment fields in the fbl5n but  if the invoice has a payment term (30 day additional etc) i want to see (net due date + payment term's extra days) . for example if the net due date is 01.06.2011 and payment term is extra 20 days  , how can i see 21.06.2011 in fbl5n or any other sceens?
    Edited by: Burak Akdasli on Jun 22, 2011 3:43 PM

    Hi
    I understand from ur question whats the billing date?
    If this is ur question, you can fetch it from sales order>item>billing tab.
    The logic u had mentioned is confusing be more specifc as to what scenario u are trying.
    Reward if it helped
    Chandru

  • The Credit Memo & Original Invoice do not have the same net due date.

    The issue is that for returns of goods from the customer, the credit memo that gets created does not have the same net due date as the original invoice.  To accomplish this, in the credit memo, the indicator "V" must be entered in the credit memo field BSEG-REBZG "Invoice Ref".  This will make the credit memo due based on the payment terms. In the OSS message 50388, SAP identifies a user exit in SDVFX008 which will fill field BSEG-REBZG with the value "V".  Doing this should automatically make the credit memo for returns due the same date as the original invoice.SAP says to do the following:
    The function module called by SDVFX008 is EXIT_SAPLV60B_008
    Make the ABAP coding in include program ZXVVFU08.
    Populate field ACCIT-REBZG with "V"
    Despite doing this , we couldnt get the same net due date as the credit memo & Original invoice.
    Can anyone help? POINTS WILL BE GIVEN.
    Thanks
    Anita

    Hi Anitha,
    Does the value 'V' gets paopulated?.
    I mean to ask whether the program goes into the user exit logic?.
    Please let me know.
    Thank you.
    Regards,
    Karun M

  • Calendar date & net due date (FI) PAYMENT TERMS - OBB8 Vendor Invoice

    I read many posts on SDN forum about the topic.
    Anyway, I didn't find a simple solution for that.
    My aim is is to calculate a net due date based on working days.
    So, If I've got a 30 days document days payment term  ("Deafult for baseline date" = Document date ; Additional Months = '2'), a Vendor Invoice (document date = 12.05.2011), by standard net due date will be 12.06.2011.
    FROM 12.05.2011 to 12.06.2011 =
    32 CALENDAR  DAYS         
    22 WORKDAYS (32 minus  10 holyday - 2 weekends)
    WORKDAYS PAYMENT TERMS  Within 30 workdays Due net
    Vendor Invoice  document date = 12.05.2011
    plus   30 workdays   =  DUE DATE  22.06.2011  (and not 12.06.2011)
    Can I obtain that with a standard functionality?
    Edited by: Roberto Buono on Jul 1, 2011 2:29 PM

    Hi,
    Sadly this is not available as standard.  As per your need the Net due date should be worked out by using a factory calendar; but what this does is it delinks the direct correlation between the number of days in the payment terms with the difference between the due date and baseline date.  I hope you are aware that Net Due date is not stored but is a variable calculated during run time in reports.
    There are four things you can try:
    1.  The simplest to do is: As the number of weekends are fixed; and if the intention is to give a 30 working day term, then add on the number of weekends and make the payment term effectively for say 40 days.  There will be marginal variations over what you want. Best part here is that config remains standard.
    2. All the receivable reports will use a function module (usually the same one) to calculate the net due date; enhance the FM and make it consider a factory calendar for calculating due date.
    3. Enhance the accounting interface, and in runtime; modify the days that are coming from the payment term; based on a factory calendar, and update the accounting document. This delinks the days mentioned in the payment term and the accounting document and may not be palatable.
    4. Enhance the accounting interface, and in runtime; calculate the due date and update the baseline date with it and make the payment term as "Immediate" yielding the desired due date. Not very elegant.  Alternatively add to the baseline date days equivalent to holidays and weekends and keep the days from payment terms constant and update the accounting document. Better...
    All four options have somes pros and cons.  I do not see any other means of acheiving what you want.  Maybe you could restrict users to a custom receivables/due date/ageing report which delivers what you want and lock the standard reports.
    Cheers..

Maybe you are looking for

  • Acer Aspire V 15 Nitro VN7-571G-58T0 issues

    I bought the laptop in May 2015, and I'm facing the following problems: 1. Wifi doesn't work properly:I have tried updating the driver of the Qualcomm Atheros AR5BWB222 WiFi card, but it has made no difference. Acer issued a patch to supposedly recti

  • Slection Screen Validations

    Hi Experts,     Could any one provide me the material for selection screen validations Ex: In selection Initial screen, I have 2 radio buttons. Based on selecting the radio button, the input selection screen should be displayed below the radio button

  • 4G Phones 3G sensitivity

    I've got the Droid, and thankfully Verizon seems to have fixed the no connectivity 4G to 3G issue in the Long Island area.  But does anyone notice that in weaker 3G areas you don't get a connection whereas 3G only phones do?  I know the 4G signal doe

  • URL for configuration in HTTP SUBMIT button --urgent

    Hi All,    I am in development of a urgent interactive form and I am new this. My aim is to build a interactive form ( SFP) and then place a HTTP Submit button and post the data back . I went through the documentation and understood that W can send d

  • Results displayed b4 click of search button

    I have defined parameters in my read only vo query which has a join condition on multiple tables Declared bind variables for that with the same name I have dragged and dropped my params on to th jspx from datacontrol execute with params section and m