2007 Jul 24 3:07 PM
Hi,
I have Documnet field in my ztable. it contains the 50 char length.
I am entering the data like DA,Dl,DZ.......upto 50 chars. But in my report I have to compare the 2 chars from this field. How can i separate?
regards,
Ajay reddy
2007 Jul 24 3:15 PM
HI,
if you have exactly 50 characters all the time.
data : begin of itab_value occurs 0,
str(2) type c,
end of itab_value.
data : lv_str type i.
loop at itab.
lv_strlen = strlen(itab-str).
do .
if lv_strlen > 0.
itab_value-str = itab-str+0(2).
append itab_value.
shift itab-str left by 3 places.
lv_strlen = strlen(itab-str).
else.
exit.
endif.
enddo.
here you have itab_value with all the values splint into two character string and you can compare here.
your comparision logic here.
referesh itab_value.
endloop.
thanks
mahesh
Message was edited by:
I Can Solve It
Hi,
I have Documnet field in my ztable. it contains the 50 char length.
I am entering the data like DA,Dl,DZ.......upto 50 chars. But in my report I have to compare the 2 chars from this field. How can i separate?
regards,
Ajay reddy
2007 Jul 24 3:15 PM
HI,
if you have exactly 50 characters all the time.
data : begin of itab_value occurs 0,
str(2) type c,
end of itab_value.
data : lv_str type i.
loop at itab.
lv_strlen = strlen(itab-str).
do .
if lv_strlen > 0.
itab_value-str = itab-str+0(2).
append itab_value.
shift itab-str left by 3 places.
lv_strlen = strlen(itab-str).
else.
exit.
endif.
enddo.
here you have itab_value with all the values splint into two character string and you can compare here.
your comparision logic here.
referesh itab_value.
endloop.
thanks
mahesh
Message was edited by:
I Can Solve It
2007 Jul 24 3:29 PM
HI,
According to my logic i have to use RANGES with comma separater.
How can i do that.
regards,
Ajayreddy
2007 Jul 24 3:34 PM
DATA: BEGIN OF itab OCCURS 0,
fld(2) TYPE c,
END OF itab.
PARAMETERS: str(50) TYPE c. " to put ur values like DA,Dl,DZ.......upto 50 char
START-OF-SELECTION.
CONDENSE str NO-GAPS.
SPLIT str AT ',' INTO TABLE itab.
LOOP AT itab.
WRITE:/ itab-fld.
ENDLOOP.
Reward if useful
Regards
Prax
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |