2008 Nov 04 10:15 AM
Hi,
I have gone through existing related posts but i couldnt get the
clear answer.
My question is i have seen few subroutines which are being called without perform statement.
How is it possible and if possible then in what are all the cases.
Please tell me.
Thanks,
Ahmed.
Hi,
I have gone through existing related posts but i couldnt get the
clear answer.
My question is i have seen few subroutines which are being called without perform statement.
How is it possible and if possible then in what are all the cases.
Please tell me.
Thanks,
Ahmed.
2008 Nov 04 10:17 AM
Nope, you can not call subroutine without PERFORM statement. Like you cannot call a function without CALL FUNCTION statement.
2008 Nov 04 10:19 AM
Hi Ahmed,
Basically PERFORM is a keyword used to declare a subroutine.
And FORM is a keyword used to define a subroutine.
So without declaration we can define right.
Cheers!!
VEnk@
2008 Nov 04 10:21 AM
Hi,
u must have seen those in programs.... like ALV, output control, include programs.....
there are subroutines which are not called from within that programs. but they are called from some other programs....so u dont see that Perform statement...
2008 Nov 04 10:22 AM
Ahmed,
If you have ever accessed NACE tcode...there you will find routines like Entry,Entry_Neu..etc.
In these cases, in the program you just need to have
Form Entry
Endform.
As you are assigning to nace....Perform will be taken care of. This is an example without Perform.
Regards,
Vishwa.
2008 Nov 04 10:26 AM
Hi Ahmed,
There could be chances of dynamic calls to the particular subroutine. For example we can pass event name and form name to function module 'REUSE_ALV_GRID_DISPLAY' or list display with table parameter it_events.
Regards,
Vikas.
2008 Nov 04 10:28 AM
Hi,
Its not possible to call a subroutine without a perform statment, but yes there are some places where you assign a subroutine name and the main program then calls these subroutines dynamically.
With ALV's for example you pass the callback subroutines for setting the pf-status , user_command etc. these are then called using the syntax perform (subroutin_name) in program (program_name) using changing...
Same is the case with the Scripts and EDI processing settings in NACE as mentioned above. they will be called dynamically.
regards,
Advait
2008 Nov 04 10:36 AM
Hi Advait,
I have found your answer interesting . Can you please send one example.
Thanks, Ahmed
2008 Nov 04 10:42 AM
In the below code we have given the subroutine name to the input to ALV FM, and that gets called dynimically.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
i_grid_title = text-005
i_callback_pf_status_set = 'F_SET_PF_STATUS_1'
i_callback_user_command = 'F_USER_COMMAND_1'
is_layout = e_layout2
it_fieldcat = t_fcat2
TABLES
t_outtab = t_docs2
EXCEPTIONS
program_error = 1
OTHERS = 2.
************
FORM f_user_command_1 USING us_ucomm LIKE sy-ucomm
us_selfield TYPE slis_selfield.
ENDFORM.
2008 Nov 04 11:04 AM
Hi ,
Swastik has given you an example for ALV.
So for ourput types, If you goto transaction NACE, Application V3 and take any output type and see the processing routines, you will see the prgoram name and the subroutine(Form)
example :
Output Type RD01 SingleInv.f.InvList
Application V3 Billing
Program FORM routine Form Sm
RVADIN01 ENTRY RVINVOICE01
RVADIN01 ENTRY RVINVOICE01
EDI RSNASTED EDI_PROCESSING
So if you goto program RSNASTED, you will only see the subroutine edi_processing and not the perform statement. This is because the subroutine is called from another program RGJVEDIO dynamically.
PERFORM EDI_PROCESSING(RSNASTED) USING HELP_RETURNC
US_SCREEN.
regards,
Advait
2008 Nov 04 11:16 AM
Hi,
All the ways mention in this thred so far actually USES the key word PERFORM some where in the SAP STANDARD programs to call the subroutine.
I feel you are talking about MACROS and not subroutine becuase for calling them we only type the MACRO name and the variables to be passes.
Macros are defined using DEFINE .. ENDDEFINE. statements.
Regards,
Prakash Pandey
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |