2009 Sep 14 10:47 AM
Hello,
I have a material = HR-SEC
I want to convert it to Internal format 000000000000HR-SEC. The conversion routine is not working.
I want to shift the material field to right and then add zeros using Overlay.
When I use Shift right, only one character is right shifted.
Any clue??
~Pranu
2009 Sep 14 10:52 AM
DATA : s1 type char20,
i1 TYPE i.
s1 = 'HR-SEC'.
i1 = strlen( s1 ).
i1 = 20 - i1.
OVERLAY s1 WITH '00000000000000000000'.
SHIFT s1 by i1 PLACES RIGHT CIRCULAR.
WRITE s1.
Hello,
I have a material = HR-SEC
I want to convert it to Internal format 000000000000HR-SEC. The conversion routine is not working.
I want to shift the material field to right and then add zeros using Overlay.
When I use Shift right, only one character is right shifted.
Any clue??
~Pranu
2009 Sep 14 10:51 AM
Hi Pranu,
use
shift material by 12 places right.
here is sample code....
data:
w_i(30) type c value 'HR-SEC', " ur material field shd be > the length by the number of places u r shiftng it.
w_over(12) type c value '000000000000'.
shift w_i right by 12 places.
write:/ w_i.
overlay w_i with w_over.
write:/ w_i.
Regards,
Mdi.Deeba
Edited by: Mdi.Deeba on Sep 14, 2009 3:38 PM
2009 Sep 14 10:52 AM
DATA : s1 type char20,
i1 TYPE i.
s1 = 'HR-SEC'.
i1 = strlen( s1 ).
i1 = 20 - i1.
OVERLAY s1 WITH '00000000000000000000'.
SHIFT s1 by i1 PLACES RIGHT CIRCULAR.
WRITE s1.
2009 Sep 14 10:53 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |