Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to change value

Former Member
0 Kudos
119

Hi,

I have a value like 100- in itab.How to change -100 using

SHIFT function or some other else.

points guaranteed

kaki

1 ACCEPTED SOLUTION

Former Member
0 Kudos
93

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

6 REPLIES 6

Former Member
0 Kudos
94

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

0 Kudos
93

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.

0 Kudos
93

Thanks anid,

Points allowted.

cheers

kaki

Message was edited by: Kaki R

Former Member
0 Kudos
93

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

Former Member
0 Kudos
93

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.

Former Member
0 Kudos
93

Hi!

Use CLOI_PUT_SIGN_IN_FRONT.

Regards,

Maxim.