SAP ABAP

Archive for May 24th, 2007

BDC PROGRAM STRUCTURE

There are 5 parts in a BDC program .Each part is executed one after another.

1) Selection screen is used with a parameter to input the text file of TYPE RLGRAP-FILENAME . Various function modules like KD_GET_FILENAME_ON_F4 can be used to read the file name at runtime or the filename can be defaulted by using DEAULT clause in the parameter statement.

2) Open the text file for input.If file fails to open (SY-SUBRC NE 0) then stop the program with a error message. OPEN DATASET filename FOR INPUT IN TEXT MODE is used to open the file.

3)Loop through the dataset using a loop statement like DO .. ENDDO with an EXIT statemenyt if no next record exists.and filling the work structure which will hold the data for a single transaction in each loop pass. Filling the BDC TABLE of TYPE BDCDATA in the loop for every record(equivalent to transaction) in the data set. Submit the internal table containing bdc data for each and every transaction (internal table of TYPE BDCDATA is submitted for each transaction until all the records in the dataset are read) using CALL TRANSACTION ‘tr’ USING I_bdcdata MODE ‘N’ UDATE ‘S’ .

DO
READ DATASET file INTO W_bdcdata
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
PERFORM Fill_BDCDATA
PERFORM Submit_BDCDATA
ENDDO

4) Error handling when submission via CALL TRANSACTION fails ,either by using the internal table to be filled by the system messages which is of TYPE BDCMSGCOLS and can be specified in CALL TRANSACTION statement with the addition MESSAGES INTO . Or error handling by sending the mail to a predefined recipient. Or for each and every transaction that fails create asingle BDC SESSION by using BDC_OPEN_GROUP function moduleand submitting the intenal bdc data table to it. For each and every error a report should display themall at the end of the program so that the transacton in error can be identified.
The approach of opening a BDC SESSION is often used with an error report when an error occurs as all the transaction in error can be seen and executed in the session manager .

5)Clean up actions. Here clean up actions are performed like closing the dataset with CLOSE DATASET command ,closing any errorsession if they were created using CLOSE_GROUP function module.and displaying the report .
To fill the bdc data table we should have all the information associated with the screens used in the transaction and all the fields in those screens that will be filled by the CALL TRANSACTION statement.We can use BDC SESSION RECORDER or Transaction Recorder(Transaction SHDB) to get the information on the screens and the fields. Thedata which is required to fill the internal table of TYPE BDCDATA is
Program Name
Screen Number
Screen Begin
Field Name
Field Value

Information on Field Name and Field Type can be used to create the structure that will be used to read records from the data set .

While filling the Field value in BDCDATA table care should be taken for special fields like ‘BDC_CURSOR’,’ BDC_OKCODE’

Structure of BDCDATA table
PROGRAM Name of program
DYNPRO Number of screen
DYNBEGIN If New screen begins value =’X’
FNAM Field Name
FVAL Field Value

Structure of BDCMSGCOLL
MSGID Message ID
MSGTYP MessageType
MSGNR Message Number
MSGV1 1st placeholder
MSGV2 2nd Place Holder
MSGV3 3rd Placce Holder
MSGV4 4th Place Holder

To see all the messages stored by the system in the BDCMSGCOLS table we can use LOOP AT .ENDLOOP command.

Code to read internal table of type BDCMSGCOLS.

TABLE T100 HAS FOLLOWING FIEL
DSSPRSL TYPE SPRAS (Language)
ARBGB TYPE ARBGP (BUSINESS AREA)
MSGNR Message number (3C)
TEXT Message Text (Type 73C)

LOOP AT MESSTAB. “Int Table of TYPE BDCMSGCOLS

SELECT SINGLE * FROM T100
WHERE SPRSL = MESSTAB-MSGSPRA
AND ARBGB = MESSTAB-MSGID
AND MSGNR = MESSTAB-MSGNR.

IF SY-SUBRC = 0.

L_MSTRING = T100-TEXT.

IF L_MSTRING CS ‘&1’.

REPLACE ‘&1’ WITH MESSTAB-MSGV1 INTO L_MSTRING.

REPLACE ‘&2’ WITH MESSTAB-MSGV2 INTO L_MSTRING.

REPLACE ‘&3’ WITH MESSTAB-MSGV3 INTO L_MSTRING.

REPLACE ‘&4’ WITH MESSTAB-MSGV4 INTO L_MSTRING.

ELSE.

REPLACE ‘&’ WITH MESSTAB-MSGV1 INTO L_MSTRING.

REPLACE ‘&’ WITH MESSTAB-MSGV2 INTO L_MSTRING.

REPLACE ‘&’ WITH MESSTAB-MSGV3 INTO L_MSTRING.

REPLACE ‘&’ WITH MESSTAB-MSGV4 INTO L_MSTRING.

ENDIF.
CONDENSE L_MSTRING.

WRITE: / MESSTAB-MSGTYP, L_MSTRING(250).

ELSE. WRITE: / MESSTAB.

ENDIF.

ENDLOOP.

SKIP.

ENDIF.

This example code is based on enhancement SUSR0001.This enhancement uses function exit EXIT_SAPLSUSF_001 .

Enhancement : SUSR0001 User Exit after logon to SAP system.
When the User logs in the system ,this exit is called each and every time for every user after logon to the R/3 system.

Function Exit : EXIT_SAPLSUSF_001 .
Every dialog user passes thrugh this function module after logon,It can be used to execute individual customer checks and send mesages to the user.TABLE USR02 CONTAINS LOGON DATA and can be used in this exit to get the user logon data and take necessary actions as required by the customer requirement and even LOG_OFF (not recommended by SAP).

STEPS REQUIRED FOR IMPLEMETING THE EXIT

1) Open CMOD(Project maintenance) Transaction.Enter a project name starting with Z.Press enter.

2) Goto Enhancement window by clicking the enhancement button in the application tool bar.

3) Write SUSR0001 in the enhancement column and press enter.

4) Goto Components window(It will show al the exits included in this enhancement), in our case only one Function Exit will be shown.

5) Double click on the Function exit EXIT_SAPLSUSF_001.
The following function source code will be displayed in the function editor

FUNCTION EXIT_SAPLSUSF_001.*”———————————————————————-*”*”Lokale Schnittstelle:*”———————————————————————-
INCLUDE ZXUSRU01.
ENDFUNCTION.

6) Double click on the include ZXUSRU01 .If it will ask to create the include say yes .
7)Write the following code in the include.
DATA W_TEXT(30) TYPE C.DATA W_DATE(10) TYPE C.WRITE sy-datum TO W_DATE DD/MM/YYYY.CONCATENATE ‘ Date is ‘ W_DATE INTO W_TEXT.
CALL FUNCTION ‘POPUP_TO_INFORM’ EXPORTING titel = ‘Welcome to Paradise !’ txt1 = ‘Have A Nice Day’ txt2 = W_TEXT* TXT3 = ‘ ‘* TXT4 = ‘ ‘

