Application Development 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: 

Help with perform statement

Former Member
0 Kudos

Hi all,

I have this perform statement

data: gt_outtab type table of mara,

gt_fieldcat type lvc_t_fcat.

perform create_and_init_alv changing gt_outtab

gt_fieldcat.

when i double click on this perform ian getting a form like this

FORM create_and_init_alv CHANGING P_GT_OUTTAB

P_GT_FIELDCAT.

ENDFORM. " create_and_init_alv

when i look at the sap standard program for the same perform statement

it has something like this

perform create_and_init_alv changing gt_outtab

gt_fieldcat.

form create_and_init_alv changing pt_outtab like gt_outtab[]

pt_fieldcat type lvc_t_fcat.

ENDFORM.

my questions are

1)can anyone tell me why there is a difference

2) do we need to writ things again in form like gt_outtab[] and type lvc_t_fcat as you see in sap standard code.

what is the purpose of it.

Thanks

Kajol

1 ACCEPTED SOLUTION

amit_khare
Active Contributor
0 Kudos

Its not necessaru to have those values if the data declarations are global.But this will give error in Extended Check (SLIN).

We need to mention these things manually.Its a good practice.

Regards,

Amit

Reward all helpful replies.

4 REPLIES 4

amit_khare
Active Contributor
0 Kudos

Its not necessaru to have those values if the data declarations are global.But this will give error in Extended Check (SLIN).

We need to mention these things manually.Its a good practice.

Regards,

Amit

Reward all helpful replies.

0 Kudos

Hi,

Thats the only reason. When you say Global Declarations , i have declared at the top of tthe program and thats it means its global for entire program

Thanks

marcelo_ramos
Active Contributor
0 Kudos

Hi,

When you create a form by double click the system generate the declaration source of the form like this -> perform create_and_init_alv changing <b>gt_outtab</b>

<b>gt_fieldcat</b>.

I recommend you to insert the statments like <reference>, beyond the reason previously informed exists the other problem, the performance. If you don't inform the reference, the time of program's processing are bigger.

Regards.

Marcelo Ramos.

0 Kudos

Thanks all.

I have assigned points to all