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.
Similar Messages
-
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
SRIcan anyone give some idea about this...how to do?
-
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 -
Regarding using of EXTENSION1 and EXTENSION2 in BAPI_OUTB_DELIVERY_CHANGE
Hi,
Can any one please help me how to code for zfields in EXTENSION1 and EXTENSION2 in BAPI_OUTB_DELIVERY_CHANGE
Thanks,
Nethaji.I had a requirement to change a Z field in LIKP by a BAPI call and found this thread.
Although the original participant probably have found alternative ways, I hope this can be helpful for others search for a solution to this.
These are my findings u2013 please correct me if I am wrong. The EXTENSION1 & EXTENSION2 can NOT be used to change LIKP Z-fields. These doesnu2019t do anything in themselves, but can be imported in BADI IF_EX_SMOD_V50B0001~EXIT_SAPLV50I_010 (Thereu2019s a corresponding CMOD in older versions).
However, the data available here are :
CS_VBKOK
CT_VBPOK
CT_VBSUPCON
EXTENSION1
EXTENSION2
So, for changes to delivery header, only fields in structure CS_VBKOK can be changed. As VBKOK does not have any customer appends, this is not possible. Furthermore is the BAPI BAPI_OUTB_DELIVERY_CHANGE only calling WS_DELIVERY_UPDATE anyway, so the BAPI can not do any magic the FM canu2019t. So what is the purpose with EXTENSION1/ EXTENSION2 ?
As I see it, itu2019s a handy way to transfer data to the BADI, so you can build logic to manipulate any of the existing CS_VBKOK fields. You could have done the same with a Memory export/import anyway.
/END-BAD-NEWS
/BEGIN-GOOD-NEWS
After some trial and error, I managed to use BAPI_OUTB_DELIVERY_CHANGE to change Z fields in LIKP. Before the call, I export the desired content to a memory ID, which I then import in MV50AFZ1, BAPI_OUTB_DELIVERY_CHANGE
See this working demonstration code :
Calling program :
*& Report ZTEST_BAPI_DELIVERY_CHANGE
report ztest_bapi_delivery_change.
data : gs_bapiobdlvhdrchg type bapiobdlvhdrchg.
data : gs_bapiobdlvhdrctrlchg type bapiobdlvhdrctrlchg.
data : gs_bapidlvcontrol type bapidlvcontrol.
data : gt_bapireturn type standard table of bapiret2.
data : gs_bapireturn type bapiret2.
data : gs_likp type likpvb.
data : ld_zzhuload type erlkz.
constants: gc_x(1) type c value 'X'.
parameter : p_vbeln like likp-vbeln.
Get relevant LIKP fields
select * from likp
into corresponding fields of gs_likp
where vbeln = p_vbeln.
endselect.
Fill header data - convert to BAPI format
call function 'MAP2E_LIKPVB_TO_BAPIOBDLVHDRCH'
exporting
likpvb = gs_likp
changing
bapiobdlvhdrchg = gs_bapiobdlvhdrchg.
Field to set as LIKP Z-field
ld_zzhuload = 'X'.
Memory-ID imported in MV50AFZ1
export ld_zzhuload to memory id 'ZZHULOAD'.
call function 'BAPI_OUTB_DELIVERY_CHANGE'
exporting
header_data = gs_bapiobdlvhdrchg
header_control = gs_bapiobdlvhdrctrlchg
delivery = gs_bapiobdlvhdrchg-deliv_numb
techn_control = gs_bapidlvcontrol
tables
return = gt_bapireturn
exceptions
communication_failure = 1
system_failure = 2
others = 3.
if gt_bapireturn[] is initial.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = gc_x.
else.
loop at gt_bapireturn into gs_bapireturn
where type = 'E'.
message id gs_bapireturn-id type 'S'
number gs_bapireturn-number with
gs_bapireturn-message_v1
gs_bapireturn-message_v2
gs_bapireturn-message_v3
gs_bapireturn-message_v4.
exit.
endloop.
endif.
MV50AFZ1, form USEREXIT_SAVE_DOCUMENT_PREPARE
data : ld_zzhuload type erlkz.
if xlikp-vbtyp = 'J' " outbound delivery
and t180-trtyp = 'V'. " Change
Memory-ID exported from program ZZZ...
import ld_zzhuload from MEMORY ID 'ZZHULOAD'.
if sy-subrc is initial
and not ld _zzhuload is initial.
LOOP AT xlikp.
xlikp-zzhuload = ld_zzhuload.
MODIFY xlikp transporting zzhuload.
ENDLOOP.
free MEMORY ID 'ZZHULOAD'.
endif.
endif.
I hope someone will find this helpful. Obviously I can not take responsibility for the functionality
Sorry for the format, I can not get the tags to work..... -
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 Use BAPI_OUTB_DELIVERY_CHANGE for Batch Split
Hi Experts, I have the follow delivery:
Item Material Deliv.Qty Un
10 739911 2 PQT
And I want to obtain this:
Item Material Deliv.Qty Un Batch
10 739911 0 PQT
900001 739911 1 PQT ZZ00060
900002 739911 1 PQT ZZ00061
But, after using the Bapi I obtained this:
Item Material Deliv.Qty Un Batch
10 739911 1,372 PQT
900001 739911 0,314 PQT ZZ00060
900002 739911 0,314 PQT ZZ00061
So as you can see the problem is with the "Deliv.Qty". I expected:
Item Deliv.Qty
10 0
900001 1
900002 1
But I obtained:
Item Deliv.Qty
10 1,372
900001 0,314
900002 0,314
The parameters that I am using in the Bapi are:
HEADER_DATA
DELIV_NUMB = 801174646
HEADER_CONTROL
DELIV_NUMB = 801174646
DELIVERY = 801174646
TECHN_CONTROL
UPD_IND = U
ITEM_DATA (three records):
DELIV_NUMB = 801174646
DELIV_ITEM = 000010
MATERIAL = 739911
FACT_UNIT_NOM = 1
FACT_UNIT_DENOM = 1
DELIV_NUMB = 801174646
DELIV_ITEM = 900001
MATERIAL = 739911
BATCH = ZZ00060
HIERARITEM = 000010
USEHIERITM = 1
DLV_QTY = 1
DLV_QTY_IMUNIT = 1
FACT_UNIT_NOM = 1
FACT_UNIT_DENOM = 1
DELIV_NUMB = 801174646
DELIV_ITEM = 900002
MATERIAL = 739911
BATCH = ZZ00061
HIERARITEM = 000010
USEHIERITM = 1
DLV_QTY = 1
DLV_QTY_IMUNIT = 1
FACT_UNIT_NOM = 1
FACT_UNIT_DENOM = 1
ITEM_CONTROL (three records):
DELIV_NUMB = 801174646
DELIV_ITEM = 000010
CHG_DELQTY = X
DELIV_NUMB = 801174646
DELIV_ITEM = 900001
CHG_DELQTY = X
DELIV_NUMB = 801174646
DELIV_ITEM = 900002
CHG_DELQTY = X
So I am missing something but I don't know what.
Can any one help me with this please?
PD: I have looked the following forums in order to use the Bapi:
How to Use BAPI_OUTB_DELIVERY_CHANGE for Batch Split
batch split using BAPI_OUTB_DELIVERY_CHANGE
Re: Help in BAPI_OUTB_DELIVERY_CHANGE(batch-split)
BAPI_OUTB_DELIVERY_CHANGE - Batch Splits don't work
Help for BAPI_OUTB_DELIVERY_CHANGEHey,
My code is for the inbound delivery but it should work the same.
Give this a try.
REPORT z_delivery_batch_split.
DATA:header_data LIKE bapiibdlvhdrchg,
header_control LIKE bapiibdlvhdrctrlchg,
delivery LIKE bapiibdlvhdrchg-deliv_numb,
ls_return LIKE bapiret2,
item_data TYPE TABLE OF bapiibdlvitemchg,
item_control TYPE TABLE OF bapiibdlvitemctrlchg,
ls_item_data LIKE bapiibdlvitemchg,
ls_item_control LIKE bapiibdlvitemctrlchg,
return TYPE TABLE OF bapiret2 WITH NON-UNIQUE KEY type.
header_data-deliv_numb = '1800005005'.
header_control-deliv_numb = '1800005005'.
delivery = '1800005005'.
ls_item_data-deliv_numb = '1800005005'.
ls_item_data-deliv_item = '900001'.
ls_item_data-material = '000000000020067722'.
PERFORM create_batch CHANGING ls_item_data-batch.
ls_item_data-hieraritem = '000010'.
ls_item_data-usehieritm = '1'.
ls_item_data-dlv_qty = 80.
ls_item_data-dlv_qty_imunit = 80.
ls_item_data-fact_unit_nom = '1'.
ls_item_data-fact_unit_denom = '1'.
ls_item_data-sales_unit = 'EA'.
ls_item_data-base_uom = 'EA'.
APPEND ls_item_data TO item_data.
ls_item_data-deliv_numb = '1800005005'.
ls_item_data-deliv_item = '900002'.
ls_item_data-material = '000000000020067722'.
PERFORM create_batch CHANGING ls_item_data-batch.
ls_item_data-hieraritem = '000010'.
ls_item_data-usehieritm = '1'.
ls_item_data-dlv_qty = 60.
ls_item_data-dlv_qty_imunit = 60.
ls_item_data-fact_unit_nom = '1'.
ls_item_data-fact_unit_denom = '1'.
ls_item_data-sales_unit = 'EA'.
ls_item_data-base_uom = 'EA'.
APPEND ls_item_data TO item_data.
ls_item_control-deliv_numb = '1800005005'.
ls_item_control-deliv_item = '900001'.
ls_item_control-chg_delqty = 'X'.
APPEND ls_item_control TO item_control.
ls_item_control-deliv_numb = '1800005005'.
ls_item_control-deliv_item = '900002'.
ls_item_control-chg_delqty = 'X'.
APPEND ls_item_control TO item_control.
break cgavin.
CALL FUNCTION 'BAPI_INB_DELIVERY_CHANGE'
EXPORTING
header_data = header_data
header_control = header_control
delivery = delivery
* TECHN_CONTROL = TECHN_CONTROL
TABLES
* HEADER_PARTNER = HEADER_PARTNER
* HEADER_PARTNER_ADDR = HEADER_PARTNER_ADDR
* HEADER_DEADLINES = HEADER_DEADLINES
item_data = item_data
item_control = item_control
* ITEM_SERIAL_NO = ITEM_SERIAL_NO
* EXTENSION1 = EXTENSION1
* EXTENSION2 = EXTENSION2
return = return
* TOKENREFERENCE = TOKENREFERENCE
* HANDLING_UNIT_HEADER = HANDLING_UNIT_HEADER
* HANDLING_UNIT_ITEM = HANDLING_UNIT_ITEM
* PARTIAL_GR_OBJECTS = PARTIAL_GR_OBJECTS
READ TABLE return
INTO ls_return
WITH TABLE KEY type = 'E'.
IF sy-subrc = 0.
MESSAGE ID ls_return-id TYPE ls_return-type NUMBER ls_return-number WITH ls_return-message_v1 ls_return-message_v2
ls_return-message_v3 ls_return-message_v4.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
break cgavin.
*& Form CREATE_BATCH
* text
* <--P_LS_ITEM_DATA_BATCH text
FORM create_batch CHANGING p_ls_item_data_batch.
DATA: ls_bncom TYPE bncom.
ls_bncom-matnr = ls_item_data-material.
ls_bncom-werks = 'C333'.
ls_bncom-lgort = '3000'.
SELECT SINGLE mtart
FROM mara
INTO ls_bncom-mtart
WHERE matnr = ls_bncom-matnr.
CALL FUNCTION 'VB_NEXT_BATCH_NUMBER'
EXPORTING
matnr = ls_bncom-matnr
werks = ls_bncom-werks
check_batch = 'X'
check_material = ''
message_when_auto = ' '
x_bncom = ls_bncom
lock_batch = ' '
IMPORTING
new_charg = p_ls_item_data_batch
EXCEPTIONS
no_material = 1
no_plant = 2
material_not_found = 3
plant_not_found = 4
no_batch_handling = 5
batch_exist = 6
no_number = 7
illegal_batch_number = 8
interval_not_found = 9
object_not_found = 10
interval_overflow = 11
error_automatic_batch_number = 12
cancelled = 13
automatic_batch_num_not_active = 14
OTHERS = 15.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
ENDFORM. " CREATE_BATCH -
Error while using BAPI_OUTB_DELIVERY_CHANGE
Hi Friends,
I m using BAPI_OUTB_DELIVERY_CHANGE to change the delivery. But I m getting error - Error in document &1 item &2 (quantity consistency check).
I m changing the delivered qty in batch-split and
delivered qty in header level.
Is there any problem in code
Some code snaps is:
loop at itab.
item_data1-DELIV_NUMB = s_vbeln.
item_data1-DELIV_ITEM = 10.
item_data1-DLV_QTY = itab-nt_qty.
item_data1-UNIT_OF_WT = itab-unit.
append item_data1.
endloop.
ITEM_CONTROL1-DELIV_NUMB = s_vbeln.
item_control1-DELIV_ITEM = 10.
item_control1-CHG_DELQTY = 'X'.
append item_control1.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
HEADER_DATA = header_data1
HEADER_CONTROL = header_control1
DELIVERY = s_vbeln
TECHN_CONTROL =
TABLES
HEADER_PARTNER =
HEADER_PARTNER_ADDR =
HEADER_DEADLINES =
ITEM_DATA = item_data1
ITEM_CONTROL = item_control1
ITEM_SERIAL_NO =
SUPPLIER_CONS_DATA =
EXTENSION1 =
EXTENSION2 =
RETURN = ret .
Please help me.Hi friends, this can be solved setting values for the following additional parameters of structure ITEM_DATA.
FACT_UNIT_NOM = 1.
FACT_UNIT_DENOM = 1.
This works for me, please let me know if this works for you!
Regards
Leonardo
Maybe you are looking for
-
How can I remove underscores from the topics in the Search pane?
Hi, I am using TCS3 and have created a number of projects using Webhelp. The problem is that the ranked list that is generated after searching shows most, but not all, the section titles with underscores between the words, e.g. Modules_and_wizards. C
-
Do I need a power converter for my ipad in Ireland?
Do I need a power converter for my ipad2 and my macbook air (11 inch 2010) in Ireland? Sorry, I'm new to this site and just found the answer to my question in another post.
-
When I launch iTunes using Windows, I receive this error message: " The File "iTunes library .itl" cannot be read because it was created by a newer version of iTunes" ( I have already uninstalled & reinstalled iTunes)
-
Hello! I have a great problem. When I for example try to delete records in SQLPlus Worksheet everything is OK, but when I load DBA Studio, I see that "deleted" records are still in the table! Please, help. Chief
-
Problem to start domain BEA-149204
Hi, I have just installed WebLogic serwer 8.1 SP4 on RedHat Linux 2.4.21-27.ELsmp with Intel Xeon(TM) CPU 3.20GHz CPUs 2 CPU 4GB RAM; It is a new installation; After install I've created new domain with configuration Wizzard, without JMS, JDBC, Advan