Skip to Content
author's profile photo Former Member
Former Member

Negative sign when output

I've an ABAP report where it will populate the result in an .TXT file

In SAP, it has indicate whether the Amount is H or S.

IF gw_regup-shkzg NE 'H'. gw_inv-wrbtr = gw_regup-wrbtr * -1. ELSE. gw_inv-wrbtr = gw_regup-wrbtr. ENDIF.

When i debug it, it does show it has negative sign behind

But when it got printed out in the TXT, there is no negative sign. Does the P(7) DECIMALS 2 might be causing it?

untitled.PNG (1.4 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jul 05, 2012 at 01:42 AM

    Dear Chin,

    Did you modify your internal table after you change the sign?

    For example,

    MODIFY gt_inv FROM gw_inv INDEX n TRANSPORTING wrbtr.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Vive,

      I managed to solve it.

      First i increase the lv_line length.

         DATA: lv_rwbtr(16),         lv_wrbtr(16),         lv_prtnm(35),         lv_brcod(3), *        lv_line(51).
      lv_line(52). "Increase total size by 1 to show negative sign from WRBTR

      Next i also increase the length of the lv_line when passing the variable from WRBTR

       *        lv_line+35(15) = lv_wrbtr.
      lv_line+35(16) = lv_wrbtr. "Increase output size to show negative sign

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.