cancel
Showing results for 
Search instead for 
Did you mean: 

Function module to get due date by terms of payment

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Jelena
Active Contributor

I don't think there is a straight-forward function and you might need to use some additional programming. Take a look at FI_FIND_PAYMENT_CONDITIONS. Also search by DUEDATE* in SM37.

fernando_martin
Participant
0 Kudos

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

Former Member
0 Kudos

Hi Fernando,

I'm also trying to calculate the expitarion date. Looking your code I see that in the "If sy-subrc 0." sentence it's needed anything more.

Please, could you tell which code goes into the If sentence?

Thanks a lot.

Regards.

Lakshmipathi
Active Contributor
0 Kudos

You can try with any of the following Function Modules

a) J_1A_SD_CI_DUEDATE_GET

b) ITEM_DERIVE_FIELDS

thanks

G. Lakshmipathi

Former Member
0 Kudos

Thanks for the reply.

My business requirement is to determine the due date at the time of creation of the billig document and I do have the billing document yet.