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

how to concatenate data into asingle row while using table controls?

Former Member
0 Likes
774

In a table contro with single column of 200 cahrs length:

Data of 20 chars will be input by scanning a barcode using a RF scanner.

Each barcode shall be separated by a comma and fill in 10 per row.

Let us say first barcode scan showed x1, second barcode scan x2, third barcode scan showed x3 etc.

Now the first row of the table control should show x1,x2,x3....

Once x10 is arrived , then it sould go to second row x11,x12,x13...

How to achive this?

5 REPLIES 5
Read only

former_member202474
Contributor
0 Likes
727

Hi,

Try using a counter and also a loop statement.

when counter = 10 append work area(should have a concatenated value i.e x1,x2,x3....) to itab and make the counter back to 1.

**Reward if useful**

Regards,

Ruby.

Read only

Former Member
0 Likes
727

Hi,

You can use a counter and a flag.Use ctr = ctr + 1 in a loop.If the value of ctr is less than 10 you keep on concatenating values x1,x2,x3..etc. separated by ",".If the ctr is 10.Reset the flag and counter.after 10th append it to internal table.Pass this internal table to table control.

Read only

0 Likes
727

Before using the counter as mentioned above, where do I store the values that are input?

The values x1;x2;x3 wtc are coming into the table control from a barcode scanner.

Read only

0 Likes
727

Hi,

Before passing the data to table control write:

data : var(100) type c,

var1(100) type c.

Loop at itab.

ctr = ctr +1.

var = itab-field.

conactenate var1 var ',' into var1.

If ctr > 10 .

append var1 to tabcontrol.

endif.

endloop.

Read only

0 Likes
727

Vishal,

This should happen in the PAI right?

Then itab should also be a table control??

Can you pl jot down the process flow - PBO and PAI briefly?

What I am trying to understadn is, as soon as the data is read from the barcode, it will be displayed on the screen.

Then your code will come into picture at PAI adn modfies the table control- is it not?

So probably some thing needs to be controlled in the ITS that connects sap adn the rf scanner?