SAP AND ABAP TIPS AND FACTS

Monday, March 31, 2008

Best Practices for SAP ABAP INTERNAL TABLES

Best Practices for SAP ABAP INTERNAL TABLES.

Sorted Tables, Hashed Tables and Key access to internal tables were introduced after release 4.0. Prior to this internal tables were declared as follows.

All internal tables had a header line. The syntax was as follows.

Data: BEGIN of <itab> occurs <n>,

END of <itab>

The number <n> in the occurs had the same meaning as the initial size as in release 4.0 onwards.

Collect

To fill a standard internal table without creating duplicate entries and add up the Packed, Integer, and Floating Point fields at the same time, use:

COLLECT I_SUM.

COLLECT uses a hash algorithm and is independent of the number of entries in the table (it does not need to maintain a table index). Therefore COLLECT is faster than READ BINARY combined with INSERT. If you need the final data sorted, the table should be sorted after all data has been collected.


Caution: When you fill an internal table, do not use COLLECT in combination with any other table filling statements (APPEND, INSERT, MODIFY, SELECT * INTO TABLE, SELECT * APPENDING TABLE). If you mix COLLECT with other statements, COLLECT cannot use it's hash algorithm and resorts to a normal linear search which is considerably slower.

Copying an internal table
Internal tables can be copied by MOVE like any other data object. If an internal table (itab) has a header line, the table can be accessed by itab[].

ITAB2[] = ITAB1[].

Processing tables only once. Your program should be structured so that your internal tables are processed only once, if possible. Seek to combine operations on an internal table so that they can all be processed in the one loop. The only situation where this may not be possible is where subsequent processing depends on the whole table having been processed previously (if the operations are linearly dependent they can still be done within the same loop).

READ instead of LOOP. If you only wish to retrieve a certain record from a table it is much more efficient (especially if the table is sorted) to use a READ WITH KEY or a READ INDEX on the table than looping until the record is found.

Sorted and Hashed tables: Following on from above, if you wish to reference a table several times within a program it is good practice to keep it sorted or to use a hashed table. Reads from normal unsorted internal tables have an order N time dependency (where N is the number of records), whereas sorted tables read with the command BINARY-SEARCH have a logarithmic time dependency (Log N), and hashed tables have a constant time dependency regardless of the number of records.
 
LOOP AT … WHERE. If you only wish to process certain entries of your internal table, use the LOOP AT.. WHERE command instead of a loop and then an IF or a CHECK statement.

In loops, only perform operations as necessary. If you are to perform an action on a field, remember to only perform the action when the value of the field changes and store the result. This means performing the operation within the ON CHANGE OF and AT NEW or AT END statements. WARNING Be aware that when using the AT statements, the order of the fields in your table or field-group is extremely important, if a field ‘higher up’ (further to the left) changes it will also trigger the AT statement on any field ‘lower down’ (further to the right).


APPEND LINES OF. When combining tables of the same structure, instead of looping through one table and appending the records to the other table, use this command that transfers the whole table in one operation. This is particularly useful if you require the retrieval of the same data from two different database tables, in which case you can use two SELECT INTO and then an APPEND LINES OF to combine your data.
Syntax: APPEND LINES OF itab1 [FROM idx1] [TO idx2] TO itab2.

READ TABLE … TRANSPORTING NO FIELDS. This statement is the fastest way to find a particular record within an internal table (when combined with the most efficient searching technique for that table, such as a hashed table or a read using a binary search). This command is used to set the sy-tabix field and the sy-subrc field to indicate position of the record and if found successfully, these fields can then be used to insert new records or to continue processing knowing the record exists.

See Also:

SAP ABAP INTERNAL TABLE BASICS
INTERNAL TABLES IN SAP ABAP

Related Interview Questions
TRUE or FALSE

1) COLLECT can be used to add up the Packed, Integer, and Floating Point fields at the same time.                     TRUE
2) COLLECT is faster than READ BINARY combined with INSERT                                                                                 TRUE
3) Mixing collect with other statements
     (APPEND, INSERT, MODIFY, SELECT * INTO TABLE, SELECT * APPENDING TABLE)  is a good practice        FALSE
4) COLLECT uses a hash algorithm                                                                                                                                 TRUE
5) ITAB2[] = ITAB1[]. will copy ITAB2[] into ITAB1[]                                                                                                            FALSE


Friday, March 28, 2008

SAP ABAP Internal Table Basics

SAP ABAP Internal Table Basics

The TYPES statement can be used to create a new local internal table in your program. The syntax is as follows.

TYPES <t> TYPE|LIKE <tabkind> OF <linetype> [WITH <key>]
          [INITIAL SIZE <n>].

TYPE or LIKE can be used, the type constructor defines the table type <TABKIND>, the <linetype> and the <key> of the table. With the INITIAL SIZE the size of the table can be defined.


Table types can be as follows.

ANY TABLE                          
INDEXED TABLE                 
HASHED TABLE                    
STANDARD TABLE             
SORTED TABLE                  

The minimum size of an internal table is 256 bytes.

ANY TABLE
Has GENERIC TYPES

INDEXED TABLE
Has GENERIC TYPES, INDEX ACCESS

HASHED TABLE
FULLY SPECIFIED TYPES, NO INDEX ACCESS, KEY ACCESS. Basically a HASHED TABLE does not have a linear Index and can be accessed by using its key. The response time is constant and does not depend on the number of records. While defining a HASHED TABLE the key that has been defined should be UNIQUE. This table is searched using a HASHED algorithm.

STANDARD TABLE (INDEXED TABLE)
FULLY SPECIFIED TYPES, INDEX ACCESS, KEY ACCESS. These tables have a linear INDEX. These tables can be accessed using the INDEX or the KEY. The response time here does depend on the number of records in the table. While defining the INDEX TABLE the KEY has always to be NON UNIQUE.  UNIQUE key is not allowed.

SORTED TABLE (INDEXED TABLE)        
FULLY SPECIFIED TYPES. INDEX ACCESS, KEY ACCESS. They have an internal INDEX and are always SORTED by the KEY while saving. While doing a KEY access the response time does depend on the number of records in the internal Table. Here the system uses a binary search. In sorted tables the KEY can be UNIQUE as well as NON UNIQUE

Examples of Defining Tables.

TYPES: BEGIN OF SalesOrd,
VBELN LIKE VBAK-VBELN,
KUNNR LIKE KNA1-KUNNR,
MATNR LIKE MARA-MATNR,
END OF SalesOrd.

STANDARD TABLE
TYPES ITAB_SalesORD TYPE STANDARD TABLE OF SalesOrd WITH DEFAULT KEY.

