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

perform help

Former Member
0 Likes
954

hi,

i new in this topic.

i have this code and i wont to send 5 tables to this code what is the best way to do that?

Regards

i have tables like it_p ,it_p1,it_p2,it_p3,it_p4.

CALL TRANSFORMATION id_indent

SOURCE itab = it_p[]

RESULT XML resstream.

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
934

If your internal tables are filled you can do something like this:

DO 5 TIMES. ENDDO. In between DO and ENDDO you can call your transformation.

Edited by: Micky Oestreich on Apr 15, 2008 10:03 AM

8 REPLIES 8
Read only

Sm1tje
Active Contributor
0 Likes
935

If your internal tables are filled you can do something like this:

DO 5 TIMES. ENDDO. In between DO and ENDDO you can call your transformation.

Edited by: Micky Oestreich on Apr 15, 2008 10:03 AM

Read only

Former Member
0 Likes
934

hi Micky

there is no way to do it in perform?

Regards

Read only

Sm1tje
Active Contributor
0 Likes
934

Sorry, for the mistake, I pressed the wrong button. I still wanted to add the following:

1. Fill your internal tables in a separate subroutine form fill_itab_p1, form fill_itab_p2, etc.

2, From this subroutine call another subroutine form call_transformation using it_p1.

3. The latter form will look like this: form CALL_TRANSFORMATION USING ITAB type TABLE

changing <your XML result>.

this way you can use any internal table, regardless of its structure.

This is one way to go, but there are of course others. This kinda depends on your coding so far.

Hope this helps, good luck.

Read only

Sm1tje
Active Contributor
0 Likes
934

Arona,

Rengid and Vinod are using the TABLES statement in the perform, while I'm using the USING parameter. This depends on how your have defined your internal table.

I assumed that you have defined it like this:

it_p1 type table of ....

or

it_p1 type table_type in which table_type is a type you defined yourself.

When using TABLES parameter that internal table is probably defined with OCCURS 0, and header line, although that is no longer the way to do this since ABAP OO was introduced.

Hope this makes sense.

Read only

0 Likes
934

Hi Micky,

It is not necessary to define the internal table with headerline when u r passing it in TABLES parameter. We can pass even if declare the itab like below.

TYPES: BEGIN OF...

END OF...

DATA: itab TYPE STANDARD/SORTED table of t_xxx.

But only the difference is if u define the itab with headerline then we have to pass the table with table body operator like itab[].

Thanks,

Vinod.

Read only

Sm1tje
Active Contributor
0 Likes
934

Hi Vinod,

you are correct, and that's more or less what I was trying to say. Thanks for elaborating.

Read only

Former Member
0 Likes
934

You have to ctreate a perform for it,

eg:

Perform transformation tables it_p[].

Perform transformation tables it_p1[].

Perform transformation tables it_p2[].

etc.

Form transformation tables p_it.

CALL TRANSFORMATION id_indent

SOURCE itab = p_it

RESULT XML resstream.

endform.

Read only

vinod_vemuru2
Active Contributor
0 Likes
934

Hi Ricardo,

Even though it is not the most optimized way still u can reduce the number of lines of code by this way.

PERFORM transform TABLES it_p.

PERFORM transform TABLES it_p1.

PERFORM transform TABLES it_p2.

PERFORM transform TABLES it_p3.

PERFORM transform TABLES it_p4.

FORM transform TABLES pi_tab.

CALL TRANSFORMATION id_indent

SOURCE itab = pi_tab[]

RESULT XML resstream.

Do further Processing of resstream here.

ENDFORM.

Only advantage is if u want to make any changes then u need to make it in one place by this way instead of 5 places.

Thanks,

Vinod.