May 16, 2009

Function Determine Due Date

this function is used for counting due date of invoice. Table invoice doesn't have duedate field, it must count from payment terms rules. In payment terms rules, duedate can be counted from one of this fields namely base line date or document date or manually or ...(I forget) and will be saved in bseg or bsid/bsad or bsik/bsak - in baseline date field (zbfdt). So, this function will help for counting duedate.

REPORT ZVR_INCLUDE2 .
tables : faede,bseg.
parameters :vbeln like bseg-vbeln,
koart like bseg-koart.
data :str1 like faede.
str1-rebzg = vbeln.
str1-koart = koart.
CALL FUNCTION 'DETERMINE_DUE_DATE'
EXPORTING
I_FAEDE = str1
IMPORTING
E_FAEDE = str1
* 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.

write :/ 'net date ',str1-netdt.

No comments:

Post a Comment