SORTED TABLE
TYPES ITAB_SORD_St TYPE SORTED TABLE OF SalesOrd WITH UNIQUE KEY VBELN.

HASHED TABLE
TYPES ITAB_SalesOrd TYPE HASHED TABLE OF SalesOrd WITH UNIQUE KEY VBELN.

Appending lines to an Internal Table.

Appending a Single Line

To add a line to an index table, use the statement:

APPEND <line> TO <itab>.

Sorting Internal Tables.

Internal Tables are sorted as follows.

SORT <itab> [ASCENDING|DESCENDING] [AS TEXT] [STABLE].

Attributes of an Internal Table.

You can use the following statement to find the attributes of an Internal Table at Runtime.

DESCRIBE TABLE <itab> [LINES <l>] [OCCURS <n>] [KIND <k>].


LINES parameter will fill the number of lines into the variable <lin>.
OCCURS will return the initial size of the table to the variable <n>.
KIND parameter, will return the table type to the variable  <k>: ‘T’ for standard table, ‘S’ for sorted table, and ‘H’ for hashed table.

Internal Tables Related Interview Questions

True or False

1) Hashed Tables can have UNIQUE key                                                                                                TRUE
2) SORTED Tables can have only NON UNIQUE KEY                                                                            FALSE
3) STANDARD Tables can have UNIQUE as well as NON UNIQUE KEY                                             FALSE
4) HASHED Tables Do not have an INDEX ACCESS                                                                              TRUE
5) The Access time in a Hashed Table depends on the Number of records in the table               FALSE


Thursday, March 27, 2008

Internal Tables in SAP ABAP

Internal Tables in SAP ABAP

Internal tables are an important part of any ABAP development. Internal tables are used every where. We will see how to Initialize an internal table. 

Basically we will see what the following statements do to an internal table.

CLEAR
REFRESH
FREE

Consider an Internal table with name ITAB. If you want to clear the header line of the Internal Table ITAB use the statement given below

CLEAR ITAB.

Many a times you want to just clear the header line of the internal table but want to keep the contents as they are. CLEAR ITAB will just clear the header line of the internal table.

CLEAR ITAB[]

The above statement will clear the contents of the internal table but the header line contents will not be cleared.

REFRESH ITAB

The above statement will also clear the contents of the internal table completely. If the table has a header line the contents of the header line will still remain. This is used when the internal table is without the header line.

FREE ITAB

Will deallocate the memory for the internal table. For better performance of ABAP programs you should free the memory if the internal table is not going to be used again in the program.

DELETE

You can use DELETE statement to delete a particular record from the internal table.

 
Examples

CLEAR ITAB.

 If the ITAB has 4 fileds and 4 Records as follows

 

VBELN            KUNNR             MATNR             WERKS

00010              7777                 A123                  1000

00020              7777                 B122                  1000

00030              7777                 C506                  1000

00040              7777                 D777                  1000

 

and the header line contents are as follows

 

Header Line           <00010 7777  A123  1000>

 

Note: CLEAR ITAB will clear only the contents of the header line. and the ITAB values will remain as shown below.

ITAB

 

VBELN           KUNNR           MATNR           WERKS

00010             7777               A123                1000

00020             7777               B122                1000

00030             7777               C506                1000

00040             7777               D777                1000

Header Line <                             >

 

CLEAR ITAB[]

Will clear the header line as well as the contents of ITAB

VBELN KUNNR MATNR WERKS

<>

Header Line

Header Line           <00010 7777  A123  1000>

REFRESH

Will clear the header line as well as the contents of ITAB

VBELN KUNNR MATNR WERKS

Header Line           <00010 7777  A123  1000>

Header Line

<>

FREE ITAB 

Will clear the contents of the ITAB as shown above for REFRESH and CLEAR in addidtion to that it also frees the memory allocation from SAP memory.

Header Line           <00010 7777  A123  1000>

DELETE

If you just want to delete a particular row then you need to use the DELETE statement.

Example

DELETE ITAB INDEX IDX.

SY-SUBRC = 0 The entry was deleted.

SY_SUBRC = 4 The entry does not exist.

Consider a case when your internal table has duplicate entries, in this situation you can SORT the internal table and delete the duplicate entries as follows

SORT ITAB

DELETE ADJACENT DUPLICATES FROM ITAB.

 COMPARING field1 field2

 COMPARING ALL FIELDS


Related Interview Questions

1) IF ITAB is an internal table with a header line declared in ABAP what is the difference between the following

CLEAR ITAB
CLEAR ITAB[]
REFRESH ITAB
FREE ITAB

Ans. CLEAR ITAB will clear the contents of the header line only.
        CLEAR ITAB[] will clear the contents of the table but the header line contents will remain as they are.
        REFRESH ITAB will clear the contents of the table but the header line contents will remain as they are.FREE ITAB will clear the
        contents  of the ITAB keeping the header line contents intact. This will also dealocate the internal table from the SAP memory.

2 How ill you delete adjacent duplicates from an internal table ITAB

Ans. First you need to SORT the internal table as shown below
        SORT ITAB.
Then you need to delete the duplicates as shown below
        DELETE ADJACENT DUPLICATES FROM ITAB

Also

DELETE ADJACENT DUPLICATES FROM ITAB COMPARING field1 field2

DELETE ADJACENT DUPLICATES FROM ITAB COMPARING ALL FIELDS


       

  

Wednesday, March 26, 2008

Conversion Routines in SAP

Conversion Routines in SAP

CONVERSION ROUTINES are also called as CONVERSION EXITS.

In some cases SAP displays values differently then they the way they are stored.

For example while creating a Sales order the input value for the filed Order Type VBAK-AUART is actually 'OR' that is on the screen. Similarly for Partner functions like Sold-to Party the value is (SP) and for Ship-to Party it is (SH). These are basically the screen values. These values are stored differently internally.

This can be easily seen while creating a sales order using a BAPI.

If you use the BAPI ‘BAPI_SALESORDER_CREATEFROMDAT1’ and try to pass ‘OR’ for the field VBAK-AUART ie order type or pass SP and SH to Sold-to Party and Ship-to party respectively then you will get an error message. Please note that this happens only when you are trying to pass the values for your code. If you test the BAPI using a transaction SE37 then an automatic conversion takes place and you can pass the screen values. This is basically the CONVERSION ROUTINE. We will now see the way of finding the conversion routines in SAP. Also in some scenarios for custom development you may have to write your own conversion routines.

