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

Re: Structured Variables as Parameters.

Former Member
0 Likes
465

Hello Gurus,

How can we use structured variables as parameters. Here is the code that I am working on.

abap.

call method abc=>xyz

exporting 123 = 456

345 = 678

importing 012 = 345.

endabap.

log ( 345 ).

chetab ( ijk , ijk_1 ).

So when i run the script i notice that log ( 345 ) gives me:-

log 345 = XML-DATA-01

Parameter

1

a

b

c

2

a

b

c

Now 345 is a table with diff fields (a, b, c) and multiple records (1, 2,..). In chetab command interface I have to give b and c field values to compare and is it also possible to repeat the check for diff records. Please help me with this.

Thanks,

GS.

1 ACCEPTED SOLUTION
Read only

Vny12
Product and Topic Expert
Product and Topic Expert
0 Likes
434

Hi,

use the code below.

Do 5 .

variable abc = x[&lpc]-a.

variable qwe = x[&lpc]-b.

CHETAB ---> pass abc and qwe or x[&lpc]-a and x[&lpc]-b.

in the interface,

clear chetab_1.

end loop

since chetab is in loop.

refresh the chetab interface so that every time in loop new data gets inn.

regards

vinay

3 REPLIES 3
Read only

Former Member
0 Likes
434

Hello Gurus,

My question now is half answered. I am able to pass a, b values in CHETAB command. All I had to do was in CHETAB command interface for element a, b i entered the value as X[1]-a and X[1]-b.

However as mentioned earlier X[] has multiple records say 5. So i have to check table entries for 5 records. I have writted my CHETAB command in DO loop. However everytime it takes X[1]-a and X[1]-b.

So, all I need now is, can it take X[2]-a and X[2]-b, X[3]-a and X[3]-b, ... for each iteration in the DO loop. I dont know whether its possible. But if it is then please can anybody help me on this.

Thanks,

GS

Note: Sorry Gurus, please replace X with 345 in this message.

Edited by: Get Started on Apr 4, 2009 12:41 AM

Read only

Vny12
Product and Topic Expert
Product and Topic Expert
0 Likes
435

Hi,

use the code below.

Do 5 .

variable abc = x[&lpc]-a.

variable qwe = x[&lpc]-b.

CHETAB ---> pass abc and qwe or x[&lpc]-a and x[&lpc]-b.

in the interface,

clear chetab_1.

end loop

since chetab is in loop.

refresh the chetab interface so that every time in loop new data gets inn.

regards

vinay

Read only

Former Member
0 Likes
434

Hello Vinay,

I have done the same thing and was able to use the structured variables as parameters. Thank you so much for reply. Now that you have taken some time in writing a mail, I have awarded the points to you.

Thanks,

GS