Application Development 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: 

fb01 transaction

Former Member
0 Kudos

Hello Experts,

I want to write bdc program for fb01. to do recording , when i am entering vallues i am getting error as 'in company code 1000 the number 16 is missing in the year 2007' irrespective of the document type. what should i do?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Do not write a BDC on FB01. Instead use BAPI

'BAPI_ACC_GL_POSTING_POST' OR BAPI_ACC_DOCUMENT_POST'.

Regards,

Atish

3 REPLIES 3

Former Member
0 Kudos

Hi,

Do not write a BDC on FB01. Instead use BAPI

'BAPI_ACC_GL_POSTING_POST' OR BAPI_ACC_DOCUMENT_POST'.

Regards,

Atish

0 Kudos

may be there is some problem in code...try to run it in A mode and see the fieild in which error is coming..

its better to use BAPI for this purpose.

MOVE sy-uname TO wa_export_header-username.

MOVE c_header_txt TO wa_export_header-header_txt.

MOVE wa_unbilled-company_code TO wa_export_header-comp_code.

"MOVE WA_UNBILLED-ACC_YEAR TO WA_EXPORT_HEADER-FISC_YEAR. "--Might be uncommented

MOVE wa_unbilled-document_date TO wa_export_header-doc_date.

MOVE wa_unbilled-posting_date TO wa_export_header-pstng_date.

MOVE wa_unbilled-period TO wa_export_header-fis_period.

"MOVE wa_unbilled-document_type TO wa_export_header-doc_type.

MOVE c_doctype_value TO wa_export_header-doc_type.

  • Filtering data (empty spaces into Zeros)

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = wa_unbilled-account1

IMPORTING

output = wa_unbilled-account1.

  • _____________________________________________________________________________

  • _____________________________________________________________________________

  • ACCOUNT GL - (DEBIT)

MOVE c_itemno_dr TO wa_bapi_accountgl-itemno_acc.

MOVE wa_unbilled-company_code TO wa_bapi_accountgl-comp_code.

MOVE wa_unbilled-posting_date TO wa_bapi_accountgl-pstng_date.

MOVE wa_unbilled-account1 TO wa_bapi_accountgl-gl_account.

"MOVE wa_unbilled-document_type TO wa_bapi_accountgl-doc_type.

MOVE c_doctype_value TO wa_bapi_accountgl-doc_type.

MOVE wa_unbilled-text1 TO wa_bapi_accountgl-item_text.

" MOVE wa_unbilled-cost_center_1 TO wa_bapi_accountgl-costcenter.

APPEND wa_bapi_accountgl TO t_bapi_accountgl.

  • Filtering data (empty spaces into Zeros)

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = wa_unbilled-account2

IMPORTING

output = wa_unbilled-account2.

  • ACCOUNT GL - (CREDIT)

MOVE c_itemno_cr TO wa_bapi_accountgl-itemno_acc.

MOVE wa_unbilled-company_code TO wa_bapi_accountgl-comp_code.

MOVE wa_unbilled-posting_date TO wa_bapi_accountgl-pstng_date.

MOVE wa_unbilled-account2 TO wa_bapi_accountgl-gl_account.

MOVE wa_unbilled-text2 TO wa_bapi_accountgl-item_text.

"MOVE wa_unbilled-cost_center_2 TO wa_bapi_accountgl-costcenter.

APPEND wa_bapi_accountgl TO t_bapi_accountgl.

  • _____________________________________________________________________________

  • _____________________________________________________________________________

  • CURRENCY - (DEBIT)

MOVE c_itemno_dr TO wa_bapi_currency-itemno_acc.

MOVE wa_unbilled-curr_code TO wa_bapi_currency-currency.

MOVE wa_unbilled-amt_curr_doc1 TO wa_bapi_currency-amt_doccur.

APPEND wa_bapi_currency TO t_bapi_currency.

  • CURRENCY - (CREDIT)

MOVE c_itemno_cr TO wa_bapi_currency-itemno_acc.

MOVE wa_unbilled-curr_code TO wa_bapi_currency-currency.

"Conversion from positive into negative for credit

wa_bapi_currency-amt_doccur = ( wa_unbilled-amt_curr_doc2 * -1 ). APPEND wa_bapi_currency TO t_bapi_currency.

  • _____________________________________________________________________________

  • _____________________________________________________________________________

  • Calling function module bapi and passing data.

CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'

EXPORTING

documentheader = wa_export_header

TABLES

accountgl = t_bapi_accountgl

currencyamount = t_bapi_currency

return = t_bapi_return.

  • Calling function module bapi for commit.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = c_x.

Former Member
0 Kudos

Dear Maaka,

Kindly go through the code in the following link.

http://www.erpgenie.com/abap/bdc_and_idoc_status.htm

Regards,

Abir

***************************************

  • Don't forget to Reward Points *