Conversion routines are identified by a five-place name and are stored as a group of two function modules. The function modules have a fixed naming convention. The following function modules are assigned to conversion routine xxxxx:

  • CONVERSION_EXIT_xxxxx_INPUT
  • CONVERSION_EXIT_xxxxx_OUTPUT

The conversion routine is usually associated with a Domain for that field. So when you enter values on the screen, and save the values the conversion exit is triggered. Similarly, while displaying the values on the screen another conversion routine gets triggered. The conversion routine associated with the domain also triggers when outputting the data on the screen with the WRITE statement.

A conversion routine can also be triggered by specifying its five-place name in the attributes of a field in the Screen Painter or with the addition USING EDIT MASK <Name of conversion routine> in the WRITE command in the program. With the USING NO EDIT MASK addition in the WRITE statement, you can skip a conversion routine defined for a domain when outputting.

As mentioned earlier for every field that needs conversion there will be 2 conversion routines. For example for the Partner Function filed KNVP-PARVW there are 2 conversion routines associated with it namely

CONVERSION_EXIT_PARVW_INPUT
CONVERSION_EXIT_PARVW_OUTPUT

One of the ways to find a conversion routine is as follows.

Run transaction SE11 give the table name eg. KNVP.



Once the table fields are displayed double click on the filed for which you need to find the conversion exit eg. KNVP-PARVW.


Once the data element is displayed double click on the data-element to display the domain.

You will find the Conversion Exit under output characteristics double click on the conversion exit to display the function modules.


The conversion exit function modules have 2 Parameters one for INPUT and the other for OUTPUT. The INPUT parameter in the INPUT conversion and the OUTPUT parameter in the OUTPUT conversion should not have any reference fields because the value passed in the call could have a different length than that expected.

ABAP statements that result in an interruption of processing (such as CALL SCREEN, CALL DIALOG, CALL TRANSACTION, SUBMIT, COMMIT WORK, ROLLBACK WORK, MESSAGE I, MESSAGE W) are not allowed in conversion routines.

Tuesday, March 25, 2008

SAP SPA/GPA Parameters

SAP SPA/GPA Parameters

The SPA SET PARAMETERS and GPA GET parameters is a useful way in passing values to SAP memory. Using these Parameters you can pass values to SAP programs and even get values generated from SAP Programs.

SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. It is important to note that the values are stored in GLOBAL and User-Specific Memory.

A Parameter ID can be 20 Characters long.

You can pass values to the SAP memory using SET PARAMETER ID <pid> field <f> and get the values from the SAP Memory using GET PARAMETER ID <pid> field<f>.

On a selection screen, you link fields to parameters using the MEMORY ID addition in the PARAMETERS or SELECT-OPTIONS statement. If you specify an SPA/GPA parameter ID when you declare a parameter or selection option, the corresponding input field is linked to that input field.

Now we will see an example as to how SET PARAMETER and GET PARAMETER can be used in a real life Scenario.

Suppose you want to call a Transaction and Skip the Initial Screen. For example in transaction VA01 if the parameters on the initial screen are fixed and you want to preset to the user screen no 2. then it can be done as follows.

data: d_order_type_field like vbak-auart value 'OR'.

    SET PARAMETER ID 'AAT' FIELD d_order_type_field.
    CALL TRANSACTION 'VA01' AND SKIP FIRST SCREEN.


Please not that the PARAMETER ID AAT can be obtained by pressing F1 on the filed. See the figure shown below.



You can also get the latest Order number from SAP using GET PARAMETER ID as follows.

data: d_order_no like vbak-vbeln.

        Code for BDC.
        GET PARAMETER ID 
'AUN' FIELD d_order_no.

Form more details check the following

Creating a Sales Order using RFC.

SAP ABAP Authorizations / SAP Authorizations

SAP ABAP Authorizations / SAP Authorizations

While writing code in ABAP for example reports/interfaces/enhancements developers should take care that the Authorizations are taken care of. In ABAP code the SQL statements (Database Access) does not trigger Authorizations. This makes the code vulnerable. A program that has been transported to production without proper authorizations gives access to all the data that the SQL and Native SQL statements are querying to any user who is executing that program.

Hence it becomes mandatory for the developer to take care of Authorizations in the code.

SAP Authorization Concept

In SAP Authorization are user specific and in the user master record the authorization is assigned. Data in SAP must be protected so that only those users who have permission should be able to access the data. For example certain users may have access to Sales Side data amongst these users certain users may have permission only to view the data and other to change it. Also certain users may have permissions only to view MM side data.

Authorization Objects are used to take care of the Authorizations in SAP. Each Authorization Object can have 10 fields.

As a developer if required you can create your own Authorization Object. For example if you create an Authorization Object Z_Sales then it can have 2 authorization fields and the activity field can have  3 actions associated with it like create (01), change (02) and display (03).

Important tables associated with Authorization are as follows

Some of the tables associated with SAP Authorizations.

TACT        Activities which can be Protected
TACTZ      Valid activities for each authorization object
TSTCA      Values for transaction code authorizations

For example customers can be divided into certain regions say NORTH, SOUTH, EAST, WEST.

and the Authorization object S_Sales has a filed REGIONID to define the region, then you can create an authorization object as follows.

Aythorization Object                        Authorization Display for S_SALES
S_SALES                                           REGIONID '*'  (For All Regions)
REGIONID (Region)                         ACTVT 'DISPLAY'
ACTVT (Activity)                          

S_SALES                                           REGIONID 'NORTH'  (Only North Region)
REGIONID (Region)                         ACTVT 'CHANGE'
ACTVT (Activity)                          


This object shows how to restrict certain users from changing customer data not related to regions in SOUTH, EAST and WEST.

Transactions associated with Authorization Objects are as follows

SU20  Fields
SU21 Objects


Monday, March 24, 2008

SAP Hold Data Set Data Own Data and System Status

SAP Hold Data Set Data Own Data and System Status


SAP SYSTEM INFORMATION

If you are on a particular screen and wish to check the current transaction in SAP then you can follow the menu path given below.
System----->Status.
Please refer the diagram shown below.



Once you click on Status you will see the screen shown below.



In the above screen you can see the complete SAP system information.

SAP OWN DATA

In the SAP System if you want to set defaults or want to give your own preferences then you can follow the menu path given below.

SYSTEM -------- USER PROFILE -------- OWN DATA.

Please refer the screen shown below.






For example you can change the way system date is displayed. (mm.dd.yyyy) or (dd.mm.yyyy)



Hold Data and Set Data

Suppose you want to create multiple Sale Orders or Purchase Orders with similar data. Then you need not type in all the fields again and again. This can be done by using the Hold Data and Set Data functionality.

