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

data fetching problem in internal table

Former Member
0 Likes
410

Hi All,

I have two internal table which are of type as shown below.

itab1 is of following type:

regno(255) type c,

uid type c

itab2 is of following type

regno type regno,

uid type userid,

address type add,

phno type phn.

Datas in itab2 are as follows:

100 01 india 3454534

200 01 china 34553543

300 02 us 6464654

400 02 uk 45654

Itab1 is populated using the uid field as key as shown below.

regno uid

100 200 01

300 400 02

100 200 are values in field regno

01 is uid.

What we have done is collected all the regno which belong to the same uid for sending a single mail to the uid person with both the regno. We are able to achieve this. For this finally we loop into itab1 and fetch the uid and send mail to him.

Now an extra requirement is to send the details of a regno (address and phno) along with the mail. The prob is in our final internal table we have a character field which will have all the regno for a uid (may be upto 20). Each regno will be of length 3.

I have to loop into tab1 and read tab2 to achieve this using uid as key. But regno will for a uid will be combined. I have fetch each regno say 100 first and get the details and then 200 and then get the details and send a mail to uid 01. Then 300 and 400 details and then a mail to uid 02.

Please explain how to get individual regno when i loop into tab1 and read tab2 so that i can fetch the details.

Any suggestion will be very helpful

2 REPLIES 2
Read only

anversha_s
Active Contributor
0 Likes
382

Hi,

My sugestion is

1. Instead of country name put country code(3rd field).

2. now during the loop check which all country codes are coming unde rthat corresponding UID.

3. Fect all respective those details and send across the mail.

Rgds,

Anversha

Read only

Former Member
0 Likes
382

Hi Aslam,

As per my understanding...

In itab1, instead of maintaining all the reg no in the same field(like 100 200 300 ....) againist uid 01

maintain multiple records like

regno udi

100 01

200 01

300 01 etc

(in this case the combination of regno & uid becomes the key.)

now while ur sending mail to the people, just loop the recors of itab1

in the same loop u can just write a read statement to get the remainig details(address, phone no etc..) of that regno from itab2.

Hope this helps you, revert back if still u hav any problm.