Application Development and Automation 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: 
Read only

DETERMINE_DUE_DATE

f_cemunal
Participant
0 Likes
5,555

Hello Masters,

I am trying to get due dates with determine_due_date fm but i can't.i have searched this forum about this fm and i could not find any related things to my problem.

also i debugged my program and saw that FAEDE-REBZG is empty.this is why fm doesn't work.

Any help would be appreciated.

Regards.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,041

Hi Cem,

Before passing above FM in your program  , you can move all corresponding field values  from

BSID table to FAEDE_EXP and then execute your FM. because BSID table having FAEDE-REBZG value.

It will be work successfully. Please try and let us know if you have any Query.

Regards,

Prasenjit

Hello Masters,

I am trying to get due dates with determine_due_date fm but i can't.i have searched this forum about this fm and i could not find any related things to my problem.

also i debugged my program and saw that FAEDE-REBZG is empty.this is why fm doesn't work.

Any help would be appreciated.

Regards.

12 REPLIES 12
Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
4,041

Hello Cem,

Please share the paramteres passed to the FM DETERMINE_DUE_DATE.

Thanks

Read only

0 Likes
4,041

Hello,

CALL FUNCTION 'DETERMINE_DUE_DATE'

     EXPORTING

       I_FAEDE                    = FAEDE_EXP

     IMPORTING

       E_FAEDE                    = FAEDE_IMP

     EXCEPTIONS

       ACCOUNT_TYPE_NOT_SUPPORTED = 1

       OTHERS                     = 2.

Read only

0 Likes
4,041

Hello Cem

Please check if you are populating below fields.


FAEDE_EXP-koart = 'K'.  " Accounttype is vendor

FAEDE_EXP-zfbdt = bsak-zfbdt. "Baseline date for d

FAEDE_EXP-zbd3t = bsak-ZBD3Ts.   "Net payment terms period.

Thanks

Read only

0 Likes
4,041

Hello Always,

I have posted all of my code down there.I should have done at the first time.


Thanks

Read only

Former Member
0 Likes
4,042

Hi Cem,

Before passing above FM in your program  , you can move all corresponding field values  from

BSID table to FAEDE_EXP and then execute your FM. because BSID table having FAEDE-REBZG value.

It will be work successfully. Please try and let us know if you have any Query.

Regards,

Prasenjit

Read only

4,041

Hello Prasenjit,

Here is all of my fm code :


loop at ibsid.

  " WRBTR = IBSId-WRBTR.

   IF IBSID-SHKZG = 'H'.

     IBSID-WRBTR = - IBSID-WRBTR.

   ENDIF.

   MOVE-CORRESPONDING IBSID TO FAEDE_EXP.

   FAEDE_EXP-KOART = 'K'.

   CALL FUNCTION 'DETERMINE_DUE_DATE'

     EXPORTING

       I_FAEDE                    = FAEDE_EXP

     IMPORTING

       E_FAEDE                    = FAEDE_IMP

     EXCEPTIONS

       ACCOUNT_TYPE_NOT_SUPPORTED = 1

       OTHERS                     = 2.

   VADE = FAEDE_IMP-NETDT.

   if vade <= sy-datum.

     lv_wrbtr = lv_wrbtr + ibsid-wrbtr.

   else.

     clear : ibsid-wrbtr.

   endif.

endloop.

  if lv_wrbtr < 0.

    itab-durum = 'NO'.

  else.

    itab-durum = 'YES'.

    itab-cur_ov = lv_wrbtr.

  endif.

i have debugged it and i saw that it works for some record and for some doesnt.but the problem is that it doesnt see FAEDE-REBZG value for some record but i know all of my records have REBZG.

What should i do ?

Regards.

Read only

0 Likes
4,041

The below are the two mandatory fields for Account type 'K' in the FM for due date calculation.

FAEDE_EXP-zfbdt

FAEDE_EXP-zbd3t

Please debug the FM independtly in SE37 for better understanding.

Thanks

Read only

0 Likes
4,041

Hi Cem,

As mention Always Learner,

Please try to check  above field  as well as you can validate one condition before  passing values in FM like.


FAEDE-KOART = 'K' then FAEDE--SHKZG = 'S' otherwise FAEDE-KOART = 'D' then FAEDE-SHKZG = 'H'.

Regards,

Prasenjit

Read only

0 Likes
4,041

You get data from BSID so debitor (customers)

You set FAEDE_EXP-KOART = 'K' so Kreditor (vendor)


Some typo or actually intended so ?


Regards,

Raymond

Read only

0 Likes
4,041

These fields are populated in fm.

I have been looking up the records and what i have found is the fields without a UMSKZ value make this problem.

is it just a coincidence or relevant?

Read only

0 Likes
4,041

it is wrong but does it matter? i want to calcaulate the due date

Read only

0 Likes
4,041

Usually SAP executes a MOVE-CORRESPONDING from BSEG (or seconday indexes) structures to those parameters, and if you check the FM there are some IF condition on SHKZG (debit/credit) and account type (K,D, etc.) so you may fool the program.

Regards,

Raymond