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

Passing itab in a perform statement

Former Member
0 Likes
986

Hi Experts,

In a Fucn Module, I need to write a perform statement and the corresponding FORM lies in an include. I need to pass an internal table(itab) & workarea(wa_itab) in perform as below :

Declaration of itab:

types: BEGIN OF ty_out1,

f1(16) TYPE c,

f2 TYPE wrbtr,

END OF ty_out1.

data : itab type standard table of ty_out1,

wa_itab type ty_out1,

PERFORM <form name> tables itab

USING wa_itab

test1.

-


Dbl click on above perform takes us to an include prog and the form is declared as below -


what should be the syntax of the FORM in INCLUDE statement.

Note: I should not use the top include of the main prog for any declarations.

form search_slash tables ptab2 like itab

using wa2_itab like wa_itab

test2 .

Now what should be the syntax of the form above? Is the above right?

Please suggest

Thanks

Dan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
959

Hi,

Try declaring your int table with table types in se11. You need to use table types and then pass it in perform.

Award points if you find its useful.

bye

7 REPLIES 7
Read only

Former Member
0 Likes
959

Hi,

once you click on the perforn name system will prompt you for cration new form

if you select a new include then you have to initiliase the same in main program or in a include

otherwise select the main program and write the perform there only

Regards

Shiva

Read only

0 Likes
959

Hi,

As i am in a FM, Its not possible to write the form statement in the same main program.

Thanks

Read only

Former Member
0 Likes
959

Hi,

Whne u double click on the perform it will ask where u need to create it.

Choose that and automatically the FORM will get created.

No need to create a form explicitly.

Read only

Former Member
0 Likes
959

Hi,

If you want to pass only the internal table with header line,

then use tables ptab2 structure wa2_itab

For internal table with header line use:

tables ptab2 like wa2_itab

or

tables ptab2[ ] like wa2_itab.

Hope this helps.

Reward if helpful.

Regards,

Sipra

Read only

0 Likes
959

double click on the perform it will ask where u need to create it.

Choose that and automatically the FORM will get created.

so there is No need to create a form explicitly.

Read only

Former Member
0 Likes
960

Hi,

Try declaring your int table with table types in se11. You need to use table types and then pass it in perform.

Award points if you find its useful.

bye

Read only

0 Likes
959

Hi Harikumar Ganti,

Thats Perfect.

Thanks