‎2006 Jun 20 3:27 AM
Hi Experts,
For posting data in to FB01 ,is there any BAPI for that?
Thanks & Regards,
Rayeez
‎2006 Jun 20 3:38 AM
Hi Rayeez,
Please check this BAPI.
BAPI_ACC_GL_POSTING_POST
BAPI_ACC_DOCUMENT_POST
BAPI_ACC_BILLING_POST
BAPI_ACC_INVOICE_RECEIPT_POST
Hope this will help.
Regards,
Ferry Lianto
Please reward points if helpful.
‎2006 Jun 20 4:06 AM
HI
GOOD
CHECK OUT WITH THESE
BAPI_ACC_DOCUMENT_POST
THANKS
MRUTYUN
‎2006 Jun 20 4:11 AM
Hi,
refer this thread:
coding:
BAPI_ACC_GL_POSTING_POST Accounting: General G/L Account Posting
Data : DOCUMENTHEADER LIKE BAPIACHE08,
ACCOUNTGL LIKE BAPIACGL08 OCCURS 0,
CURRENCYAMOUNT LIKE BAPIACCR08 OCCURS 0
RETURN LIKE BAPIRET2 OCCURS 0,
EXTENSION1 LIKE BAPIEXTC OCCURS 0,
OBJ_TYPE LIKE BAPIACHE02-OBJ_TYPE,
OBJ_KEY LIKE BAPIACHE02-OBJ_KEY,
OBJ_SYS LIKE BAPIACHE02-OBJ_SYS.
CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
EXPORTING
DOCUMENTHEADER = DOCUMENTHEADER
IMPORTING
OBJ_SYS = OBJ_SYS
OBJ_KEY = OBJ_KEY
OBJ_TYPE = OBJ_TYPE
TABLES
EXTENSION1 = EXTENSION1
RETURN = RETURN
CURRENCYAMOUNT = CURRENCYAMOUNT
ACCOUNTGL = ACCOUNTGL
EXCEPTIONS
OTHERS = 01.
rgds,
latheesh
Message was edited by: Latheesh Kaduthara
‎2006 Jun 20 5:57 AM
FB01 can be used to post any type of FI document, so there will be not one BAPI which can post all. First decide on what all types of document that you are going to post.
Warm Regards
Anup Varghese
‎2006 Jun 20 7:25 AM
Anup,
not knowing what BAPI can be used for what I do not understand your recommendation.
Tell us, i.e., what you can <b>not</b>use BAPI_ACC_GL_POSTING_POST for.
Regards,
Clemens
‎2006 Jun 20 6:02 AM
Hi check this,
PRELIMINARY_POSTING_POST_D
PRELIMINARY_POSTING_POST_ALL
PRELIMINARY_POSTING_UPDATE
PRELIMINARY_POSTING_HEADER
Regards,
Wasim Ahmed
‎2006 Jun 20 11:31 AM
Hi,
If the above mentioned BAPIs are not working, u can use FM-
'POSTING_INTERFACE_START'
'POSTING_INTERFACE_DOCUMENT'
See this report below- it is posting the doc correctly
REPORT YTEST11.
DATA: ws_lines_doc(3) TYPE n.
TYPES: BEGIN OF ty_ftpost.
INCLUDE STRUCTURE ftpost.
TYPES: END OF ty_ftpost.
TYPES: tyt_ftpost TYPE TABLE OF ty_ftpost.
DATA: i_ftpost TYPE tyt_ftpost WITH HEADER LINE.
TYPES: BEGIN OF ty_blntab.
INCLUDE STRUCTURE blntab.
TYPES: END OF ty_blntab.
TYPES: tyt_blntab TYPE TABLE OF ty_blntab.
DATA: i_blntab TYPE tyt_blntab WITH HEADER LINE.
TYPES: BEGIN OF ty_fttax.
INCLUDE STRUCTURE fttax.
TYPES: END OF ty_fttax.
TYPES: tyt_fttax TYPE TABLE OF ty_fttax.
DATA: i_fttax TYPE tyt_fttax WITH HEADER LINE.
PERFORM f5000_fill_doc_header.
************************************************************************
*Fill the document position
************************************************************************
PERFORM f6000_fill_doc_position.
CALL FUNCTION 'POSTING_INTERFACE_START'
EXPORTING
I_CLIENT = SY-MANDT
i_function = 'C'
I_GROUP = ' '
I_HOLDDATE = ' '
I_KEEP = ' '
I_MODE = 'A'
I_UPDATE = 'S'
I_USER = SY-UNAME
I_XBDCC = ' '
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.
CALL FUNCTION 'POSTING_INTERFACE_DOCUMENT'
EXPORTING
i_tcode = 'FB01'
tables
t_blntab = i_blntab
t_ftpost = i_ftpost
t_fttax = i_fttax
EXCEPTIONS
ACCOUNT_MISSING = 1
COMPANY_CODE_MISSING = 2
POSTING_KEY_INVALID = 3
POSTING_KEY_MISSING = 4
RECORD_TYPE_INVALID = 5
TRANSACTION_CODE_INVALID = 6
AMOUNT_FORMAT_ERROR = 7
TOO_MANY_LINE_ITEMS = 8
COMPANY_CODE_INVALID = 9
SCREEN_NOT_FOUND = 10
NO_AUTHORIZATION = 11
OTHERS = 12
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
if sy-subrc <> 0.
write 😕 'error in posting'.
else.
loop at i_blntab.
write : / i_blntab-belnr.
endloop.
endif.
&----
*& Form f5000_fill_doc_header
&----
text
----
--> p1 text
<-- p2 text
----
form f5000_fill_doc_header .
REFRESH i_ftpost.
CLEAR i_ftpost.
ADD 1 TO ws_lines_doc.
i_ftpost-stype = 'K'.
i_ftpost-count = ws_lines_doc.
i_ftpost-fnam = 'BKPF-BLDAT'.
i_ftpost-fval = '06122005'.
APPEND i_ftpost.
i_ftpost-fnam = 'BKPF-BUDAT'.
i_ftpost-fval = '06122005'.
APPEND i_ftpost.
i_ftpost-fnam = 'BKPF-BLART'.
i_ftpost-fval = 'SA'.
APPEND i_ftpost.
i_ftpost-fnam = 'BKPF-BUKRS'.
i_ftpost-fval = '0001'.
APPEND i_ftpost.
i_ftpost-fnam = 'BKPF-WAERS'.
i_ftpost-fval = 'GBP'.
APPEND i_ftpost.
i_ftpost-fnam = 'BKPF-BKTXT'.
i_ftpost-fval = 'Text'.
APPEND i_ftpost.
CLEAR ws_lines_doc.
endform. " f5000_fill_doc_header
&----
*& Form f6000_fill_doc_position
&----
text
----
--> p1 text
<-- p2 text
----
form f6000_fill_doc_position .
i_ftpost-stype = 'P'.
ADD 1 TO ws_lines_doc.
i_ftpost-count = ws_lines_doc.
i_ftpost-fnam = 'RF05A-NEWBS'.
i_ftpost-fval = '40'.
APPEND i_ftpost.
i_ftpost-fnam = 'RF05A-NEWKO'.
i_ftpost-fval = '220200'.
APPEND i_ftpost.
i_ftpost-fnam = 'BSEG-WRBTR'.
i_ftpost-fval = '1.00'.
APPEND i_ftpost.
i_ftpost-stype = 'P'.
ADD 1 TO ws_lines_doc.
i_ftpost-count = '2'.
i_ftpost-fnam = 'RF05A-NEWBS'.
i_ftpost-fval = '50'.
APPEND i_ftpost.
i_ftpost-fnam = 'RF05A-NEWKO'.
i_ftpost-fval = '113200'.
APPEND i_ftpost.
i_ftpost-fnam = 'BSEG-WRBTR'.
i_ftpost-fval = '*'.
APPEND i_ftpost.
endform. " f6000_fill_doc_position
Regards,
Bittu