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: 

BAPI_ACC_DOCUMENT_POST - header text not populated.

venkateswaran_k
Active Contributor
0 Kudos

Dear All

Please help me where I am missing. I am using BAPI_ACC_DOCUMENT_POST to post the documents. Everything is working fine. But the Header text is not populated.

  header-username = sy-uname.
  header-header_txt = 'Transfer Cost Posting'.
  header-comp_code = '1000'.
  header-doc_date =  p_bldat. "                     wa_finalposting_cc-bldat.
  header-pstng_date = p_budat. "                    wa_finalposting_cc-budat.
  header-doc_type = 'TR'.
  header-ref_doc_no =  'TR-06'.

Is anything related to document type setting? Kindly help me.

Regards,

Venkat

1 ACCEPTED SOLUTION

venkateswaran_k
Active Contributor

Thank you gabmarian and sandra.rossi

Your directions helped me a lot.

Yes, there was a BADI implemented AC_DOCUMENT - but no functional code exists. Only there was some break point checks were there. Hence I replied that there was no enhancements.

But later as per sandra's comment, i further searched and found that - even if you dont' have any code but the method is implemented for any reason - the header text will be over written.. That was the message I got.

So adding further code in those methods - brought the header text.

CHANGE_INITIAL & CHANGE_AFTER_CHECK

DATA: wa_header TYPE acchd.
  IF sy-xprog EQ 'SAPMSSY1'.
    CLEAR wa_header.
    wa_header = im_document-header.
    ex_document-header-bktxt = wa_header-bktxt.
    CLEAR wa_header.
  ENDIF.

Many thanks to gabmarian and sandra.rossi

Regards,

Venkat

4 REPLIES 4

gabmarian
Active Contributor
0 Kudos

Did you check whether it is cleared by a substitution rule or a user exit (e.g. the one where you can process the extension fields)?

venkateswaran_k
Active Contributor
0 Kudos

Hi gabmarian

There are no exits / rule that replaces this value.

Regards,

Venkat

Sandra_Rossi
Active Contributor
0 Kudos

You may search the forum/SAP Web site with your favorite Web search engine. I see many answers for search below. Based on the results, if it still doesn't solve, you may anyway refine your query/provide more information.

BAPI_ACC_DOCUMENT_POST header_txt site:sap.com

venkateswaran_k
Active Contributor

Thank you gabmarian and sandra.rossi

Your directions helped me a lot.

Yes, there was a BADI implemented AC_DOCUMENT - but no functional code exists. Only there was some break point checks were there. Hence I replied that there was no enhancements.

But later as per sandra's comment, i further searched and found that - even if you dont' have any code but the method is implemented for any reason - the header text will be over written.. That was the message I got.

So adding further code in those methods - brought the header text.

CHANGE_INITIAL & CHANGE_AFTER_CHECK

DATA: wa_header TYPE acchd.
  IF sy-xprog EQ 'SAPMSSY1'.
    CLEAR wa_header.
    wa_header = im_document-header.
    ex_document-header-bktxt = wa_header-bktxt.
    CLEAR wa_header.
  ENDIF.

Many thanks to gabmarian and sandra.rossi

Regards,

Venkat