<?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 currency error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-currency-error/m-p/6513475#M1423960</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vasuki S Patki,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use the amounts without negative sign. The posting key 50 let the system know that this is a negative amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Dirk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Jan 2010 07:38:50 GMT</pubDate>
    <dc:creator>DirkAltmann</dc:creator>
    <dc:date>2010-01-15T07:38:50Z</dc:date>
    <item>
      <title>BAPI_ACC_DOCUMENT_POST currency error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-currency-error/m-p/6513474#M1423959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;           I am using BAPI_ACC_DOCUMENT_POST for GL account postings (FB01) .&lt;/P&gt;&lt;P&gt;However , I am getting error when using the BAPI. If the posting key is 40 ( debit) , I maintain the amount as it is (positive) and if the posting key is 50 (credit) i change the amount to negative value and then do teh postings. But i get the following error in such a case. :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The +/- sign in the currency field is wrong (See Long text)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
      ls_docheader-username   = sy-uname.
      ls_docheader-bus_act    = 'RFBU'.
      ls_docheader-doc_type   = ls_record-blart.
      ls_docheader-header_txt = ls_record-bktxt.
      ls_docheader-comp_code  = ls_record-bukrs.
      ls_docheader-doc_date   = ls_record-bldat.
      ls_docheader-pstng_date = ls_record-budat.
      ls_docheader-ref_doc_no = ls_record-xblnr.
    ENDIF.

    IF ls_record-bschl1 = '40'.
      lv_count = lv_count + 1.
*Fill the bapi structure of Account GL
      ls_accountgl-itemno_acc = lv_count.
      ls_accountgl-gl_account = ls_record-hkont.
      ls_accountgl-item_text = ls_record-sgtxt.
      ls_accountgl-func_area = ls_record-fkber.
      ls_accountgl-costcenter = ls_record-kostl.
      ls_accountgl-profit_ctr = ls_record-prctr.
      ls_accountgl-orderid = ls_record-aufnr.
      APPEND ls_accountgl TO lt_accountgl.
      CLEAR ls_accountgl.

*Fill the bapi structure of Currency
      ls_amount-itemno_acc = lv_count.
      ls_amount-currency = ls_record-waers.
      ls_amount-exch_rate = ls_record-kursf.
      ls_amount-amt_doccur =  ls_record-wrbtr.  -------&amp;gt; debit amount
      APPEND ls_amount TO lt_amount.
      CLEAR ls_amount.
    ELSEIF ls_record-bschl1 = '50'.

*  *Fill the bapi structure of Account GL
      ls_accountgl-itemno_acc = lv_count.
      ls_accountgl-gl_account = ls_record-hkont.
      ls_accountgl-item_text = ls_record-sgtxt.
      ls_accountgl-func_area = ls_record-fkber.
      ls_accountgl-costcenter = ls_record-kostl.
      ls_accountgl-profit_ctr = ls_record-prctr.
      ls_accountgl-orderid = ls_record-aufnr.
      APPEND ls_accountgl TO lt_accountgl.
      CLEAR ls_accountgl.

