‎2009 Jul 15 3:17 PM
Hi Experts,
can any expert help me in providing me a sample code for the below logic.
Am working on BW.
Flatfile contains values like 16173 / 0180 / KLASSIK D/300 L258D VERN.
But the Result to be displayed should be only ---> 16173 / 0180 (Inbetween 2 numbers "/" is mandatory)
Please assist me.
Thanks in advance.
‎2009 Jul 15 3:24 PM
hi ,
try this way...
w_string = '16173 / 0180 / KLASSIK D/300 L258D VERN'.
data : begin of itab occurs 0,
w_char type chr60,
end of itab.
data : w_cal type i.
spit w_string at '/' into table itab.
loop at itab .
w_cal = sy-tabix mod 2.
if w_cal eq 0.
concatenate w_charout itab-w_char separated by '/' into w_charout .
write w_charout .
clear w_charout.
else.
move itab-w_char to w_charout.
endif.
endloop.
"The output is ..
16173 / 0180
KLASSIK D/300 L258D VERN
Prabhudas
‎2009 Jul 15 3:24 PM
hi ,
try this way...
w_string = '16173 / 0180 / KLASSIK D/300 L258D VERN'.
data : begin of itab occurs 0,
w_char type chr60,
end of itab.
data : w_cal type i.
spit w_string at '/' into table itab.
loop at itab .
w_cal = sy-tabix mod 2.
if w_cal eq 0.
concatenate w_charout itab-w_char separated by '/' into w_charout .
write w_charout .
clear w_charout.
else.
move itab-w_char to w_charout.
endif.
endloop.
"The output is ..
16173 / 0180
KLASSIK D/300 L258D VERN
Prabhudas