8)Save the include and activate it .Activate the Project also by going to the menu in CMOD transaction.Now The user exit SUSR0001 has been implemented and is ready to use.
9) Logon to the R/3 system . A dialog box will appear with the message
Welcome to Paradise ! with date .

NOTE: BAPIs like BAPI_USER_GET_DETAIL can also be used to get user info or directly read from tables USR02 etc.
PP User Exit .
This user exit is used in PP and is for u to try
MCP20020 User exit for reading info structure when transferring reqtsit contains function exitEXIT_SAPMMCP6_020
When planned independent requirements are transferred from SOP to program data, the data is read at material/plant level as standard. You can use this user exit to have a greater or smaller number of characteristics for data selection. In this case, the data is read on a different level than that in the standard system.
The interface of this user exit corresponds to that of function module ‘MC_PG_TRANSFER_PBED’, but the info structure and the key fields table (structure IKEYF) are also transferred. YF). The characteristic attributes of the characteristics used for data must be transferred to the user exit in field ‘Value’ of the key fields table.
For further information, see function module: ‘MC_PG_TRANSFER_PBED’

USEREXIT

Userxits allow us to add our own functionality to SAP standard program
without modifying it . These are implemented in the form of subroutines and hence are also known as FORM EXITs. The userexits are generally collected in includes and attached to the standard program by the SAP.
All Userexits start with the word USEREXIT_…

FORM USEREXIT_..
z..
ENDFORM.

The problem lies in finding the correct userexit and how to find it if one exists for the purpose. Once the correct userexit is found the necessary
customer code is inserted in the customer include starting with the z..
in the form routine.

e.g. USEREXIT_SAVE_DOCUMENT_PREPARE

Certain application like SD still provide this form of enhancement using userexit but this practice is no longer being followed for newer extensions
instead they are using EXITs which come bundeled in enhancement packages . Neverthiless existing USEREXITS will be supported by SAP an all the newer versions of SAP.

HOW TO FIND USEREXITS

Userexits can be found in number of ways:
1) To find userexits in SD module , goto object navigator(SE80) and select
development class from the list and enter VMOD in it. All of the userexits in SD are contained in the development class VMOD. Press
enter and you will find all the includes which contain userexits in SD for
different functions like PRICING, ORDER PROCESSING etc. Select the userexit according to the requirement and read the comment inserted in it
and start coding .

Some examples of userexits in SD(SALES & DISTRIBUTION ) are:

1)ADDING OF NEW FIELDS IN PRICING
In Pricing in SD the fields on the basis of which pricing is done are derived from the FIELD CATALOG which is a structure KOMG .This structure is used to transfer transaction data to the pricing procedure in SD and is also known as communication structure.This structure KOMG consists of two tables KOMK for Header related fields and KOMP for item related fields.
The fields which are not in either of the two tables KOMK and KOMP
cannot be used in pricing .Sometimes a need arises when the pricing
is to be based on some other criteria which is not present in the form of fields in either of the two tables.
This problem can be solved by using USEREXITS which are provided for pricing in SD.
Pricing takes place both when the SALES ORDER ( Transaction VA01) is created as well as when INVOICING ( Transaction VF01) is done.Hence SAP provides 2 userexits ,one for sales order processing which is

USEREXIT_PRICING_PREPARE_TKOMP or
USEREXIT_PRICING_PREPARE_TKOMK
Depending upon which table (KOMK or KOMP) the new fields were inserted we use either of the above two userexits.These userexits are found in include MV45AFZZ of the standard SAP sales order creation program SAPMV45A.

In the case of userexit which will be called when invoicing is done ,these
are provided in the include RY60AFZZ which is in the standard SAP
program SAPMV45A. The name of the userexits are same. i.e
USEREXIT_PRICING_PREPARE_TKOMP or
USEREXIT_PRICING_PREPARE_TKOMK

These userexits are used for passing the data from the communication structure to the pricing procedure, for this we have to fill the newely
created field in the communication structure KOMG for this we fill the code in the above userexit using the MOVE statement after the data that
has to be passed is taken from the database table by using the SELECT statement. The actual structure which is visible in these userexits and which is to be filled for that particular field is TKOMP or TKOMK.

Before the coding for these userexits is done ,it is necessary to create a new field in either of the two tables KOMK or KOMP .For this purpose
includes are provided in each of them .
To create the field in header data(KOMK) the include provided is KOMKAZ
and to create the field in item data(KOMP) the include provided is KOMPAZ.

One possible example for the need of creating new fields can be e.g. Frieght to be based upon transportation zone ,for this no field is available in field catalog and hence it can be created in KOMK and then above userexits can be used to fill the transportation data to it.

2)The other method of finding userexit is to find the word USEREXIT in the
associated program of the transaction for which we want to determine userexit using SE38.
3)The other method of finding userexits is to find the include in case of SD/MM applications where the userexits are located ,this can be found in the SAP reference IMG generally in the subfolder under SYSTEM MODIFICATION.

Some other examples of userexits in SD are:

USEREXIT_NUMBER_RANGE
This userexit is used to assign a different internal document number to the
sales order(VA01) when it is created depending on some criteria like a different SALES ORGANIZAION(VKORG) .

USEREXIT_SAVE_DOCUMENT_PREPARE
This userexit is used to insert the ABAP code which will be called when
the document (sales order VA01) is just about to be saved.This userexit is used generally for custom checks on different fields , to display some information before the order will be saved or for making changes to certain fields before the sales order will be saved.

Exits & Enhancements
There are mainly six types of EXITs in sap which have been collected in the form of enhancement packages and attached to standard code in SAP.
These are different from USEREXIT in the way that they are implemented
in the form of FUNCTIONs while in USEREXITS we use form routines for their implementation. These are also sometimes known as function exits .
These start from the word EXIT_ followed by the program name and then followed by a three digit number.

e.g. EXIT_SAPMV45A_002
This exit is found in SD in enhancement V45A0002.

TYPES OF EXITS

1)MENU EXITS
2)FUNCTION EXITS
3)TABLE EXITS
4)SCREEN EXITS
5)KEYWORD EXITS
6)FIELD EXITS

We use SAP transactions CMOD and SMOD to manage exits. Before implementing an exit , it is required to create the project by using CMOD
selecting the enhancement e.g. V45A0002 and selecting the component
(one which fulfills our need) i.e the exit which will be implemented in SMOD and after coding has been done the project has to be activated.
An exit can be coded only once.

FUNCTION EXITS
These are used to add functionality through ABAP code . These start from the word EXIT_programname_NNN ending in a 3 digit number. No access code is required to implement any tupe of exit including function exits.
The function exits are called from the standard SAP program in the form
of ABAP statement
CALL CUSTOMER-FUNCTION ‘NNN’

