‎2008 Jun 25 5:52 PM
Hi gurus,
Im trying to create an FI document, but having the requirement that at least one item has to have the funds commitment doc number and doc number item.
How can i do this with this bapi? i've already search in the tables that the bapi uses, but didnt found any field for this...
Does anyone knows?
Thanks in Advance,
Best Regards
João Martins
Anyone?!?!?
Edited by: joao martins on Jun 26, 2008 11:23 AM
‎2008 Jun 26 6:05 PM
Hi Chidanand,
thanks for your reply, but i didnt get it where did you the funds commitment doc number and doc item...
As far as i know, it should be posted on the extension1 table, but it's giving me an error....
Any ideas?
Thanks for your reply,
Regards,
João Martins
‎2008 Jun 26 5:43 PM
Guys sorry to be boring but i really need help on this.
Can anyone help me on this subject??
thanks
Regards
‎2008 Jun 26 5:49 PM
Hi Joao,
I have developed one program for the below requirement .
Please take a look I think this might take a great help to solve your problem.
&*********Reward Point if helpful*************&
*&---------------------------------------------------------------------*
*& Report ZCC_ACCPOST_BAPI
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
report zcc_accpost_bapi no standard page heading..
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
*REPORT Z9_LALIT_ACCTPOST_BAPI
*Name: Chidanand Chauhan
*Desc: To Update the table for account posting using bapi.
*Date: 30/04/2007
**********************************************************************
* DATA DECLARATION
**********************************************************************
*
*&---HEADER DECLARATION
data: header type bapiache09. " HEADER DATA
**********************************************************************
* INTERNAL TABLE DECLARATION
**********************************************************************
*&----G/L ACCOUNT ITEM
data: accountgl type standard table of bapiacgl09.
*&---g/l Account tax
data: account_tax type standard table of bapiactx09.
*&---CURRENCY ITEMS
data: currency_amount type standard table of bapiaccr09.
*&----RETURN PARAMETER
data: return type standard table of bapiret2 with header line.
**********************************************************************
* WORK-AREA DECLARATION
**********************************************************************
*&----WORKAREA FOR G/L ACCOUNT ITEM
data: wa_accountgl type bapiacgl09.
*&---WORKAREA FOR CURRENCY ITEMS
data: wa_currency_amount type bapiaccr09.
*&---WORKAREA FOR TAX ITEMS
data: wa_tax type bapiactx09.
**********************************************************************
* INITIALIZATION
**********************************************************************
header-header_txt = 'TEST HEADER'.
header-username = 'DEVUSER'.
header-comp_code = '0001'.
header-fisc_year = '2008'.
header-doc_date = '20080625'.
header-pstng_date = '20080625'.
header-trans_date = '20080625'.
header-doc_type = 'RV'.
header-ac_doc_no = '90000014'.
header-bus_act = 'RFBU'.
wa_accountgl-itemno_acc = '0000000010'.
wa_accountgl-gl_account = '0000012000'.
wa_accountgl-item_text = 'SO_DOC'.
wa_accountgl-de_cre_ind = 'S'.
append wa_accountgl to accountgl.
clear wa_accountgl.
wa_accountgl-itemno_acc = '0000000020'.
wa_accountgl-gl_account = '0000113020'.
wa_accountgl-item_text = 'SO_DOC'.
wa_accountgl-de_cre_ind = 'H'.
append wa_accountgl to accountgl.
clear wa_accountgl.
wa_currency_amount-itemno_acc = '0000000010'.
wa_currency_amount-amt_doccur = '500'.
wa_currency_amount-currency = 'INR'.
append wa_currency_amount to currency_amount.
clear wa_currency_amount.
wa_currency_amount-itemno_acc = '0000000020'.
wa_currency_amount-amt_doccur = '-500'.
wa_currency_amount-currency = 'INR'.
append wa_currency_amount to currency_amount.
clear wa_currency_amount.
*WA_TAX-ITEMNO_ACC = '0000000010'.
*WA_TAX-TAX_CODE = 'V0'.
*APPEND WA_TAX TO ACCOUNT_TAX.
*CLEAR WA_TAX.
*
*WA_TAX-ITEMNO_ACC = '0000000020'.
*WA_TAX-TAX_CODE = 'V0'.
*APPEND WA_TAX TO ACCOUNT_TAX.
*CLEAR WA_TAX.
**************************************************************
* START-OF-SELECTION
**************************************************************
start-of-selection.
call function 'BAPI_ACC_DOCUMENT_POST'
exporting
documentheader = header
* CUSTOMERCPD =
* CONTRACTHEADER =
* IMPORTING
* OBJ_TYPE =
* OBJ_KEY =
* OBJ_SYS =
tables
accountgl = accountgl
* ACCOUNTRECEIVABLE =
* ACCOUNTPAYABLE =
* ACCOUNTTAX = ACCOUNT_TAX
currencyamount = currency_amount
* CRITERIA =
* VALUEFIELD =
* EXTENSION1 =
return = return
* PAYMENTCARD =
* CONTRACTITEM =
* EXTENSION2 =
* REALESTATE =
.
if return-type na 'EA'.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
* IMPORTING
* RETURN = RETURN.
write:/ return-message.
else.
write:/ return-message.
endif.
write:/ return-message+36(10).
write:/ return+36(10).
‎2008 Jun 26 6:05 PM
Hi Chidanand,
thanks for your reply, but i didnt get it where did you the funds commitment doc number and doc item...
As far as i know, it should be posted on the extension1 table, but it's giving me an error....
Any ideas?
Thanks for your reply,
Regards,
João Martins
‎2008 Jun 26 6:12 PM
What is the field in Bseg? I log in spanish and can't find them
If you don't see them in the table, you need to use the extension
The extension goes to a user exit where you need to move those fields to the tables, it doesn't work just putting information, you need to write the user exit also
‎2008 Jun 26 6:39 PM
Hi,
Yes you are right, you need to populate the extension structure and then move the fields in extension structure to accounting document.
For populating the accounting document from extension structure, you can either use the a BTE event RWBAPI01 or the enhancement spot badi BADI_ACC_DOCUMENT.
Check the BAPI_ACC_DOCUMENT_POST documentation for more information on extension structure.
Thanks
Romit
‎2008 Jun 26 7:52 PM
Guys thanks all for your anwsers,
I already figured out. Besides the exit to pass the funds commitment doc number, tyhat i allready had it, it was missing the geber, aufnr fistl etc to the strcture of the item... i wasn't passing becaus i thought that the bapi get it the information directly from the funds commitement....
Thanks again to all
Best Regards
João Martins
Ps - Points were rewarded