Powered By

Free XML Skins for Blogger

Powered by Blogger

Wednesday, February 3, 2010

SAP Basis FAQ

SAP Basis FAQ

Automatic CTS

Even though SAP does not recommend automatic imports, it is the most practical way of moving transports from a development system to a QA environment or to a special development system (although I wouldn't recommend auto imports to a production system for obvious reasons).

There are various methods for doing this. The most effective and simple method is using an OS script (shell/perl etc.) scheduled using cron for user sidadm. There are a couple of steps you need to take before setting up automatic imports.

  1. Your entire project team should agree upon the overall strategy, frequency of imports etc.
  2. Resolve any issues with transport approvals (many shops don't care about traffic between DEV and QA)
  3. Who is responsible for watching for errors and corrective actions (an email to the developer works in this case)

Configuring outbound SAP to Internet mail Gateway (R/3 4.0 and above)

Step 1 (UNIX SETUP)
Logon to your as sidadm
Change directory to /sapmnt/SID/global (or any directory globally available across all application servers)
Create the following entries in file SAP_EMAIL_GATEWAY.sh and save the file
#!/bin/sh
GWCONFIG=/sapmnt/SID/global/SAP_EMAIL_GATEWAY.cfg
export GWCONFIG
/sapmnt/SID/exe/mlunxsnd $*
Execute the command: mlosmadm SAP_EMAIL_GATEWAY.cfg (enter the following information)
System name : SID
Client : 200
Username : MAILADM
Password : initpass
Language : E
Loadbalancing : Y
Message Server :
Group name : LOGON GROUP1
Using SAPROUTER : N
Trace Level (inBoound) : 0
Sendmail Command :
Codepage :
Trace Level (Outbound) : 0
Update file : Y
Step 2 (SAP SETUP)

Logon to SAPSYSTEM (SID) via SAPGUI
Transaction SU01, create user MAILADM and password initpass, usertype CPIC
Transaction SM59, Click Create

RFC Destination : SAP 4.5 INTERNET MAIL GATEWAY
Connection Type : T
Description : INTERNET EMAIL GATEWAY
Hit RETURN
Click EXPLICIT HOST
Enter /sapmnt/P21/global/ SAP_EMAIL_GATEWAY.sh
Save your entries
Transaction SCOT, click Edit--> CREATE NODES
Node : EMAIL
Description : SAP CONNECT NODE FOR EMAIL (continue)
RFC DESTINATION: (choose SAP 4.5 INTERNET MAIL GATEWAY from the pull down menu)
Choose radio button Internet
Address area : *DOMAIN (your intranet domain)
Ccontinue
Format : DOC, DAT, R3F, TXT, RAW,PPT,XLS (continue)
Continue
Set further address types : N
Minimum waiting : 5 minutes
Check both Node is in use', Node can resolve path references
Continue
Choose Goto--> Schedule Background Job
Enter name for the job & save

Configuring outbound SAP to Internet mail Gateway (Upto R/3 3.1I)

SAP can be configured to send and receive emails from different sources. This section explains how to integrate SAPOffice with an external email system. This is in no way supplementing the online documentation available on the online documentation CD supplied by SAP but simplyfies the process to the bare Internet email must be configured and running prior to this. Email from SAP is forwarded to the users external email client such as Eudora, Outlook etc.

You can configure inbound and outbound forwarding. Outbound flow forwards a SAP message (eg:update termination) via UNIX sendmail to the intended recepient. Inbound accepts a message from sendmail and places it in the users SAPOffice inbox. Many SAP shops prefer to configure outbound only.

Configuring outbound forwarding

SAP configuration
  1. Create your RFC destination for outbound email using transaction SM59
RFC Destination         :  SAP_INTERNET_GATEWAY

Connection Type : T

Description : SAP internet mail gateway

Click on 'Explicit Host' if you want on demand gateway dameon invocation.

Program : /sapmnt/SID/exe/mlunxsnd

Target Host : Enter hostname that runs your central instance.

Click 'Test Connection' and you should see a successfull message.
  1. Choose menu Tools-->Administration-->Management-->Process Technology-->Office-->Office Settings
  2. Click Internet Gateway
Gateway Destination             : SAP_INTERNET_GATEWAY

Path for configuration file : /sapmnt/SID/exe/sap_mailSID.cfg

Return Address : .com
  1. Click Internet Settings and fill in the following fields
  2. Save the settings
  3. Click Back
  4. Choose menu Office-->Addresses-->Communication Types
  5. Type in INT over the Comm. type and Internet Mail over description.
  6. . Check Maintain and Send checkboxes and Save your entries.
  7. UNIX configuration

  8. . cd /sapmnt/SID/exe

  9. .mlosadm sap_mailSID.cfg

    Client 000

    Username : MAILADM

    Password : MAILADM

    Language : E

    System name : SID

    System number :

    Hostname :

    Gateway hostname:

    Gateway server sapgw

    Sendmail Command :

    Update file : Y
Testing
  1. Logon to SAP
  2. Execute transaction SO01
  3. Write a message and send it to
  4. If you don't see the mail in your internet mailbox, go back and review steps 1-12

FTP from ABAP

There are 2 ways of executing FTP from an ABAP (online or batch mode),



Initiated from the operating system. A script is available in the utility repository that explains how to do this very easily.

Initiated from the ABAP itself An example is given below.
  1. Create a logical OS command 'zftp' using transaction SM69. Make sure that you enable 'comand line parameter allowed' checkbox
  2. Create a shell script called 'zftp' with the following lines
RMTHOST=`echo $2 | tr '[A-Z]' '[a-z]'`

ftp -v $RMTHOST <<> /out/zftp.$$ 2>&1

lcd /out

put $1

bye

EOF
  1. Use the SXPG_COMMAND_EXECUTE function module to call this script (zftp) with the filename you want to transfer as the parameter. Eg:
call function 'SXPG_COMMAND_EXECUTE'

exporting

commandname =

tables

exec_protocol =

exceptions

no_permission = 1

command_not_found = 2

parameters_too_long = 3

...

Enable web based online documentaion (R/3 4.0 or above)

  1. Install Netscape webserver or use an existing web server (requires administrators privelege)
  2. Create a directory called SAPDOCS4 under your web server document root.
  3. Mount the CDROM containing online documentation on your PC or your UNIX server.
  4. Recursively copy all files under /cdrom/docs/ to the SAPDOC4 directory under the web server root.
  5. Create the following entries in your /usr/sap/SID/SYS/profile/DEFAULT.PFL
eu/iwb/installed_languages = EN
eu/iwb/help_type=2
eu/iwb/server_win32=webserver.domain.com
eu/iwb/path_win32=saphelp/helpdata
  1. Restart your SAP system

How to access an external database from ABAP via DBLINK (ORACLE)

  1. Using transaction SE11, create a table (ZTABLE) with the same fields as the table in the external database, make sure that the type and lengths of the fields are identical.
  2. Using transaction SE11, create a view (ZTABLE_VIEW, projection view) using BASIS table ZTABLE
  3. Using SVRMGRL>
create dblink REMOTE_DB as connect to remote_user identified by password; (database link created)
drop table ZTABLE; (table dropped)
create synonym ZTABLE for ZTABLE@REMOTE_DB; (synonym created)
  1. Using transaction SE16 , type in ZTABLE_VIEW and hit RETURN
  2. Enter value in key fields and hit execute. (displays rows from the remote table)

Tips and Tricks

  1. To see the complete text of an error/warning message on the SAPGUI status bar, right click on the message and drag left.
  2. To prevent your spool requests getting deleted from the BASIS cleanup jobs, you need to uncheck the Delete after print checkbox in the print control screen, execute transaction SP01, find your spool#, click on Attributes and change the Delete After date
  3. Short cuts using the OK-code box.
  1. Use transaction AL11 to browse the application servers directory structure.

No comments: