Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Invoice Payment Term

Former Member
0 Kudos

Hi !

Is in abap a function that calculate Payment date

given the invoice date and the payment term code ( LFM1-ZTERM )? .

please give the name of that function and other detail

about the function. how to use it ? restriction etc ?

thanks

moshe

14 REPLIES 14

Former Member
0 Kudos

check fm...

J_1A_SD_CI_DUEDATE_GET

Former Member
0 Kudos

Hi,

Check the function module 'WLF_INVOICE_DETERMINE_DUEDATE', this might help,

Rgds,

Former Member
0 Kudos

use the funtion mod 'DETERMINE_DUE_DATE'.

u also need to pass the Account type ( KOART ) along with the invoice date n payment term..

0 Kudos

Hi !

First thanks for your answer.

I need a function that determine the invoice due-date of

MM - purchse order not of sales and distribution.

The field ZTERM contain the code payment term to which field of the function parmetr, do i have to set the ZTERM field ?

0 Kudos

Hi Solman,

i think its irrelevant for the function module as to whether its for PO or sales, becasue, wen u mention the Account type, it talks about Vendor or customer...so in case of Purchase Order, it ll be a Vendor that u need to pass,ie, 'K'.

0 Kudos

Hi Bikash!

How do i find the proper zbldt from the payment term.

I want to use function 'DETERMINE_DUE_DATE' and i don't

know how suply the proper ZBD1T. I have the value of

the payment term (ZTERM), but i don't know how to get appropiate ZBD1T! is there a function the get ZTERM

and return the appropiate ZBD1T ?

thanks

moshe

ferry_lianto
Active Contributor
0 Kudos

Hi Moshe,

You can code something like this.

data: faede type faede.
 
Select single * from BSAD
                into wa_bsad
                where belnr = wa_intit-belnr.
 
move-corresponding wa_bsad to faede.
faede-koart = C_D.
 
CALL FUNCTION 'DETERMINE_DUE_DATE'
  EXPORTING
    I_FAEDE                          = faede
 IMPORTING
   E_FAEDE                          =  faede
 EXCEPTIONS
   ACCOUNT_TYPE_NOT_SUPPORTED       = 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.
 
move faede-netdt to gv_netdt.

or

due_date = bseg-zfbdt + t052-ztag1.

Here ztag1 is obtained from table t052 using bseg-zterm.

Hope this will help.

Regards,

Ferry Lianto

Please reward points if helpful.

0 Kudos

Hi !

In my report am working with PO Tables : RBKP, RSEG, EKKO, MKPF, MSEG.

What is the relationships(foreign key relationship) between those table and BSAD?

Can you tell me please how do i join between BSAD

and those tables ?

( I tried BSAD-belnr to mseg-belnr

or to rbkp-belnr however it isn't

OK relationships ).

Thanks

Moshe

0 Kudos

Can you check whether this releation exits

BSID-XBLNR = MKPF-BELNR?

Regds

Manohar

0 Kudos

Hi Manohar !

The relation you suggested doesn't exist. table MKPF doesn't have field named BELNR but MBLNR or XBLNR, and

this fields are not foreign key fields for Bsid-XBLNR.

Is in SAP other relationships keys between the tables ?

or is there other function that calculate due date of

MM-PUR invoice given payment terms ?

Thanks

Moshe

0 Kudos

Hmm...now you check this relationship.

MKPF-MBLNR = BSID-AUGBL

MKPF-MJAHR = BSID-GJAHR

MKPF-BLDAT = BSID-AUGDT

MKPF-XABLN = BSID-BELNR

Regds

Manohar

0 Kudos

Hello,

As you, I would like to get the payment date using the doc date and the payment term.

Have you found the module function and do you know how to use it properly ?

Thanks,

Regards,

Francis

0 Kudos

Hi Ferry Lianto !

Thanks for your answer.

I recognazie that in SAP there are two type of payment term.

One type use t052-ztag1 field, and the secound type use

the fields t052-ZFAEL(days) t052-ZMONA(month) for calculating the due date.

Do you know a function to calculate due date that use the

secound type of payment term ( given t052-ZFAEL(days) t052-ZMONA(month)) ?

thanks

moshe

0 Kudos

Hi ,

Find the Invoice due date with payment terms use the below function module.

J_1A_SD_CI_DUEDATE_GET

Below the logic.

DATA : g_dzfbdt TYPE dzfbdt .

CALL FUNCTION 'J_1A_SD_CI_DUEDATE_GET'

EXPORTING

iv_vbeln = '0911000030' " Pass the invoice #

iv_zterm = 'Z180' " Invoice payment terms

  • IV_RATNR = 1

IMPORTING

ev_netdate = g_dzfbdt " Due date

EXCEPTIONS

FI_DOCUMENT_NOT_FOUND = 1

PAYMENT_TERMS_INCOMPLETE = 2

INVOICE_NOT_FOUND = 3

OTHERS = 4.

IF sy-subrc eq 0.

write : g_dzfbdt .

ENDIF.

Thanks,

Iyankannu