2007 Jul 11 12:04 PM
hi frnds,
I have a doubt 'how to delete 1st charactor from the internal table records'.
Ex : itab have city name but it displaying
1pune
2mumbai
3chennai
i want to remove the 1st charactor from the output. i need only
pune
mumbai
chennai
plz give me a soln
Gowri
2007 Jul 11 12:08 PM
Hi Gowri,
assuming that city name is C_NAME and is of length 10 char.
loop at itab into wtab.
wtab-c_name = wtab-c_name+1(9).
modify itab from wtab transporting c_name.
endloop.
This would solve your problem.
<b>Reward points if this helps.</b>
Kiran
hi frnds,
I have a doubt 'how to delete 1st charactor from the internal table records'.
Ex : itab have city name but it displaying
1pune
2mumbai
3chennai
i want to remove the 1st charactor from the output. i need only
pune
mumbai
chennai
plz give me a soln
Gowri
2007 Jul 11 12:06 PM
Hi,
Lets say your internal table is ITAB and the Field name is CITY and the CITY length is 20 charecters
LOOP AT ITAB.
ITAB-CITY = ITAB-CITY+1(20).
Modify ITAB index SY-TABIX.
ENDLOOP.Regards
Sudheer
2007 Jul 11 12:06 PM
Hi Gowri,
Can you give the code that you have used? It would be helpful for me to debug it.
Thanks & Regards,
Sumanth
2007 Jul 11 12:08 PM
Hi
do like this.
Loop at ITAB
itab-name+0(1) = space.
condense itab-name.
modify itab index sy-tabix.
endloop.
<b>Reward points for useful Answers</b>
Regards
Anji
2007 Jul 11 12:08 PM
loop at itab into wa_itab.
shift wa_itab left.
modify itab from wa_itab.
endloop.
2007 Jul 11 12:08 PM
Hi Gowri,
assuming that city name is C_NAME and is of length 10 char.
loop at itab into wtab.
wtab-c_name = wtab-c_name+1(9).
modify itab from wtab transporting c_name.
endloop.
This would solve your problem.
<b>Reward points if this helps.</b>
Kiran
2007 Jul 11 12:12 PM
Hello,
Check this :
DATA:BEGIN OF itab OCCURS 0,
f1 TYPE char5,
END OF itab.
DATA: wa_tab LIKE LINE OF itab.
CLEAR wa_tab.
wa_tab-f1 = '1ABC'.
APPEND wa_tab TO itab.
CLEAR wa_tab.
wa_tab-f1 = '2DEF'.
APPEND wa_tab TO itab.
CLEAR wa_tab.
wa_tab-f1 = '3GHI'.
APPEND wa_tab TO itab.
CLEAR wa_tab.
LOOP AT itab INTO wa_tab.
WRITE:/ wa_tab-f1.
ENDLOOP.
WRITE:/ '*******************'.
LOOP AT itab INTO wa_tab.
DATA:len TYPE i.
len = STRLEN( wa_tab-f1 ).
wa_tab-f1 = wa_tab-f1+1(len).
WRITE:/ wa_tab-f1.
ENDLOOP.
endloop.
Regards,
Deepu.K
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |