Skip to Content

Negaive Amount

Dear All

I am facing a strange issue first time. I have data type

like

DATA: AMT LIKE BSEG-NETWR.

AMT = 232323.233-

Figure in variable AMT is in negative.

But when i use Write statement to print it on list negative sign is not appearing.

Write:\ AMT.

I also tried AMT = AMT * -1.

But not working.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 10, 2008 at 04:02 AM

    Hi,

    Please try this ..

    DATA :v_data TYPE p DECIMALS 2,

    l_str TYPE string,

    l_str1 TYPE string,

    l_str2 TYPE string.

    v_data = '-300'.

    l_str = v_data.

    CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'

    CHANGING

    value = l_str.

    MOVE l_str to v_data.

    SPLIT l_str at '.' INTO l_str1 l_str2.

    WRITE: / l_str1.

    Regards,

    Murali

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 10, 2008 at 12:19 AM

    change the logic so that by using CONCATENATE statement u can populate -ve sign for the particular value in the output.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 10, 2008 at 12:21 AM

    Yes that is possible but my question is whats wrong with write statement. Because Write prints a negative amount in negative there is no need for any further logic.

    I don't know whats wrong in my case.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 10, 2008 at 02:06 AM

    Change the sign to front and see,

    DATA : amt LIKE bseg-netwr.

    amt = -232323.233.

    WRITE :/ amt.

    Refer this document

    http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/db9e2335c111d1829f0000e829fbfe/content.htm

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 10, 2008 at 02:27 AM

    hi ,

    try with any other fields of BSEG , like WRBTR.

    regards

    Prabhu

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 10, 2008 at 03:37 AM

    u can try it out with changing the data type ..

    Try this ..

    data : dmbtr type wertv8.

    wertv8 data type can have +/- sign also .

    Hope this will help u to solve ur problem .

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 10, 2008 at 03:48 AM

    Hi,

    check your variable length.

    if it is sufficient...then try to concatenate the value into that variable and display it. it will solve your problem.

    Regards,

    venkat.

    Add comment
    10|10000 characters needed characters exceeded