"In ABAP it is very convenient to run a report using a Variant. Basically a report can have several Variants linked to it. If you use a variant then the data entry time is reduced considerably and this also reduces data entry errors. The load on the ABAP processing is also reduced. To create a Variant you may need the necessary authorizations. Most of the times while testing programs you will need to run a report using a variant and hence having the authorization to create a Variant is necessary. To create a Variant go to the main reporting screen, enter the name of the report for which you want to create the variant and select goto Variants option from the menu. The system displays the initial screen for the Variants. For creating a Variant you need to enter all the mandatory fields. Also you need to give a unique name for the Variant. Follow the naming convention rules. You may have to create several Variants for a particular report. Once a Variant is created you ca also schedule to run the report in the background using this Variant. For each variant that you create you need to give a brief description which will help to explain the purpose of the variant and help to distinguish the various Variants that you have created. You may want to protect your Variant by selecting the Protect Variant option. This option enables only the person who has created the Variant to change or delete it. While Running a report directly from the menu you can use the Run with Variant option and then select the desired variant from the dropdown list. Remember that Variants are report dependant. So to create a Variant you need to first create an ABAP report (Executable Program with selection screen). Once you successfully create all the variants for an ABAP report, you will save considerable amount of time which would otherwise have been spent in entering the same data again and again."
"A subset of Standard SQL that is fully integrated in ABAP is Open SQL statements. Their role is to help you by giving permission to access data irrespective of the database system, which the R/3 installation is using. The Data Manipulation Language (DML) part of the Standard SQL is present in the Open SQL. In other words, it gives you the permission to read (SELECT) and change (INSERT, UPDATE, DELETE) data. In the R/3 system, the tasks of the Data Definition Language (DDL) and Data Control Language (DCL) parts of the Standard SQL are performed by the ABAP dictionary and the authorization system."
To get a list of all the BAPIs in the system the following BAPI can be used.
BAPI_MONITOR_GETLIST ____________________________
The following Parameters should be passed to the above mentioned BAPI
Object type Release /Reference Release to Display Display Potential BAPIs Display New BAPIs in Release Display BAPIs from Previous Releases Release Status of BAPIs Release Status of Function Modules
The BAPI returns a table with the following information.
Object type, Object name, Method name of BAPI, Function module name, Application component ID, Release at creation, Author, Last changed on, Last changed by, R/3 System, name of R/3 System, Application area or BAPI Work Group reponsible, Interface object type, Release status of BAPI methods, Release status of function module, Release in which object type was set as obsolete, Documentation on function module exists, Documentation for business object exists, Message type, Object type component, Description.
Example:
REPORT ZEX_BAPI_GETLIST .
* Parameters-----------------------------------------------------------* Parameter: p_ojtpe like BAPIMONIT-OBJTYPE default '*', p_rel like BAPIMONIT-CREA_REL default SY-SAPRL, p_poten like BAPIMONIT-OPTSEL default ' ', p_newbp like BAPIMONIT-OPTSEL default 'X', p_oldbp like BAPIMONIT-OPTSEL default 'X', p_relbp like BAPIMONIT-OPTSEL default '*', p_relfun like BAPIMONIT-FUNCREL default '*'.
* Data Declaration-----------------------------------------------------* Data: d_ret like BAPIRET2.
* Internal Table Declaration-------------------------------------------* Data: int_comsel like BAPIMONCOM occurs 0 with header line, int_orgBP like BAPISRCSYS occurs 0 with header line, int_selbap like BAPIMONSTR occurs 0 with header line.
Always specify your conditions in the Where-clause instead of checking
them yourself with check statements. The database system can then use an index
(if possible) and the network load is considerably less.
Always use Pretty Printer and Extended Program Check before releasing the code.
Do not leave unused code in the program. Comment the code thoroughly. Align the comments and the Code. Follow the SAP Standards and SAP Best Practices guidelines. It’s a good practice to take a dump of the code on your local drive.