This is in contrast to USEREXITs where PERFORM statement is used to call
the required userexit.
To implement the FUNCTION EXITs first of all the project is created and a suitable enhancement package is selected and from its compnents the function exit to be implemented is selected and on double clicking it the exit code will appear in ABAP EDITOR(se38) where a Z include will be found and the customer code should be entered in this include.

e.g.

ADDING A DEFAULT SOLD-TO-PARTY in Sales Order Creation
To show a default sold-to-party in this field when the user creates a sales order (VA01) we can use a function exit .This function exit is located
in enhancement no V45A0002 . Before we can choose the exit we have to
create a project in CMOD after that enter V45A0002 in the enhancement field and click on the components . In the components you will see the
exit EXIT_SAPMV45A_002 . This exit is used for our purpose.

Double clicking on this exit will takes us to function builder (SE37) . This
function exit has one exporting parameters and two importing parameters, we are interested in exporting parameter which is E_KUNNR
of type KNA1-KUNNR i.e if we move the desired customer name to this
structure(E_KUNNR) it will be shown in the field as the default value when we create the sales order.
This function also contains a customer include ZXVVA04 . This include
will be used to write our custom code .
Double clicking on this include and it will prompt us that this include does not exists do you want to create this object ,select yes and the include will be created .In this include we can write our own code that will fill the field E_KUNNR.
e.g. E_KUNNR = 301.

Activate the include and Activate the project. Now when ever the SALES ORDER will be created , sold-to-party field will come up with a predefined
customer .
FIELD EXITS
The field exits are managed,created,activated through program RSMODPRF. The field exit is associated with a data element existing in ABAP dictionary and hence to the screen field using that data element.
The format of field exit is :

FIELD_EXIT_dataelement_A-Z or 0-9
If a particular screen and program name is not specified than the field exit will effect all the screens containing that data element.
The function module associated with field exit shows two parameters
INPUT and OUTPUT. Input parameter contains the data passed to the field exit when the field exit was invoked by the R/3 , We can write our own code to change the output parameter depending upon our requirements.
Before the field exit can have any effect the system profile parameter
ABAP/FIELDEXIT in all the application servers should be set to YES

ABAP/FIELDEXIT = YES

LSMW is a tool used to tranfer data from legacy system to R/3 periodically or once.It supports conversion of data and Batch Input,BAPI,IDOC or Direct Input can be used as the method for transfer of data.Total of 26 processing steps are available in LSMW ,In case of data transfer using Batch Input only 14 steps are required.
Execute the transaction LSMW to start transfer of data,Before using the LSMW we should have good knowledge about the business object and the fields that will be transferred.
There are 14 steps that are normally used and these are :

1) Maintain Object Attributes.
2) Maintain Source Structures.
3) Maintain Source Fields.
4) Maintain Structure Relations
5) Maintain Field Mapping and conversion rules .
6) Maintain Fixed Values,translations ,user defined routines.
7) Specify Files .
8) Assign Files .
9) Read DATA.
10) Display Read Data.
11) Convert Data.
12) Display Converted Data.
13) Create Batch Input Session.
14) Run Batch Input Sesion.


What is SAP and SAP AG.

SAP AG is a German company founded in 1972 by 5 IBM employees who understood the benefit and the need of an ERP product which can fullfill all the business process needs of an enterprise big or small .
They developed the ERP packaget with the same name SAP and now is among the fourth largest independent software supplier across the world.
Among the various products of SAP AG is SAP R/3 ,which fullfills all the business needs of an organization by providing various applications like

Material Management(MM) ,
Sales and Distribution(SD) ,
Production Planning(PP) ,
Finance and Controlling(FI/CO) ,
Human Resources(HR) among others.

R/3 as it is popularly know is highly customizable and integrated product where all the applications running on it are tightly integrated .
Under mySAP.com SAP provides various web enabled products and services.It is a market leader in client/server enterprise application software and is based on best business practices and helps business achieve cost and competitive advantages.

What is SAP ABAP ?
The SAP R/3 code is written in an interpretive language called ABAP. (ABAP is a German acronym that, loosely translated, means “Advanced Business Application Programming.”) ABAP is very similar to COBOL in its syntax. Use of the ABAP language allows SAP customers to extend the functionality of the base product .

SAP Products .
The SAP R/3 application offers end users the ability to run their entire business from a single application vendor. Some SAP customers choose to run their entire enterprise from SAP, while others run SAP only for specific business processes, such as manufacturing or finance. SAP is designed to allow customers to choose their own set of business functions, and it is sold in many configurations–both as specific business functions and as enterprise-wide solutions.
An SAP customer can choose whatever applications meet his site’s specific business requirements. In addition, the customer is free to customize his SAP installation, adding new database entities as well as new functionality. For example, a company may use an inventory method that is nonstandard but essential to the company’s efficiency; the basic SAP functionality can be modified to accommodate the specific requirements of that inventory method. The result of all of this flexibility is that virtually every SAP installation has its own specific configuration and set of functions. However, there are costs associated with customizing SAP. An organization that makes thousands of customizations to its SAP application may find itself spending millions of dollars to upgrade SAP: when SAP is upgraded, every customization must be identified in the ABAP code, and these changes must be reapplied to the upgraded SAP software, increasing the cost of the upgrade.
SAP products are distributed as applications with functional modules inside each application. Applications are generally focused on particular business functions. The modules within each application perform specific business tasks such as capital investment management, personnel administration, and quality management. The major applications are financials, human resources, and logistics, described briefly in the following sections.
In addition to basic business functions, SAP also offers products in the following areas
SAP Business Intelligence initiative
SAP Supply Chain Management initiative
SAP Customer Relationship Management initiative
SAP Electronic Commerce
SAP Human Resources
SAP Treasury
SAP Real Estate
SAP Environment, Health, & Safety
SAP has also branched out from traditional online transaction processing (OLTP) products into data warehousing with its Business Information Warehouse (BIW) and Supply Chain Optimization, Planning, and Execution (SCOPE) products
Financials applications
The SAP Financials applications contain all of the functionality needed for enterprise-wide financial management. The modules within the Financials applications include the following:
Financial Accounting (FI)
Provides a complete financial accounting solution, including income statements, balance sheets, journals, ledgers, and all areas of financial accounting.
Enterprise Controlling (EC)
Assists in controller tasks.
Capital Investment Management (IM)
Assists finance organizations in their capital investments and tracking.
Controlling (CO)
Assists the controller organization.
Treasury (TR)
Assists with transactions related to the U.S. Treasury.
Human Resources applications
The SAP Human Resources (HR) applications are designed to provide a fully functioning HR system. They include two primary modules:
Personnel Administration (PA)
Assists with all areas of personnel administration, including applicant tracking and personnel history.
Personnel Development (PD)
Assists with training and educational status of employees.
These systems handle all of the mundane HR tasks, such as personnel and payroll, and also a number of more esoteric HR functions, such as seminar and convention management.
Logistics applications
The SAP Logistics applications include SAP’s most popular modules. Logistics was the first area of entry for SAP. This includes virtually every area of manufacturing, from the initial acquisition of raw materials to the delivery of finished goods. The modules in this area include the following products:
Materials Management (MM)
Manages raw materials, inventory, and all aspects of goods manufacturing.
Production Planning (PP)
Offers sophisticated tools for planning large production environments.
General Logistics (LO)
Manages logistics for companies that require large-scale deployment of goods and resources.
Sales and Distribution (SD)
Manages the inventory and distribution of finished goods.
Plant Maintenance (PM)
Manages the resources required for large manufacturing plants.
Quality Management (QM)
Captures and maintains quality control for manufacturing environments.
Project System (PS)
Assists with the scheduling of project tasks and interdependencies between tasks.

