2005 Nov 21 6:12 AM
Hi,
I have a value like 100- in itab.How to change -100 using
SHIFT function or some other else.
points guaranteed
kaki
2005 Nov 21 6:17 AM
DATA STR(4) TYPE C VALUE '100-'.
WRITE:/ 'BEFORE CHANGE: ',STR.
SHIFT STR BY 1 PLACES CIRCULAR RIGHT.
WRITE:/ 'AFTER CHANGE: ',STR.
PLZ REWARD POINTS IF IT HELPS YOU.
THANKS
2005 Nov 21 6:17 AM
DATA STR(4) TYPE C VALUE '100-'.
WRITE:/ 'BEFORE CHANGE: ',STR.
SHIFT STR BY 1 PLACES CIRCULAR RIGHT.
WRITE:/ 'AFTER CHANGE: ',STR.
PLZ REWARD POINTS IF IT HELPS YOU.
THANKS
2005 Nov 21 6:26 AM
JUST RUN THIS CODE.. I HOPE IT SERVES YOUR NEED.
plz reward points.
DATA: BEGIN OF ITAB OCCURS 0,
STR(4) TYPE C,
END OF ITAB.
START-OF-SELECTION.
*----
POPULATING VALUE IN ITAB.
ITAB-STR = '100-'.
APPEND ITAB.
ITAB-STR = '200-'.
APPEND ITAB.
WRITE:/ 'BEFORE CHANGE:'.
LOOP AT ITAB.
WRITE:/ ITAB-STR.
ENDLOOP.
*----
CHANGING THE VALUES.
LOOP AT ITAB.
SHIFT ITAB-STR BY 1 PLACES CIRCULAR RIGHT.
MODIFY ITAB.
ENDLOOP.
WRITE:/ 'AFTER CHANGE:'.
LOOP AT ITAB.
WRITE:/ ITAB-STR.
ENDLOOP.
2005 Nov 21 8:36 AM
Thanks anid,
Points allowted.
cheers
kaki
Message was edited by: Kaki R
2005 Nov 21 6:17 AM
Hi,
use SPLIT and CONCATENATE commands to do it.
SPLIT will change 100- into '100' and '-'.
now CONCATENATE '-' and '100' to convert it into -100
2005 Nov 21 6:28 AM
Hi,
Just split that value and again concatenate it.
if p_amount ca '-'.
replace '-' with '' into p_amount.
concatenate '-' p_amount into p_amount.
endif.
Thanks.
If your issue is solved reward points and close the thread.
2005 Nov 21 8:25 AM