*Fill the bapi structure of Currency
      ls_amount-itemno_acc = lv_count.
      ls_amount-currency = ls_record-waers.
      ls_amount-exch_rate = ls_record-kursf.

     ls_amount-amt_doccur = -1 *  ls_record-wrbtr. -----&amp;gt; credit amount
      APPEND ls_amount TO lt_amount.
      CLEAR ls_amount.

    ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2010 06:13:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-currency-error/m-p/6513474#M1423959</guid>
      <dc:creator>former_member206377</dc:creator>
      <dc:date>2010-01-15T06:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST currency error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-currency-error/m-p/6513475#M1423960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vasuki S Patki,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use the amounts without negative sign. The posting key 50 let the system know that this is a negative amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Dirk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2010 07:38:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-currency-error/m-p/6513475#M1423960</guid>
      <dc:creator>DirkAltmann</dc:creator>
      <dc:date>2010-01-15T07:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST currency error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-currency-error/m-p/6513476#M1423961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use BAPI_ACC_GL_POSTING_POST to post the document through FB01 and below is the code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the document header fill the below value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE:  p_bldat           TO  s_dochdr-doc_date,&lt;/P&gt;&lt;P&gt;         p_blart           TO  s_dochdr-doc_type,&lt;/P&gt;&lt;P&gt;         p_budat           TO  s_dochdr-pstng_date,&lt;/P&gt;&lt;P&gt;         p_monat           TO  s_dochdr-fis_period,&lt;/P&gt;&lt;P&gt;         s_gl_data2-newbk  TO  s_dochdr-comp_code,&lt;/P&gt;&lt;P&gt;         p_xblnr           TO  s_dochdr-ref_doc_no,&lt;/P&gt;&lt;P&gt;         p_bktxt           TO  s_dochdr-header_txt,&lt;/P&gt;&lt;P&gt;         v_usnam           TO  s_dochdr-username,&lt;/P&gt;&lt;P&gt;         v_fisc_year       TO  s_dochdr-fisc_year,&lt;/P&gt;&lt;P&gt;         p_wwert           TO  s_dochdr-trans_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF v_wrbtr &amp;gt; 0.&lt;/P&gt;&lt;P&gt;v_dummy_line = v_dummy_line + c_10.&lt;/P&gt;&lt;P&gt;    s_accountgl-itemno_acc = v_dummy_line.&lt;/P&gt;&lt;P&gt;    s_accountgl-gl_account = s_gl_data-saknr.&lt;/P&gt;&lt;P&gt;       s_accountgl-comp_code  = s_gl_data-newbk.&lt;/P&gt;&lt;P&gt;    s_accountgl-pstng_date = p_budat.&lt;/P&gt;&lt;P&gt;    s_accountgl-doc_type = p_blart.&lt;/P&gt;&lt;P&gt;    s_accountgl-fisc_year = v_fisc_year.&lt;/P&gt;&lt;P&gt;    s_accountgl-fis_period = p_monat.&lt;/P&gt;&lt;P&gt;    s_accountgl-ref_key_1 = s_gl_data-xref1.&lt;/P&gt;&lt;P&gt;    s_accountgl-ref_key_2 = s_gl_data-xref2.&lt;/P&gt;&lt;P&gt;    s_accountgl-costcenter = s_gl_data-kostl.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;    s_accountgl-orderid = s_gl_data-aufnr.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    s_accountgl-alloc_nmbr = s_gl_data-dzuonr.&lt;/P&gt;&lt;P&gt;    s_accountgl-item_text = s_gl_data-sgtxt.&lt;/P&gt;&lt;P&gt;    s_accountgl-profit_ctr = s_gl_data-prctr.&lt;/P&gt;&lt;P&gt;    s_accountgl-wbs_element = s_gl_data-posid.&lt;/P&gt;&lt;P&gt;    APPEND s_accountgl TO t_accountgl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    v_wrbtr = v_wrbtr * -1.&lt;/P&gt;&lt;P&gt;    s_currencyamount-itemno_acc = v_dummy_line.&lt;/P&gt;&lt;P&gt;    s_currencyamount-amt_doccur = v_wrbtr.&lt;/P&gt;&lt;P&gt;    s_currencyamount-currency   = p_waers.&lt;/P&gt;&lt;P&gt;    APPEND s_currencyamount TO t_currencyamount.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      documentheader = s_dochdr&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      accountgl      = t_accountgl&lt;/P&gt;&lt;P&gt;      currencyamount = t_currencyamount&lt;/P&gt;&lt;P&gt;      return         = t_returnpost&lt;/P&gt;&lt;P&gt;      extension1     = t_extension.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2010 09:31:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-currency-error/m-p/6513476#M1423961</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-15T09:31:31Z</dc:date>
    </item>
  </channel>
</rss>

