How to use BAPI_ACC_DOCUMENT_POST
Hello ALL.
I need to update the field AUFNR in database table BSEG, I'm using the BAPI BAPI_ACC_DOCUMENT_POST, the function module execute with out errors, but do not change the field AUFNR.
Could any one help me?
Thanks in advance
Hello Lalit, thanks for your answer.
We take care about the order number while creating new accounting documents, But the users are creating these documents automatically through transaction code FAGL_FC_VAL (Foreign Currency Valuation).
This transaction code creates a new accounting document based on another accounting document already created, what I need is, replicate the order number from original accounting document into the new one.
Best regards.
Similar Messages
-
Help on how to use BAPI_ACC_DOCUMENT_POST...
Hello experts,
Please help me on how to use the BAPI BAPI_ACC_DOCUMENT_POST. I dont have the time to
record via SHDB and do BDC and I would like to try out the said BAPI. I think this will be faster
I need to fill in the header, line items, etc. Any detailed examples will be highly appreciated.
Thanks a lot guys and take care!Take a look at the following code :
* IF GL ACCOUNT
* Accountgl / Compte générale
ws_accountgl-itemno_acc = w_compt.
ws_accountgl-comp_code = p_bukrs.
ws_accountgl-pstng_date = ws_reformat-datecpt.
ws_accountgl-fisc_year = ws_reformat-datecpt(4).
ws_accountgl-fis_period = ws_reformat-datecpt+4(2).
ws_accountgl-doc_type = p_blart.
ws_accountgl-item_text = ws_reformat-libel.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = ws_reformat-cptclf
IMPORTING
output = ws_accountgl-gl_account.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = ws_reformat-kostl
IMPORTING
output = ws_accountgl-costcenter.
ELSE. " ACC. PAYABLE
* Account Payable / Compte fournisseur
ws_accountpayable-itemno_acc = w_compt.
ws_accountpayable-comp_code = p_bukrs.
ws_accountpayable-item_text = ws_reformat-libel.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = ws_reformat-cptclf
IMPORTING
output = ws_accountpayable-vendor_no.
APPEND ws_accountpayable TO accountpayable.
ENDIF.
* Currencyamount Struct.
ws_currencyamount-itemno_acc = w_compt.
ws_currencyamount-currency = 'EUR'.
* ws_currencyamount-curr_type = '00'.
IF ws_reformat-sign EQ 'C'.
ws_reformat-wrbtr_c = ws_reformat-wrbtr_c * ( - 1 ).
ENDIF.
ws_currencyamount-amt_doccur = ws_reformat-wrbtr_c.
APPEND ws_currencyamount TO currencyamount.
* BAPI
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = documentheader
TABLES
accountgl = accountgl
accountpayable = accountpayable
currencyamount = currencyamount
return = t_return.
IF sy-subrc <> 0.
MESSAGE e999(re) WITH 'Problem occured'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF. -
How to Use 'BAPI_ACC_DOCUMENT_POST' in an Inbound IDOC?
Hi,
One of the standard IDOC for posting accounts is Message type(ACC_DOCUMENT), and an FM IDOC_INPUT_ACC_DOCUMENT "NOT released' uses same
functionality to achieve.
I created a custom one as standard one is not released yet, My question is how to handle records if number of records in flat file coming from legacy contains more data.
Example. If number of records exceeds 999.
Thanks and Regards
MohinderHi,
BAPI_ACC_DOCUMENT_POST can post 999 line items only.
More than 999 records:
If the count is 999 don't take the flat file values, take a dummy GL account and assign it as 999 record.
the amount should be balance amount of 998 records, it may credit or debit.
Regards,
Sri -
How to use BAPI_ACC_DOCUMENT_POST for CO-PA Account Assignment
hi all,
when i used bapi to posting docment,but for document_type ='DR'(customer invoice), it is related with Profit. Segment.
it returned following message in return table:
E RW 609 Error in document: ZBKPF ZY2005 DEVCLNT230
E F5 808 Field Prof.Segmt is a required field for G/L account CN10 50600824
W KI 166 Enter a true account assignment object with revenues
maybe due to i haven't fill parameter:CRITERIA and VALUEFIELD
but i have no idea about this.
would you please give some idea, sample code is great .
thanks.
helenHi, Qunli
If you haven't the documentation of the BAPI, you can search in here http://ifr.sap.com/catalog/query.asp
You can find the BAPI in SAP FI(470 or above). Under the 'Accounting Interface' hierarchy, you can find a 'AcctngBilling' BO, and the Post method of it is the BAPI you're calling. (you can search to demonstrate in Tcode BAPI). There is some explain for the interface, if it is not enough, I have some sample application which call this BAPI.
Hope it will be helpful.
Thanks a lot -
As far as I know this two bapi used to create accounting document. But how do we use them ? and what's the different between them?
The most important thing is in what condition we use which bapi to post accounting doc?
Such as there is one requirement to post accounting doc though t-code F-02 in BDC, but how do I know whether I can use this two bapi to replace the BDC?
BAPI_ACC_DOCUMENT_POST
BAPI_ACC_GL_POSTING_POSTHello,
how we use BAPI_ACC_DOCUMENT_POST:
gs_documentheader-ref_doc_no = .... your document number (from number range)
gs_documentheader-bus_act = 'RFBU'.
gs_documentheader-username = sy-uname.
gs_documentheader-header_txt = .... your header text
gs_documentheader-comp_code = '0001'.
gs_documentheader-doc_date = ..... date
gs_documentheader-pstng_date = .... date
gs_documentheader-fisc_year =.... year
gs_documentheader-fis_period = .... period
gs_documentheader-doc_type = 'BS'.
loop at ... items ... assigning <belpos_line>.
gs_accountgl-itemno_acc = <belpos_line>-posnr. "10 digits !
gs_accountgl-bus_area = ... your business area
gs_accountgl-tax_code = <belpos_line>-tax_code.
gs_accountgl-gl_account = <belpos_line>-gl_account.
gs_accountgl-comp_code = ... your company code.
gs_accountgl-alloc_nmbr = ... some identity number
gs_accountgl-item_text = .... item text
gs_accountgl-costcenter = <belpos_line>-kostl.
gs_accountgl-plant = .... werks
append gs_accountgl to gt_accountgl.
gs_currencyamount-itemno_acc = <belpos_line>-posnr.
gs_currencyamount-currency = ... waers
gs_currencyamount-amt_doccur = .... waers
append gs_currencyamount to gt_currencyamount.
endloop.
call function 'BAPI_ACC_DOCUMENT_POST'
exporting
documentheader = gs_documentheader
importing
obj_type = gd_obj_type
obj_key = gd_obj_key
obj_sys = gd_obj_sys
tables
accountgl = gt_accountgl
currencyamount = gt_currencyamount
return = gt_return.
Regards -
How to use EXTENSION1 in BAPI_ACC_DOCUMENT_POST
Hi,
I am using BAPI_ACC_DOCUMENT_POST for posting documents similar to what is posted using FBS1 transaction code.
I'm not able to populate reversal date in the BAPI_ACC_DOCUMENT_POST. There is a provision it seems using the EXTENSION1 tables parameter.
Can anyone please tell me the procedure preferably a small piece of sample code in which I can know how to pass the Reversal Date using the EXTENSION1 structure.
Also which process code is required to be used in the Business Transaction Events enhancements to implement this.
Thanks and regards,
Satyadev Duttahi
good
go through this program which ll help you to give greater knowledge about use of EXTENSION1 in BAPI_ACC_DOCUMENT_POST
======================================
report zbapi_factura_acreedor2 .
*REPORT acc_bapi_test_document .
selection-screen begin of block bl01 .
parameters:
check_l radiobutton group rb1,
check_a default 'X' radiobutton group rb1,
post radiobutton group rb1.
selection-screen uline.
parameters:
rev_c radiobutton group rb1,
rev_p radiobutton group rb1.
selection-screen uline.
parameters:
ref_key like bapiache01-obj_key default 'TEST000001BAPICALL',
dest like bdi_logsys-logsys default ' '.
selection-screen end of block bl01 .
data:
gd_documentheader like bapiache09,
gd_customercpd like bapiacpa09,
gd_fica_hd like bapiaccahd,
it_accountreceivable like table of bapiacar09 with header line,
it_accountgl like table of bapiacgl09 with header line,
it_accounttax like table of bapiactx09 with header line,
it_criteria like table of bapiackec9 with header line,
it_valuefield like table of bapiackev9 with header line,
it_currencyamount like table of bapiaccr09 with header line,
it_return like table of bapiret2 with header line,
it_receivers like table of bdi_logsys with header line,
it_fica_it like table of bapiaccait with header line,
it_accountpayable like table of bapiacap09 with header line,
it_paymentcard like table of bapiacpc09 with header line,
it_ext like table of bapiacextc with header line.
it_re LIKE TABLE OF bapiacre09 WITH HEADER LINE,
it_ext2 LIKE TABLE OF bapiparex WITH HEADER LINE.
perform fill_internal_tables.
if check_l = 'X'.
call function 'BAPI_ACC_DOCUMENT_CHECK'
destination dest
exporting
documentheader = gd_documentheader
customercpd = gd_customercpd
contractheader = gd_fica_hd
tables
accountgl = it_accountgl
accountreceivable = it_accountreceivable
accountpayable = it_accountpayable
accounttax = it_accounttax
currencyamount = it_currencyamount
criteria = it_criteria
valuefield = it_valuefield
extension1 = it_ext
return = it_return
paymentcard = it_paymentcard
contractitem = it_fica_it.
extension2 = it_ext2
realestate = it_re.
write: / 'Result of check lines:'. "#EC NOTEXT
perform show_messages.
endif.
if check_a = 'X'.
call function 'BAPI_ACC_DOCUMENT_CHECK'
destination dest
exporting
documentheader = gd_documentheader
customercpd = gd_customercpd
contractheader = gd_fica_hd
tables
accountgl = it_accountgl
accountreceivable = it_accountreceivable
accountpayable = it_accountpayable
accounttax = it_accounttax
currencyamount = it_currencyamount
criteria = it_criteria
valuefield = it_valuefield
extension1 = it_ext
return = it_return
paymentcard = it_paymentcard
contractitem = it_fica_it.
extension2 = it_ext2
realestate = it_re.
write: / 'Result of check all:'. "#EC NOTEXT
perform show_messages.
endif.
if post = 'X'.
data: l_type like gd_documentheader-obj_type,
l_key like gd_documentheader-obj_key,
l_sys like gd_documentheader-obj_sys.
if dest = space or
dest = gd_documentheader-obj_sys.
post synchron
call function 'BAPI_ACC_DOCUMENT_POST'
exporting
documentheader = gd_documentheader
customercpd = gd_customercpd
contractheader = gd_fica_hd
importing
obj_type = l_type
obj_key = l_key
obj_sys = l_sys
tables
accountgl = it_accountgl
accountreceivable = it_accountreceivable
accountpayable = it_accountpayable
accounttax = it_accounttax
currencyamount = it_currencyamount
criteria = it_criteria
valuefield = it_valuefield
extension1 = it_ext
return = it_return
paymentcard = it_paymentcard
contractitem = it_fica_it.
extension2 = it_ext2
realestate = it_re.
write: / 'Result of post:'. "#EC NOTEXT
perform show_messages.
else.
create Idoc
it_receivers-logsys = dest.
append it_receivers.
call function 'ALE_ACC_DOCUMENT_POST'
exporting
documentheader = gd_documentheader
customercpd = gd_customercpd
contractheader = gd_fica_hd
tables
accountgl = it_accountgl
accountreceivable = it_accountreceivable
accountpayable = it_accountpayable
accounttax = it_accounttax
currencyamount = it_currencyamount
criteria = it_criteria
valuefield = it_valuefield
extension1 = it_ext
paymentcard = it_paymentcard
contractitem = it_fica_it
extension2 = it_ext2
realestate = it_re
receivers = it_receivers
COMMUNICATION_DOCUMENTS =
APPLICATION_OBJECTS =
exceptions
error_creating_idocs = 1
others = 2 .
if sy-subrc = 0.
write: / 'IDoc created'. "#EC NOTEXT
else.
write: sy-msgid.
endif.
endif.
endif.
if rev_p = 'X' or rev_c = 'X'.
data: rev like bapiacrev,
rev_key like ref_key.
rev_key = ref_key.
rev_key(1) = 'R'.
rev-obj_type = gd_documentheader-obj_type.
rev-obj_key = rev_key.
rev-obj_sys = gd_documentheader-obj_sys.
rev-obj_key_r = ref_key.
if rev_c is initial.
if dest = space or
dest = gd_documentheader-obj_sys.
call function 'BAPI_ACC_DOCUMENT_REV_POST'
exporting
reversal = rev
bus_act = gd_documentheader-bus_act
tables
return = it_return.
else.
it_receivers-logsys = dest.
append it_receivers.
call function 'ALE_ACC_DOCUMENT_REV_POST'
exporting
reversal = rev
busact = gd_documentheader-bus_act
OBJ_TYPE = 'BUS6035'
SERIAL_ID = '0'
tables
receivers = it_receivers
COMMUNICATION_DOCUMENTS =
APPLICATION_OBJECTS =
exceptions
error_creating_idocs = 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.
else.
write: / 'IDoc created'. "#EC NOTEXT
endif.
endif.
else.
call function 'BAPI_ACC_DOCUMENT_REV_CHECK'
exporting
reversal = rev
bus_act = gd_documentheader-bus_act
tables
return = it_return.
endif.
write: / 'Result of Reversal Posting:'. "#EC NOTEXT
perform show_messages.
endif.
commit work.
Form fill_internal_tables
form fill_internal_tables.
perform fill_header.
perform fill_accountgl.
perform fill_accountar.
perform fill_accountap.
perform fill_accounttax.
perform fill_currencyamount.
perform fill_criteria.
perform fill_valuefield.
perform fill_re.
perform fill_cpd.
perform fill_contractitem.
perform fill_contractheader.
perform fill_paymentcard.
perform fill_extension.
endform. " fill_internal_tables
Form Show_messages
form show_messages.
if it_return[] is initial.
write: / 'no messages'.
else.
skip 1.
loop at it_return.
write: / it_return-type,
(2) it_return-id,
it_return-number,
(80) it_return-message,
IT_RETURN-LOG_NO
IT_RETURN-LOG_MSG_NO
it_return-message_v1,
IT_RETURN-MESSAGE_V2
IT_RETURN-MESSAGE_V3
IT_RETURN-MESSAGE_V4
(20) it_return-parameter,
(3) it_return-row,
it_return-field.
IT_RETURN-SYSTEM
endloop.
endif.
uline.
endform. " Show_messages
FORM fill_accountgl *
form fill_accountgl.
clear it_accountgl.
it_accountgl-itemno_acc = 2.
it_accountgl-gl_account = '0021510201'.
it_accountgl-item_text = 'BAPI Test G/L line item'. "#EC NOTEXT
it_accountgl-bus_area = '01'.
it_accountgl-profit_ctr = '0000010101'.
it_accountgl-comp_code = 'SLOC'.
append it_accountgl.
clear it_accountgl.
it_accountgl-itemno_acc = 3.
it_accountgl-gl_account = '0082000201'.
it_accountgl-item_text = 'BAPI Test G/L line item'. "#EC NOTEXT
it_accountgl-bus_area = '01'.
it_accountgl-profit_ctr = '0000010101'.
it_accountgl-comp_code = 'SLOC'.
it_accountgl-tax_code = 'A3'.
append it_accountgl.
clear it_accountgl.
it_accountgl-itemno_acc = 5.
it_accountgl-gl_account = '0021510201'.
it_accountgl-item_text = 'BAPI Test G/L line item'. "#EC NOTEXT
it_accountgl-bus_area = '01'.
it_accountgl-profit_ctr = '0000010301'.
it_accountgl-comp_code = 'SLOC'.
append it_accountgl.
clear it_accountgl.
it_accountgl-itemno_acc = 6.
it_accountgl-gl_account = '0082000201'.
it_accountgl-item_text = 'BAPI Test G/L line item'. "#EC NOTEXT
it_accountgl-bus_area = '01'.
it_accountgl-profit_ctr = '0000010301'.
it_accountgl-comp_code = 'SLOC'.
it_accountgl-tax_code = 'A3'.
append it_accountgl.
clear it_accountgl.
it_accountgl-itemno_acc = 7.
it_accountgl-itemno_acc = 8.
it_accountgl-gl_account = '0021510201'.
it_accountgl-item_text = 'BAPI Test G/L line item'. "#EC NOTEXT
it_accountgl-bus_area = '90'.
it_accountgl-profit_ctr = '0000900008'.
it_accountgl-comp_code = 'CORP'.
append it_accountgl.
clear it_accountgl.
it_accountgl-itemno_acc = 8.
it_accountgl-itemno_acc = 9.
it_accountgl-gl_account = '0082000201'.
it_accountgl-item_text = 'BAPI Test G/L line item'. "#EC NOTEXT
it_accountgl-bus_area = '90'.
it_accountgl-profit_ctr = '0000900008'.
it_accountgl-comp_code = 'CORP'.
it_accountgl-tax_code = 'A3'.
append it_accountgl.
endform. "fill_accountgl
FORM fill_header *
form fill_header.
CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
IMPORTING
own_logical_system = gd_documentheader-obj_sys.
OBJ_TYPE has to be replaced by customers object key (Y* or Z*)
gd_documentheader-obj_type = 'IDOC'.
gd_documentheader-obj_key = ref_key.
gd_documentheader-username = sy-uname.
gd_documentheader-header_txt = 'BAPI Test'. "#EC NOTEXT
gd_documentheader-obj_key_r =
GD_DOCUMENTHEADER-reason_rev =
gd_documentheader-comp_code = 'SLOC'.
GD_DOCUMENTHEADER-AC_DOC_NO =
gd_documentheader-fisc_year = sy-datum(4).
gd_documentheader-doc_date = sy-datum.
gd_documentheader-pstng_date = sy-datum.
GD_DOCUMENTHEADER-TRANS_DATE =
GD_DOCUMENTHEADER-VALUE_DATE =
GD_DOCUMENTHEADER-FIS_PERIOD =
gd_documentheader-doc_type = 'KR'.
gd_documentheader-ref_doc_no = 'xxxx'.
GD_DOCUMENTHEADER-COMPO_ACC =
gd_documentheader-bus_act = 'RFBU'.
endform. "fill_header
FORM fill_contractheader *
form fill_contractheader.
gd_fica_hd-doc_no =
gd_fica_hd-doc_type_ca =
gd_fica_hd-res_key =
gd_fica_hd-fikey =
gd_fica_hd-payment_form_ref =
endform. "fill_contractheader
FORM fill_cpd *
form fill_cpd.
gd_customercpd-name
gd_customercpd-name_2
gd_customercpd-name_3
gd_customercpd-name_4
gd_customercpd-postl_code
gd_customercpd-city
gd_customercpd-country
gd_customercpd-country_iso
gd_customercpd-street
gd_customercpd-po_box
gd_customercpd-pobx_pcd
gd_customercpd-pobk_curac
gd_customercpd-bank_acct
gd_customercpd-bank_no
gd_customercpd-bank_ctry
gd_customercpd-bank_ctry_iso
gd_customercpd-tax_no_1
gd_customercpd-tax_no_2
gd_customercpd-tax
gd_customercpd-equal_tax
gd_customercpd-region
gd_customercpd-ctrl_key
gd_customercpd-instr_key
gd_customercpd-dme_ind
gd_customercpd-langu_iso
endform. "fill_cpd
FORM fill_ar *
form fill_accountar.
CLEAR it_accountreceivable.
it_accountreceivable-itemno_acc =
it_accountreceivable-customer =
IT_ACCOUNTRECEIVABLE-REF_KEY_1 =
IT_ACCOUNTRECEIVABLE-REF_KEY_2 =
IT_ACCOUNTRECEIVABLE-REF_KEY_3 =
IT_ACCOUNTRECEIVABLE-PMNTTRMS =
IT_ACCOUNTRECEIVABLE-BLINE_DATE =
IT_ACCOUNTRECEIVABLE-DSCT_DAYS1 =
IT_ACCOUNTRECEIVABLE-DSCT_DAYS2 =
IT_ACCOUNTRECEIVABLE-NETTERMS =
IT_ACCOUNTRECEIVABLE-DSCT_PCT1 =
IT_ACCOUNTRECEIVABLE-DSCT_PCT2 =
IT_ACCOUNTRECEIVABLE-PYMT_METH =
IT_ACCOUNTRECEIVABLE-DUNN_KEY =
IT_ACCOUNTRECEIVABLE-DUNN_BLOCK =
IT_ACCOUNTRECEIVABLE-PMNT_BLOCK =
IT_ACCOUNTRECEIVABLE-VAT_REG_NO =
IT_ACCOUNTRECEIVABLE-ALLOC_NMBR =
it_accountreceivable-item_text =
IT_ACCOUNTRECEIVABLE-PARTNER_BK =
IT_ACCOUNTRECEIVABLE-GL_ACCOUNT =
it_accountreceivable-comp_code
it_accountreceivable-bus_area
it_accountreceivable-pmtmthsupl
it_accountreceivable-paymt_ref
it_accountreceivable-scbank_ind
it_accountreceivable-businessplace
it_accountreceivable-sectioncode
it_accountreceivable-branch
it_accountreceivable-pymt_cur
it_accountreceivable-pymt_cur_iso
it_accountreceivable-pymt_amt
it_accountreceivable-c_ctr_area
it_accountreceivable-bank_id
it_accountreceivable-supcountry
it_accountreceivable-supcountry_iso
it_accountreceivable-tax_code
it_accountreceivable-taxjurcode
it_accountreceivable-tax_date
it_accountreceivable-sp_gl_ind
it_accountreceivable-partner_guid = '1465464654'.
APPEND it_accountreceivable.
endform. "fill_accountar
FORM fill_ap *
form fill_accountap.
clear it_accountpayable.
it_accountpayable-itemno_acc = 1.
it_accountpayable-vendor_no = '0000060259'.
it_accountpayable-vendor_no = '0000060693'.
it_accountpayable-gl_account
it_accountpayable-ref_key_1
it_accountpayable-ref_key_2
it_accountpayable-ref_key_3
it_accountpayable-comp_code = 'SLOC'.
it_accountpayable-bus_area = '01'.
it_accountpayable-pmnttrms = 'A000'.
it_accountpayable-bline_date
it_accountpayable-dsct_days1
it_accountpayable-dsct_days2
it_accountpayable-netterms
it_accountpayable-dsct_pct1
it_accountpayable-dsct_pct2
it_accountpayable-pymt_meth
it_accountpayable-pmtmthsupl
it_accountpayable-pmnt_block
it_accountpayable-scbank_ind
it_accountpayable-supcountry
it_accountpayable-supcountry_iso
it_accountpayable-bllsrv_ind
it_accountpayable-alloc_nmbr
it_accountpayable-item_text = 'BAPI Test A/P line item'. "#EC NOTEXT
it_accountpayable-po_sub_no
it_accountpayable-po_checkdg
it_accountpayable-po_ref_no
it_accountpayable-w_tax_code
it_accountpayable-businessplace
it_accountpayable-sectioncode
it_accountpayable-instr1
it_accountpayable-instr2
it_accountpayable-instr3
it_accountpayable-instr4
it_accountpayable-branch
it_accountpayable-pymt_cur
it_accountpayable-pymt_amt
it_accountpayable-pymt_cur_iso
it_accountpayable-sp_gl_ind
append it_accountpayable.
endform. "fill_accountap
FORM fill_tax *
form fill_accounttax.
clear it_accounttax.
it_accounttax-itemno_acc = 4.
it_accounttax-gl_account = '0011361502'.
it_accounttax-tax_code = 'A3'.
it_accounttax-acct_key = 'VST'.
it_accounttax-cond_key = 'MWVS'.
it_accounttax-itemno_tax = 8.
append it_accounttax.
clear it_accounttax.
it_accounttax-itemno_acc = 7.
it_accounttax-gl_account = '0011361502'.
it_accounttax-tax_code = 'A3'.
it_accounttax-acct_key = 'VST'.
it_accounttax-COND_KEY = 'MWVS'.
append it_accounttax.
clear it_accounttax.
it_accounttax-itemno_acc = 10.
it_accounttax-itemno_acc = 9.
it_accounttax-gl_account = '0011361502'.
it_accounttax-tax_code = 'A3'.
it_accounttax-acct_key = 'VST'.
it_accounttax-cond_key = 'MWVS'.
it_accounttax-itemno_tax = 4.
append it_accounttax.
endform. "fill_accounttax
FORM fill_currencyamount *
form fill_currencyamount.
clear it_currencyamount.
it_currencyamount-itemno_acc = 1.
it_currencyamount-curr_type = '00'.
it_currencyamount-currency = 'MXN'.
it_currencyamount-amt_doccur = '-7408036.2'.
append it_currencyamount.
clear it_currencyamount.
it_currencyamount-itemno_acc = 2.
it_currencyamount-curr_type = '00'.
it_currencyamount-currency = 'MXN'.
it_currencyamount-amt_doccur = '5336472.00'.
append it_currencyamount.
clear it_currencyamount.
it_currencyamount-itemno_acc = 3.
it_currencyamount-curr_type = '00'.
it_currencyamount-currency = 'MXN'.
it_currencyamount-amt_doccur = '3840.00'.
append it_currencyamount.
clear it_currencyamount.
it_currencyamount-itemno_acc = 4.
it_currencyamount-curr_type = '00'.
it_currencyamount-currency = 'MXN'.
it_currencyamount-amt_base = '5548.00'.
it_currencyamount-amt_doccur = '832.2'.
it_currencyamount-amt_doccur = '576.00'.
it_currencyamount-amt_base = '3840.00'.
append it_currencyamount.
clear it_currencyamount.
it_currencyamount-itemno_acc = 5.
it_currencyamount-curr_type = '00'.
it_currencyamount-currency = 'MXN'.
it_currencyamount-amt_doccur = '2051279.00'.
append it_currencyamount.
clear it_currencyamount.
it_currencyamount-itemno_acc = 6.
it_currencyamount-curr_type = '00'.
it_currencyamount-currency = 'MXN'.
it_currencyamount-amt_doccur = '1690.00'.
append it_currencyamount.
clear it_currencyamount.
it_currencyamount-itemno_acc = 7.
it_currencyamount-curr_type = '00'.
it_currencyamount-currency = 'MXN'.
it_currencyamount-amt_base = '1690.00'.
it_currencyamount-amt_doccur = '253.5'.
append it_currencyamount.
clear it_currencyamount.
it_currencyamount-itemno_acc = 8.
it_currencyamount-itemno_acc = 7.
it_currencyamount-curr_type = '00'.
it_currencyamount-currency = 'MXN'.
it_currencyamount-amt_doccur = '13905.00'.
append it_currencyamount.
clear it_currencyamount.
it_currencyamount-itemno_acc = 9.
it_currencyamount-itemno_acc = 8.
it_currencyamount-curr_type = '00'.
it_currencyamount-currency = 'MXN'.
it_currencyamount-amt_base = '2.70'.
it_currencyamount-amt_doccur = '18.00'.
append it_currencyamount.
clear it_currencyamount.
it_currencyamount-itemno_acc = 10.
it_currencyamount-itemno_acc = 9.
it_currencyamount-curr_type = '00'.
it_currencyamount-currency = 'MXN'.
it_currencyamount-amt_doccur = '2.70'.
it_currencyamount-amt_base = '18.00'.
append it_currencyamount.
endform. "fill_currencyamount
FORM fill_criteria *
form fill_criteria.
CLEAR it_criteria.
it_criteria-itemno_acc = 2.
it_criteria-fieldname = 'BZIRK'.
it_criteria-character = '000001'.
append it_criteria.
endform. "fill_criteria
FORM fill_valuefield *
form fill_valuefield.
CLEAR it_valuefield.
it_valuefield-itemno_acc = 2.
it_valuefield-fieldname = 'VV010'.
it_valuefield-curr_type
it_valuefield-currency = 'EUR'.
it_valuefield-currency_iso
it_valuefield-amt_valcom
it_valuefield-base_uom
it_valuefield-base_uom_iso
it_valuefield-qua_valcom
append it_valuefield.
endform. "fill_valuefield
FORM fill_extension *
form fill_extension.
CLEAR it_ext.
it_ext-field1
it_ext-field2
it_ext-field3
it_ext-field4
APPEND it_ext.
DATA: ls_zzz TYPE ZZZ_ACCIT.
CLEAR it_ext2.
it_ext2-structure = 'ZZZ_ACCIT'.
ls_zzz-posnr = 2.
ls_zzz-awref_reb = '123654'.
ls_zzz-aworg_reb = '654654'.
ls_zzz-grant_nbr = '0022002'.
MOVE ls_zzz TO it_ext2-valuepart1.
APPEND it_ext2.
endform. "fill_extension
FORM fill_paymentcard *
form fill_paymentcard.
CLEAR it_paymentcard.
it_paymentcard-itemno_acc = 1.
it_paymentcard-cc_glaccount
it_paymentcard-cc_type
it_paymentcard-cc_number
it_paymentcard-cc_seq_no
it_paymentcard-cc_valid_f
it_paymentcard-cc_valid_t
it_paymentcard-cc_name
it_paymentcard-dataorigin
it_paymentcard-authamount = '100'.
it_paymentcard-currency = 'EUR'.
it_paymentcard-currency_iso
it_paymentcard-cc_autth_no
it_paymentcard-auth_refno
it_paymentcard-auth_date
it_paymentcard-auth_time
it_paymentcard-merchidcl
it_paymentcard-point_of_receipt
it_paymentcard-terminal
it_paymentcard-cctyp = '1'.
APPEND it_paymentcard.
endform. "fill_paymentcard
FORM fill_contractitem *
form fill_contractitem.
CLEAR it_fica_it.
it_fica_it-itemno_acc
it_fica_it-cont_acct
it_fica_it-main_trans
it_fica_it-sub_trans
it_fica_it-func_area
it_fica_it-fm_area
it_fica_it-cmmt_item
it_fica_it-funds_ctr
it_fica_it-fund
append it_fica_it.
endform. "fill_contractitem
*& Form fill_re
form fill_re .
CLEAR it_re.
it_re-itemno_acc =
it_re-business_entity =
it_re-building =
it_re-property =
it_re-rental_object =
it_re-serv_charge_key =
it_re-settlement_unit =
it_re-contract_no =
APPEND it_re.
endform. "fill_re
thanks
mrutyun^ -
How to populate COPA fields for GL posting using BAPI_ACC_DOCUMENT_POST
Hi All,
I am posting documents in FB50 using BAPI_ACC_DOCUMENT_POST. I have a requirement to post the documents with profitability segment parameters as well. Should I use EXTENSION1 table to pass COPA updates and implement BTE to achieve it? Can anyone please guide me with the procedure to populate the COPA fields for GL posting using BAPI_ACC_DOCUMENT_POST?
Also please let me know how/where to check if COPA is enabled for a GL account.
Thanks,
SubathraModerator Message: This forum is for questions directly related to Web Dynpro ABAP only. It should not be used for general questions. I am moving this thread to the ABAP General forum.
-
How to use Bapi BAPI_ACC_DOCUMENT_POST for g/l account document posting
Hi all,
I am using BAPI_ACC_DOCUMENT_POST bapi for g/l account documents posting.as I am first time using BAPI in my program.can anyone give details about how to use this BAPI for document postings.what importing parameters need to be passed , which exporting parameters need to be passed and which tables need to be used.
Thanks in advance.
Regards,
HarshadaModerator message - Please search before asking - post locked
Rob -
Hi,
I want to post asset together with expense into one document. The first approach is to use BAPI_ACC_DOCUMENT_POST with custom obj_type, like ZBKPF. But when we post using the custom obj_type, we cannot reverse the document using FB08.
Is that anyway we can post using BAPI_ACC_DOCUMENT_POST and reverse using FB08?
Or is that any BAPI that can do this?
Thanks,
Tai
Edited by: Tai Pang Ng on Apr 8, 2011 9:37 PMIt is because I want to post asset. I tried to post my asset without specified the obj_type and acc_type, then I got an error saying cannot direct post thru my GL account. That's true becuase posting asset, we just use asset number and reconciliation GL.
Then I tried to put my asset no in GL field, then I got another error saying the GL is not in Chart of Account, and that's true also becuase the asset no is never config in our chart of account.
Then I found out that I had to specified the acct_type to 'A'. After that, I got another error saying RFBURFBU000000000000 is not define. That's I cannot post this thru obj_type RBFU. After checking that, I had to specified bus_act to RMWE and custom obj_type to some Z value to make it go.
But after all these, I cannot reverse my posting using FB08 anymore because this is an custom obj_type and not allow to reverse using FB08.
Please let me know if I made mistake in the above.
Thanks,
Tai -
Accounting Document not Cleared using BAPI_ACC_DOCUMENT_POST
Dear Experts,
I am Using BAPI_ACC_DOCUMENT_POST to post the GL'S , Accounting document is getting created successfully . My Doubt is whether this bapi will clear the Accounting document automatically or we have to use any other function module to clear the Document?
Please let me know how to clear the document.
Thanks & Regards,
Hemant Gulati(A1)Documents are not cleared; their line items are.
Rob -
No need to calc the tax by using BAPI_ACC_DOCUMENT_POST
Hi
i am using BAPI_ACC_DOCUMENT_POST to upload the transaction data.
here no need to calc the TAX since i have the tax field in my file.
i checked the SDN links but those are not serving problem.
Pls give some snippet to slove my problem.
Thanks in advance.
Regards,
Sriya i am passing string to Extension from BAPI.
Then i wrote like this
READ TABLE C_EXTENSION INDEX 1.
IF C_EXTENSION-FIELD1 = 'BAPI CALL'.
LOOP AT C_ACCIT.
c_ACCIT-MWSKZ = 'ST'.
MODIFY C_ACCIT.
how to pass the tax field.
i am checking with this code but while deburging i can see it not taking my Gfunciton module.
Thank you very much for you replies Vinod.
Sri
Edited by: srikanthn on Apr 19, 2010 6:19 PM -
Upload item text for FI document using BAPI_ACC_DOCUMENT_POST
Hi,
I need to upload FI document posting using BAPI_ACC_DOCUMENT_POST. However item text that I received is too long and need to store at item long text. So can we use BAPI_ACC_DOCUMENT_POST to upload long text for item text? If this possible, may I know how to do this.
Thanks.
Regards,
ainHi,
You cannot pass item long text using this BAPI, Call the function module SAVE_TEXT after successfull call of BAPI
Call Save_Text with following parameters.
Text_ID : 0001 (Notes)
Text_object : DOC_ITEM (Line Item Text)
Language : EN
Text Name : Company code +Document NO + Fiscal Year + Line item ID
Regards
Vinod -
Down payment request for assets using bapi_acc_document_post
Hi guys(girls)!,
I<< priority reduced >>
I'm posting a down payment request to an asset with a z program using bapi_acc_document_post. Everything is fine, but, when i go to fb03 to check the generated document i don't see the asset number associated to the purchase doc. When i go to bseg to check, i don't see the asset number and the subnumber. I lack just these to fields even i'm passing the values to correct fields in bapiacgl09.
This is the values i'm passing:
wa_acctgl-itemno_acc = iterator.
wa_acctgl-gl_account = lv_skont.
wa_acctgl-vendor_no = p_vendor.
wa_acctgl-doc_type = p_tipdoc.
wa_acctgl-item_text = p_txtcab.
wa_acctgl-po_number = p_ponum.
wa_acctgl-po_item = s_ekpo-ebelp.
wa_acctgl-serial_no = imp_no.
wa_acctgl-asset_no = wa_ekkn-anln1.
wa_acctgl-sub_number = wa_ekkn-anln2.
wa_acctgl-acct_type = 'A'.
wa_acctgl-CS_TRANS_T = '100'.
wa_acctgl-asval_date = sy-datum.
APPEND wa_acctgl TO gt_acctgl.
CLEAR wa_acctgl.
Please help!.
Edited by: Rob Burbank on Oct 24, 2011 9:44 AM
Edited by: ramvargash on Oct 25, 2011 2:54 PMHi Eduardo, what i'm trying to do is a down payment request for an asset. Indeed, i do the post. My problem is that the asset main number and the asset subnumber are not getting saved in bseg, so when i go to fb03 and double click on a line item, i got prompt to fb03 in visualize mode, and the fixed asset field is blank.
I have now a week trying to get the asset main number and the asset subnumber getting saved in bseg. I note that i have other field that are not getting saved 'cause i'm not passing the value thru the bapi. This field is LNRAN.
If you or anybody have a clue how to solve this, i would appreciate the help.
Ramón Vargas -
Inter company GL Postings using BAPI_ACC_DOCUMENT_POST
Hi,
I am having a requirement where one GL entry will be done for one company code and the 2nd entry will be done for another company code.
In this case there are 3 documents that are being generated.
One document for each company code and 3rd one for cross company code GL posting.
Can you please tell me how this can be done technically using some BAPI's or FM.
I tried using BAPI_ACC_DOCUMENT_POST, but was not successful
Appreciate any help in this regard.
Thanks and regards,
HariharanI have found it out myself. You can give the company code at item level and though the document number it gives back is the document for the header level code, where as this document contains the cross company code document inside it.
-
How to use Extension parameter in BAPI
Hi,
Can anyone provide any clue about how to use the EXTENSION paramenters in BAPI? Thanks.
Regards,
ChrisHi,
just check this thread you can get some idea how to use extension in BAPI.
BAPI_ACC_DOCUMENT_POST (EXTENSION)
Regards
Vijay
Maybe you are looking for
-
Is it possible to add a word at the end of a line?
Hi, i'm searching a way to automatically add a word at the end of a certain paragraph styles? is it something possible doing by using a script? i don't script myself but if someone could find me a way to do this it would be really appreciated. Here's
-
Hi friends, I am using an SVG object to create a pdf from BLS.I am assigning a string value to a variable pre-defined in that SVG object.The problem here is i am unable to get carriage return in that string(string is of huge length) which is being di
-
Dear All, If I change the House Bank Currency, do I also have to change the currency in the GL account too or it can remain the local currency? Thanx Rosalyn
-
HT1475 where can i get the plug in for a canon 5d mark iii
I bougth a new camera and i cant see mi .CR2 images in te preview it just apear the icon, I had been looking for an update but cant find one
-
Hi there, We're having issues when posting depreciation into Period 15 for 2009, and I was wondering if there is any way to check that our system is set up to accept posting from special periods (14, 15, 16). We have managed to post into periods 1 a