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

Cannot use BAPI to post FI doc with header text

Former Member
0 Likes
1,373

Hi All,

I had tried using BAPI : BAPI_ACC_DOCUMENT_POST to post and I had filled the header_txt field in document header structure, but I cannot see the text of the posted doc and all the other information is correct but without any header text.

Any of you could help me?

Regards,

Edmond

6 REPLIES 6
Read only

Former Member
0 Likes
910

You are checking in bkpf right?

What type of document are you posting?

Edited by: Ramiro Escamilla on Jun 26, 2008 12:07 PM

Read only

0 Likes
910

SL

Read only

0 Likes
910

Hello Edmond,

Please check if a Substitution is in place for Header Text.

It could be at Company Code or Document Type Level.

Hope this helps.

With Regards

Vijay Gajavalli

Read only

0 Likes
910

Could you tell me the detail of how to check it? Thanks!

Read only

Former Member
0 Likes
910

Because BAPI: BAPI_ACC_DOCUMENT_POST will Check BADI with Posting

1.BADI Information:

(1)Object Type Name(Interface) is IF_EX_AC_DOCUMENT (T-code: SE24)

(2)Method: CHANGE_INITIAL & CHANGE_AFTER_CHECK

2.Reason:

(1)Once This BADI has been created for any reason,

BAPI:BAPI_ACC_DOCUMENT_CHECK & BAPI_ACC_DOCUMENT_POST

will check it for Document Header Text

(2)If Method: CHANGE_INITIAL & CHANGE_AFTER_CHECK has been created for any reason,

but Creator return an null Document Header Text, then BAPI will clear Document Header Text

3.Solution:

(1)Add source code into Method: CHANGE_INITIAL & CHANGE_AFTER_CHECK,

please refer to (2) for detail source code below

(2)

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

DATA: wa_header TYPE acchd.

IF sy-xprog EQ 'SAPLBPFC'.

*---<SAPLBPFC> is for Posting with BAPI: BAPI_ACC_DOCUMENT_CHECK

*---<SAPMSSY1> is for Test(Check) with BAPI: BAPI_ACC_DOCUMENT_POST

CLEAR wa_header.

wa_header = im_document-header.

ex_document-header-bktxt = wa_header-bktxt.

CLEAR wa_header.

ENDIF.

Read only

Former Member
0 Likes
910

Sorry! I have corrected source code

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

DATA: wa_header TYPE acchd.

IF sy-xprog NE 'SAPMSSY1'.

*---<SAPLBPFC> is for Posting with BAPI: BAPI_ACC_DOCUMENT_POST

*---<SAPCNVE > is for Posting(Tax) with BAPI: BAPI_ACC_DOCUMENT_POST

*---<SAPMSSY1> is for Test(Check) with BAPI: BAPI_ACC_DOCUMENT_CHECK

CLEAR wa_header.

wa_header = im_document-header.

ex_document-header-bktxt = wa_header-bktxt.

CLEAR wa_header.

ENDIF.