Application Development 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: 

Seperation of contents in the string

Former Member
0 Kudos

Hi Guru's,

I was assigned a little bit query related to updation of text for LFA1 object. I would like to expalin my requirement in details. I have 2 texts like Z001 & Z002. Z001 stores range of PRO numbers. Z002 is for display the current PRO number related to perticular vendor. we need to update that Z002 by code it self. Suppose Z001 contains the range like this (ROADWAY 444 100 , ROADWAY 444 999). I need to update Z002 with the next value starting from lower value like

(ROADWAY 444100,ROADWAY 444 101,ROADWAY 444 102...........). For each vendor length of PRO # may change. Now my problem is how can i seperate alphabates and numerics in this string (ROADWAY 444 100..) for updating Z002 with next PRO#. Kindly help me out in this scenario and your help will be greatly appriciated.

Regards,

Ravi.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ravi,

You can split the string into parts..

DATA : begin of itab OCCURS 0,

line type char100,

end of itab.

SPLIT z001

AT space

INTO TABLE itab.

Now if you are sure that the 3rd record will be which you need to use..

Then, LOOP AT itab INDEX 3.

MOVE itab-line TO w_num.

w_num = w_num + 1.

ENDLOOP.

Thanks and Best Regards,

Vikas Bittera.

**Reward if useful**

2 REPLIES 2

Former Member
0 Kudos

Hi Ravi,

You can split the string into parts..

DATA : begin of itab OCCURS 0,

line type char100,

end of itab.

SPLIT z001

AT space

INTO TABLE itab.

Now if you are sure that the 3rd record will be which you need to use..

Then, LOOP AT itab INDEX 3.

MOVE itab-line TO w_num.

w_num = w_num + 1.

ENDLOOP.

Thanks and Best Regards,

Vikas Bittera.

**Reward if useful**

0 Kudos

Hi Vikas,

Very thinks for the immediate and useful suggestion. I will develop a logic based on your suggestion.

Regards,

Ravi...