To check this functionality pleas run transaction VA01 ----  SAP Sales Order Create. Type in the required fields like

Ship-to Party
Sold-to Party
Purchase Order Number
Material No
Quantity

and then click on HOLD Data (Menu Path >>>>>>>>> System ---------- User Profile ------- Hold Data)

Please refer the figure below.






The fields that contain data will be held even after saving the sales Order and will remain when the next VA01 screen appears. Now you can make changes in the data and Save the Order.

Similarly you can use Set Data. By using Set Data the values remain on the screen but are not available for editing. Set Data can be used if you are sure that you would be creating multiple objects in same with exactly the same data values.


Sunday, March 23, 2008

SAP OLE

SAP OLE

ABAP supports the OLE2 automation technique, applications like Excel and Winword can be integrated with SAP using OLE2 automation Server.

Pre-requisite:

Applications controlled by ABAP must be registered in R/3.

Please see the diagram given below.




For more details see the links given below.

SAP OLE AUTOMATION PART 1
SAP OLE AUTOMATION PART 2
SAP OLE AUTOMATION PART 3

Saturday, March 22, 2008

System Tables in SAP

System Tables in SAP


SAP RFC

SAP RFC

RFC (Remote Function Call), these are function modules in SAP but are remotely enabled. This makes them similar to SAP BAPIs. Thus a Remote function module can be called from another Non-SAP System using a .Net connector or a Java connector. RFCs can be used to interface SAP and Non SAP systems or 2 different SAP R/3 systems.

SAP ABAP RFCs are of 3 types

Synchronous RFC
Transactional RFCs
Queued RFCs.

Synchronous RFC
In Synchronous RFCs both the Systems must be available at the time of the call. These RFCs are based on Synchronous communication.

Transactional RFCs
Here the called system need not be available at the time of the call. A unique transaction ID is generated and the called program is stored in the system along with the data. If the receiving system is not available for a long time then the call is scheduled to run in a batch.

Queued RFCs.

To guarantee that multiple LUWs are processed in the order specified by the application, tRFC can be serialized using queues (inbound and outbound queues). This type of RFC is called queued RFC (qRFC).
qRFC is therefore an extension of tRFC. It transfers an LUW (transaction) only if it has no predecessors (in reference to the sequence defined in different application programs) in the participating queues.

For more details and related topics please see the following links

Creating SAP RFCs
SAP Function Modules
SAP BAPIs
SAP BAPIs in Real life

SAP BAPI

SAP BAPI

BAPI (Business Application Programmer Interfaces), are the interfaces provided by SAP. BAPIs can be used for the following.

1) Integrating SAP to Non SAP systems using .NET Connector and Java Connector for example Visual Basic (Microsoft),  or with Visual Age for Java (IBM)
2) Creating a Web Based interface to SAP
3) Uploading Data to SAP
4) Posting Data to SAP from within SAP
5) Creating an interface between various SAP Systems

Related Transaction Codes

BAPI
SE37

Please refer the diagram below.



SAP ABAP BAPIs

The Business Application Programming Interfaces allow object-oriented access to the SAP system through methods for the business object types. Together with the business object types, BAPIs define and document the interface standard at the business level.

Benefits of using BAPIs

BAPIs allow integration at the Business Level, as each BAPI is built around a Business Object

BAPIs are well defined and are internally consistent

For a BAPI access is through a object-oriented interface and connectors such as .Net and Java Connector are available for building an interface with Non SAP Systems

Stability is not affected because they are upward compatible and all the BAPI interfaces will survive an R/3 Upgrade.

For More Details See the links Below.

BAPIs in Real Life
RFCs
Function Modules

Friday, March 21, 2008

SAP ABAP Tutorial on Subroutines. PERFORM FORM ENDFORM

SAP ABAP Tutorial on Subroutines. PERFORM FORM ENDFORM

A subroutine is a block of code introduced by FORM and concluded by ENDFORM.







FORM <subroutine
name> [USING ... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]...
]

[CHANGING... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]...
].


<Subroutine
code>


ENDFORM.




In ABAP a subroutine is defined as shown above. All the subroutines start with FORM followed by the subroutine name.

For example.







FORM write_hello.

    Write:/ 'Hello'.

ENDFORM.




A subroutine is called by a PERFORM statement as follows.

PERFORM write_hello.

In the above example no parameters pased to the subroutine. We will now see one more example of a simple subroutine that passes parameters. Now if you want to add two numbers. we need to write the following code.

Data: d_sum type i,
d_num1 type i,
d_num2 type i.


d_num1 = 5.
d_num2 = 10.

perform addnumbers using d_num1
d_num2 .


write:/ d_sum, d_num1, d_num2.

*---------------------------------------------------------------------*
* FORM addnumbers *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> NUM1 *
* --> NUM2 *
*---------------------------------------------------------------------*
form addnumbers using num1 num2.
d_sum = num1 + num2.
endform.

For the above code the output would be 15, 5, 10 because the values of the parameters would be as follows.

d_sum = 15,
d_num1 = 5,
d_num2 = 10.

This is because we are passing the parameters by REFERENCE and not by VALUE.

Important: For calling by reference, USING and CHANGING are equivalent.

This means that the value of the actual parameters changes if the value of the formal parameters changes. We will write some code
to demonstrate this point.

Data: d_sum  type i,
      d_num1 type i,
      d_num2 type i.


d_num1 = 5.
d_num2 = 10.


perform pass_ref using d_num1
                       d_num2.

write:/ d_sum, d_num1, d_num2.

*&---------------------------------------------------------------------*
*&      Form  pass_ref
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_D_NUM1  text
*      -->P_D_NUM2  text
*----------------------------------------------------------------------*
FORM pass_ref USING    P_D_NUM1
                       P_D_NUM2.

   P_D_NUM1 = 100.
   P_D_NUM2 = 200.

ENDFORM.                    " pass_ref


The output of the above program would be 15, 100, 200. This is because the value of actual parameters is changed because the value of the formal parameters also changes.

We will now see how to pass parameters by value. To pass parameters by value we need to explicitly state it in the subroutine. When parameters are passed by VALUE the value of the actual parameters does not change, even if the value of the formal parameters changes.

Sample code.

*&---------------------------------------------------------------------*
*&      Form  pass_val
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*     
*      -->P_D_NUM1  text
*     
*      -->P_D_NUM2  text
*----------------------------------------------------------------------*
FORM pass_val USING  VALUE(P_D_NUM1)
                     VALUE(P_D_NUM2).

 P_D_NUM1 = 1000.
 P_D_NUM2 = 2000.

ENDFORM.                    " pass_val

