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 Qustion

Former Member
0 Likes
548

HI,

i doing fm and i use performs tables itab ....

inside the perform i put :

tables p_itab structure itab

but some time its works and some time don't,

i have to declare it : tables p_itab like itab (then it works)

what it can be .

i declare it all the time the same (in top)

types :begin of 1_tab,

pernr type pernr_d,

end of 1_tab.

data: itab type table of 1_tab.

Regards

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
528

I would say to always use a Table Type declaration when typing a TABLES parameter in the FORM statement. In this case...



types :begin of 1_tab,
       pernr type pernr_d,
       end of 1_tab,
       
       tt_1tab type table of 1_tab.

form some_form  tables p_itab type tt_1tab.

endform.

Regards,

Rich Heilman

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
529

I would say to always use a Table Type declaration when typing a TABLES parameter in the FORM statement. In this case...



types :begin of 1_tab,
       pernr type pernr_d,
       end of 1_tab,
       
       tt_1tab type table of 1_tab.

form some_form  tables p_itab type tt_1tab.

endform.

Regards,

Rich Heilman

Read only

0 Likes
528

Hi Rich ,

Thanks .

why u don't recommended to use data :itab type tables of 1_tab.

and when i do double click on new perform i get like p_itab structure itab u tell its better to use it with type?

Regards

Read only

0 Likes
528

SAP recommends to always use table types in any intefaces, methods, function modules, and forms.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
528

Hello ricardo arona ,

always use TYPES statement for defining the internal table or use like

DATA : <ITAB> TYPE TABLE of <STRUCTURE>.

Thanks,

Greetson