<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Error when using functions BAPI_ACC_DOCUMENT_POST in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541558#M246668</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I used BAPI_ACC_DOCUMENT_POST function, the message: Document posted successfully appears, but really not documens are created, and the FI number range are modified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the example code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZPBA_PC                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  zpba_pc MESSAGE-ID m3.&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;DATA: obj_type LIKE bapiache09-obj_type,&lt;/P&gt;&lt;P&gt;      obj_key LIKE  bapiache09-obj_key,&lt;/P&gt;&lt;P&gt;      obj_sys LIKE  bapiache09-obj_sys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_hdr    LIKE bapiache09,&lt;/P&gt;&lt;P&gt;      it_gl     LIKE bapiacgl09 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      it_curr   LIKE bapiaccr09 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      t_result  LIKE bapiret2   OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Header Data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;it_hdr-obj_type   = 'BKPFF'.&lt;/P&gt;&lt;P&gt;it_hdr-obj_key    = '$'.&lt;/P&gt;&lt;P&gt;it_hdr-obj_sys    = 'LA122D'.&lt;/P&gt;&lt;P&gt;it_hdr-bus_act    = 'RFBU'.&lt;/P&gt;&lt;P&gt;it_hdr-comp_code  = 'VEZS'.&lt;/P&gt;&lt;P&gt;it_hdr-fisc_year  = '2004'.&lt;/P&gt;&lt;P&gt;it_hdr-fis_period = '12'.&lt;/P&gt;&lt;P&gt;it_hdr-doc_date   = '20041218'..&lt;/P&gt;&lt;P&gt;it_hdr-pstng_date = '20041218'.&lt;/P&gt;&lt;P&gt;it_hdr-doc_type   = 'ZI'.&lt;/P&gt;&lt;P&gt;it_hdr-header_txt = 'TEXTO CAB'.&lt;/P&gt;&lt;P&gt;it_hdr-username   = sy-uname.&lt;/P&gt;&lt;P&gt;it_hdr-compo_acc  = 'GL'.&lt;/P&gt;&lt;P&gt;it_hdr-ref_doc_no_long = 'REFERENCIA'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;First Item&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Account number&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;it_gl-itemno_acc = '1'.&lt;/P&gt;&lt;P&gt;it_gl-gl_account = '0014401001'.&lt;/P&gt;&lt;P&gt;it_gl-item_text  = 'PRUEBA TEXTO 1'.&lt;/P&gt;&lt;P&gt;it_gl-profit_ctr = 'VE2020'.&lt;/P&gt;&lt;P&gt;APPEND it_gl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Second Item&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Account number&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;it_gl-itemno_acc = '2'.&lt;/P&gt;&lt;P&gt;it_gl-gl_account = '0014401001'.&lt;/P&gt;&lt;P&gt;it_gl-item_text  = 'PRUEBA TEXTO 2'.&lt;/P&gt;&lt;P&gt;it_gl-profit_ctr = 'VE2020'.&lt;/P&gt;&lt;P&gt;APPEND it_gl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Set amount&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;it_curr-itemno_acc = '1'.&lt;/P&gt;&lt;P&gt;it_curr-currency = 'VEB'.&lt;/P&gt;&lt;P&gt;it_curr-amt_doccur = '10'.&lt;/P&gt;&lt;P&gt;APPEND it_curr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_curr-itemno_acc = '2'.&lt;/P&gt;&lt;P&gt;it_curr-currency = 'VEB'.&lt;/P&gt;&lt;P&gt;it_curr-amt_doccur = '-10'.&lt;/P&gt;&lt;P&gt;APPEND it_curr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;check posting&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    documentheader = it_hdr&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    accountgl      = it_gl&lt;/P&gt;&lt;P&gt;    currencyamount = it_curr&lt;/P&gt;&lt;P&gt;    return         = t_result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT t_result WHERE ( type = 'E' OR type = 'A' ).&lt;/P&gt;&lt;P&gt;  EXIT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;REFRESH t_result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    documentheader = it_hdr&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    obj_type       = obj_type&lt;/P&gt;&lt;P&gt;    obj_key        = obj_key&lt;/P&gt;&lt;P&gt;    obj_sys        = obj_sys&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    accountgl      = it_gl&lt;/P&gt;&lt;P&gt;    currencyamount = it_curr&lt;/P&gt;&lt;P&gt;    return         = t_result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.&lt;/P&gt;&lt;P&gt;COMMIT WORK.&lt;/P&gt;&lt;P&gt;WRITE: obj_key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciated your help to solve that error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Piero Cimule.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 02 Sep 2006 02:03:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-02T02:03:41Z</dc:date>
    <item>
      <title>Error when using functions BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541558#M246668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I used BAPI_ACC_DOCUMENT_POST function, the message: Document posted successfully appears, but really not documens are created, and the FI number range are modified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the example code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZPBA_PC                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  zpba_pc MESSAGE-ID m3.&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;DATA: obj_type LIKE bapiache09-obj_type,&lt;/P&gt;&lt;P&gt;      obj_key LIKE  bapiache09-obj_key,&lt;/P&gt;&lt;P&gt;      obj_sys LIKE  bapiache09-obj_sys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_hdr    LIKE bapiache09,&lt;/P&gt;&lt;P&gt;      it_gl     LIKE bapiacgl09 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      it_curr   LIKE bapiaccr09 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      t_result  LIKE bapiret2   OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Header Data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;it_hdr-obj_type   = 'BKPFF'.&lt;/P&gt;&lt;P&gt;it_hdr-obj_key    = '$'.&lt;/P&gt;&lt;P&gt;it_hdr-obj_sys    = 'LA122D'.&lt;/P&gt;&lt;P&gt;it_hdr-bus_act    = 'RFBU'.&lt;/P&gt;&lt;P&gt;it_hdr-comp_code  = 'VEZS'.&lt;/P&gt;&lt;P&gt;it_hdr-fisc_year  = '2004'.&lt;/P&gt;&lt;P&gt;it_hdr-fis_period = '12'.&lt;/P&gt;&lt;P&gt;it_hdr-doc_date   = '20041218'..&lt;/P&gt;&lt;P&gt;it_hdr-pstng_date = '20041218'.&lt;/P&gt;&lt;P&gt;it_hdr-doc_type   = 'ZI'.&lt;/P&gt;&lt;P&gt;it_hdr-header_txt = 'TEXTO CAB'.&lt;/P&gt;&lt;P&gt;it_hdr-username   = sy-uname.&lt;/P&gt;&lt;P&gt;it_hdr-compo_acc  = 'GL'.&lt;/P&gt;&lt;P&gt;it_hdr-ref_doc_no_long = 'REFERENCIA'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;First Item&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Account number&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;it_gl-itemno_acc = '1'.&lt;/P&gt;&lt;P&gt;it_gl-gl_account = '0014401001'.&lt;/P&gt;&lt;P&gt;it_gl-item_text  = 'PRUEBA TEXTO 1'.&lt;/P&gt;&lt;P&gt;it_gl-profit_ctr = 'VE2020'.&lt;/P&gt;&lt;P&gt;APPEND it_gl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Second Item&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Account number&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;it_gl-itemno_acc = '2'.&lt;/P&gt;&lt;P&gt;it_gl-gl_account = '0014401001'.&lt;/P&gt;&lt;P&gt;it_gl-item_text  = 'PRUEBA TEXTO 2'.&lt;/P&gt;&lt;P&gt;it_gl-profit_ctr = 'VE2020'.&lt;/P&gt;&lt;P&gt;APPEND it_gl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Set amount&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;it_curr-itemno_acc = '1'.&lt;/P&gt;&lt;P&gt;it_curr-currency = 'VEB'.&lt;/P&gt;&lt;P&gt;it_curr-amt_doccur = '10'.&lt;/P&gt;&lt;P&gt;APPEND it_curr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_curr-itemno_acc = '2'.&lt;/P&gt;&lt;P&gt;it_curr-currency = 'VEB'.&lt;/P&gt;&lt;P&gt;it_curr-amt_doccur = '-10'.&lt;/P&gt;&lt;P&gt;APPEND it_curr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;check posting&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    documentheader = it_hdr&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    accountgl      = it_gl&lt;/P&gt;&lt;P&gt;    currencyamount = it_curr&lt;/P&gt;&lt;P&gt;    return         = t_result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT t_result WHERE ( type = 'E' OR type = 'A' ).&lt;/P&gt;&lt;P&gt;  EXIT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;REFRESH t_result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    documentheader = it_hdr&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    obj_type       = obj_type&lt;/P&gt;&lt;P&gt;    obj_key        = obj_key&lt;/P&gt;&lt;P&gt;    obj_sys        = obj_sys&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    accountgl      = it_gl&lt;/P&gt;&lt;P&gt;    currencyamount = it_curr&lt;/P&gt;&lt;P&gt;    return         = t_result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.&lt;/P&gt;&lt;P&gt;COMMIT WORK.&lt;/P&gt;&lt;P&gt;WRITE: obj_key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciated your help to solve that error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Piero Cimule.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Sep 2006 02:03:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541558#M246668</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-02T02:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Error when using functions BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541559#M246669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the changes :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report ZPBA_PC *&lt;/P&gt;&lt;P&gt;*&amp;amp; *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; *&lt;/P&gt;&lt;P&gt;*&amp;amp; *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT zpba_pc MESSAGE-ID m3.&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;DATA: obj_type LIKE bapiache09-obj_type,&lt;/P&gt;&lt;P&gt;obj_key LIKE bapiache09-obj_key,&lt;/P&gt;&lt;P&gt;obj_sys LIKE bapiache09-obj_sys,&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;l_flag type c.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_hdr LIKE bapiache09,&lt;/P&gt;&lt;P&gt;it_gl LIKE bapiacgl09 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;it_curr LIKE bapiaccr09 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;t_result LIKE bapiret2 OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Header Data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;it_hdr-obj_type = 'BKPFF'.&lt;/P&gt;&lt;P&gt;it_hdr-obj_key = '$'.&lt;/P&gt;&lt;P&gt;it_hdr-obj_sys = 'LA122D'.&lt;/P&gt;&lt;P&gt;it_hdr-bus_act = 'RFBU'.&lt;/P&gt;&lt;P&gt;it_hdr-comp_code = 'VEZS'.&lt;/P&gt;&lt;P&gt;it_hdr-fisc_year = '2004'.&lt;/P&gt;&lt;P&gt;it_hdr-fis_period = '12'.&lt;/P&gt;&lt;P&gt;it_hdr-doc_date = '20041218'..&lt;/P&gt;&lt;P&gt;it_hdr-pstng_date = '20041218'.&lt;/P&gt;&lt;P&gt;it_hdr-doc_type = 'ZI'.&lt;/P&gt;&lt;P&gt;it_hdr-header_txt = 'TEXTO CAB'.&lt;/P&gt;&lt;P&gt;it_hdr-username = sy-uname.&lt;/P&gt;&lt;P&gt;it_hdr-compo_acc = 'GL'.&lt;/P&gt;&lt;P&gt;it_hdr-ref_doc_no_long = 'REFERENCIA'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;First Item&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Account number&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;it_gl-itemno_acc = '1'.&lt;/P&gt;&lt;P&gt;it_gl-gl_account = '0014401001'.&lt;/P&gt;&lt;P&gt;it_gl-item_text = 'PRUEBA TEXTO 1'.&lt;/P&gt;&lt;P&gt;it_gl-profit_ctr = 'VE2020'.&lt;/P&gt;&lt;P&gt;APPEND it_gl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Second Item&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Account number&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;it_gl-itemno_acc = '2'.&lt;/P&gt;&lt;P&gt;it_gl-gl_account = '0014401001'.&lt;/P&gt;&lt;P&gt;it_gl-item_text = 'PRUEBA TEXTO 2'.&lt;/P&gt;&lt;P&gt;it_gl-profit_ctr = 'VE2020'.&lt;/P&gt;&lt;P&gt;APPEND it_gl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Set amount&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;it_curr-itemno_acc = '1'.&lt;/P&gt;&lt;P&gt;it_curr-currency = 'VEB'.&lt;/P&gt;&lt;P&gt;it_curr-amt_doccur = '10'.&lt;/P&gt;&lt;P&gt;APPEND it_curr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_curr-itemno_acc = '2'.&lt;/P&gt;&lt;P&gt;it_curr-currency = 'VEB'.&lt;/P&gt;&lt;P&gt;it_curr-amt_doccur = '-10'.&lt;/P&gt;&lt;P&gt;APPEND it_curr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;check posting&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;documentheader = it_hdr&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;accountgl = it_gl&lt;/P&gt;&lt;P&gt;currencyamount = it_curr&lt;/P&gt;&lt;P&gt;return = t_result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT t_result WHERE ( type = 'E' OR type = 'A' ).&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;l_flag = 'X'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;if l_flag is initial.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;REFRESH t_result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;documentheader = it_hdr&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;obj_type = obj_type&lt;/P&gt;&lt;P&gt;obj_key = obj_key&lt;/P&gt;&lt;P&gt;obj_sys = obj_sys&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;accountgl = it_gl&lt;/P&gt;&lt;P&gt;currencyamount = it_curr&lt;/P&gt;&lt;P&gt;return = t_result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Clear l_flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT t_result WHERE ( type = 'E' OR type = 'A' ).&lt;/P&gt;&lt;P&gt;l_flag = 'X'.&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&amp;lt;/b&amp;gt;&amp;lt;b&amp;gt;if l_flag is initial.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;COMMIT WORK AND WAIT.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;endif.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: obj_key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Sep 2006 02:51:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541559#M246669</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-02T02:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error when using functions BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541560#M246670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check OSS note 306504. According to it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Use of OBJ_TYPE (reference transaction)