Please find the code below that demonstrates this concept.

Data: d_sum  type i,
      d_num1 type i,
      d_num2 type i.


d_num1 = 5.
d_num2 = 10.


perform pass_val using d_num1
                                     d_num2.

write:/ d_sum, d_num1, d_num2.

*&---------------------------------------------------------------------*
*&      Form  pass_val
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*     
*      -->P_D_NUM1  text
*     
*      -->P_D_NUM2  text
*----------------------------------------------------------------------*
FORM pass_val USING  VALUE(P_D_NUM1)
                     VALUE(P_D_NUM2).

 P_D_NUM1 = 1000.
 P_D_NUM2 = 2000.

ENDFORM.                    " pass_val

The output of the above program is 15, 5, 10.

We will now see the effect of CHANGING when the PARAMETERS are passed by VALUE. If CHANGING is specified in PARAMETERS that are passed by value then the value of the ACTUAL Parameters also changes. Please see the sample code below.


Data: d_sum  type i,
      d_num1 type i,
      d_num2 type i.


d_num1 = 5.
d_num2 = 10.

perform pass_val_chcg  using d_num1
                                               d_num2.

write:/ d_sum, d_num1, d_num2.

*&---------------------------------------------------------------------*
*&      Form  pass_val_chcg
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_D_NUM1  text
*      -->P_D_NUM2  text
*----------------------------------------------------------------------*
FORM pass_val_chcg USING      VALUE(P_D_NUM1)
                            CHANGING   VALUE(P_D_NUM2).

 P_D_NUM1 = 1001.
 P_D_NUM2 = 2002.

ENDFORM.                    " pass_val_chcg

The output of the above program would be as follows.

15, 5, 2,002

This is because we have specified CHANGING only for the PARAMETER P_D_NUM2 and hence the actual Parameter d_num2 also changes.

If the subroutine concludes successfully, that is, when the ENDFORM statement occurs, or when the subroutine is terminated through a CHECK or EXIT statement, the current value of the formal parameter is copied into the actual parameter.

If the subroutine terminates prematurely due to an error message, no value is passed.

Wednesday, March 19, 2008

Examining Function Modules in SAP ABAP

Examining Function Modules in SAP ABAP


Prior to creating a new function module, you need to create a function group. Some examples of function groups are given below.

















Add one more function module to the same Function Group, goto SE80 and see the result.








Function
Group
Description
V02D Customer Master: Read/Block
VBAK Business Object Sales
Document
ITOB_BAPI_EQ PM Equipment: BAPIs
STXD SAPscript program interface
1




Take time to go through each of the function module components. We will examine each of them in this post.

Required transactions are as folows.















Transaction Description
SE37 Function Builder Initial
Screen
SE80 Object Navigator


Run transaction SE37, and in the resulting screen click on the attributes TAB as shown below.



Now you can run transaction SE80, to check the Function Modules, Subroutines and Includes associated with this group. This way you can find out related function modules. For example if a particular function module does not satisfy your requirement, then you can search for a related function module in the same group.

See the figure below.



Now you know how to identify similar function modules in SAP ABAP.

Now Let us see the components that the SAP system created when a function group is created.Create a new function group from transaction SE80 and see all the components associated with it. See the figure below.




As you can see two includes have been created as follows.

LZTEMPTOP
LZTEMPUXX

In the TOP include, LZTEMPTOP you can place all the global data definations, these will be global to all the function modules in this group.

The second include program namely LZTEMPUXX should not be modified. The SAP R/3 system automatically places all the includes that you create in this include.
When you double click on this include just after creating the Function Group you see the following message in the left pane.

*****************************************************************
*   THIS FILE IS GENERATED BY THE FUNCTION LIBRARY.                           *
*   NEVER CHANGE IT MANUALLY, PLEASE!                                                *
*****************************************************************







Important:
Every time a function module is added to a Function Group, SAP R/3 will
add a new statement to the UXX. The include for the first function module
will be 01, the second 02 and so on




Create one more function module, add it to the same group, goto SE80 and see the result, you will notice that the system has generated one more Include named LZTEMPU02. In this case TEMP is specific to the names given for this example.

SAP ABAP Tutorial for creating an RFC (Remote enabled Function Module)

SAP ABAP Tutorial for creating an RFC (Remote enabled Function Module)

Task: To create an RFC  for creating a Sales order in SAP.

In the earlier posts we have already seen how to use a BAPI to create a SALES order in SAP ABAP. Today we will create an RFC to post a sales order.


Note: You can use the following BAPIs and Function modules to create a Sales Order in SAP.


BAPI_SALESORDER_CREATEFROMDAT1 Sales Order: Create Sales Order
BAPI_SALESORDER_CREATEFROMDAT1 Sales Order: Create Sales Order
SD_SALESDOCUMENT_CREATE

Other BAPIs related to Sales Order are as follows.

BAPISDORDER_GETDETAILEDLIST Sales Order: List of All Order Data
BAPI_ORDER_CHANGE_STATUS_GET Change status for order
BAPI_SALESORDER_CHANGE Sales Order: Change Sales Order
BAPI_SALESORDER_GETLIST Sales order: List of all orders for customer
BAPI_SALESORDER_GETSTATUS Sales order: Display status
BAPI_SALESORDER_SIMULATE Sales Order: Simulate Sales Ord


Transactions used in this Tutorial.

SE37            Function Builder
SE38            ABAP Editor
SE80            Object Navigator
SHDB           BDC Recorder


First we will do a BDC recording using transaction SHDB. To see details on how to do a BDC recording please click here.

In this case you need to use the transaction VA01 to do the recording.

We will do the recording for the following fields.

Order Type



Sold-to Party
Ship-to Party
Purch Ord No



Material
Quantity



In the function module that we create these will be the Import Parameters.

Note: you need to do the BDC recording for all the mandatory fields for creating a Sales Order.


Once the BDC recording is complete for Transaction VA01 as shown in the previous post (Refer this)

We need to create a program for this recording (Refer this).

Once the above two tasks are complete we need to do some clean up as we have to transfer this program to a function module. Please refer to the following program.

**********************************************************************************************************************************

report ZSALESORDER
       no standard page heading line-size 255.


DATA:   BDCDATA LIKE BDCDATA    OCCURS 0 WITH HEADER LINE,
        CTUMODE LIKE CTU_PARAMS-DISMODE VALUE 'A',
        CUPDATE LIKE CTU_PARAMS-UPDMODE VALUE 'L',
        MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE,
        L_SUBRC LIKE SY-SUBRC,
        L_MSTRING(480),
        NODATA VALUE '/'.



