10-17-2008 8:24 AM
Hi,
I have a requirement where i need to loop the internal table with a condition if the condition becomes true then a particula field of that row should be added with a -ve sign,and modify that row.
The field is of type quantity.
10-17-2008 8:27 AM
hi,
when condition is satisfied
multiply with -1.
i.e.,
itab-field1 = itab-field1 * -1.
modify itab.
Rgds.,
subash
10-17-2008 8:26 AM
Hi
Take that sign into a variable var1 and the field var2.
Use concatenate statement..CONCATENATE VAR1 VAR2 INTO VAR3.(another variable.)
Regards,
Vishwa.
10-17-2008 8:27 AM
hi,
when condition is satisfied
multiply with -1.
i.e.,
itab-field1 = itab-field1 * -1.
modify itab.
Rgds.,
subash
10-17-2008 8:27 AM
hi,
check this.
if it_bsis-shkzg = it_bseg-shkzg.
if it_bseg-shkzg = 'H'.
it_bsis-wrbtr = it_bsis-wrbtr * -1 .
it_bsis-dmbtr = it_bsis-dmbtr * -1 .
IT_FINAL-wrbtr = IT_bsis-wrbtr.
IT_FINAL-dmbtr = IT_bsis-dmbtr.
else.
it_bsis-wrbtr = it_bsis-wrbtr .
it_bsis-dmbtr = it_bsis-dmbtr .
IT_FINAL-wrbtr = IT_bsis-wrbtr.
IT_FINAL-dmbtr = IT_bsis-dmbtr.
endif.
endif.
it_final-waers1 = 'INR'.
APPEND IT_FINAL.
CLEAR IT_FINAL.
10-17-2008 8:27 AM
Hi Anjali,
Try this way :
Loop at itab into wa.
if <condition>
wa-qty = wa-qty * (-1).
modify itab from wa.
else.
<do something>
endif.
endloop.
Regards,
Swapna.
10-17-2008 8:39 AM
10-17-2008 8:40 AM
Did you check all replies?
check Sniper's reply.
CLOI_PUT_SIGN_IN_FRONT
10-17-2008 8:41 AM
10-17-2008 8:53 AM
10-17-2008 8:58 AM
10-17-2008 8:27 AM
loop at itab.
if <reqd. condition>
itab-quantity = -1*itab-quantity.
modify itab transporting quantity.
endif.
10-17-2008 8:28 AM
Hi Anjali,
For this type of issue what you need to do is first change the variable type to CHAR(10) and check if Value is negative. Then assign the value with the negative sign in the variable and then modify the table.
Thanks,
Chidanand
10-17-2008 8:28 AM
I suppose u mean to say the sign should be in front ..
-131.23
and now u might have a case where the o/p is 131.23- when u are dealing with q fields.
To get the sign in front use the FM CLOI_PUT_SIGN_IN_FRONT but here the data type has to be char to handle the sign part.
Vijay.
10-17-2008 8:28 AM
hi,
to add -ve sign to quantity field,multiply that field with -1.
like:
data int1 type i.
int1 = '500'.
int1 = int1 * -1.
now int1 will be -500.