Application Development and Automation 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: 
Read only

Doubt in prgms

Former Member
0 Likes
999

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
982

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

6 REPLIES 6
Read only

Former Member
0 Likes
982

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

Read only

Former Member
0 Likes
982

Hi Gowri,

Can you give the code that you have used? It would be helpful for me to debug it.

Thanks & Regards,

Sumanth

Read only

Former Member
0 Likes
982

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

Read only

Former Member
0 Likes
982
loop at itab into wa_itab.
 shift wa_itab left.
  modify itab from wa_itab.
endloop.
Read only

Former Member
0 Likes
983

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

Read only

Former Member
0 Likes
982

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