*include bdcrecx.

start-of-selection.


perform bdc_dynpro      using 'SAPMV45A' '0101'.
perform bdc_field       using 'BDC_CURSOR'
                              'VBAK-SPART'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'VBAK-AUART'
                              'OR'.
perform bdc_field       using 'VBAK-VKORG'
                              ''.
perform bdc_field       using 'VBAK-VTWEG'
                              ''.
perform bdc_field       using 'VBAK-SPART'
                              ''.
perform bdc_dynpro      using 'SAPMV45A' '4001'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'VBKD-BSTKD'
                              '15493'.
perform bdc_field       using 'KUAGV-KUNNR'
                              '7777'.
perform bdc_field       using 'KUWEV-KUNNR'
                              '7777'.
perform bdc_field       using 'RV45A-KETDAT'
                              '04/01/2008'.
perform bdc_field       using 'RV45A-KPRGBZ'
                              'D'.
perform bdc_field       using 'VBKD-PRSDT'
                              '03/19/2008'.
perform bdc_field       using 'BDC_CURSOR'
                              'RV45A-KWMENG(01)'.
perform bdc_field       using 'RV45A-MABNR(01)'
                              'y-351'.
perform bdc_field       using 'RV45A-KWMENG(01)'
                              '                  1'.
perform bdc_dynpro      using 'SAPMV45A' '4001'.
perform bdc_field       using 'BDC_OKCODE'
                              '=SICH'.
perform bdc_field       using 'VBKD-BSTKD'
                              '15493'.
perform bdc_field       using 'KUAGV-KUNNR'
                              '7777'.
perform bdc_field       using 'KUWEV-KUNNR'
                              '7777'.
perform bdc_field       using 'RV45A-KETDAT'
                              '04/01/2008'.
perform bdc_field       using 'RV45A-KPRGBZ'
                              'D'.
perform bdc_field       using 'VBKD-PRSDT'
                              '03/19/2008'.
perform bdc_field       using 'VBKD-ZTERM'
                              'ZB01'.
perform bdc_field       using 'VBKD-INCO1'
                              'CIF'.
perform bdc_field       using 'VBKD-INCO2'
                              'Düsseldorf'.
perform bdc_field       using 'BDC_CURSOR'
                              'RV45A-MABNR(02)'.
perform bdc_dynpro      using 'SAPLSPO2' '0101'.
perform bdc_field       using 'BDC_OKCODE'
                              '=OPT1'.
perform bdc_transaction using 'VA01'.


Form bdc_transaction using tcode.

    CALL TRANSACTION TCODE USING BDCDATA
                     MODE   CTUMODE
                     UPDATE CUPDATE
                     MESSAGES INTO MESSTAB.
    L_SUBRC = SY-SUBRC.

      WRITE: / 'CALL_TRANSACTION',
               TCODE,
               'returncode:'(I05),
               L_SUBRC,
               'RECORD:',
               SY-INDEX.
      LOOP AT MESSTAB.

      ENDLOOP.

 endform.
*----------------------------------------------------------------------

*        Start new screen

*----------------------------------------------------------------------

FORM BDC_DYNPRO USING PROGRAM DYNPRO.
  CLEAR BDCDATA.
  BDCDATA-PROGRAM  = PROGRAM.
  BDCDATA-DYNPRO   = DYNPRO.
  BDCDATA-DYNBEGIN = 'X'.
  APPEND BDCDATA.
ENDFORM.

*----------------------------------------------------------------------

*        Insert field

*----------------------------------------------------------------------

FORM BDC_FIELD USING FNAM FVAL.
  IF FVAL <> NODATA.
    CLEAR BDCDATA.
    BDCDATA-FNAM = FNAM.
    BDCDATA-FVAL = FVAL.
    APPEND BDCDATA.
  ENDIF.
ENDFORM.

**********************************************************************************************************************************
Please make a note that the above program has been modified from the program that was generated using transaction SHDB. The include BDCRECX has been commented out and the code has been inserted in the main program. We will do further modifications to this program while inserting this code in the Remote Enabled Function Module RFC.

We will now create a Function Module and make it Remotely Enabled. How to create a function module see here.

Before creating a function module you need to create a function group see here.

Once the structure of the function module is created we need to create the Import Parameters. The import parameters we vary from system to system and will depend on the fields that you need to transfer to SAP R/3. Ideally there will be Import Parameters, Tables and Export Parameters.

Please see the figure below.

IMPORTANT: Note that the Pass Value filed has been selected. This filed has to be selected for all RFCs.




Once the Import Parameters are set you can create the export parameters.

Here we will be exporting the Sales Order Number.

IMPORTANT: Note that the Pass Value filed has been selected. This filed has to be selected for all RFCs.




Now we need to create an Include program as shown below.

Put the following code in a separate include program. This include program will be inserted in one of the includes of the function module. Namely LZSALESTOP. Please note that this name fill differ in your system. But the last three letters of the include will be TOP.

Also make a note of the following.

The include ending with UXX (in our case LZSALESUXX) should not be modified. SAP generates the following code in this include.

*****************************************************************
*   THIS FILE IS GENERATED BY THE FUNCTION LIBRARY.                           *
*   NEVER CHANGE IT MANUALLY, PLEASE!                                                *
*****************************************************************




Put the following code in a separate include program. This include program will be inserted in one of the includes of the function module. Namely LZSALESTOP. Please note that this name fill differ in your system. But the last three letters of the include will be TOP.

INCLUDE LZSALESU01.

***INCLUDE ZSALESCREATEI .

DATA:   BDCDATA LIKE BDCDATA    OCCURS 0 WITH HEADER LINE,
        CTUMODE LIKE CTU_PARAMS-DISMODE VALUE 'A',
        CUPDATE LIKE CTU_PARAMS-UPDMODE VALUE 'L',
        MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE,
        L_SUBRC LIKE SY-SUBRC,
        L_MSTRING(480),
        NODATA VALUE '/'.



Form bdc_transaction using tcode.

    CALL TRANSACTION TCODE USING BDCDATA
                     MODE   CTUMODE
                     UPDATE CUPDATE
                     MESSAGES INTO MESSTAB.
    L_SUBRC = SY-SUBRC.

      WRITE: / 'CALL_TRANSACTION',
               TCODE,
               'returncode:'(I05),
               L_SUBRC,
               'RECORD:',
               SY-INDEX.

 endform.
*----------------------------------------------------------------------

*        Start new screen

*----------------------------------------------------------------------

