<?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 Re: BAPI_ACC_DOCUMENT_POST in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421861#M1549414</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When the bapi end, in the internal table t_return, have an error 702 (Balance in transaction currency), I'm new in this module, I never used BTE, I'm looking some information about structure extension1, Do you have an example about this??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to post a document for receivables doubtful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Oct 2010 16:09:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-10-21T16:09:36Z</dc:date>
    <item>
      <title>BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421859#M1549412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to implement BAPI_ACC_DOCUMENT_POST. I'm following the examples for filling the structures, but I'm not really sure if Im filling well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is the code, hoping you can help me. Thanks!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT t_itab.
PERFORM llena_header.

READ TABLE t_zctasing WITH KEY XBLNR = t_itab-tarifa
BUKRS = t_itab-sociedad
ZDIVISION = t_itab-division.
IF sy-subrc EQ 0.
PERFORM llena_accountgl.
PERFORM llena_accounttax.
ENDIF.
* PERFORM llena_accountgl.
PERFORM llena_currencyamount.



CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
exporting
documentheader = t_header
* customercpd = gd_customercpd
* contractheader = gd_fica_hd
* importing
* obj_type = l_type
* obj_key = l_key
* obj_sys = l_sys
tables
accountgl = t_accountgl
accounttax = t_accounttax
currencyamount = t_currencyamount
return = t_return.



* IF sy-subrc = 0.
* CLEAR commit_ret.
* CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT = 'X'
* IMPORTING
* RETURN = commit_ret.
* ENDIF.


CLEAR : t_header,
t_accountgl[],
t_accounttax[],
t_currencyamount[],
t_return[].

ENDLOOP.


FORM llena_header .

t_header-username = sy-uname.
t_header-header_txt = t_itab-descripcion.
t_header-comp_code = t_itab-sociedad.
t_header-doc_date = sy-datum.
t_header-pstng_date = sy-datum.
t_header-fis_period = sy-datum+2(2).
t_header-doc_type = t_itab-clase_docto.
t_header-ref_doc_no = t_itab-tarifa.
t_header-bus_act = 'RFBU'.

ENDFORM. " llena_header
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Form llena_accountgl
*&amp;amp;---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --&amp;gt; p1 text
* &amp;lt;-- p2 text
*----------------------------------------------------------------------*
FORM llena_accountgl .
CLEAR t_accountgl.

IF t_zctasing-ziep EQ 'X'.
IF t_itab-iva EQ '10'.
t_accountgl-tax_code = 'A1'.
ELSEIF t_itab-iva EQ '15'.
t_accountgl-tax_code = 'A2'.
ELSEIF t_itab-iva EQ '16'.
t_accountgl-tax_code = 'A3'.
ELSEIF t_itab-iva EQ '11'.
t_accountgl-tax_code = 'A4'.
ENDIF.
ELSEIF t_itab-iva EQ '11'.
t_accountgl-tax_code = 'S2'.
ELSEIF t_itab-iva EQ '16'.
t_accountgl-tax_code = 'S1'.
ENDIF.


CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = t_zctasing-zcta
IMPORTING
OUTPUT = t_zctasing-zcta.

clear t_accountgl.
t_accountgl-itemno_acc = 1.
t_accountgl-gl_account = t_zctasing-zcta.
t_accountgl-item_text = 'BAPI Test G/L line item'. "#EC NOTEXT
t_accountgl-comp_code = t_itab-sociedad.
t_accountgl-bus_area = t_itab-division.
append t_accountgl.

ENDFORM. " llena_accountgl
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Form llena_accounttax
*&amp;amp;---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --&amp;gt; p1 text
* &amp;lt;-- p2 text
*----------------------------------------------------------------------*
FORM llena_accounttax .

SELECT SINGLE *
FROM T030K
WHERE ktopl EQ 'MM01' AND
ktosl EQ 'MWS' AND
mwsKz EQ t_accountgl-tax_code.


clear t_accounttax.
t_accounttax-itemno_acc = 2.
t_accounttax-gl_account = t030k-konts.
t_accounttax-tax_code = t_accountgl-tax_code.
t_accounttax-acct_key = 'MWS'.
t_accounttax-cond_key = 'MWAS'.
* t_accounttax-itemno_tax = 2.
append t_accounttax.

ENDFORM. " llena_accounttax
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Form llena_currencyamount
*&amp;amp;---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --&amp;gt; p1 text
* &amp;lt;-- p2 text
*----------------------------------------------------------------------*
FORM llena_currencyamount .

 DATA : v_importe_iva TYPE bapiaccr09-amt_doccur,
v_importe TYPE bapiaccr09-amt_doccur.

v_importe_iva = t_itab-importe * t_itab-iva.
v_importe_iva = v_importe_iva / 100.
v_importe = t_itab-importe - v_importe_iva.

clear t_currencyamount.
t_currencyamount-itemno_acc = 1.
* t_currencyamount-curr_type = '10'.
t_currencyamount-currency = 'MXN'.
t_currencyamount-amt_doccur = t_itab-importe.
append t_currencyamount.

clear t_currencyamount.
t_currencyamount-itemno_acc = 2.
* t_currencyamount-curr_type = '10'.
t_currencyamount-currency = 'MXN'.
t_currencyamount-amt_base = t_itab-importe.
t_currencyamount-amt_doccur = v_importe_iva.
append t_currencyamount.

