Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error FI 038 in BAPI_ACC_DOCUMENT_POST

Former Member
0 Likes
737

Dear All,

We are getting an error FI 038 - No posting object defined. The part of the code is as below.

gs_doc_header-obj_type = 'BKPFF'.

gs_doc_header-obj_key = '$'.

gs_doc_header-obj_sys = 'D22CLNT949'.

gs_doc_header-bus_act = 'RFBU'.

gs_doc_header-username = sy-uname.

gs_doc_header-doc_date = sy-datum. "

gs_doc_header-pstng_date = sy-datum. ".

*gs_doc_header-fisc_year = sy-datum(4). "

*gs_doc_header-fis_period = sy-datum+4(2).

gs_doc_header-doc_type = 'JV'.

gs_doc_header-comp_code = '5000'.

clear gs_acc_gl.

gs_acc_gl-itemno_acc = '1'. "50

hkont = '520000'.

*

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = hkont

IMPORTING

OUTPUT = hkont

.

gs_acc_gl-gl_account = hkont. " GL Account

gs_acc_gl-item_text = ''. " Line Item Text

*gs_acc_gl-doc_type = 'JV'.

gs_acc_gl-comp_code = '5000'. " Company Code

gs_acc_gl-pstng_date = sy-datum. " Posting Date

kostl = '501000'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = kostl

IMPORTING

OUTPUT = kostl

.

gs_acc_gl-COSTCENTER = kostl.

*gs_acc_gl-costcenter = 'E-2008-001-R1'. " WBS Element

append gs_acc_gl to gt_acc_gl.

clear gs_acc_gl.

gs_acc_gl-itemno_acc = '2'. "40

hkont = '501000'.

*

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = hkont

IMPORTING

OUTPUT = hkont

.

gs_acc_gl-gl_account = hkont. " GL Account

gs_acc_gl-item_text = ''. " Line Item Text

gs_acc_gl-doc_type = 'JV'.

gs_acc_gl-comp_code = '5000'. " Company Code

gs_acc_gl-pstng_date = sy-datum. " Posting Date

kostl = '501000'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = kostl

IMPORTING

OUTPUT = kostl

.

gs_acc_gl-COSTCENTER = kostl.

*gs_acc_gl-DE_CRE_IND = 'H'.

*gs_acc_gl-costcenter = 'E-2008-001-R1'. " WBS Element

append gs_acc_gl to gt_acc_gl.

clear gs_curr_amt.

gs_curr_amt-itemno_acc = '1'. "

*gs_curr_amt-curr_type = '00'.

gs_curr_amt-currency = 'INR'. "bdc_source-col_g. " Currancy

gs_curr_amt-amt_doccur = '-10'. " Line Item Amount

append gs_curr_amt to gt_curr_amt.

clear gs_curr_amt.

gs_curr_amt-itemno_acc = '2'. "

*gs_curr_amt-curr_type = '00'.

gs_curr_amt-currency = 'INR'. " Currancy

gs_curr_amt-amt_doccur = '10'. "gt_itab-setwr * -1. " Line Item Amount

append gs_curr_amt to gt_curr_amt.

W_EXTENSION1-FIELD1 = hkont+7(3).

CONCATENATE W_EXTENSION1-FIELD1 '50' INTO W_EXTENSION1-FIELD1.

APPEND W_EXTENSION1 TO I_EXTENSION1.

W_EXTENSION1-FIELD1 = hkont+7(3).

CONCATENATE W_EXTENSION1-FIELD1 '40' INTO W_EXTENSION1-FIELD1.

APPEND W_EXTENSION1 TO I_EXTENSION1.

refresh gt_return.

call function 'BAPI_ACC_DOCUMENT_POST'

exporting

documentheader = gs_doc_header

*importing

  • OBJ_KEY = gv_OBJ_KEY

tables

accountgl = gt_acc_gl

currencyamount = gt_curr_amt

EXTENSION1 = I_EXTENSION1

return = gt_return.

IF gt_return[] IS NOT INITIAL.

LOOP AT gt_return.

WRITE: / gt_return-message.

ENDLOOP.

ENDIF.

Are we missing out any fields of the bapi.

Please guide in resolving the issue.

Thanks in advance,

Neela

2 REPLIES 2
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
519

Please check below mentioned link. SOme Config issue.

[;

Please search sdn for the same you will find many threads.

Also check whether for this Object type you have entry in TTYP table

Nabheet

Edited by: nabheetmadan09 on Jan 17, 2012 1:20 PM

Read only

RaymondGiuseppi
Active Contributor
0 Likes
519

Read first [Note 561175 - BAPI posting in accounting with FI as reference|https://service.sap.com/sap/support/notes/561175]

Regards,

Raymond