SAP R/3 Architecture
The R/3 architecture can be seen as consisting of 3 layers.
The three layers are:

Presentation layer
The PC-based GUI interface that is used by the end-user community.

Application layer
The SAP application servers that service requests for data and manage the interface to the presentation layer.

Database layer
The actual DBMS that communicates with the application servers to fulfill their requests for data.
A piece of “middleware” called BASIS links the application to the database and the operating system. BASIS is most commonly associated with the GUI interface to SAP (called SAPGUI), and the BASIS Administrator is an SAP professional who is responsible for configuring the SAP environment, including the GUI screens and the SAP application servers.

SAP end users log into their PCs using SAPGUI, and are connected to a specific application server. This application server has pre-established connections with the Oracle database, and it services all requests for data. As I mentioned earlier, the access language for Oracle data is SAP ABAP. ABAP generates Oracle SQL (Structured Query Language), which is then used to service the end user’s request for data. The communication between the application servers and the database, and between the client and the application servers, is TCP/IP.

While SAP is available for many different hardware platforms and operating systems, the majority of SAP systems use Unix-based servers or Windows servers for hosting SAP and the Oracle database.

The SAP skills that are in demand today are :
Functional consultants: Without them business process can’t be mapped to SAP so functional consultants in any module will always be in demand for a long time.
• ABAP programmers: This skill has good market value and will continue to be around forever because of changes done to existing projects and new developments. Demand for HR ABAP programmers have vanished. But
programmers with experience in multiple modules, ESS, SAP Script, BAPI, and RFC etc. will persist to be in demand.
• Human Resource (HR): Specialized knowledge of Payroll Mangement ,Travel and Expenses module, Recruitment, Tax configuration, extremely good Payroll functional consultants are still in good demand.
• BASIS consultants: Consultants that have good experience in upgrading new versions, UNIX or Windows NT skill and database administration will be in demand. Role involves installation , recovery , performance tuning, networking , upgradation , user authorizations , archiving etc.
• APO (Supply chain)
• Business Warehouse (BW): many were thinking BW will be the next hot skill and they were right ! .
• Project Management: Customers that are planning to upgrade will need experienced Project Managers & Team leaders to drive the project from scoping and planning all the way through implementation.
• Human Resource (HR): SAP 46X version of HR is very user friendly and has many added functionalities. Good
payroll and time functional consultants will continue to be in demand.
• ALE/EDI: Very few consultants get opportunity to do ALE, so there is still shortage of expert ALE consultants.




This procedure is useful when you need to reinstall the NT or Oracle or SAP
software on an existing SAP db/app server, and
you don't want to waste time with a backup/restore to get your database back. This
procedure assumes that all control file paths start with "oracle" (this is usually
the case):

  1. backup all parameter files (e.g. Orant/network/admin, Orant/database,
    /usr/sap/SID/sys/profile)
  2. reinstall NT (if necessary) and Oracle (if necessary)
  3. reinstall SAP app server from the kernel CD
  4. restore all parameter files (e.g. Orant/network/admin, Orant/database,
    /usr/sap/SID/sys/profile)
  5. rename all "oracle" paths to "oracle0" (e.g. oracle/sapdata1, oracle/mirrlogA)
  6. reinstall sap db server with "create db" and "link to sapdba"
    options only. This will create the necessary registry keys
  7. quit program when "Creating database" message appears, because you
    don't need to recreate the database.
  8. stop all oracle services. Delete all "oracle" folders, and
    rename "oracle0" folders to "oracle"
  9. reboot the machine.




Why would you need to install 30F on Oracle 7.3.4? I had a client once that was migrating
to a new platform and upgrading from Oracle 7.2 to 7.3.4 and from SAP 30F to 31H. To
save time, we installed 30F on 7.3.4 first, imported the old 7.2 database into the
7.3.4 database, and then upgraded SAP. This cut out the step of upgrading from 7.2 to
7.3.4.

  1. Install all items from Oracle 7.3.4 (SAP Oracle 7.3.4 CD)
  2. Copy the files Core34.dll, Core34o.dll, and Nlsrtl31.dll
    from the Oracle 7.2 installation CD to the target Orant/bin directory.
  3. copy (not rename) svrmgr23.exe to sqldba72.exe in Orant/bin
  4. copy (not rename) folder rdbms73 to rdbms72 in Orant
  5. Install Application Server (R3Inst, SAP 30F Kernel CD)
  6. Create the Oracle services with oradim73 -new -sid <SID>
  7. Copy files initnt.ora, initnt.sap, initSID.dba, initSID.sap
    from the 31H kernel CD to
    the install directory (drive:\users\SIDadm\install).
  8. Edit the sapfs.inf file to adjust tablespace sizes
  9. Install the database server (R3Inst, SAP 30F Kernel CD)

This section explains how to migrate an SAP system (version 3.x) running Oracle 7.x from
one machine to another. This procedure was used to migrate a database from
the Alpha (NT) platform to the Intel (NT) platform.
For instance, if you are upgrading to a new server, you can use this procedure
to move your system onto the new server. It will work even if the old server
and the new server
are different operating system platforms, as long as Oracle is able to
export from the source platform and import the target platform
(although SAP makes a very big deal about such cross-platform migrations).
Several steps in this procedure require familiarity with Oracle database administration,
which is not described in detail here.
Topics covered here are:

  1. Plan layout for target system (the most important step!):
    disks, tablespaces, data files, etc.

  2. Submitting a Proposal to Management
  3. Install software in target system
  4. Prepare the Target Database (tablespaces, data files, rollback segments)
  5. Perform cleanup, checks, and documentation for source system
  6. Export source system
  7. Import source system into target system
  8. Post-import steps
  9. Additional notes: scripting,
    Troubleshooting and log analysis with grep, awk, and diff

