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: 

To find the field in the work area and pass to some field

Former Member
0 Kudos

Hi all,

My Requirement is something like this .

i have 2 records in my internal table and i the value which i require may be anywhere in that internal table .

Eg.

NODE NODEDESC PSPHI PARENT CHILD ZLEFT ZRIGHT

-


ASD XCCC ASD R.00002

CDD CCCCC CDD GHJ

FGB FFFF R.000005 RFG

GHJ CCCC CDD CDD RFG

Records look like the above pattern so i want to capture the values like R.00002 or any value which resembles R.------

as i need to pass these things to my another function module my question is R.---- can be in any field so how can i get that values.

please help me

Hope i am clear with my question.

Regards,

Sana.

1 ACCEPTED SOLUTION

former_member404244
Active Contributor
0 Kudos

Hi,

Try this way..

Suppose my internal table has 3 fields(A1,A2,A3) and i have two records.

A1 A2 A3

g1 t 2 R1

t1 R1 t2



Loop at itab.

var1 = itab-A1.
var2 = itab-a2
var3 = itab-a3.

if var1 CA 'R'.
move var1 to some variable.
elseif var2 CA '2'.
move var2 to some variable.
elseif var3 CA 'R'.
Move var3 to some variable.
endif.

clear : itab,
           var1,
           var2,
          var3.
endloop.

Regards,

Nagaraj

3 REPLIES 3

Former Member
0 Kudos

Hi,

Use search command as below for u r requirment.

DATA text_table TYPE TABLE OF string.

APPEND: 'Sweet child in time' TO text_table,

'you''ll see the line' TO text_table,

'the line between' TO text_table,

'good and bad.' TO text_table.

SEARCH text_table FOR '.see.' AND MARK.

Regards,

Kumar.

former_member404244
Active Contributor
0 Kudos

Hi,

Try this way..

Suppose my internal table has 3 fields(A1,A2,A3) and i have two records.

A1 A2 A3

g1 t 2 R1

t1 R1 t2



Loop at itab.

var1 = itab-A1.
var2 = itab-a2
var3 = itab-a3.

if var1 CA 'R'.
move var1 to some variable.
elseif var2 CA '2'.
move var2 to some variable.
elseif var3 CA 'R'.
Move var3 to some variable.
endif.

clear : itab,
           var1,
           var2,
          var3.
endloop.

Regards,

Nagaraj

Former Member
0 Kudos

Hi,

Try this


data: str type string.
loop at itab into wa_itab.
  str = wa_itab.
  search for the pattern 
  You can put all your data that's needed into a seperate internal table
  clear str.
endloop.