Posting Clearing document through function module POSTING_INTERFACE_CLEARING
*** Header and line item diffrentiation:
LCF_STYPE_K TYPE STYPE_PI VALUE 'K', " HEADER Line
LCF_STYPE_P TYPE STYPE_PI VALUE 'P', " Line Item
*** Populate and map FTCLEAR to POSTING_INTERFACE_CLEARING
LDS_FTCLEAR-AGKOA = 'K' or 'D' ( based on account type, Vendor or Customer for Out Going / Incoming Payments.
LDS_FTCLEAR-AGBUK = <company_code>.
LDS_FTCLEAR-XNOPS = 'X'.
LDS_FTCLEAR-SELFD = <referece_document_number>
LDS_FTCLEAR-SELVON = <reference_field> " SELFD is value of the filed assigned here.
APPEND LDS_FTCLEAR TO P_LDT_FTCLEAR.
*** FTPOST sample filling data
LDS_FTPOST-STYPE = P_LCF_STYPE.
LDS_FTPOST-COUNT = P_LDF_COUNT.
LDS_FTPOST-FNAM = P_LCF_FNAM.
LDS_FTPOST-FVAL = P_FVAL.
APPEND LDS_FTPOST TO P_LDT_FTPOST.
Call the below function modules in following order.
POSTING_INTERFACE_START :
CALL FUNCTION 'POSTING_INTERFACE_START'
EXPORTING
I_CLIENT = SY-MANDT
I_FUNCTION = 'C' ( Function: BDC, Call Trans. Using, internal interface)
I_MODE = MODE ( N - no screen, A - all screen, E - Error --> Mode we use in Call transaction)
I_USER = SY-UNAME
EXCEPTIONS
CLIENT_INCORRECT = 1
FUNCTION_INVALID = 2
GROUP_NAME_MISSING = 3
MODE_INVALID = 4
UPDATE_INVALID = 5
OTHERS = 6.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
POSTING_INTERFACE_CLEARING:
CALL FUNCTION 'POSTING_INTERFACE_CLEARING'
EXPORTING
I_AUGLV = 'AUSGZAHL' " Follow below mentioned table
I_TCODE = 'FB05'
I_SGFUNCT = 'C'
IMPORTING
E_MSGID = LDS_RETURN-ID
E_MSGNO = LDS_RETURN-NUMBER
E_MSGTY = LDS_RETURN-TYPE
E_MSGV1 = LDS_RETURN-MESSAGE_V1
E_MSGV2 = LDS_RETURN-MESSAGE_V2
E_MSGV3 = LDS_RETURN-MESSAGE_V3
E_MSGV4 = LDS_RETURN-MESSAGE_V4
* E_SUBRC = SY-SUBRC
TABLES
T_BLNTAB = LDT_BLNTAB
T_FTCLEAR = LDT_FTCLEAR
T_FTPOST = LDT_FTPOST
T_FTTAX = LDT_FTTAX
EXCEPTIONS
CLEARING_PROCEDURE_INVALID = 1
CLEARING_PROCEDURE_MISSING = 2
TABLE_T041A_EMPTY = 3
TRANSACTION_CODE_INVALID = 4
AMOUNT_FORMAT_ERROR = 5
TOO_MANY_LINE_ITEMS = 6
COMPANY_CODE_INVALID = 7
SCREEN_NOT_FOUND = 8
NO_AUTHORIZATION = 9
OTHERS = 10.
AUGLV | Purpose |
AUSGZAHL | Outgoing payment |
EINGZAHL | Incoming payment |
GUTSCHRI | Credit memo |
UMBUCHNG | Transfer posting with clearing |
Note the following :
Processing with 'Call Transaction ... Using '
If processing takes place with 'Call Transaction .. Using', the initiator can see whether processing was successful by looking at the export parameter'SUBRC'.
SUBRC = 0 means that the document was posted. The document number is stored in table T_BLNTAB. For intercompany documents, several document numbers are stored here.
SUBRC <> 0 means that the document could not be posted. Information concerning the error which has arisen is returned via the message fields MSGID, MSGNO, etc.
Support of transaction 'FBB1'
If you want to access transaction FBB1, you should note the following:
POSTING_INTERFACE_END:
CALL FUNCTION 'POSTING_INTERFACE_END'
EXPORTING
I_BDCIMMED = 'X'
EXCEPTIONS
SESSION_NOT_PROCESSABLE = 1
OTHERS = 2.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 |