04-26-2007 8:19 AM
Hi Friends,
Can any one tell me the differences between
Report Using BAPI Function module and
Report using normal select statements
which one u prefer ?
Thanks and Regards
Vijaya
04-26-2007 9:03 AM
well it depends what you are doing and what is the scope of what you are doing. Don't just create a function module for the sake of it . in any case if you have to extract data from database, you will need to write some select statements, either in the report or the function modules. If you think you need these select statements repeatedly in your project or they are a candidate for a scenario which might be reusable at other places, then go ahead creating a function module. If it is a one time affair, try writing selects in the program itself. you can still modularize it using subroutines.
there is enough memory overhead attached to a function module call as the entire function group needs to be loaded in the memory. so make your choice depending on the scope of your work.
regards,
Priyank
04-26-2007 8:26 AM
BPAI is prefareble because it is SAP standard. So less chance of erroe.
04-26-2007 8:32 AM
04-26-2007 8:36 AM
FM or BAPI are reuseable code and like black box where the actual functionality is already implemented and tested. So we dont have to concentrate the underlying logic. Like, blackbox we can just pass the required logic and get the result.
But in report, if u wanna implement that functionality of your own by select query of some other commands, you have to spend some effort for that. So when there is a standard code available to you for a functionality, why should you waste time do invent the logic again. You can use the FM or BAPI to get ur job done. Isn't it??
04-26-2007 8:56 AM
04-26-2007 9:03 AM
well it depends what you are doing and what is the scope of what you are doing. Don't just create a function module for the sake of it . in any case if you have to extract data from database, you will need to write some select statements, either in the report or the function modules. If you think you need these select statements repeatedly in your project or they are a candidate for a scenario which might be reusable at other places, then go ahead creating a function module. If it is a one time affair, try writing selects in the program itself. you can still modularize it using subroutines.
there is enough memory overhead attached to a function module call as the entire function group needs to be loaded in the memory. so make your choice depending on the scope of your work.
regards,
Priyank