09-10-2008 1:11 AM
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.
09-10-2008 5: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
09-10-2008 1:19 AM
change the logic so that by using CONCATENATE statement u can populate -ve sign for the particular value in the output.
09-10-2008 1: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.
09-10-2008 3: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
09-10-2008 3:27 AM
hi ,
try with any other fields of BSEG , like WRBTR.
regards
Prabhu
09-10-2008 4: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 .
09-10-2008 4: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.
09-10-2008 5: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