This document refers to several programs, some of
which you may not have used before. Some notes on these:

  • SAP: Whenever I mention a transaction, it means an SAP transaction
  • sapdba: the SAP administration program invoked from the server's command line
  • sqlplus: the SQL*Plus program
    that comes with your Oracle software. Like sqldba,
    sqlplus can be used to execute SQL commands. It also has a screen buffer, so you can
    scroll up to see output that is longer than the screen size (which you can't do with
    sqldba). On NT platforms, sqlplus has the additional benefit of being accessible from
    a remote workstation on the net. SQL*Plus is used here for generating scripts, and
    either SQL*Plus or sqldba can be used to execute the scripts
  • sqldba/svrmgr: the sqldba program invoked from the server's command line.
    I prefer using SQL*Plus when possible, because you can copy and paste in SQL*Plus.
    However, some scripts need to be run from sqldba (or svrmgr).
    Depending on your version of Oracle,
    the program for sqldba may be sqldba72, sqldba73, svrmgr23, or svrmgr30. For
    information on setting up SQL*Plus, see
    Troubleshooting SAP Server startup.
  • Creating and Executing a Script with sqldba/svrmgr:
    To create and execute a script (with sqldba/svrmgr):

    1. Log in to the database with SQL*Plus
    2. Type in (but don't execute) the script-generating SQL command
    3. Type in the statement "spool script_name" to start spooling
      to a file named script_name
    4. Execute the SQL statement
    5. Type "spool off" to stop spooling
    6. Edit the file script_name:

      • Delete any non-SQL statements at the beginning of the script
      • insert a "connect internal" statement on the first line
      • Delete any non-SQL statements at the end of the script

    7. Open a command prompt
    8. Enter "sqldba @script_name > log_file" where script_name is
      the full pathname of the script file, and log_file is the full pathname
      of the file to which you want to log the script's results.

  • Creating and Executing a Script with SQL*Plus:
    This is easier, especially for executing one-time scripts (like deleting
    a set of objects):

    1. Log in to the database with SQL*Plus
    2. Enter and execute the script-generating SQL command
    3. Select the output, and copy it to the clipboard (if the
      output is messed up by page or line breaks, adjust the buffer settings
      linesize, pagesize, buffer width, buffer length.
    4. Press Ctrl-V to paste the commands into the SQL*Plus command buffer,
      and press Enter a few times to return to the SQL*Plus prompt.
    5. Enter a slash to execute the command.

  • Export, EXP, Import, IMP: the
    export/import programs that come with your Oracle
    software (the actual names will be something like imp72.exe or exp72.exe, depending
    on your Oracle version)
  • grep, awk, diff: small useful utilities that are
    native to UNIX, but can be used on NT
    (by downloading them from any of several sites that have the GNU executables. One
    such site is ftp://ftp.tas.gov.au/gnu). This document describes some basic
    applications of them for searching (grep), manipulating (awk),
    and comparing (diff) text files.

Before starting any export/import, you should, of course, backup the database and the
database environment (such as control files, directory paths, and environment variables).
Also, you will need to obtain a new license key from SAP in order to run the system on
a different server.


Planning the Layout: the Most Important Step!

back to top


Before starting the export/import process (and ideally, before even procuring the
target system server), you must plan the layout for the target system,
primarily for security, performance, and reliability/redundancy reasons.
To plan out the layout,

  1. Decide on the maximum size for your Oracle database data files
  2. Find which, if any, tablespaces need to add datafiles
  3. Decide which datafiles need to be separated (such as data/index files)
  4. Calculate number of volumes you will use, and the size of each volume
  5. Decide on distribution of SAP directories (data and other)
  6. Decide on configuration of hard disks, mirroring, and RAID
  7. Decide on configuration of tablespaces and data files

The maximum data file size may be a limitation of your operating system; some
operating systems have a maximum file size of 2G. It may also be a matter of policy, as
performance may be better if large tablespaces are spread across several data files.

To assist in these tasks, use transaction DB02 and/or use
sapdba/sqldba/svrmgr/sqlplus to query the tables
dba_data_files and dba_free_space:

  • Tablespace/data file relationships and free space:

    select fs.tablespace_name, sum(fs.bytes/1024) FreeKb,
    df.status, df.file_name
    from dba_free_space fs, dba_data_files df
    where fs.file_id = df.file_id and
    fs.tablespace_name = df.tablespace_name
    group by fs.tablespace_name, df.status, df.file_name

  • Data files: select * from dba_data_files
  • Tablespace size statistics: total, used, free, %used:

    select TotalKbSQL.tablespace_name,
    round(TotalKb, 2) TotalKb,
    round(FreeKb, 2) FreeKb,
    round(TotalKb - FreeKb, 2) UsedKb,
    round(100*(TotalKb - FreeKb)/TotalKb, 1) PctUsed
    from (
    select tablespace_name, sum(bytes)/1024 FreeKb
    from dba_free_space
    group by tablespace_name
    ) FreeKbSQL,
    (
    select tablespace_name, sum(bytes)/1024 TotalKb
    from dba_data_files
    group by tablespace_name
    ) TotalKbSQL
    where TotalKbSQL.tablespace_name = FreeKbSQL.tablespace_name(+)


    The output of this query looks something like:

    TABLESPACE_NAME TOTALKB FREEKB USEDKB PCTUSED
    ------------------------------ --------- --------- --------- ---------
    PSAPBTABD 3416064 886584 2529480 74
    PSAPBTABI 1775616 537576 1238040 69.7
    PSAPCLUD 109568 48512 61056 55.7
    PSAPCLUI 20480 13104 7376 36
    . . . . .
    . . . . .
    . . . . .

  • Dataset size statistics: total, used, free, %used:

    select FreeMBSQL.dataset, round(TotalMB, 2) TotalMB,
    round(FreeMB, 2) FreeMB, round(TotalMB - FreeMB, 2) UsedMB,
    round(100*(TotalMB - FreeMB)/TotalMB, 1) PctUsed
    from (
    select
    decode(1,
    least(instr(df.file_name, 'SAPDATA1'), 1),'sapdata1',
    least(instr(df.file_name, 'SAPDATA2'), 1),'sapdata2',
    least(instr(df.file_name, 'SAPDATA3'), 1),'sapdata3',
    least(instr(df.file_name, 'SAPDATA4'), 1),'sapdata4',
    least(instr(df.file_name, 'SAPDATA5'), 1),'sapdata5',
    least(instr(df.file_name, 'SAPDATA6'), 1),'sapdata6',
    'unknown') dataset,
    sum(fs.bytes)/1048576 FreeMB
    from dba_free_space fs, dba_data_files df
    where df.file_id = fs.file_id and
    fs.tablespace_name = df.tablespace_name
    group by decode(1,
    least(instr(df.file_name, 'SAPDATA1'), 1),'sapdata1',
    least(instr(df.file_name, 'SAPDATA2'), 1),'sapdata2',
    least(instr(df.file_name, 'SAPDATA3'), 1),'sapdata3',
    least(instr(df.file_name, 'SAPDATA4'), 1),'sapdata4',
    least(instr(df.file_name, 'SAPDATA5'), 1),'sapdata5',
    least(instr(df.file_name, 'SAPDATA6'), 1),'sapdata6',
    'unknown')
    ) FreeMBSQL,
    (
    select decode(1,
    least(instr(df.file_name, 'SAPDATA1'), 1),'sapdata1',
    least(instr(df.file_name, 'SAPDATA2'), 1),'sapdata2',
    least(instr(df.file_name, 'SAPDATA3'), 1),'sapdata3',
    least(instr(df.file_name, 'SAPDATA4'), 1),'sapdata4',
    least(instr(df.file_name, 'SAPDATA5'), 1),'sapdata5',
    least(instr(df.file_name, 'SAPDATA6'), 1),'sapdata6',
    'unknown') dataset,
    sum(df.bytes)/1048576 TotalMb
    from dba_data_files df
    group by decode(1,
    least(instr(df.file_name, 'SAPDATA1'), 1),'sapdata1',
    least(instr(df.file_name, 'SAPDATA2'), 1),'sapdata2',
    least(instr(df.file_name, 'SAPDATA3'), 1),'sapdata3',
    least(instr(df.file_name, 'SAPDATA4'), 1),'sapdata4',
    least(instr(df.file_name, 'SAPDATA5'), 1),'sapdata5',
    least(instr(df.file_name, 'SAPDATA6'), 1),'sapdata6',
    'unknown')
    ) TotalMBSQL
    where FreeMBSQL.dataset = TotalMBSQL.dataset

    The output of this query looks something like:

    DATASET TOTALMB FREEMB USEDMB PCTUSED
    -------- --------- --------- --------- ---------
    sapdata1 4237 1467.95 2769.05 65.4
    sapdata2 2000 205.94 1794.06 89.7
    sapdata3 1200 160.1 1039.9 86.7
    sapdata4 2052.8 437.82 1614.98 78.7
    sapdata5 2923 1344.11 1578.89 54
    sapdata6 1975 703.84 1271.16 64.4

Using this information, plus your maximum data file size,
decide if you need to add more data files (if your tablespaces exceed
(maximum data file size)*(number of data files installed), you will have to
add data files).

At the end of this step, you should document the planned configuration of mirroring,
RAID configuration, data file location and size, and SAP directories.


Submitting the Proposal

back to top


Before going ahead and making any changes to any system, make sure that
everyone understands what is involved and agrees to it. For this end, a
formal proposal should be submitted to management. Downtime may affect
the company's productive schedule, so the proposal must include specific
dates of planned downtime for management approval. In order to get a better idea
of the necessary downtime, it may be necessary to run an export on the system
overnight, after shutting down SAP. If the system cannot be down for export testing,
then an online backup can be performed; using the backup tapes, the system can then
be restored to a test system, and the export procedure tested from the test system.

The proposal should include:

  • Specific dates of planned downtime
  • Minimum and maximum downtime estimates
  • Alternate plans in case of export/import errors or delays
  • Export/import strategy and procedure steps
  • Formal acceptance conditions, procedures, and documents. This may
    include, for example, specific reports or transactions to be run for
    verification after the import. Generally, as long as the SAP installation
    and the import execute without errors, there will be no
    discrepencies between the target system and the source system.

Only when the proposal is agreed upon and signed by management should
further action be taken.


Installing the Software on the Target System

back to top


When you install the software in the target system, note:

  • the target and source system must run the same SAP version during export/import
  • the target and source system need not run the same Oracle version, as long
    as the export (dump) file can be read by the target system's Oracle. For instance,
    Oracle 7.3 can import databases that were exported from Oracle 7.2, so
    importing a 7.2 database into a 7.3 target system is fine

Note that this the procedure described here is part of an overall
migration procedure to first install the SAP system and blank database using
the unchanged configuration of a new SAP system, then alter the
database configuration (to conform to the plan prepared
from the step Planning the Layout) in the step
Preparing the Target Database. An alternative is to alter the SAPfs.inf file,
which controls how SAP sets up the tablespaces and data files during installation, before
installing the SAP database server.

The procedure for software installation on the target server is:

  1. Make sure the operating system and any required patches or service packs are
    already installed and working
  2. Install the Oracle database software (using OraInst.exe), as described in the
    SAP installation manual
  3. Install R3inst.exe onto your computer from the SAP Kernel CD.
  4. (Installing the application server software)
    Run R3inst.exe (from the program menu, not the CD), select "New
    Server->Application Server" and continue to install the application server
    as described in the SAP manual
  5. If you want to change the default size of tablespaces, you can
    edit the SAPfs.inf. However, this step is not required, because we will
    later set tablespace data file sizes to be unlimited (only during import)
  6. (Installing the database server software) Run R3inst.exe again (from
    the program menu, not the CD)if it is not already running, and select
    "New Server->Database Server". When R3inst.exe prompts you to choose the
    items to import, check only "Create Database" and "Setup sapdba
    and brbackup". Do NOT check "Import Data".
    This will create the database, data files, and tablespaces. It will
    not create tables or import table data.


Preparing the Target Database

back to top


The actions taken in this section are:

  1. Activate rollback segments (this can also be done after the import)
  2. Turn off archive logging
  3. Add datafiles, if necessary
  4. Alter data file storage parameters, if necessary

Step 1 can optionally be done later, since the import will use the commit=y flag and
therefore will not write to the rollback segments.
Steps 3 and 4 are performed using the list (from the step Planning the Layout)
of tablespace and data file sizes and locations.

You can change the size of a data file by using the alter database command.
Since the import will probably require larger tablespaces and data files
for most tablespaces, it may be easier to first set all of your data files
to autoextend, and then manually change the storage parameters of particularly large
tablespaces. You can create an sqldba script to do this from SQL*Plus:


set linesize 40
select rpad('host echo autoextending ' ||tablespace_name, 40, '.'),
'alter database datafile "' || file_name ||
'" autoextend on next NEXT_SIZE maxsize MAX_DF_SIZE;'
from dba_data_files
where tablespace_name 'PSAPROLL' and tablespace_name 'SYSTEM'

This SQL statement outputs a list of commands, which can be run as a script
from sqldba. MAX_DF_SIZE is the maximum size of your data files (from the
Planning the Layout step), and NEXT_SIZE is the size of the next extent.
Note that, after generating the script, you will have edit it
and change all the double quotes (") to single quotes (') before sqldba can use it.


Cleaning Up, Checking, and Documenting the
Source Database

back to top


Cleaning up the database reduces the amount of data that needs to be exported/imported.
Checking the database is necessary to make sure that it is consistent before export.
Documenting of database and SAP logs is necessary in order to verify the results
of the export/import, and, in the case of differences between the source and target, to
distinguish whether the differences arose from the export/import, or from some other
factor.

Cleanup can be divided into two basic parts: database cleanup (the archiving and/or
deletion of records in db tables) and file cleanup (the archiving and/or deletion of files
on the server). Database cleanup should include regular maintenance from reports
RSBTCDEL, RSPO0041, RSBDCREO, RSSNAPDL, and RSBPSTDE, as well as archiving and deletion
of transport files, temporary files left over from reorgs or upgrades, etc. See
Cleaning the System for more info.

Database checks can be done from transaction DB02.

Document any warning or error entries in the system log (SM21) and
the database logs (located somewhere around the DVEBMGS/work directory).


Exporting the Database

back to top


Use Oracle's EXP program to export the database to a dump file. A sample use of export
would be to export the entire database to a file named d:\devexport.dmp. The
parameter file d:\devexp.par (text) would be:


userid=system/manager
buffer=131072
file=d:\devexport.dmp
compress=y
full=y
consistent=n

and the export would begin executing, while logging output (from stderr) to the
file d:\devexp.log, with
the command


exp parfile=d:\devexp.par 2>devexp.log


Some things to keep in mind are:

  • use EXP help=y for command-line help on EXP.
  • During export, SAP should not be running, in order to ensure a consistent
    database.
  • The size of the binary dump file will be about
    40-60% of the total size of the data files.
  • The compress parameter compresses table extents, and is therefore usually
    desirable.
  • Log files: a log file is essential
    for verifying a successful export and/or fixing problems during export or import.
    The export program let's you specify a logfile, or you can redirect
    output with 2> to capture the export program's screen output. Redirecting screen
    output generates much more useful information than using the logfile parameter.
  • Switch off the consistent parameter:
    If you have a consistent database that will not be modified throughout the
    export (usually the case), you can switch off consistency checking,
    which will save a lot of time.
  • Check the Oracle product documentation for more details on export/import.


Importing the Database

back to top


Use Oracle's IMP program to import the dump file. The IMP program can be run interactively, or using a parameter file. A first-time full import parameter file d:\devimp.par, for
importing a file devexport.dmp, might look like:


userid=system/manager
buffer=131072
ignore=y
commit=y
full=y
file=d:\devexport.dmp

The import would begin executing, while logging output (from stderr) to the
file d:\devimp.log, with the command


imp parfile=d:\devimp.par 2>devimp.log


If the import encounters errors, and some tables are not imported successfully,
a re-import is necessary. A re-import parameter file might look like:



userid=system/manager
buffer=131072
ignore=y
commit=y
full=n
file=F:\export.dmp
fromuser=SAPR3
tables=(TSKT4, TST01, TST03, VBAP)

This tells IMP to only import the specified tables (which belong to the user SAPR3,
as do all SAP tables). The 'ignore' parameter tells IMP whether to
skip a table if it already exists (ignore=N) or to import the table data regardless
of whether it exists already or not (ignore=Y). The 'commit' parameter tells IMP
not to roll back if an error occurs (commit=Y) while importing data. The data
that was already inserted into the table remains so. This may improve performance.

Some things to keep in mind are:

  • use IMP help=y to get command-line help for IMP.
  • Make sure that the target database's archive logging is turned off.
  • The import, if no errors are encountered, will take several hours. If
    errors occur, it may slow the import down considerably, so make sure to check
    the import every few hours.
  • Log files: Some versions of the IMP program produce logs that are practically useless if you use the logfile parameter. Use the redirect 2>
    to create a logfile.
  • Ignore parameter: if an import was stopped, you can use the ignore parameter
    to either re-import data (ignore=y), or to skip over tables that were already imported
    (ignore=n). If you use ignore=n, make sure to note any tables that were only partially
    imported, as these will have to be re-imported.
  • If your parameter file is incomplete for some reason, the
    IMP program might start and then just hang. And if it is working, the program
    may still hang for several seconds without doing anything. Check the CPU usage
    if you think it's hanging.
  • Check the Oracle product documentation for more details on export/import.


Post-Import Steps

back to top


After importing the database, a few other steps need to be done:

  1. Check the import log for errors, and handle any failed imports.
  2. Restore database settings, such as archive logging, tablespace storage
    parameters, and datafile storage parameters
  3. Run various database checks (DB02)
  4. Restore transport system control files and, if necessary, data files
  5. Check language environment(see Configuring the
    language environment
    )
  6. Edit the SAP start, instance, and default profiles, based on the start and instance
    profiles of the source system. First edit the files in the operating system, then
    use CCMS to import them into the database.
  7. Verify that additional application servers work properly
  8. Formal acceptance of target system: Perform all user acceptance testing
    as outlined in your acceptance documentation (see
    Submitting a Proposal to Management)
  9. Cleanup temporary files


Additional Notes:

back to top


This section describes some general troubleshooting and analysis methods:

  • Getting Grep, Awk, Diff
  • Deleting data from the database
  • Using grep to search the log files for regular expressions (patterns)
  • Using awk to manipulate text files and create scripts
  • Using diff to compare log files

Getting Grep, Awk, Diff


If you are using UNIX, you already can use grep, awk, and diff. Otherwise, you
can get the latest versions at http://www.simtel.net under the GNU Project (or

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/
or
ftp://ftp.tas.gov.au/gnu

Sample Script Creation Commands


These are some sample commands that can be used to create SQL scripts.
The command is run from SQLPlus and spooled into the script file.
Set the SQL*Plus buffer width to 40 first, to get line breaks at the right
place. Run the scripts with svrmgr or sqldba, such as

svrmgr23 @script.sql 2>logfile.log.

disable autoextend script:


select rpad('host echo autoextend off ' ||tablespace_name, 40, '.'),
'alter database datafile "' || file_name ||
'" autoextend OFF;'
from dba_data_files
where tablespace_name 'PSAPROLL' and tablespace_name 'SYSTEM'

The script that is generated needs to be further edited by adding the connect internal
command at the start, deleting superfluous output, and replacing double quotes
with single quotes.

drop tables script:


select rpad('host echo drop table ' ||table_name, 40, '.'),
'drop table ' || table_name || ';'
from user_tables

Deleting data from the database


To completely restart an import, the easiest way is to recreate the database by
starting R3INST and selecting only "Create Database" and "Link DB to sapdba/brbackup".

To delete tables, the fastest way is to use the TRUNCATE command, because it deletes
the tables immediately without using rollspace.

To re-import a table that already exists, set the IGNORE parameter to Y
when importing.

Using grep to search the log files for regular expressions (patterns)



Below is a list of some questions/problems and solutions when trying to print.

Question/Problem

Solution
Double-byte characters show up on the screen, but not when printed.

Create a new spool request, but don't print it. Check the output using the
DISPLAY function in SP01. Do the characters show up properly? If they do, it may be a
problem with SAPLPD or the device format. If not, SAPWIN or whatever device you are
using may be misconfigured to the wrong code page, or it could be a problem in the
SAPScript.

How do I change the codepage on a device?

Copy your DEVICE to ZDEVICE. Under the three listings for codepages, set the
new codepage in listing 1. Leave the other two codepages as 1134 or whatever
the codepage settings were for the original DEVICE.

How do I copy a device plus its other settings (like print controls)?

Go to SPAD->Device Print Control->Utilities->Copy Device Type. Don't use the
copy utility in SPAD->Output Devices, because it only copies basic info.

I used SPAD->Device Print Control->Utilities->Copy Device Type to copy a device,
now how do I delete it?

Go to SPAD->Device Print Control->Utilities->Delete. Don't use
SPAD->Output Devices, because it can't delete the device if it has related
data like print controls.

What do device formats (SPAD->Device Format) do?

They contain comands that are used to set features like font, font size,
character set, orientation, margins, and vertical/horizontal spacing. If you are using
SAPWIN, some common commands are:

  • \e%SAPWIN%: change to SAPWIN command set
  • \eWxxx;: change to character set xxx
  • \eFFONTNAME;: set to font FONTNAME
  • \ePP;: set to orientation P (Portrait)
  • \eSxxxX: set fontsize to zzz (where 200 = 10.0 pt, 240 = 12.0 pt)
  • \elx;: set vertical spacing to x lines per inch
  • \ecxx.y;: set horizontal spacing to xx.y (e.g. 12.0) chars per inch
  • \eMTxxx;: set top margin to xxx (where 567 = 1.0cm)
  • \eMLxxx;: set left margin to xxx (where 567 = 1.0cm)

I want to dial-in to an SAP system and print from my computer. How do I do it?

If you are using MS Windows, you need to remove ALL network devices except the
Dial-Up Adapter. Make sure that you can dial-in and log into the SAP system first.
The server must be able to know your machine's IP address by its NAME. The easiest
way to do this is to assign a static IP to the dial-up connection, and make sure that
an entry is added to the application server's HOSTS file with that IP address bound to
a host name (less than 8 characters long).
After you have connected, start up SAPLPD. Make SURE that the IP address listed in the SAPLPD
window is the same address as your dial-up adapter (from Win95/98, run winipcfg to see
your dial-up adapter settings).

If possible, after you have dialed in to the network, ask the administrator to execute
a
ping <hostname>
where <hostname> is the name of your computer AS
DEFINED IN THE AFOREMENTIONED HOSTS FILE, and make sure that the app server can ping your
dial-in machine successfully.

Configure a print device to use your computer as the SAPLPD host.
The easiest way to do this is to find a device that works on
some other computer running SAPLPD (on the LAN with the SAP server), copy all of its
settings to a new device (SPAD->Printing Devices->Change),
and change only the name of the host computer to the hostname
defined in the aforementioned hosts file.

I have other problems that are not listed here

Read the SAP R/3 Handbook. Check the SAP Notes database. Write to SAP. Write
me at khari_it@yahoo.co.in.


Below is a list of common questions/problems and solutions when transporting objects between
systems.

Question/Problem

Solution
The tp command doesn't work. It always shows some error which I don't understand.

Make sure the environment is set up properly. See
Troubleshooting Server Startup for details.

After releasing my change request, I can't find the transport files
in the transport directory.

Make sure you released the request, as well as the tasks under it (the request
is the part of the tree directly under the word "Transportable").
Check the
action logs using SE09 for errors. If there were no errors, try re-transporting
an object by changing it and creating a new request. Before releasing the task or
request, go to SE09 and list the request. If the request is listed under "Local",
it can NOT be transported to another system.

My change request is always local, but I want it to be transportable

The problem lies in either the workbench setup, the development class assigned
to the objects you wish to transport, or both. Check the workbench setup with
SE06->Display. Is your system set as a productive system? If so, change requests
usually are not transportable. Try creating a new development class Z000, and choose
any transport layer that the system allows you to choose (if your system does not allow
you to choose any transport layers, then the workbench is not set up to allow any
changes to be transportable). If it allows you to choose
several layers, create on new class for each layer, and a new change request for each
class. Then go to SE09 and check if your requests are transportable. If they are
transportable, try to release one of the development classes (release the task and
the request) and check that the files are created.

The system won't let me release a request because the the "target system is the same
as the source system."

Click on the request, hit Shift+F6 (Change), and change the target system to a
SID other than the source system. If your system won't let you change it to a SID that
works, you are either trying to transport from the wrong system, or you need to
redo your system landscape.

How do I redo the system landscape?

This should be done by a consultant during installation, and should not be changed
after installation. If you really want to do it yourself, release all locked objects,
log onto client 000 with DDIC, go to SE06, choose the landscape you want (usually
2- or 3-system group, and press Create. Tell the system which SIDs do which roles,
and the rest is set up automatically.

I want to import objects into a system other than the one for which the transport
files are targeted.

Use the override options. See the page on Transport
System
.
After using the override options, tp won't let me delete the request from the buffer.

Re-import the request, and then delete it from the buffer. If you cannot re-import
(because, for instance, it is a very old request, and you do not know if re-importing
will overwrite newer object), you can delete the entries directly from the file
/usr/sap/trans/buffer/SID. This of course is not a "real" solution, but it does work
(the "real" solution maybe would involve further editing of the E070, E071, or E070C
tables, but I don't know).

I have created local objects in both the target system and the source system.
Now I want to organize development and create objects only in the DEV system,
and allow no direct changes to the target system. What do I do about the objects
already created?

They need to be reassigned to a development class before they can be transported.
Create a development class (or use an existing one) and test to make sure its objects
can be exported and imported successfully.

How do I delete all the old change request/task clutter from my system.

If none of the tasks in the request have been released, the entire task/request
can be deleted. Before deletion, however, you should check to make sure that the
related objects are either changed back to the state they were in before the change
that resulted in their being linked to the change request.

The system says that I have to release all locked objects before I can perform a
certain task. How do I find out what objects are locked?

Look in the tables TLOCK, E070, E071, and E070C. Sometimes, data in these tables
can become orphaned, and may need to be processed manually (this is rarely necessary).

What do I do with all these transport files?

You can backup and delete old transport files every once in a while. Directories
to be backed up and deleted in the /usr/sap/trans directory include: data,
cofiles, log, olddata, EPS/out, EPS/log, and put/*. Note that SAP-delivered files
can be deleted without backup; this includes directories such as put/exe, put/tools,
and EPS/in.

I have other problems that are not listed here

Read the SAP R/3 Handbook. Check the SAP Notes database. Write to SAP. Write
me at khari_it@yahoo.com.


Read Whole Site there

http://abapcode.info

Topic Wise Content

blog content

May 2007
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  

Blog Stats

  • 550,558 hits