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

About BAPI_ACC_GL_POSTING_POST

Former Member
0 Likes
918

Hi all, I want to use BAPI_ACC_GL_POSTING_POST to do posting in F-02. And if I want to using posting key '31', how can I give the parameters? This is my code:

it_item-itemno_acc = '10'.

UNPACK '21210100' TO it_item-gl_account.

UNPACK p_lifnr TO it_item-vendor_no.

  • it_item-vendor_no = p_lifnr.

  • UNPACK p_lifnr TO it_item-alloc_nmbr.

it_item-comp_code = 'ZB09'.

it_item-costcenter = costcenter.

it_item-ref_key_3 = 'XXX'.

it_item-pstng_date = sy-datum.

it_item-doc_type = 'SA'.

it_item-fisc_year = sy-datum+0(4).

it_item-fis_period = sy-datum+4(2).

APPEND it_item.

There is an error message: Accout 21210100 in company code ZB09 cannot be directly posted to. What should I do?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
847

Hi

Please check something for transaction F-44 for clearing vendor items...

Please check BAPI_ACC_DOCUMENT_POST and also use the correct document type...

Regards,

Arun

7 REPLIES 7
Read only

Former Member
0 Likes
848

Hi

Please check something for transaction F-44 for clearing vendor items...

Please check BAPI_ACC_DOCUMENT_POST and also use the correct document type...

Regards,

Arun

Read only

0 Likes
847

I must use BAPI_ACC_DOCUMENT_POST, right?

Read only

0 Likes
847

yeah.. i guess... because reconciliation accounts cannot be directly posted to...

Read only

0 Likes
847

I have tried BAPI_ACC_DOCUMENT_POST, but it still said:

Accout 21210100 in company code ZB09 cannot be directly posted to.:(

Read only

0 Likes
847

Hi,

The error you have mentioned:

Accout 21210100 in company code ZB09 cannot be directly posted to.:(

Is related to GL Account Configuration. Talk to FI Consultant they will fix it.

And you can use any BAPI:

BAPI_ACC_DOCUMENT_POST

Or

BAPI_ACC_GL_POSTING_POST

If you are using BAPI then no need to pass the posting key. e.g. '31' etc. Based on Document type BAPI will automatically determine the Posting key.

Ashvender

Read only

0 Likes
847

Yeah, thanks!

I think it it related to GL Account Configuration, but the Consultant think there is someting wrong with the program:(, so I don't know how the resolve the issue.

Read only

0 Likes
847

Hi,

Try by passing the cost center to both the entries. Means debit entry as well as credit entry (Psoting key 31 & 40).

Ashvender