FORM BDC_DYNPRO USING PROGRAM DYNPRO.
  CLEAR BDCDATA.
  BDCDATA-PROGRAM  = PROGRAM.
  BDCDATA-DYNPRO   = DYNPRO.
  BDCDATA-DYNBEGIN = 'X'.
  APPEND BDCDATA.
ENDFORM.

*----------------------------------------------------------------------

*        Insert field

*----------------------------------------------------------------------

FORM BDC_FIELD USING FNAM FVAL.
  IF FVAL <> NODATA.
    CLEAR BDCDATA.
    BDCDATA-FNAM = FNAM.
    BDCDATA-FVAL = FVAL.
    APPEND BDCDATA.
  ENDIF.
ENDFORM.

Now the main code has to be inserted in the body of the function module. The code shown below needs to be inserted in the body of the function module.

Please note that in the code given below the hard coded values are replaced by IMPORT Parameters of the function module.


FUNCTION Z_SALES_CREATE.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(ORDTYP) LIKE  VBAK-AUART
*"     VALUE(SOLDTO) LIKE  KNA1-KUNNR
*"     VALUE(SHIPTTO) LIKE  KNA1-KUNNR
*"     VALUE(PURCHORDNO) LIKE  VBKD-BSTKD
*"     VALUE(MATNO) LIKE  MARA-MATNR
*"     VALUE(QTY) LIKE  RV45A-KWMENG
*"  EXPORTING
*"     VALUE(SALESORDNO) LIKE  VBAK-VBELN
*"----------------------------------------------------------------------

perform bdc_dynpro      using 'SAPMV45A' '0101'.
perform bdc_field       using 'BDC_CURSOR'
                              'VBAK-SPART'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'VBAK-AUART'
                              ORDTYP.
perform bdc_field       using 'VBAK-VKORG'
                              ''.
perform bdc_field       using 'VBAK-VTWEG'
                              ''.
perform bdc_field       using 'VBAK-SPART'
                              ''.
perform bdc_dynpro      using 'SAPMV45A' '4001'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'VBKD-BSTKD'
                              PURCHORDNO.
perform bdc_field       using 'KUAGV-KUNNR'
                              SOLDTO.
perform bdc_field       using 'KUWEV-KUNNR'
                              SHIPTTO.
perform bdc_field       using 'RV45A-KETDAT'
                              '04/01/2008'.
perform bdc_field       using 'RV45A-KPRGBZ'
                              'D'.
perform bdc_field       using 'VBKD-PRSDT'
                              '03/19/2008'.
perform bdc_field       using 'BDC_CURSOR'
                              'RV45A-KWMENG(01)'.
perform bdc_field       using 'RV45A-MABNR(01)'
                              MATNO.
perform bdc_field       using 'RV45A-KWMENG(01)'
                              QTY.
perform bdc_dynpro      using 'SAPMV45A' '4001'.
perform bdc_field       using 'BDC_OKCODE'
                              '=SICH'.
perform bdc_transaction using 'VA01'.

GET PARAMETER ID 'AUN' FIELD SALESORDNO.
ENDFUNCTION.


Note that the remotely enabled and Start Immediately radio buttons are selected as shown below.



Please add the following line once the Call Transaction is completed.

GET PARAMETER ID 'AUN' FIELD SALESORDNO.

The above command will get the newly created Sales Order in the filed SALESORDNO. Alternatively you can follow the procedure given below using the USEREXIT.

GET PARAMETER ID 'AUN' FIELD SALESORDNO. Is a simpler way of getting the latest sales order number.

For more details on GET PARAMETER ID and SET PARAMETER ID please see the following.

SAP SPA/GPA Parameters


Important. The Sales Order number should be obtained in the EXPORT parameters of the function module. This is not handled in the code given below. But I will mention the user-exit from where the Sales Order number needs to be exported to this function module. We will discuss IMPORTING and EXPORTING from SAP Memory in the next Post.

User Exit Program Name: MV45AFZZ

        FORM USEREXIT_SAVE_DOCUMENT.                                          
                                                                              
        * Example:                                                            
        * CALL FUNCTION 'ZZ_EXAMPLE'                                          
        *      IN UPDATE TASK                                                 
        *      EXPORTING                                                      
        *           ZZTAB = ZZTAB.                                            
        LOOP AT XVBEP WHERE UPDKZ NE UPDKZ_DELETE                             
                        AND NOT AUFNR IS INITIAL.                             
          SET PARAMETER ID 'ANR' FIELD XVBEP-AUFNR.                           
        ENDLOOP.                                                              
                                                                                                                                                     
                                                                              
        ENDFORM.  

The Sales order number will be generated at the above point and can be exported to SAP Memory which can then be imported back into the function module.

ABAP TIPS

PREVIOUS                  NEXT                    RANDOM

 ABAP TIPS


Since your web browser does not support JavaScript, here is a non-JavaScript version of the image slideshow:

 ABAP TIPS
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.


 ABAP TIPS
For all frequently used Select statements, try to use an index. You always use an index if you specify (a generic part of) the index fields concatenated with logical Ands in the Select statement's Where clause. Note that complex Where clauses are poison for the statement optimizer in any database system.


 ABAP TIPS
If there exists at least one row of a database table or view with a certain condition, use the Select Single statement instead of a Select-Endselect-loop. Select Single requires one communication with the database system, whereas Select-Endselect needs two.


 ABAP TIPS
It is always faster to use the Into Table version of a Select statement than to use Append statements.


 ABAP TIPS
To read data from several logically connected tables use a join instead of nested Select statements. Network load is considerably less.


 ABAP TIPS
If you want to find the maximum, minimum, sum and average value or the count of a database column, use a select list with aggregate functions instead of computing the aggregates yourself. Network load is considerably less.


 ABAP TIPS
If you process your data only once, use a Select-Endselect-loop instead of collecting data in an internal table with Select Into Table. Internal table handling takes up much more space.


 ABAP TIPS
Use a select list or a view instead of Select * , if you are only interested in specific columns of the table. Network load is considerably less.


 ABAP TIPS
For all frequently used, read-only tables, try to use SAP buffering. Network load is considerably less.


 ABAP TIPS
Whenever possible, use array operations instead of single-row operations to modify your database tables. Frequent communication between the application program and database system produces considerable overhead.


 ABAP TIPS
Whenever possible, use column updates instead of single-row updates to update your database tables. Network load is considerably less.


 ABAP TIPS
Instead of using nested Select loops or FOR ALL ENTRIES it is often possible to use subqueries. Network load is considerably less.


 ABAP TIPS
Use the special operators CO, CA, CS, instead of programming the operations yourself. If ABAP/4 statements are executed per character on long strings, CPU consumption can rise substantially.


 ABAP TIPS
