11-09-2015 6:09 AM
I am getting errors while trying to perform an asset massive posting with posting keys “70” (debit asset) and “75” (credit asset). I was trying to test the BAPI BAPI_ACC_DOCUMENT_POST by creating a test program and just passing the values to the respective Internal tables. Kindly check the code and also the errors I am getting and suggest.
DATA: w_header TYPE bapiache09 ,
i_gl TYPE STANDARD TABLE OF bapiacgl09,
i_currency TYPE STANDARD TABLE OF bapiaccr09 ,
i_return TYPE STANDARD TABLE OF bapiret2,
v_objtype TYPE awtyp,
v_objkey TYPE awkey,
v_objsys TYPE awsys,
w_currency TYPE bapiaccr09,
w_gl TYPE bapiacgl09 .
w_header-username = sy-uname.
*w_header-obj_type = 'BKPFF'.
*w_header-obj_key = '$'.
*w_header-obj_sys = 'CEDCLNT120'.
*w_header-bus_act = 'RFBU'.
w_header-doc_date = '20151106'.
w_header-comp_code = 'CTBT'.
w_header-pstng_date = '20151106'.
w_header-header_txt = 'ABCD'.
w_currency-currency = 'USD'.
w_currency-itemno_acc = '0000000010'.
w_currency-amt_doccur = 100.
APPEND w_currency TO i_currency.
w_currency-currency = 'USD'.
w_currency-itemno_acc = '0000000020'.
w_currency-amt_doccur = -100.
APPEND w_currency TO i_currency.
w_gl-gl_account = '0000738000'.
*w_gl-bus_area = 'RFBU'.
w_gl-sub_number = '0000'.
w_gl-itemno_acc = '0000000010'.
w_gl-item_text = 'WERTT'.
w_gl-acct_type = 'A'.
w_gl-doc_type = 'AA'.
w_gl-comp_code = 'CTBT'.
w_gl-ALLOC_NMBR = '1234567891'.
w_gl-funds_ctr = '1A12B'.
w_gl-cmmt_item = 'TCIOTHER'.
w_gl-fund = 'CIFS'.
w_gl-asset_no = '140000000012'.
w_gl-sub_number = '0000'.
w_gl-FUNC_AREA_LONG = '1001_2015'.
w_gl-CS_TRANS_T = '120'.
APPEND w_gl TO i_gl.
w_gl-gl_account = '0000738000'.
*w_gl-bus_area = 'RFBU'.
w_gl-sub_number = '0000'.
w_gl-itemno_acc = '0000000020'.
w_gl-item_text = 'WERT'.
w_gl-acct_type = 'A'.
w_gl-doc_type = 'AA'.
w_gl-comp_code = 'CTBT'.
w_gl-ALLOC_NMBR = '1234567891'.
w_gl-funds_ctr = '1A12B'.
w_gl-cmmt_item = 'TCIOTHER'.
w_gl-fund = 'CIFS'.
w_gl-asset_no = '140000000012'.
w_gl-sub_number = '0000'.
w_gl-FUNC_AREA_LONG = '1001_2015'.
w_gl-CS_TRANS_T = '120'.
APPEND w_gl TO i_gl.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
DOCUMENTHEADER = w_header
IMPORTING
obj_type = v_objtype
obj_key = v_objkey
obj_sys = v_objsys
TABLES
ACCOUNTGL = i_gl
* ACCOUNTRECEIVABLE =
* ACCOUNTPAYABLE =
* ACCOUNTTAX =
CURRENCYAMOUNT = i_currency
return = i_return.
Errors screenshot is attached.
11-09-2015 9:12 AM
Hi,
I suggest that you debug, or do a where-used on the message numbers listed in the BAPI return table.
You'll learn more (and have some fun) by solving it yourself!
cheers
Paul