‎2006 Oct 14 10:17 AM
Hi Friends,
I am getting values in negatiive like this 2,32,542- I want to put the negative sign in front of the value
-2,32,542, is there any function module for this.
Please help me.
Thanx in advance,
Venu
‎2006 Oct 14 10:21 AM
Hi Venu,
check this function module..
CLOI_PUT_SIGN_IN_FRONT will move the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all character fields), not right justifed as numbers normally are.
chck this example..
data: a1 type i value 56 ,
a2 type i value 60,
res type i.
res = a1 - a2.
data: res1(10).
res1 = res.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
VALUE = res1.
write res1.
===============================[OR]
<b>data : char(20).
data : val type i.
val = val - 50.
if val < 0.
write val to char.
concatenate '-' char into char .
condense char no-gaps.
endif.
write : / char.</b>
reward if useful..
Thaks,Eswar
‎2006 Oct 14 10:42 AM
Hi Eswar,
I am not getting the field is mseg-menge how to do it.
Thanx
Venu
‎2006 Oct 14 10:48 AM
‎2006 Oct 14 11:09 AM
Hi
loop at it_mseg.
AT END OF matnr.
Material No.
lw_final-matnr = lw_mseg-matnr.
Opening qty
lw_final-openqty = lf_open_rec_qty - lf_open_issue_qty.
lw_final-recpqty =
lw_final-issuqty =
Closing qty
<b>lw_final-closqty</b> = lf_close_rec_qty - lf_close_issue_qty.
Getting Material Description
SELECT SINGLE maktx INTO lf_maktx
FROM makt
WHERE matnr = lw_mseg-matnr
AND spras = sy-langu.
Materail Description
lw_final-maktx = lf_maktx.
endloop.
I want to change the value of this field.
lw_final-closqty
Please help me,
thanx in advance.
Venu
‎2006 Oct 14 11:36 AM
hi venu,
chk this sample.
v_amount = itab-shkzg.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
VALUE = itab-shkzg.
v_amount = itab-shkzg
endif.
rgds
anver
Message was edited by: Anversha s