Some function modules for string manipulation have become obsolete and should be replaced by ABAP/4 statements or functions: STRING_CONCATENATE... -> CONCATENATE, STRING_SPLIT... -> SPLIT, STRING_LENGTH -> strlen(), STRING_CENTER -> WRITE...TO...CENTERED, STRING_MOVE_RIGHT -> WRITE...TO...RIGHT-JUSTIFIED


 ABAP TIPS
Use the CONCATENATE statement instead of programming a string concatenation of your own.


 ABAP TIPS
If you want to delete the leading spaces in a string, use the ABAP/4 statement SHIFT...LEFT DELETING LEADING... .Other constructions (with CN and SHIFT...BY SY-FDPOS PLACES, with CONDENSE if possible, with CN and ASSIGN CLA+SY-FDPOS(LEN) ...) are not as fast. In any case, avoid using SHIFT inside a WHILE-loop!


 ABAP TIPS
Use the SPLIT statement instead of programming a string split yourself.


 ABAP TIPS
Use the strlen( ) function to restrict the DO loop to the relevant part of the field, e.g. when determinating a check-sum.


 ABAP TIPS
Use "CLEAR f WITH val" whenever you want to initialize a field with a value different from the field's type-specific initial value.


 ABAP TIPS
Try to keep the table ordered and use binary search or used a table of type SORTED TABLE. If TAB has n entries, linear search runs in O( n ) time, whereas binary search takes only O( log2( n ) ).


 ABAP TIPS
A dynamic key access is slower than a static one, since the key specification must be evaluated at runtime. However, for large tables the costs are dominated by number of comparison needed to locate the entry.


 ABAP TIPS
If you need to access an internal table with different keys repeatedly, keep your own secondary indices.With a secondary index, you can replace a linear search with a binary search plus an index access.


 ABAP TIPS
LOOP ... WHERE is faster than LOOP/CHECK because LOOP ... WHERE evaluates the specified condition internally. As with any logical expressions, the performance is better if the operands of a comparison share a common type. The performance can be further enhanced if LOOP ... WHERE is combined with FROM i1 and/or TO i2, if possible.


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.

Ole Automation Part1
Ole Automation Part 2
Processing Blocks in ABAP
Simple ABAP Report
ALV Grid - Changing Colors
ALV Report Example
Creating Variants For ABAP Reports
Recording BDC using Transaction
Sales Document Flow in ABAP
User Exits in SAP SD
SAP ABAP Naming Standards
SAP SD Tables
SAP ABAP Data Dictionary Tables
MM Important Transaction Codes in SAP
Passing g Data From One ABAP Program to Another
ABAP Compute Add Collect and Append
SAP ABAP Determining Attributes of Data
SAP ABAP Editor Icons
BAPI for Displaying Material Data
BAPI to get customer bank details
EDI Outbound Process
SAP EDI Process Overview
Function Module for Vendor Bank details
SAP IDOC
Creating a Valid Password in SAP
SAP BADIs Introduction
SAP ABAP MACROS
POP UP function Module to Confirm and Save Data
Select Options
BAPI for availability check
String to Numerical
SAP Goods Movement Process
Getting a List of Plants for a Material
SAP R3 Clients Concept
ABAP Adobe Forms
Authorization Object Tables
SAP Industry Specific Solutions

Sap Scripts and SmartForms Bar Codes
Standard Reports and Sap Scripts
Important Standard Reports in SAP
Abap Tricks and Tips
Bapi Sales Order
BAPI Purchase Order
Creating Function Modules in SAP
Creating Tables in SAP
Finding User Exits in SAP
Function Module Create Text and Read Text
Important Transaction Codes in SAP
ABAP Function Module for Submitting a Program
ABAP Game Tic Tac Toe
ABAP Internal Table To Excel Sheet
ABAP Function Module to create Directory
Different Types of Menus in SAP
Function Modules in SAP to check Loged in Users
ABAP Function Module for Adding Days to Dates
Call a Transaction From a Remote System
SAP MM simple Procurement Cycle
BAPI Material EDIT
Finding Decimal Places in Currency
Getting negative sign before a number in ABAP
Program Editor Lock Unlock
Restricting Select Options
List of BAPIs in the system
SAP Function Module Scramble a String
LSMW
POP up table contents on the screen
SAP R3 Bookmarking Websites
Stock Requirements List Function Module
Retail Transaction Codes
ABAP Debugger Break Points
ABAP Debugger WatchPoints
Drill Down Reports Concept
Creating a HOT SPOT
Interactive Programs and Hide Technique
String Concatenate
Get Week of the Year
SAP ABAP to Add Days to a Date
Add Months to a Date
Get Month in the Year
Display Clock

ABAP Code For Progress BAR
ABAP Function Module For Caluclator
ABAP Function Module For Calender
Displaying Messages in ABAP
Function Module Pop Up To Confirm
Conversion Routines in SAP
SAP ABAP Authorization
SAP ABAP Module Pool Tutorial
SAP ABAP RFC

Finding Path to SAP Transaction in Menu
SAP Purchasing Documents
SAP and ABAP Shortcuts
Logical Databases
Advantages of Logical Databases
Copy to Clipboard
BAPI Create Material
Finding and Running Programs in ABAP
Program Syntax Check and Extended Syntax Check
Select Options upper lower case
BAPI Sales Order Simulate
Get PLANT and Description for a Material
MRP List Function Module
Production Planning and Controlling
Applications in SAP R3
Tool Based Reports
Important Transaction Codes in SAP
SAP Stock per Bin
Pop Up a Calender
Module to Read a File
Module to Reverse A String
Run an Executable Program with Parameters
Program for POP up Screen
Printing Selection Parameters for a Report
Uploading and DownLoading a Report
SAP ABAP Version Management
SAP ABAP Short Cuts
List of Important System Variables

ABAP MACROS
ABAP Calling a File Selector
Some Important Function Modules
ABAP String Operations

ABAP Function Module to Check Validity of Date
Transfer Internal Table Contents to a File

SAP ABAP Program Types
BAPI to Read Customer Data
Checking Validity of Date
Download to Application Server
ABAP Debugger Breakpoint and Watchpoint
BAPI to get Company Code Details
Creating Material Using BAPI part 2
Generating a Valid Password
Logical Databases Structure
Making Fields OBligatory in Selection Screen
ABAP Views
Getting a Company Code for a Plant
Importing contents of Clipboard in SAP
Getting a Plant for a Material
Plant Material and Storage Location
SAP Production Planning Standard Reports
NetWeaver Components
Supported Databases and Operating Systems