07-18-2007 6:21 PM
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
07-18-2007 6:22 PM
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.
07-18-2007 6:22 PM
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.
07-18-2007 7:38 PM
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
07-18-2007 7:59 PM
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.
07-19-2007 3:27 PM