* clear t_currencyamount.
* t_currencyamount-itemno_acc = 3.
** t_currencyamount-curr_type = '10'.
* t_currencyamount-currency = 'MXN'.
** t_currencyamount-amt_doccur = '3840.00'.
* append t_currencyamount.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 15:20:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421859#M1549412</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T15:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421860#M1549413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have a specific issue, such as no document or is there something wrong with your posted document?  I don't see the extension parameter - have you implemented the BTE for the posting keys (covered in many posts on this forum)?  Why is the commit code commented out?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 15:43:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421860#M1549413</guid>
      <dc:creator>brad_bohn</dc:creator>
      <dc:date>2010-10-21T15:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421861#M1549414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When the bapi end, in the internal table t_return, have an error 702 (Balance in transaction currency), I'm new in this module, I never used BTE, I'm looking some information about structure extension1, Do you have an example about this??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to post a document for receivables doubtful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 16:09:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421861#M1549414</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T16:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421862#M1549415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See test report ACC_BAPI_TEST_DOCUMENT. You will get better idea how to fill up all different parameters/tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Pranav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 16:29:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421862#M1549415</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T16:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421863#M1549416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think it's telling you that the sum of the debits has to equal the sum of the credits and they don't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 16:40:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421863#M1549416</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T16:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421864#M1549417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following the report ACC_BAPI_TEST_DOCUMENT, change my code as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even still get error 702 " Balance in transaction currency". What's happening?? help please!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; t_accountgl-itemno_acc   = 2.&lt;/P&gt;&lt;P&gt; t_accountgl-gl_account    = t_zctasing-zcta. "'0021510201'.&lt;/P&gt;&lt;P&gt; t_accountgl-item_text       = 'BAPI Test G/L line item'.   "#EC NOTEXT&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; t_accountgl-comp_code = t_itab-sociedad.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; t_accountgl-bus_area    = t_itab-division.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; t_accountgl-profit_ctr       = t_zctasing-zprctr.&lt;/P&gt;&lt;P&gt; t_accountgl-tax_code       = 'S1'.&lt;/P&gt;&lt;P&gt;  append t_accountgl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM llena_currencyamount .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : v_importe_iva TYPE bapiaccr09-amt_doccur,&lt;/P&gt;&lt;P&gt;       v_importe TYPE bapiaccr09-amt_doccur,&lt;/P&gt;&lt;P&gt;       v_iva(5)  TYPE c.&lt;/P&gt;&lt;P&gt;CONCATENATE '1.' t_itab-iva INTO v_iva.  " '1.16'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_importe_iva = ( t_itab-importe / v_iva ) * t_itab-iva.&lt;/P&gt;&lt;P&gt;v_importe_iva = v_importe_iva / 100.&lt;/P&gt;&lt;P&gt;v_importe = t_itab-importe - v_importe_iva.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  clear t_currencyamount.&lt;/P&gt;&lt;P&gt;  t_currencyamount-itemno_acc   = 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; t_currencyamount-curr_type    = '10'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  t_currencyamount-currency     = 'MXN'.&lt;/P&gt;&lt;P&gt;  t_currencyamount-amt_doccur   =  t_itab-importe * ( -1 ). "'565.58'&lt;/P&gt;&lt;P&gt;  append t_currencyamount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; clear t_currencyamount.&lt;/P&gt;&lt;P&gt;  t_currencyamount-itemno_acc   = 2.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; t_currencyamount-curr_type    = '10'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  t_currencyamount-currency     = 'MXN'.&lt;/P&gt;&lt;P&gt;  t_currencyamount-amt_doccur   =  v_importe. " '487.57'&lt;/P&gt;&lt;P&gt;  append t_currencyamount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  clear t_currencyamount.&lt;/P&gt;&lt;P&gt;  t_currencyamount-itemno_acc   = 3.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; t_currencyamount-curr_type    = '10'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  t_currencyamount-currency     = 'MXN'.&lt;/P&gt;&lt;P&gt;  t_currencyamount-amt_base     = v_importe. " '487.57'&lt;/P&gt;&lt;P&gt;  t_currencyamount-amt_doccur   = v_importe_iva. " '78.01'&lt;/P&gt;&lt;P&gt;  append t_currencyamount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " llena_currencyamount&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 18:27:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421864#M1549417</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T18:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421865#M1549418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please make GL account line item number matches with the currency amount number... otheriwse it will throw such an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nabheet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 20:38:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421865#M1549418</guid>
      <dc:creator>nabheetscn</dc:creator>
      <dc:date>2010-10-21T20:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421866#M1549419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I foundwhat was missing, thanks to all for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 23:25:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421866#M1549419</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T23:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421867#M1549420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="green" __jive_macro_name="color"&gt;Moderator message - Per forum rules, please tell the forum just what solved the problem. You can also assign Po1nts to helpful answers. This encourages people to help you in the future.

Rob&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Oct 2010 12:58:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421867#M1549420</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-22T12:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421868#M1549421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the structure ACCOUNTRECEIVABLE(BAPIACAR09) structure was missing to fill. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM llena_receivable .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR t_accountreceivable.&lt;/P&gt;&lt;P&gt;  t_accountreceivable-itemno_acc = 1.&lt;/P&gt;&lt;P&gt;  t_accountreceivable-customer   = t_itab-cliente.&lt;/P&gt;&lt;P&gt;  t_accountreceivable-item_text  = t_itab-tarifa.&lt;/P&gt;&lt;P&gt;  APPEND t_accountreceivable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Hugo0355 on Oct 22, 2010 4:16 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Oct 2010 14:15:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421868#M1549421</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-22T14:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421869#M1549422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Oct 2010 14:23:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post/m-p/7421869#M1549422</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-22T14:23:51Z</dc:date>
    </item>
  </channel>
</rss>

