EXTENSION1 table in BAPI_ACC_BILLING_POST
hello experts,
I got one bapi to upload the data for AR line items and G/L line items BAPI_ACC_BILLING_POST. This bapi is containing all the fields to be mapped.... except BSEG-ZUONR, RSTGR and WSKTO.
If I add these 3 fields also into the the bapi extension1 table and write the logic in the corresponding user exit it will fulfill the requirement.
Can anyone guide me how to add these fields to the above function module IN EXTENSION1 table....
Please its bit urgent... can anyone guide me plz plz
SRI
can anyone give some idea about this...how to do?
Similar Messages
-
Extension1 table in BAPI_OUTB_DELIVERY_CHANGE
Hello all,
As far as i understood, i have to fill this extension1 table to change the likp fields with this bapi.
Is anyone has a sample code or an example for filling this table? There is only area for fields. Where are we going to put the values? And is there any flag to make this update? An axample of this bapi can be very useful too.
Thanks in advance.I solved the problem by using the enhancement below, addition to this bapi.
IF_EX_SMOD_V50B0001~EXIT_SAPLV50I_010
For further requirements im giving the code..
DATA ls_vbkok LIKE cs_vbkok.
MOVE-CORRESPONDING cs_vbkok TO ls_vbkok.
CLEAR cs_vbkok.
GET PARAMETER ID 'ZWMRFPAR001' FIELD ls_vbkok-lifex.
GET PARAMETER ID 'ZWMRFPAR002' FIELD ls_vbkok-wadat_ist.
FREE MEMORY ID 'ZWMRFPAR001'.
FREE MEMORY ID 'ZWMRFPAR002'.
ls_vbkok-borgr_kzwad = 'X'.
MOVE-CORRESPONDING ls_vbkok TO cs_vbkok. -
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^ -
Fill extension1 User-Exit LACC4F10
Hi dear friends,
I'm having a lot of trouble activating ACBAPI01 user-exit.
When calling user-exit in LACC4F10 there is the following code:
check not t_extension[] is initial.
read table it_acchd index 1.
call customer-function '001'
tables
t_accit = it_accit
extension = t_extension
return = lt_return
t_accwt = it_accwt
changing
t_acchd = it_acchd.
I don't know how or where to fill t_extension, i tried to apply Note 419666, which basically coments that line:
CHECK NOT t_extension[] IS INITIAL note 419666.
but that note can't be implemented anymore, i don't know what else to do. I search every note and forum but still can't figure out how to fill that structure. With that condition i can never get into zxaccu15.
Please i request your help.
Would be very grateful,
Daniel SinaniHi Daniel,
Basically this t_extension is related to BAPI 'BAPI_ACC_GL_POSTING_POST'. If there are any user defined fields to be populated then the extension1 table is filled in bapi which comes as T_EXTENSION in your exit. If there is nothing then user exit is not at all invoked.
But i want to know how you reached to this point of user-exit.
I mean why are you using this user exit.
One crude way of breaking this problem is (only if the above mentioned BAPI is executed), fill extension 1 table with some data at least one line. Then the CHECK condition in the include gets satisfied and you will reach user exit.
Regards,
Ramesh. -
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.
-
Need help in BAPI_ACC_DOCUMENT_POST.
Hi Friends,
Can any one help me in passing on the TAX parameters and currency parameters to
BAPI_ACC_DOCUMENT_POST.
this is the code i am using . it is posting the document and a TAX line is not created .
LOOP AT IT_ITEM WHERE HEAD_COL = IT_HEADER-FIRST_COL.
V_ITEM = V_ITEM + 1.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = V_ITEM
IMPORTING
OUTPUT = V_ITEM.
* IT_ACCGL-ITEMNO_ACC = V_ITEM. "IT_ITEM-NEWBS.
*for vendor / gl accounts based on newbs
IF IT_ITEM-NEWBS = '40' OR IT_ITEM-NEWBS = '50'.
IT_ACCGL-GL_ACCOUNT = IT_ITEM-NEWKO.
IT_ACCGL-ITEMNO_ACC = V_ITEM. "IT_ITEM-NEWBS.
IT_ACCGL-ITEM_TEXT = IT_ITEM-SGTXT.
IT_ACCGL-TAX_CODE = IT_ITEM-MWSKZ.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = IT_ITEM-AUFNR
IMPORTING
OUTPUT = IT_ACCGL-ORDERID.
IT_ACCGL-ALLOC_NMBR = IT_ITEM-ZUONR.
CONCATENATE IT_HEADER-BUDAT+0(4) IT_HEADER-BUDAT+5(2) IT_HEADER-BUDAT+8(2) INTO IT_ACCGL-PSTNG_DATE.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = IT_ITEM-KOSTL
IMPORTING
OUTPUT = IT_ACCGL-COSTCENTER.
IT_ACCGL-ITEM_TEXT = IT_ITEM-SGTXT.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = IT_ITEM-PRCTR
IMPORTING
OUTPUT = IT_ITEM-PRCTR.
IT_ACCGL-PROFIT_CTR = IT_ITEM-PRCTR.
APPEND IT_ACCGL.
*for Account tax
IT_ACCTAX-ITEMNO_ACC = V_ITEM.
IT_ACCTAX-ACCT_KEY = 'VST'.
IT_ACCTAX-GL_ACCOUNT = IT_ITEM-NEWKO.
IT_ACCTAX-TAX_CODE = IT_ITEM-MWSKZ.
IT_ACCTAX-TAX_RATE = IT_MWDAT-KBETR.
APPEND IT_ACCTAX.
**CURRENCY
*populate it_curr - BAPI currency table
IT_CURR-ITEMNO_ACC = V_ITEM. "IT_ITEM-NEWBS.
IT_CURR-CURRENCY = IT_HEADER-WAERS.
IT_CURR-AMT_DOCCUR = IT_ITEM-WRBTR.
IT_CURR-EXCH_RATE = IT_HEADER-KURSF.
CLEAR IT_BSEG.
READ TABLE IT_BSEG WITH KEY BELNR = IT_ITEM-NEWKO
MWSKZ = IT_ITEM-MWSKZ
WRBTR = IT_ITEM-WRBTR.
IT_CURR-AMT_BASE = IT_BSEG-FWBAS.
V_BUKRS = IT_HEADER-BUKRS.
V_MWSKZ = IT_ITEM-MWSKZ.
V_WAERS = IT_HEADER-WAERS.
V_WRBTR = IT_ITEM-WRBTR.
CALL FUNCTION 'CALCULATE_TAX_FROM_GROSSAMOUNT'
EXPORTING
I_BUKRS = V_BUKRS
I_MWSKZ = V_MWSKZ
* I_TXJCD = ' '
I_WAERS = V_WAERS
I_WRBTR = V_WRBTR
* IMPORTING
* E_FWNAV =
* E_FWNVV =
* E_FWSTE =
* E_FWAST =
TABLES
T_MWDAT = IT_MWDAT
EXCEPTIONS
BUKRS_NOT_FOUND = 1
COUNTRY_NOT_FOUND = 2
MWSKZ_NOT_DEFINED = 3
MWSKZ_NOT_VALID = 4
ACCOUNT_NOT_FOUND = 5
DIFFERENT_DISCOUNT_BASE = 6
DIFFERENT_TAX_BASE = 7
TXJCD_NOT_VALID = 8
NOT_FOUND = 9
KTOSL_NOT_FOUND = 10
KALSM_NOT_FOUND = 11
PARAMETER_ERROR = 12
KNUMH_NOT_FOUND = 13
KSCHL_NOT_FOUND = 14
UNKNOWN_ERROR = 15
OTHERS = 16
IF SY-SUBRC = 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
IT_CURR-TAX_AMT = IT_MWDAT-KBETR.
IT_CURR-AMT_BASE = IT_MWDAT-KAWRT.
ENDIF.
APPEND IT_CURR.
***Extension1
*populate it_extension1 - BAPI extension1 table
V_NEWBS = IT_ITEM-NEWBS.
IT_EXTENSION1-FIELD1(10) = V_ITEM.
IT_EXTENSION1-FIELD1+10(2) = IT_ITEM-MWSKZ.
IF NOT IT_ITEM-MWSKZ IS INITIAL.
IT_EXTENSION1-FIELD2(10) = V_ITEM.
IT_EXTENSION1-FIELD2+10(1) = 'X'.
ENDIF.
*for posting key
IT_EXTENSION1-FIELD3 = V_NEWBS.
***for posting key IN EXTENSION2
IT_EXTENSION2-STRUCTURE = 'ACCIT'.
IT_TES-POSNR = V_ITEM.
IT_TES-BSCHL = V_NEWBS.
IT_TES-KBETR = IT_MWDAT-KBETR.
** IT_TES-MWSKZ = IT_ITEM-MWSKZ.
** IT_TES-XMWST = 'X'.
IT_EXTENSION2-VALUEPART2(10) = V_ITEM.
IT_EXTENSION2-VALUEPART2 = IT_ITEM-MWSKZ.
IF NOT IT_ITEM-MWSKZ IS INITIAL.
IT_EXTENSION2-VALUEPART3(10) = V_ITEM.
IT_EXTENSION2-VALUEPART3+10(1) = 'X'.
ENDIF.
MOVE IT_TES TO IT_EXTENSION2-VALUEPART1. "#EC ENHOK
APPEND IT_EXTENSION2.
ELSEIF IT_ITEM-NEWBS = '21' OR
IT_ITEM-NEWBS = '22' OR
IT_ITEM-NEWBS = '23' OR
IT_ITEM-NEWBS = '24' OR
IT_ITEM-NEWBS = '25' OR
IT_ITEM-NEWBS = '26' OR
IT_ITEM-NEWBS = '27' OR
IT_ITEM-NEWBS = '28' OR
IT_ITEM-NEWBS = '29' OR
IT_ITEM-NEWBS = '30' OR
IT_ITEM-NEWBS = '31' OR
IT_ITEM-NEWBS = '32' OR
IT_ITEM-NEWBS = '33' OR
IT_ITEM-NEWBS = '34' OR
IT_ITEM-NEWBS = '35' OR
IT_ITEM-NEWBS = '36' OR
IT_ITEM-NEWBS = '37' OR
IT_ITEM-NEWBS = '38' OR
IT_ITEM-NEWBS = '39'.
IF IT_HEADER-BLART = 'KR' OR IT_HEADER-BLART = 'KA'.
IT_ACCREC-ITEMNO_ACC = V_ITEM.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = IT_ITEM-NEWKO
IMPORTING
OUTPUT = IT_ITEM-NEWKO.
IT_ACCREC-VENDOR_NO = IT_ITEM-NEWKO.
*for GL account
CLEAR IT_LFB1.
READ TABLE IT_LFB1 WITH KEY LIFNR = IT_ITEM-NEWKO.
IF IT_LFB1-BUKRS = IT_HEADER-BUKRS.
IT_ACCREC-GL_ACCOUNT = IT_LFB1-AKONT.
IT_ACCREC-COMP_CODE = IT_HEADER-BUKRS.
IT_ACCREC-ITEM_TEXT = IT_ITEM-SGTXT.
IT_ACCREC-TAX_CODE = IT_ITEM-MWSKZ.
ENDIF.
APPEND IT_ACCREC.
CLEAR IT_ACCREC.
*for Account tax
IT_ACCTAX-ITEMNO_ACC = V_ITEM.
IT_ACCTAX-ACCT_KEY = 'VST'.
IT_ACCTAX-GL_ACCOUNT = IT_LFB1-AKONT.
IT_ACCTAX-TAX_CODE = IT_ITEM-MWSKZ.
IT_ACCTAX-TAX_RATE = IT_MWDAT-KBETR.
APPEND IT_ACCTAX.
**CURRENCY
*populate it_curr - BAPI currency table
IT_CURR-ITEMNO_ACC = V_ITEM. "IT_ITEM-NEWBS.
IT_CURR-CURRENCY = IT_HEADER-WAERS.
IT_CURR-AMT_DOCCUR = IT_ITEM-WRBTR * -1.
IT_CURR-EXCH_RATE = IT_HEADER-KURSF.
V_BUKRS = IT_HEADER-BUKRS.
V_MWSKZ = IT_ITEM-MWSKZ.
V_WAERS = IT_HEADER-WAERS.
V_WRBTR = IT_ITEM-WRBTR.
CALL FUNCTION 'CALCULATE_TAX_FROM_GROSSAMOUNT'
EXPORTING
I_BUKRS = V_BUKRS
I_MWSKZ = V_MWSKZ
I_WAERS = V_WAERS
I_WRBTR = V_WRBTR
* IMPORTING
* E_FWNAV =
* E_FWNVV =
* E_FWSTE =
* E_FWAST =
TABLES
T_MWDAT = IT_MWDAT
EXCEPTIONS
BUKRS_NOT_FOUND = 1
COUNTRY_NOT_FOUND = 2
MWSKZ_NOT_DEFINED = 3
MWSKZ_NOT_VALID = 4
ACCOUNT_NOT_FOUND = 5
DIFFERENT_DISCOUNT_BASE = 6
DIFFERENT_TAX_BASE = 7
TXJCD_NOT_VALID = 8
NOT_FOUND = 9
KTOSL_NOT_FOUND = 10
KALSM_NOT_FOUND = 11
PARAMETER_ERROR = 12
KNUMH_NOT_FOUND = 13
KSCHL_NOT_FOUND = 14
UNKNOWN_ERROR = 15
OTHERS = 16
IF SY-SUBRC = 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
IT_CURR-TAX_AMT = IT_MWDAT-KBETR.
IT_CURR-AMT_BASE = IT_MWDAT-KAWRT.
ENDIF.
APPEND IT_CURR.
***Extension1
*populate it_extension1 - BAPI extension1 table
V_NEWBS = IT_ITEM-NEWBS.
IT_EXTENSION1-FIELD1(10) = V_ITEM.
IT_EXTENSION1-FIELD1+10(2) = IT_ITEM-MWSKZ.
IF NOT IT_ITEM-MWSKZ IS INITIAL.
IT_EXTENSION1-FIELD2(10) = V_ITEM.
IT_EXTENSION1-FIELD2+10(1) = 'X'.
ENDIF.
*for posting key
IT_EXTENSION1-FIELD3 = V_NEWBS.
*for posting key IN EXTENSION2
IT_EXTENSION2-STRUCTURE = 'ACCIT'.
IT_TES-POSNR = V_ITEM.
IT_TES-BSCHL = V_NEWBS.
IT_TES-MWSKZ = IT_ITEM-MWSKZ.
* IT_TES-XMWST = 'X'.
IT_TES-KBETR = IT_MWDAT-KBETR.
MOVE IT_TES TO IT_EXTENSION2-VALUEPART1. "#EC ENHOK
IT_EXTENSION2-VALUEPART2(10) = V_ITEM.
IT_EXTENSION2-VALUEPART2 = IT_ITEM-MWSKZ.
IF NOT IT_ITEM-MWSKZ IS INITIAL.
IT_EXTENSION2-VALUEPART3(10) = V_ITEM.
IT_EXTENSION2-VALUEPART3+10(1) = 'X'.
ENDIF.
APPEND IT_EXTENSION2.
ENDIF.
ENDIF.
ENDLOOP.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
DOCUMENTHEADER = IT_DOC
* CUSTOMERCPD =
* CONTRACTHEADER =
IMPORTING
OBJ_TYPE = V_OBJ_TYPE
OBJ_KEY = V_OBJ_KEY
OBJ_SYS = V_OBJ_SYS
TABLES
ACCOUNTGL = IT_ACCGL
* ACCOUNTRECEIVABLE =
ACCOUNTPAYABLE = IT_ACCREC
* ACCOUNTTAX = IT_ACCTAX
CURRENCYAMOUNT = IT_CURR
* CRITERIA =
* VALUEFIELD =
EXTENSION1 = IT_EXTENSION1
RETURN = IT_RETURN
* PAYMENTCARD =
* CONTRACTITEM =
EXTENSION2 = IT_EXTENSION2
* REALESTATE =
* ACCOUNTWT =
this is for Vendor account upload to F-02.
in the flat file i am getting the Tax codes J0 and J1. for J0 there is no tax. for j1 we have 17% tax.
I am not clear in passing the values. i tried to pass the values through EXTENSION1 and EXTENSION2 also.
Kindly help me n solving this.
Thanks in Advance.
Vikki.Hi All,
Still i am not able to get the required result.
Now i am passing the Values to the Tax values to ACCOUNTTAX strcture.
But the GL is not posted .
Can you give me some code snippets on how to pass on the value to ACCOUNTTAX, CURRENCY................
For each and every Line item how we need to pass on the TAX and CURRECNY details?
For the items which have TAX , a extra line for TAX item should be created/
Is it possible to do this with EXTENSION1 or EXTENSION2?
it will be very helpful to me if you can guide me in solving this.
Awaiting your replies.
Vikki. -
Hi ,
i am using BAPI_ACC_DOCUMENT_POST to post accounting document. This accounting document is used to post amount from reconcilation account to bank GL account.the table parameter am using is ACCOUNTGL (in the function module)Now i want to give posting keys to the function module parameter. can anyone please guide me how to give posting keys?
Edited by: Santhosh Kumar Cheekoti on Dec 18, 2008 7:48 AMHi,
As pointed out in one of the previous post, posting key will be decided by the BAPI depending on the sign of the amount. Have a look at bthe following code:-
DATA: doc_header LIKE BAPIACHE09,
criteria LIKE BAPIACKEC9 OCCURS 0 WITH HEADER LINE,
doc_item LIKE BAPIACGL09 OCCURS 0 WITH HEADER LINE,
doc_ar LIKE BAPIACGL09 OCCURS 0 WITH HEADER LINE,
doc_values LIKE BAPIACCR09 OCCURS 0 WITH HEADER LINE,
return LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
extension1 like BAPIACEXTC occurs 0 with header line,
obj_type LIKE bapiache08-obj_type,
obj_key LIKE bapiache02-obj_key,
obj_sys LIKE bapiache02-obj_sys,
docnum LIKE bkpf-belnr.
*DATA:
* ITEMNO_ACC POSNR_ACC
* FIELDNAME FIELDNAME
* CHARACTER ACPI_RKE_CRIGEN
* Fill Document Header
doc_header-bus_act = 'RFBU'.
doc_header-bus_act = 'RMRP'.
*doc_header-bus_act = 'SD00'.
doc_header-username = sy-uname.
doc_header-header_txt = 'TEST BOC BAPI POSTING'.
doc_header-comp_code = 'IN10'.
doc_header-compo_acc = 'FICA'.
doc_header-doc_date = '20060127'.
doc_header-pstng_date = sy-datlo.
doc_header-doc_type = 'SA'.
** Fill Line 1 of Document Item
*doc_item-itemno_acc = '1'.
*doc_item-gl_account = '0000500001'.
*doc_item-pstng_date = sy-datum.
*doc_item-item_text = 'TEST POSTING DEBIT ITEM'.
*doc_item-costcenter = ''.
*doc_item-quantity = '1'.
*doc_item-base_uom = 'ST'.
*APPEND doc_item.
*CLEAR doc_item.
** Fill Line 2 of Document Item
*doc_item-itemno_acc = '2'.
*doc_item-customer = '0000000016'.
*doc_item-gl_account = '0000000016'.
*doc_item-pstng_date = sy-datlo.
*doc_item-item_text = 'TEST POSTING CREDIT ITEM'.
*APPEND doc_item.
*CLEAR doc_item.
doc_ar-itemno_acc = '1'.
doc_ar-gl_account = '0000500001'.
doc_ar-pstng_date = sy-datum.
doc_ar-item_text = 'TEST POSTING DEBIT ITEM'.
doc_ar-costcenter = ''.
doc_ar-quantity = '1'.
doc_ar-base_uom = 'ST'.
APPEND doc_ar.
CLEAR doc_ar.
* Fill Line 2 of Document Item
doc_ar-itemno_acc = '2'.
doc_ar-customer = '0000000016'.
doc_ar-gl_account = '0000000016'.
doc_ar-pstng_date = sy-datlo.
doc_ar-item_text = 'TEST POSTING CREDIT ITEM'.
doc_ar-stat_con = ' '.
doc_ar-costcenter = '0000201681'.
APPEND doc_ar.
CLEAR doc_ar.
* Fill Line 1 of Document Value.
doc_values-itemno_acc = '1'.
doc_values-currency_iso = 'INR'.
doc_values-amt_doccur = '200.00'.
doc_values-currency = 'INR'.
doc_values-CURR_TYPE = '00'. "Doc currency
APPEND doc_values.
CLEAR doc_values.
* Fill Line 2 of Document Value
doc_values-itemno_acc = '2'.
doc_values-currency_iso = 'INR'.
doc_values-amt_doccur = '200.00-'.
doc_values-currency = 'INR'.
doc_values-curr_type = '00'. "Doc currency
APPEND doc_values.
CLEAR doc_values.
* Add tax code in extension1 table.
extension1-field1 = 'BAPI CALL'.
APPEND EXTENSION1.
* Fill CRITERIA for CO-PA
*refresh criteria.
*criteria-ITEMNO_ACC = '1'.
*criteria-FIELDNAME = 'ARTNR'.
*criteria-CHARACTER = '000000000001312251'.
*Append criteria.
*criteria-ITEMNO_ACC = '1'.
*criteria-FIELDNAME = 'WERKS'.
*criteria-CHARACTER = 'IN91'.
*Append criteria.
*criteria-ITEMNO_ACC = '1'.
*criteria-FIELDNAME = 'KNDNR'.
*criteria-CHARACTER = '0000000016'.
*Append criteria.
*criteria-ITEMNO_ACC = '1'.
*criteria-FIELDNAME = 'FKART'.
*criteria-CHARACTER = 'ZIN2'.
*Append criteria.
*criteria-ITEMNO_ACC = '1'.
*criteria-FIELDNAME = 'KAUFN'.
*criteria-CHARACTER = '0000000633'.
*Append criteria.
*criteria-ITEMNO_ACC = '1'.
*criteria-FIELDNAME = 'KDPOS'.
*criteria-CHARACTER = '000010'.
*Append criteria.
*criteria-ITEMNO_ACC = '1'.
*criteria-FIELDNAME = 'VKGRP'.
*criteria-CHARACTER = '009'.
**Append criteria.
* All tables filled - now call BAPI.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'
EXPORTING
documentheader = doc_header
IMPORTING
OBJ_TYPE = doc_header-obj_type
OBJ_KEY = doc_header-obj_key
OBJ_SYS = doc_header-obj_sys
TABLES
* criteria = criteria
accountgl = doc_item
ACCOUNTRECEIVABLE = doc_ar
currencyamount = doc_values
return = return
EXTENSION1 = EXTENSION1.
LOOP AT return WHERE type = 'E'.
EXIT.
ENDLOOP.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = doc_header
IMPORTING
OBJ_TYPE = doc_header-obj_type
OBJ_KEY = doc_header-obj_key
OBJ_SYS = doc_header-obj_sys
TABLES
* criteria = criteria
accountgl = doc_item
currencyamount = doc_values
return = return
EXTENSION1 = EXTENSION1.
LOOP AT return WHERE type = 'E'.
EXIT.
ENDLOOP.
IF sy-subrc EQ 0.
WRITE: / 'BAPI call failed - debug and fix!'.
ELSE.
CLEAR return.
REFRESH return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
IMPORTING
return = return.
WRITE: / 'BAPI call worked!!'.
WRITE: / doc_header-obj_key, ' posted'.
ENDIF.
Regards
Raju Chitale
Edited by: Raju Chitale on Dec 18, 2008 8:31 AM -
BAPI_ACC_INVOICE_RECEIPT_POST withholding tax
Hi Experts,
I'm using the BAPI BAPI_ACC_INVOICE_RECEIPT_POST to post an vendor invoice. It is working fine with the normal posting. But when we post with withholding tax base, its not successful.
I have mapped the Withholding tax code, Business place and Section code to the correct parameters of bapi. Then inside the bapi I have supplied the withholding tax base to IT_ACCCR-QSSHB.
But I'm getting the message Balance in Transaction currency. But I'm sure that I'm passing the currencies correctly.
Please help me with the proper method of posting.
Thanks in Advance.
Edited by: Nivash S on Aug 24, 2010 12:32 PMI got this working, so I will answer my own post with an explanation of the solution, in case it benefits anyone else.
There are numerous posts in the forum about calculating Extended Withholding Tax through a BAPI, and the solutions given tend to suggest that BAPI_ACC_DOCUMENT_POST will not work with EWT, but BAPI_ACC_INVOICE_RECEIPT_POST will work if you activate the user exit EXIT_SAPLACC4_001.
In investigating this, I found the following OSS notes most helpful:
OSS Note 306504 - Collective note: BAPIs for the AC Interface
OSS Note 556311 - BAPI in the extended withholding tax
OSS Note 487722 - Using EXTENSION1 for accounting BAPIs
Note 556311 explains how to implement extended withholding tax with BAPI_ACC_INVOICE_POST, by implementing a user exit that processes the EXTENSION1 parameter, and it provides sample EWT logic for that user exit. However, note 487722 explains how to implement Business Transaction Event RWBAPI01, to process the EXTENSION1 table from BAPI_ACC_DOCUMENT_POST.
By implementing the user exit logic from note 556311, in the BTE described in note 487722, the extended withholding tax was calculated correctly from BAPI_ACC_DOCUMENT_POST. -
Field FDLEV in BAPI_ACC_DOCUMENT_POST
Hi all,
When I create a document, I'm trying to fill the FDLEV field with BAPI_ACC_DOCUMENT_POST.
For what I saw on other messages, I need to use extension1 table, but it doesn't seem to work.
Anyone can help me?
ls_extension-field1 = ps_receivable-itemno_acc.
ls_extension-field2 = 'FDLEV'.
ls_extension-field3 = ps_bseg-fdlev.
APPEND ls_extension TO pt_extension.
Thanks in advanced,
Luis CruzHi
Because u need to implement the BTE RWBAPI01 in order to get the fields transfered by extension:
a) Step one: fill the extensionin:
DATA: ST_EXTENSIONIN,
itemno_acc type POSNR_ACC
FDLEV type BSEG-FDLEV,
ST_EXTENSIONIN.
ST_EXTENSIONIN-ITEMNO_ACC = ps_receivable-itemno_acc.
ST_EXTENSIONIN-FDLEV = ps_bseg-fdlev.
APPEND ST_EXTENSIONIN TO pt_extension.
B) Step two: get the value from extension (in BTE):
DATA: ST_EXTENSIONIN,
itemno_acc type POSNR_ACC
FDLEV type BSEG-FDLEV,
ST_EXTENSIONIN.
LOOP AT t_extension.
MOVE t_extension to ST_EXTENSIONIN.
READ TABLE IT_ACCIT WITH KEY POSNR = ST_EXTENSIONIN-ITEMNO_ACC.
IF SY-SUBRC = 0.
IT_ACCIT-FDLEV = ST_EXTENSIONIN-FDLEV.
MODIFY T_ACCIT INDEX SY-TABIX.
ENDIF.
ENDLOOP.
As a structure ST_EXTENSIONIN (to fill the extensionin table) has to be used in two different program, it should be better to define it in dictionary instead of the program.
Max -
BAPI_ACC_DOCUMENT_POST long text field missing
Hi,
I will have to transfer our vendor open items from v 3.1 to ERP 2004. I
am using <b>BAPI_ACC_DOCUMENT_POST</b> to upload these open items. However, I
cannot find the <b>'LONG TEXT'</b> field in the said BAPI. In using <b>F-02</b>, a
long text field/button is available. <u><b>How can i post an entry in the long text
field of the line item in f-02 using BAPI_ACC_DOCUMENT_POST</b></u>.
Also, i have used the extension1 table and a BTE (note 487722) in
uploading the posting key. Since field bschl is available in table
accit, there was no problem in doing this. However, i cannot seem to
find the field long text in this table. Is it available? If not, what
can I do with the above situation.
Thanks.Hi
Excuse me! you can't use RFBIBL00, use the fm SAVE_TEXT.
After calling the BAPI you should have the number of FI document will be created and know in which item you need to insert the long text so:
THEAD-TDOBJECT = <Object text>.
THEAD-TDNAME(4) = <Company code>
THEAD-TDNAME+4(10) = <Document number>
THEAD-TDNAME+14(4) = <Fyscal year>
THEAD-TDNAME+18(3) = <Item number>.
THEAD-TDID = <Id text>.
THEAD-TDSPRAS = <Language>.
THEAD-TDLINESIZE = 72.
These are the header data, transfer the text in LINES parameters.
Max -
Is it possible to pass personnel number in BAPI_ACC_INVOICE_RECEIPT_POST
Hi All,
We are using an external document image system where we scan and code vendor invoices. To send the invoices to our SAP system we will use BAPI_ACC_INVOICE_RECEIPT_POST. Unfortunately we are missing the possibility to pass <b>personnel number</b>. This is an important attribute for us, e.g. with learning and education cost. Is there a simple way to pass this information?
Regards,
GerritHi Romeo,
In BAPI_ACC_DOCUMENT_POST table EXTENSION1 is available. Fields you want to pass, but which are not available in one of the other tables, you can pass via the EXTENSION1 table. In the User Exit of the BAPI you will have to map these fields to the required fields.
For example, in BAPI_ACC_INVOICE_RECEIPT_POST we have now activated User Exit ZXACCU15.
Source in the user exit:
<i>* Post the personal number and partner bank type
from the EXTENSION to the ACCIT data
structure for the NL users only.
DATA: wa_extenion LIKE bapiextc.
DATA: wa_accit LIKE accit.
DATA: h_index LIKE sy-tabix.
LOOP AT extension INTO wa_extenion
WHERE field2 = 'PERNR'
OR field2 = 'BVTYP'.
READ TABLE t_accit INTO wa_accit
WITH KEY posnr = wa_extenion-field1(10).
IF sy-subrc = 0 AND wa_accit-bukrs(2) EQ 'NL'.
h_index = sy-tabix.
IF wa_extenion-field2 = 'PERNR'.
wa_accit-pernr = wa_extenion-field3(8).
MODIFY t_accit FROM wa_accit
INDEX h_index
TRANSPORTING pernr.
ELSEIF wa_extenion-field2 = 'BVTYP'.
wa_accit-bvtyp = wa_extenion-field3(4).
MODIFY t_accit FROM wa_accit
INDEX h_index
TRANSPORTING bvtyp.
ENDIF.
ENDIF.
ENDLOOP.</i>
Table EXTENSION1 has 4 fields which you can use to your own needs. In my example we use field1 for the itemno_acc, the item number in the other table where the extension is needed. Field2 is the fieldname where the value (from field3) has to be placed. We do not use field4.
Example
FIELD1 FIELD2 FIELD3 FIELD4
0000000010 BVTYP USD
0000000020 PERNR 99999999
Unfortunately I do not know how to activate a user exit, because in our case it was already there.
Hope this is of any help,
Regards
Gerrit -
Which table of field "EXTENSION1" of vendor master data
Hi Experts,
I key in data in filed "EXTENSION1" (data line) for vendor master data, which table I can get this field?
Thanks.Use this trick I learned from an ABAP friend of mine. Has a little of trial and error in it but its really good.
1. Open 2 SAP windows
2. In window 1, Go to ST05
3. Activate Trace
4. Go to window 2, access the field which you need to learn what table it is in. Ex. Go to XK02 to view the field. enter data in it.
5. Go to window 1, Deactivate Trace
6. In window 1, display trace
7. Check each table written there in SE11 and see if your field is in that table. -
How to log the messages in an internal table n display
Hello guys,
This is my first post in SDN.
I am uploading some data from application server. I am doing lot of varifications, based on that I have to display the messages.
So I asked not to use the write statements to display the messages but asked me to create an internal table and display the messages afterwards..
like I am using some BAPI to upload after the bapi call i have to log the result for each record into an internal table and show...
can anyone guide me how to do it?Thanks for your info Azad,
here I am posting my code... can u go through it once and lemme me whether i am in right track or not?
FORM FORM_POST_DATA.
IF X_POST = 'X'.
CALL FUNCTION 'BAPI_ACC_BILLING_POST'
EXPORTING
DOCUMENTHEADER = WA_DOCUMENTHEADER
CUSTOMERCPD = WA_CUSTOMERCPD
IMPORTING
OBJ_TYPE =
OBJ_KEY =
OBJ_SYS =
TABLES
ACCOUNTRECEIVABLE = IT_ACCOUNTRECEIVABLE
ACCOUNTGL = IT_ACCOUNTGL
ACCOUNTTAX = IT_ACCOUNTTAX
CRITERIA =
VALUEFIELD =
CURRENCYAMOUNT = IT_CURRENCYAMOUNT
RETURN = IT_RETURN
SALESORDER =
SALESAMOUNT =
EXTENSION1 = IT_EXTENSION1
LOOP AT IT_RETURN.
MOVE-CORRESPONDING IT_RETURN TO IT_MESSAGES.
ENDLOOP.
ENDIF.
WRITE: / 'Result of Post:'.
WRITE : / REF_TYPE,REF_KEY,REF_SYS.
PERFORM FORM_SHOW_MESSAGES.
ENDFORM. "FORM_POST_DATA
FORM 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
Nisha... -
EXTENSION1 in BAPI_ACC_DOCUMENT_POST
Hi Guys.
I know this has been posted before, but I still can't seem to find a solution.
I am filling the table EXTENSION1 in BAPI_ACC_DOCUMENT_POST and the user_exit ZXACCU15 has been activated. I have a break-point in my exit, but it seems that the exit is not even being performed. I have created a project and activated it in CMOD but the exit is still not being executed. Do I have to activate the BADI or something?
Thanks and regards.
David.Better to copy From to BAPI_ACC_DOCUMENT_POST to ZBAPI_ACC_DOCUMENT_POST and do the modification,
here just pass what ever variable to extension,
I had one requirement to create sales order ,in sales order we have custom fields
we copied and updated data. -
How to pass BUSINESS AREA in structure EXTENSION1 in BAPI_ACC_DOCUMENT_POST
Dear All,
I'm doing one upload program with BAPI_ACC_DOCUMENT_POST.
Here when I do Tax calculation, I need to pass the value for Business Area in the structure ACCOUNTTAX. But the field is not available.
Is there any way to pass Business Area (GSBER) value to the structure EXTENSION1?
Points will be rewarded for the correct solution immediately.
Moreover I'm in pressure to complete this object. Please help me.
Thanks & Regards,
NeerajThe business area is passed in the field BUS_AREA in the tables ACCOUNTGL, ACCOUNTRECEIVABLE and ACCOUNTPAYABLE.
Rob
Maybe you are looking for
-
Add button to BP subscreen Identification Numbers
Hi gurus, in transaction BP there is a tab called Identification. On this tab a subscreen area Identification Numbers exists which contains a screen (SAPLBUD0 - 1520). We want some added logic on the screen by means of a new button. I think it is not
-
Oracle Report in a J2EE Architecture
Dear All, I have for this architecture: - Database Layer Oracle 8i in future 9i - Application Server Tomcat is possible to integrate this architecture with a Oracle Report Server? If yes how to transform the architecture? Thank's bye
-
WHEN TRYING TO PLAY FARMVILLE ON FACEBOOK THE SITEIS ENCRYPTED
WHENEVER TRYING TO PLAY FARMVILLE ON FACEBOOK A FOOTNOT APPEAR THAT THIS SITE IS ENCRYPTED.
-
Hi all, I have a logo to print in script. I want to drag it in X direction. while uploading, I increased the DPI size. still i want to modify it. How can i do it.
-
Make fails with 'qmake not found' message
Hi Can't build qt app due to error: "could not exec '/usr/lib/qt4/bin/qmake': No such file or directory" I've checked this directory - file exists, [crow@nest bin]$ file qmake qmake: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically li