<?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 Posting Issue - '+' '-' causing failure? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072919#M1355800</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Forums!,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a GL posting program, it works and posts to the GL using the BAPI &lt;/P&gt;&lt;P&gt;BAPI_ACC_GL_POSTING_POST I have run into an issue where this single document will not post?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to balance my debits and credits with a clearing account (as I am limiting the numbers of records to a posting to 900)&lt;/P&gt;&lt;P&gt;everything balances well however this single item will not post and I have no idea why?&lt;/P&gt;&lt;P&gt;I get this error: "The +/- sign in the currency field is wrong (see long text)"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  lv_posnr = gv_rec_cnt + 1.

  lv_hkont2 = p_clract.

  lv_totamt = gv_posting_debits - gv_posting_credits.

  lv_totamt = lv_totamt * -1.      " this line here is what is causing the issue
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP code that is causing the issue:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF r_shkzg IS INITIAL AND NOT ld_value IS INITIAL.      "note 420177
*   Soll/Habenkennzeichen setzen
    IF ld_value &amp;gt; 0.
      r_shkzg = 'S'.
    ELSE.
      r_shkzg = 'H'.
    ENDIF.
  ELSE.
*   Vorzeichen kontrollieren
    IF ( r_shkzg = 'S' AND ld_value &amp;lt; 0 ) OR
       ( r_shkzg = 'H' AND ld_value &amp;gt; 0 ).
      CLEAR it_return.
      it_return-type       = 'E'.
      it_return-id         = 'RW'.
      it_return-number     = '610'.
      it_return-message_v1 = it_acccr-posnr.
      it_return-message_v2 = it_acccr-curtp.
      it_return-parameter  = 'CURRENCYAMOUNT'.
      it_return-row        = r_tabix.
      it_return-field      = 'AMT_DOCCUR'.
      COLLECT it_return.
    ENDIF.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Sep 2009 14:19:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-09-14T14:19:13Z</dc:date>
    <item>
      <title>Posting Issue - '+' '-' causing failure?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072919#M1355800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Forums!,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a GL posting program, it works and posts to the GL using the BAPI &lt;/P&gt;&lt;P&gt;BAPI_ACC_GL_POSTING_POST I have run into an issue where this single document will not post?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to balance my debits and credits with a clearing account (as I am limiting the numbers of records to a posting to 900)&lt;/P&gt;&lt;P&gt;everything balances well however this single item will not post and I have no idea why?&lt;/P&gt;&lt;P&gt;I get this error: "The +/- sign in the currency field is wrong (see long text)"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  lv_posnr = gv_rec_cnt + 1.

  lv_hkont2 = p_clract.

  lv_totamt = gv_posting_debits - gv_posting_credits.

  lv_totamt = lv_totamt * -1.      " this line here is what is causing the issue
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP code that is causing the issue:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF r_shkzg IS INITIAL AND NOT ld_value IS INITIAL.      "note 420177
*   Soll/Habenkennzeichen setzen
    IF ld_value &amp;gt; 0.
      r_shkzg = 'S'.
    ELSE.
      r_shkzg = 'H'.
    ENDIF.
  ELSE.
*   Vorzeichen kontrollieren
    IF ( r_shkzg = 'S' AND ld_value &amp;lt; 0 ) OR
       ( r_shkzg = 'H' AND ld_value &amp;gt; 0 ).
      CLEAR it_return.
      it_return-type       = 'E'.
      it_return-id         = 'RW'.
      it_return-number     = '610'.
      it_return-message_v1 = it_acccr-posnr.
      it_return-message_v2 = it_acccr-curtp.
      it_return-parameter  = 'CURRENCYAMOUNT'.
      it_return-row        = r_tabix.
      it_return-field      = 'AMT_DOCCUR'.
      COLLECT it_return.
    ENDIF.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 14:19:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072919#M1355800</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-14T14:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Posting Issue - '+' '-' causing failure?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072920#M1355801</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;The proble is caused by the wrong data declaration.&lt;/P&gt;&lt;P&gt;Try it somehow like this:&lt;/P&gt;&lt;P&gt;DATA: lv_totamt TYPE WTGXXX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The WTGXXX data element can handle signs also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tamá&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 14:26:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072920#M1355801</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-14T14:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Posting Issue - '+' '-' causing failure?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072921#M1355802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tamas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you had a similar issue?&lt;/P&gt;&lt;P&gt;If you look at the SAP code that is giving the error it determines if it is a debit or credit if it is a positive or negative, I am not sure having the sign in front will help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ABAP-ER19 on Sep 14, 2009 4:31 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 14:29:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072921#M1355802</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-14T14:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Posting Issue - '+' '-' causing failure?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072922#M1355803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Changing of the datatype did not resolve the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any one else have any input? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KW&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 14:53:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072922#M1355803</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-14T14:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Posting Issue - '+' '-' causing failure?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072923#M1355804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I must also say that everything in the program has worked up until now... it just this ONE file that does not work? I have posting items using this BAPI and Program for quite some time.&lt;/P&gt;&lt;P&gt;This is a production file, so the user insists that its data integrity is correct.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 15:01:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072923#M1355804</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-14T15:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Posting Issue - '+' '-' causing failure?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072924#M1355805</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;I checked the standard code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It appears that r_shkgz should be blank at the place where error message is getting generated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you debug the code and check where this parameter is getting filled ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, check the interface and documentation of the BAPI. I think you should have some way to post negative values instead of passing the negative sign (like Dr / Cr indicator) in any of the interface parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, have a look if SAP note 420177 says something about how to handle negative postings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 15:01:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072924#M1355805</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-14T15:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Posting Issue - '+' '-' causing failure?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072925#M1355806</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;No, I think it is not the type of LV_TOTAMT which causes a problem, since you don't have a dump but an error message...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you look at the piece of code that you indicate (and the context), you are on a loop on internal table T_ACBCR. First time, if LD_VALUE is positive, R_SHKZG is set to 'S' (debitor account), else R_SHKZG is set to 'H' (creditor account). Next pass of this loop, there is a cross-control between LD_VALUE and R_SHKZG that has been set just before : &lt;/P&gt;&lt;P&gt;  R_SHKZG = 'S' -&amp;gt; you should have a LD_VALUE positive&lt;/P&gt;&lt;P&gt;  R_SHKZG = H' -&amp;gt; you should have a LD_VALUE negative&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In conclusion, all your values in table T_ACBCR should have same sign! And here it seems not to be the case... Could you please check that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Samuel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 15:04:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072925#M1355806</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-14T15:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Posting Issue - '+' '-' causing failure?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072926#M1355807</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;&lt;/P&gt;&lt;P&gt;I figured out what was the issue and what was causing this error, i would have got back to this response earlier but, had issues with my sdn account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So anyone familiar with posting to the GL knows that you cannot post over 999 lines. so I had logic in my program that when you got over 900 lines to use a clearing account for the difference, post the document and continue on processing.&lt;/P&gt;&lt;P&gt;Well this all worked well, HOWEVER this was the first time in my program that I had over 1800 lines so I had to use my clearing account logic TWICE and was creating 3 documents in total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The line I now have commented out was the issue... when I would go to post my second document with the clearing account I have RESET my counter for that particular subroutine BUT my counter for my overall subroutine was untouched...&lt;/P&gt;&lt;P&gt;so when i tried to post I have document number 1799, 1800 and then &lt;STRONG&gt;900&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus this threw off sequencing...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Long and drawn out answer but, I thought it was important to point out that it was MY logic error no issue with SAP code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    IF lv_rec_cnt &amp;gt;= p_maxgl.

      PERFORM F_BUILD_CLEARING_REC_POST.

      lv_rec_cnt = 0.

*      gv_rec_cnt = 0.

      lv_clear_acct_used = 1.

    ENDIF.

 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Sep 2009 14:21:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/posting-issue-causing-failure/m-p/6072926#M1355807</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-18T14:21:12Z</dc:date>
    </item>
  </channel>
</rss>