Enter your own value in field OBJ_TYPE (reference 
transaction). You must maintain this value in table TTYP. 
You can specify a function module that is then called if 
the user wants to navigate back to the source or sender 
document from an accounting document. This means that

in the document navigation (audit), you can integrate 
documents that were posted via the BAPIs. The field TTYP-
STRUC reflects the structure of the organizational units 
(for example, company code and fiscal year).

If you use SAP values in field OBJ_TYPE, this can result 
in unwanted effects, for example, errors may occur during 
the processing of taxes, during the navigation to the 
source document, or a document number, which is derived 
from the reference document number of the sender may be 
assigned (reference transaction BKPFF). In the test 
phase, you can use the IDoc reference transaction.

Define the FI and CO line item summarization separately 
for each reference transaction.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rob Burbank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Sep 2006 03:06:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541560#M246670</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-02T03:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error when using functions BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541561#M246671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created that TTYP data according with OSS note 306504:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AWTYP       BKPFB                            &lt;/P&gt;&lt;P&gt;STRUC       BKPF_AWOBJ                       &lt;/P&gt;&lt;P&gt;FUNCTION    BAPI_ACC_DOCUMENT_POST           &lt;/P&gt;&lt;P&gt;REMOTE                                       &lt;/P&gt;&lt;P&gt;OTEXT       Contab. via Bapi                 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then I test the program, that created the document in the ledgers, but doesn't exits in BKPF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have other suggestion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciated your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Piero.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Sep 2006 14:33:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541561#M246671</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-06T14:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Error when using functions BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541562#M246672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you calling the BAPI with it_hdr-obj_type = 'BKPFB'?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Sep 2006 14:40:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541562#M246672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-06T14:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error when using functions BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541563#M246673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I test the program with new values, that include BKPFB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Piero.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2006 12:29:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541563#M246673</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-07T12:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Error when using functions BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541564#M246674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Piero,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the below link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="2291673"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2006 12:52:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541564#M246674</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2006-09-07T12:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Error when using functions BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541565#M246675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The FI documents are posted, but when I check FB03 transaction and try to view:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enviroment -&amp;gt; Document enviroment -&amp;gt; Accounting documents...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the transaction does not show the screen with related documents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition, the GL documents relationship doesn't exist&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached the header parametes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  it_hdr-obj_type   = 'BKPFF'.&lt;/P&gt;&lt;P&gt;  it_hdr-obj_key    = '$'.&lt;/P&gt;&lt;P&gt;  it_hdr-bus_act    = 'RFBU'.&lt;/P&gt;&lt;P&gt;  it_hdr-comp_code  = sociedad.&lt;/P&gt;&lt;P&gt;  it_hdr-fisc_year  = ejercicio.&lt;/P&gt;&lt;P&gt;  it_hdr-doc_date   = f_documento.&lt;/P&gt;&lt;P&gt;  it_hdr-pstng_date = f_contabilizacion.&lt;/P&gt;&lt;P&gt;  it_hdr-fis_period = f_contabilizacion+4(2).&lt;/P&gt;&lt;P&gt;  it_hdr-doc_type   = clase_doc.&lt;/P&gt;&lt;P&gt;  it_hdr-header_txt = texto_cab.&lt;/P&gt;&lt;P&gt;  it_hdr-username   = sy-uname.&lt;/P&gt;&lt;P&gt;  it_hdr-compo_acc  = 'FI'.&lt;/P&gt;&lt;P&gt;  it_hdr-ref_doc_no_long = referencia.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciated your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Piero.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Oct 2006 15:35:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-when-using-functions-bapi-acc-document-post/m-p/1541565#M246675</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-23T15:35:55Z</dc:date>
    </item>
  </channel>
</rss>

