Algorithms in ABAP

Hello folks,
I'm looking for material (books or anything) describing the developement of effective algorithms in ABAP, and the measurement of the performance of the used concepts. I'm thinking about the possibility to write my Bachelor Thesis about an SAP related topic, and so I've began to sift through the material available.
Your hints are pretty welcome.
Thanks & regards
Gerd

Hi,
Here are some ABAP code performance tips:
For all entries
The for all entries creates a where clause, where all the entries in the driver table are combined with OR. If the number of entries in the driver table is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit the length of the WHERE clause.
The plus
•     Large amount of data
•     Mixing processing and reading of data
•     Fast internal reprocessing of data
•     Fast
The Minus
•     Difficult to program/understand
•     Memory could be critical (use FREE or PACKAGE size)
Some steps that might make FOR ALL ENTRIES more efficient:
•     Removing duplicates from the driver table
•     Sorting the driver table 
•     If possible, convert the data in the driver table to ranges so a BETWEEN statement is used instead of and OR statement:
               FOR ALL ENTRIES IN i_tab
                  WHERE mykey >= i_tab-low and
             mykey <= i_tab-high.
Nested selects
The plus:
•     Small amount of data
•     Mixing processing and reading of data
•     Easy to code - and understand
The minus:
•     Large amount of data
•     when mixed processing isn’t needed
•     Performance killer no. 1
Select using JOINS
The plus
•     Very large amount of data
•     Similar to Nested selects - when the accesses are planned by the programmer
•     In some cases the fastest
•     Not so memory critical
The minus
•     Very difficult to program/understand
•     Mixing processing and reading of data not possible
Use the selection criteria
SELECT * FROM SBOOK.                   
  CHECK: SBOOK-CARRID = 'LH' AND       
                  SBOOK-CONNID = '0400'.        
ENDSELECT.                             
SELECT * FROM SBOOK                     
  WHERE CARRID = 'LH' AND               
        CONNID = '0400'.                
ENDSELECT.                              
Use the aggregated functions
C4A = '000'.              
SELECT * FROM T100        
  WHERE SPRSL = 'D' AND   
        ARBGB = '00'.     
  CHECK: T100-MSGNR > C4A.
  C4A = T100-MSGNR.       
ENDSELECT.                
SELECT MAX( MSGNR ) FROM T100 INTO C4A 
WHERE SPRSL = 'D' AND                
       ARBGB = '00'.                  
Select with view
SELECT * FROM DD01L                    
  WHERE DOMNAME LIKE 'CHAR%'           
        AND AS4LOCAL = 'A'.            
  SELECT SINGLE * FROM DD01T           
    WHERE   DOMNAME    = DD01L-DOMNAME 
        AND AS4LOCAL   = 'A'           
        AND AS4VERS    = DD01L-AS4VERS 
        AND DDLANGUAGE = SY-LANGU.     
ENDSELECT.                             
SELECT * FROM DD01V                    
WHERE DOMNAME LIKE 'CHAR%'           
       AND DDLANGUAGE = SY-LANGU.     
ENDSELECT.                             
Select with index support
SELECT * FROM T100            
WHERE     ARBGB = '00'      
       AND MSGNR = '999'.    
ENDSELECT.                    
SELECT * FROM T002.             
  SELECT * FROM T100            
    WHERE     SPRSL = T002-SPRAS
          AND ARBGB = '00'      
          AND MSGNR = '999'.    
  ENDSELECT.                    
ENDSELECT.                      
Select … Into table
REFRESH X006.                 
SELECT * FROM T006 INTO X006. 
  APPEND X006.                
ENDSELECT
SELECT * FROM T006 INTO TABLE X006.
Select with selection list
SELECT * FROM DD01L              
  WHERE DOMNAME LIKE 'CHAR%'     
        AND AS4LOCAL = 'A'.      
ENDSELECT
SELECT DOMNAME FROM DD01L    
INTO DD01L-DOMNAME         
WHERE DOMNAME LIKE 'CHAR%' 
       AND AS4LOCAL = 'A'.  
ENDSELECT
Key access to multiple lines
LOOP AT TAB.          
CHECK TAB-K = KVAL. 
ENDLOOP.              
LOOP AT TAB WHERE K = KVAL.     
ENDLOOP.                        
Copying internal tables
REFRESH TAB_DEST.              
LOOP AT TAB_SRC INTO TAB_DEST. 
  APPEND TAB_DEST.             
ENDLOOP.                       
TAB_DEST[] = TAB_SRC[].
Modifying a set of lines
LOOP AT TAB.             
  IF TAB-FLAG IS INITIAL.
    TAB-FLAG = 'X'.      
  ENDIF.                 
  MODIFY TAB.            
ENDLOOP.                 
TAB-FLAG = 'X'.                  
MODIFY TAB TRANSPORTING FLAG     
           WHERE FLAG IS INITIAL.
Deleting a sequence of lines
DO 101 TIMES.               
  DELETE TAB_DEST INDEX 450.
ENDDO.                      
DELETE TAB_DEST FROM 450 TO 550.
Linear search vs. binary
READ TABLE TAB WITH KEY K = 'X'.
READ TABLE TAB WITH KEY K = 'X' BINARY SEARCH.
Comparison of internal tables
DESCRIBE TABLE: TAB1 LINES L1,      
                TAB2 LINES L2.      
IF L1 <> L2.                        
  TAB_DIFFERENT = 'X'.              
ELSE.                               
  TAB_DIFFERENT = SPACE.            
LOOP
AT TAB1.                     
    READ TABLE TAB2 INDEX SY-TABIX. 
    IF TAB1 <> TAB2.                
      TAB_DIFFERENT = 'X'. EXIT.    
    ENDIF.                          
  ENDLOOP.                          
ENDIF.                              
IF TAB_DIFFERENT = SPACE.           
ENDIF.                              
IF TAB1[] = TAB2[].  
ENDIF.               
Modify selected components
LOOP AT TAB.           
TAB-DATE = SY-DATUM. 
MODIFY TAB.          
ENDLOOP.               
WA-DATE = SY-DATUM.                    
LOOP AT TAB.                           
MODIFY TAB FROM WA TRANSPORTING DATE.
ENDLOOP.                               
Appending two internal tables
LOOP AT TAB_SRC.              
  APPEND TAB_SRC TO TAB_DEST. 
ENDLOOP
APPEND LINES OF TAB_SRC TO TAB_DEST.
Deleting a set of lines
LOOP AT TAB_DEST WHERE K = KVAL. 
  DELETE TAB_DEST.               
ENDLOOP
DELETE TAB_DEST WHERE K = KVAL.
Tools available in SAP to pin-point a performance problem
•                The runtime analysis (SE30)
•                SQL Trace (ST05)
•                Tips and Tricks tool
•                The performance database
Optimizing the load of the database
Using table buffering
Using buffered tables improves the performance considerably. Note that in some cases a statement can not be used with a buffered table, so when using these statements the buffer will be bypassed. These statements are:
•     Select DISTINCT
•     ORDER BY / GROUP BY / HAVING clause
•     Any WHERE clause that contains a sub query or IS NULL expression
•     JOIN s
•     A SELECT... FOR UPDATE
If you wan t to explicitly bypass the buffer, use the BYPASS BUFFER addition to the SELECT clause.
Use the ABAP SORT Clause Instead of ORDER BY
The ORDER BY clause is executed on the database server while the ABAP SORT statement is executed on the application server. The database server will usually be the bottleneck, so sometimes it is better to move the sort from the database server to the application server.
If you are not sorting by the primary key ( E.g. using the ORDER BY PRIMARY key statement) but are sorting by another key, it could be better to use the ABAP SORT statement to sort the data in an internal table. Note however that for very large result sets it might not be a feasible solution and you would want to let the database server sort it.
Avoid the SELECT DISTINCT Statement
As with the ORDER BY clause it could be better to avoid using SELECT DISTINCT, if some of the fields are not part of an index. Instead use ABAP SORT + DELETE ADJACENT DUPLICATES on an internal table, to delete duplicate rows.
Sreedhar

Similar Messages

  • Milestone billing to one delivery

    Hello,
    I've got following problem.
    To an SD-order position there is only one delivery, which should be billed within more invoices.
    These values should come into the COPA through the invoice - recort type F.
    So with the first invoice, also the costs from the delivery should be transfered into the CO-PA, but with the other invoices, only the revenues should be transfered into the CO-PA.
    The problem is, that for some materials the costs for the delivery are transfered with each invoice, so we have to much costs within the CO-PA.
    Do you know the customizing for this, please?
    Thanks a lot
    Regards
    Peter
    PS: I've noticed thath it works right for SD-order position to an material with Standard price in price control and it doesn't work right for material with Moving average price.
    Edited by: Peter Jankech on Apr 24, 2009 1:03 PM

    Hi,
    Create a new condition, an statistical condition. With a VOFM formula, you can obtain the amount, you can define the algorithm with ABAP. Check this link to understand the tool and steps: http://saptechsolutions.com/pdf/InsideVOFM.pdf
    I hope this helps you
    Regards,
    Eduardo

  • Get fuctional location from cost center

    Hi,
    I need help to write this algorithm in ABAP
    1) cost center value is given to CC variable
    2) get Fuctional location value according to the diven Cost center
    3) return 'Yes' if this fuctional location is Active, else return NO
    Thx,

    You can start by asking your functional consultant on which master data screen the relationship exists.
    Rob

  • How can i remove particular articles in the idoc before generation of idoc

    Hi ,
    How can i acheive the below screnaios.
    Need to know the feasibility  of the following  while  creating  WP_PLU idoc  using  WPMU ; do we have any  BADI or exit to achieve the following  requirement.
    Scenario 1:
    Based on a switch from a Ztable we donu2019t want  include few articles in the  IDOC.
    Example :  For article   1000  I keep an entry  in  the Ztable that send to store = Fales 
    Then  article shouldnu2019t be included in the IDOC
    Scenario 2:
    Based on a count kept in the Ztable  we restrict the number of  articles   included in the  IDOC.
    Example :  In the  in the Ztable we keep a count of 4000 articles  then  we limit the number of articles in the IDOC as 4000.
    Optionally can the following also possible in the same scenario ?
    Exit the process  of creating  idocs  and  abort the process of updating the change pointer tables )
    (Means  when we reach 4000 articles we stop creating  the IDOCS also stop updating the change pointer tables so that next day when
    WPMU runs  these unprocessed change pointers will get picket again)
    Regards
    SriHari
    Edited by: srihari haranandan on May 23, 2011 12:28 PM

    Hi SriHari,
    Surely you know them, but I suggest you to read them:
    Note 519685 - Conversion of procedure for work list creation
    Note 173587 - Settings for the pricing worklist
    Note 858555 - WP_PLU IDocs become too large
    Other way, is to set a new customer function module (ie: Z_*) for this IDOC using the actual as a template, where you can write your own algorithm with ABAP.
    I hope this helps you
    Regards.
    Eduardo

  • HMAC implementation

    I would like to ask, if somebody already implemented HMAC algorithm with ABAP.
    (http://tools.ietf.org/html/rfc2104#section-3). I need to calculate the HMAC-SHA1 hash code for authentification purposes.
    thanks,
    martin

    My solution of HMAC implementation:
    FUNCTION Z_CALCULATE_HMAC .
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(IV_HASH_ALG) TYPE  HASHALG
    *"     REFERENCE(IV_MESSAGE) TYPE  XSTRING
    *"     REFERENCE(IV_KEY) TYPE  XSTRING
    *"  EXPORTING
    *"     REFERENCE(EV_HASH) TYPE  HASH160
    * H(K XOR opad, H(K XOR ipad, text))
    * B = 64 bytes
      DATA: ipad_x TYPE xstring,
            opad_x TYPE xstring,
            key_x  TYPE xstring,
            x1     TYPE x,
            x2     TYPE x,
            x3     TYPE x,
            length_key     TYPE i,
            chars_appended TYPE i,
            xor1           TYPE xstring,
            xor2           TYPE xstring,
            ev_hash_x      TYPE hash160x.
    * -- index 0. - ipad, opad
    * ipad = the byte 0x36 repeated B times
    * opad = the byte 0x5C repeated B times.
      x1 = '36'.
      x2 = '5C'.
      x3 = '00'.
      DO 64 TIMES.
        CONCATENATE ipad_x x1  INTO ipad_x IN BYTE MODE.
        CONCATENATE opad_x x2  INTO opad_x IN BYTE MODE.
      ENDDO.
    * -- index 1. - extend key to 64 bytes
    * append zeros to the end of K to create a B byte string
    * (e.g., if K is of length 20 bytes and B=64, then K will be appended with 44 zero bytes 0x00)
    * KEY is already sended in HEX format
      key_x = iv_key.
      length_key = XSTRLEN( key_x ).
      chars_appended = 64 - length_key.
      IF chars_appended > 0 .
        DO chars_appended TIMES.
          CONCATENATE  key_x x3 INTO key_x IN BYTE MODE.
        ENDDO.
      ENDIF.
    * -- index 2. - first calculation = Key XOR ipad
    * XOR (bitwise exclusive-OR) the B byte string computed in step (1) with ipad
      xor1 = key_x BIT-XOR ipad_x.
    * -- index 3.
    * append the stream of data 'text' to the B byte string resulting from step (2)
    * message is sended already in HEX format
    *  iv_message_x = iv_message.
      CONCATENATE xor1 iv_message INTO xor1 IN BYTE MODE.
    * -- index 4.
    * apply H to the stream generated in step (3)
      CALL FUNCTION 'CALCULATE_HASH_FOR_RAW'
        EXPORTING
          alg  = iv_hash_alg
          data = xor1
    *      length = 20
        IMPORTING
          hashx = ev_hash_x.
    * -- index 5.
    * XOR (bitwise exclusive-OR) the B byte string computed in step (1) with opad
      xor2 = key_x BIT-XOR opad_x.
    * -- index 6.
    * append the H result from step (4) to the B byte string resulting from step (5)
    *  iv_message_x = ev_hash_x.
      CONCATENATE xor2 ev_hash_x INTO xor2 IN BYTE MODE.
    * -- index 7.
    * apply H to the stream generated in step (6) and output the result
      CALL FUNCTION 'CALCULATE_HASH_FOR_RAW'
        EXPORTING
          alg  = iv_hash_alg
          data = xor2
        IMPORTING
          hash = ev_hash.
    ENDFUNCTION.
    Usage:
    CALL FUNCTION 'Z_TFM_CALCULATE_HMAC'
      EXPORTING
        iv_hash_alg       = 'SHA1'
        iv_message        = '4D415254494E' "MARTIN
        iv_key            = '42524154'      "BRAT
    IMPORTING
       EV_HASH           = LV_HASH          .
    regards,
    martin

  • Error while installing J2EE Add- In to the ABAP system

    Error while installing J2EE Add-In to the ABAP system 
    We are installing J2EE Add-In to the ECC5 System in the new hardware.
    When are getting Error while installing J2EE Add-In to the ABAP system.
    Transaction Begin*****************************
    ERROR 2005-08-10 14:58:28
    CJSlibModule::writeLogEntry()
    CJS-20011 J2EE engine configuration error. DIAGNOSIS: Error when
    configuring J2EE Engine. See output of
    logfile /usr/sap/QSS/install/batchconfig.log: 'My Library Path
    is: /usr/j2se/jre/lib/sparcv9/server:/usr/j2se/jre/lib/sparcv9:/usr/j2se/jre/../lib/sparcv9:/tmp/sapinst_exe.13084.1123702275:/usr/lib::/usr/openwin/lib:/usr/sap/QSS/SYS/exe/run:/oracle/QSS/920_64/lib:/oracle/QSS/920_64/lib32:/usr/lib
    ElementInfoTask has finished successfully on dispatcher
    ConsoleLogsTask has finished successfully on dispatcher
    ChangeManagerPropsTask has finished successfully. Manager:
    LockingManager on dispatcher
    ChangeManagerPropsTask has finished successfully. Manager:
    ClusterManager on dispatcher
    ElementInfoTask has finished successfully on server
    ConsoleLogsTask has finished successfully on server
    ChangeManagerPropsTask has finished successfully. Manager:
    LockingManager on server
    ChangeManagerPropsTask has finished successfully. Manager:
    ClusterManager on server
    ChangeServicePropsTask has finished successfully. Service: dbpool on
    server
    ChangePasswordsTask finished successfully.
    Error occured while connecting to database (UploadFile). Msg: No such
    algorithm: DESede
    Transaction end***********************************
    We tried twice clean installation, after removing j2ee dir, SCS and
    resp profiles and droping PSAPQSSDB tablespace and SAPQSSDB user.
    I have also confirmed the passwords in ABAP system/000 for SAPJSF, DDIC, J2EE_ADMIN, J2EE_GUEST.
    We are getting the same error in both tries.
    Kindly advice us to resolve the problem.
    Thanks and Regards,
    Srinivas

    Ananda,
    you saved my day!  I've been banging my head against the wall with this same problem during a J2EE add-in installation for SRM 4.0 on Windows, in preparation of an LAC 2.0 installation.  I had tried deleting the schema first, but that didn't work.  After I removed the sys\global\security folder as well, it worked perfectly.
    Thank you.

  • Error during Homogenous System copy of ABAP+JAVA stack

    Hi All,
    I'm trying to do a homogeneous system copy of an XI system NW04s on Windows 2k3 and Oracle database to another windows 2k3 machine. SCS and Database went on fine but during CI installation on the target system I'm stuck at "Run ABAP Reports" phase.
    I'm getting an error:
    MUT-03025 Caught ERfcExcept in Modulecall: Exception condition "WRITE_FAILED" raised..
    runRADDBDIF was executed with status ERROR
    The ABAP stack is however up and when I login to 000 client using DDIC user and try to execute the report RADDBDIF, I get a runtime error RAISE_EXCEPTION with Exception condition "WRITE_FAILED" raised.
    A RAISE statement in the program "SAPLSUGI" raised the exception condition "WRITE_FAILED".
    If anyone has encountered similar problem, kindly help me.
    Regards,
    Sameer

    Hi Juan,
    I've already checked dev_disp and dev_ms but didn't find any errors. However, I got some errors in dev_w0. I'm pasting the same for your reference.
    trc file: "dev_w0", trc level: 1, release: "700"
    ACTIVE TRACE LEVEL           1
    ACTIVE TRACE COMPONENTS      all, MJ

    B Mon Jan 07 18:45:15 2008
    B  create_con (con_name=R/3)
    B  Loading DB library 'F:\usr\sap\COP\DVEBMGS04\exe\dboraslib.dll' ...
    B  Library 'F:\usr\sap\COP\DVEBMGS04\exe\dboraslib.dll' loaded
    B  Version of 'F:\usr\sap\COP\DVEBMGS04\exe\dboraslib.dll' is "700.08", patchlevel (0.107)
    B  New connection 0 created
    M sysno      04
    M sid        COP
    M systemid   560 (PC with Windows NT)
    M relno      7000
    M patchlevel 0
    M patchno    111
    M intno      20050900
    M make:      multithreaded, Unicode, optimized
    M pid        2148
    M
    M  kernel runs with dp version 229000(ext=109000) (@(#) DPLIB-INT-VERSION-229000-UC)
    M  length of sys_adm_ext is 576 bytes
    M  ***LOG Q0Q=> tskh_init, WPStart (Workproc 0 2148) [dpxxdisp.c   1301]
    I  MtxInit: 30000 0 0
    M  DpSysAdmExtCreate: ABAP is active
    M  DpSysAdmExtCreate: VMC (JAVA VM in WP) is not active

    M Mon Jan 07 18:45:16 2008
    M  DpShMCreate: sizeof(wp_adm)          10056     (1436)
    M  DpShMCreate: sizeof(tm_adm)          4232256     (21056)
    M  DpShMCreate: sizeof(wp_ca_adm)          24000     (80)
    M  DpShMCreate: sizeof(appc_ca_adm)     8000     (80)
    M  DpCommTableSize: max/headSize/ftSize/tableSize=500/8/528056/528064
    M  DpShMCreate: sizeof(comm_adm)          528064     (1048)
    M  DpSlockTableSize: max/headSize/ftSize/fiSize/tableSize=0/0/0/0/0
    M  DpShMCreate: sizeof(slock_adm)          0     (96)
    M  DpFileTableSize: max/headSize/ftSize/tableSize=0/0/0/0
    M  DpShMCreate: sizeof(file_adm)          0     (72)
    M  DpShMCreate: sizeof(vmc_adm)          0     (1536)
    M  DpShMCreate: sizeof(wall_adm)          (38456/34360/64/184)
    M  DpShMCreate: sizeof(gw_adm)     48
    M  DpShMCreate: SHM_DP_ADM_KEY          (addr: 05EC0040, size: 4883696)
    M  DpShMCreate: allocated sys_adm at 05EC0040
    M  DpShMCreate: allocated wp_adm at 05EC2090
    M  DpShMCreate: allocated tm_adm_list at 05EC47D8
    M  DpShMCreate: allocated tm_adm at 05EC4808
    M  DpShMCreate: allocated wp_ca_adm at 062CDC48
    M  DpShMCreate: allocated appc_ca_adm at 062D3A08
    M  DpShMCreate: allocated comm_adm at 062D5948
    M  DpShMCreate: system runs without slock table
    M  DpShMCreate: system runs without file table
    M  DpShMCreate: allocated vmc_adm_list at 06356808
    M  DpShMCreate: allocated gw_adm at 06356848
    M  DpShMCreate: system runs without vmc_adm
    M  DpShMCreate: allocated ca_info at 06356878
    M  DpShMCreate: allocated wall_adm at 06356880
    X  EmInit: MmSetImplementation( 2 ).
    X  MM global diagnostic options set: 0
    X  <ES> client 0 initializing ....
    X  Using implementation view
    X  <EsNT> Using memory model view.
    M  <EsNT> Memory Reset disabled as NT default
    X  ES initialized.
    M  ThInit: running on host hydhtc24738
    M  calling db_connect ...
    C  Prepending F:\usr\sap\COP\DVEBMGS04\exe to Path.

    C Mon Jan 07 18:45:18 2008
    C  Oracle Client Version: '10.2.0.1.0'
    C  Client NLS settings: AMERICAN_AMERICA.UTF8
    C  Logon as OPS$-user to get SAPSR3's password
    C  Connecting as /@COP on connection 0 (nls_hdl 0) ... (dbsl 700 250407)
    C  Nls CharacterSet                 NationalCharSet              C      EnvHp      ErrHp ErrHpBatch
    C    0 UTF8                                                      1   0649D5C8   064A2B64   064A23EC
    C  Attaching to DB Server COP (con_hdl=0,svchp=064A2338,srvhp=064B3F34)
    C  Starting user session (con_hdl=0,svchp=064A2338,srvhp=064B3F34,usrhp=064FFA98)
    C  Now '/@COP' is connected (con_hdl 0, nls_hdl 0).
    C  Got SAPSR3's password from OPS$-user
    C  Disconnecting from connection 0 ...
    C  Closing user session (con_hdl=0,svchp=064A2338,usrhp=064FFA98)
    C  Now I'm disconnected from ORACLE
    C  Connecting as SAPSR3/<pwd>@COP on connection 0 (nls_hdl 0) ... (dbsl 700 250407)
    C  Nls CharacterSet                 NationalCharSet              C      EnvHp      ErrHp ErrHpBatch
    C    0 UTF8                                                      1   0649D5C8   064A2B64   064A23EC
    C  Starting user session (con_hdl=0,svchp=064A2338,srvhp=064B3F34,usrhp=064FFA98)
    C  Now 'SAPSR3/<pwd>@COP' is connected (con_hdl 0, nls_hdl 0).
    C  Database NLS settings: AMERICAN_AMERICA.UTF8
    C  DB instance COP is running on HYDHTC24738 with ORACLE version 10.2.0.1.0 since JAN 07, 2008, 15:34:24
    B  Connection 0 opened (DBSL handle 0)
    B  Wp  Hdl ConName          ConId     ConState     TX  PRM RCT TIM MAX OPT Date     Time   DBHost         
    B  000 000 R/3              000000000 ACTIVE       NO  YES NO  000 255 255 20080107 184516 HYDHTC24738    
    M  db_connect o.k.
    M  ICT: exclude compression: .zip,.cs,.rar,.arj,.z,.gz,.tar,.lzh,.cab,.hqx,.ace,.jar,.ear,.war,.css,.pdf,.js,.gzip,.uue,.bz2,.iso,.sda,.sar,.gif

    I Mon Jan 07 18:45:22 2008
    I  MtxInit: 0 0 0
    M  SHM_PRES_BUF               (addr: 0AB50040, size: 4400000)
    M  SHM_ROLL_AREA          (addr: 788A0040, size: 61440000)
    M  SHM_PAGING_AREA          (addr: 0AF90040, size: 32768000)
    M  SHM_ROLL_ADM               (addr: 0CEE0040, size: 615040)
    M  SHM_PAGING_ADM          (addr: 0CF80040, size: 525344)
    M  ThCreateNoBuffer          allocated 544152 bytes for 1000 entries at 0D010040
    M  ThCreateNoBuffer          index size: 3000 elems
    M  ThCreateVBAdm          allocated 12160 bytes (50 server) at 0D0A0040
    X  EmInit: MmSetImplementation( 2 ).
    X  MM global diagnostic options set: 0
    X  <ES> client 0 initializing ....
    X  Using implementation view
    X  ES initialized.
    B  db_con_shm_ini:  WP_ID = 0, WP_CNT = 7, CON_ID = -1
    B  dbtbxbuf: Buffer TABL  (addr: 10CD00C8, size: 30000000, end: 1296C448)
    B  dbtbxbuf: Buffer TABLP (addr: 129700C8, size: 10240000, end: 133340C8)
    B  dbexpbuf: Buffer EIBUF (addr: 133400D0, size: 4194304, end: 137400D0)
    B  dbexpbuf: Buffer ESM   (addr: 137500D0, size: 4194304, end: 13B500D0)
    B  dbexpbuf: Buffer CUA   (addr: 13B600D0, size: 3072000, end: 13E4E0D0)
    B  dbexpbuf: Buffer OTR   (addr: 13E500D0, size: 4194304, end: 142500D0)

    M Mon Jan 07 18:45:23 2008
    M  CCMS: AlInitGlobals : alert/use_sema_lock = TRUE.

    S Mon Jan 07 18:45:26 2008
    S  *** init spool environment
    S  initialize debug system
    T  Stack direction is downwards.
    T  debug control: prepare exclude for printer trace
    T  new memory block 1965E820

    S Mon Jan 07 18:45:27 2008
    S  spool kernel/ddic check: Ok
    S  using table TSP02FX for frontend printing
    S  1 spool work process(es) found
    S  frontend print via spool service enabled
    S  printer list size is 150
    S  printer type list size is 50
    S  queue size (profile)   = 300
    S  hostspool list size = 3000
    S  option list size is 30
    S      found processing queue enabled
    S  found spool memory service RSPO-RCLOCKS at 1D8C00A8
    S  doing lock recovery
    S  setting server cache root
    S  found spool memory service RSPO-SERVERCACHE at 1D8C02B0
    S    using messages for server info
    S  size of spec char cache entry: 297028 bytes (timeout 100 sec)
    S  size of open spool request entry: 2236 bytes
    S  immediate print option for implicitely closed spool requests is disabled

    A  -PXA--
    A  PXA INITIALIZATION
    A  System page size: 4kb, total admin_size: 4888kb, dir_size: 4856kb.
    A  Attached to PXA (address 688A0040, size 150000K)
    A  abap/pxa = shared protect gen_remote
    A  PXA INITIALIZATION FINISHED
    A  -PXA--

    A  ABAP ShmAdm attached (addr=57A1C000 leng=20955136 end=58E18000)
    A  >> Shm MMADM area (addr=57E91D98 leng=126176 end=57EB0A78)
    A  >> Shm MMDAT area (addr=57EB1000 leng=16150528 end=58E18000)
    A  RFC Destination> destination hydhtc24738_COP_04 host hydhtc24738 system COP systnr 4 (hydhtc24738_COP_04)
    A  RFC Options> H=hydhtc24738,S=04,d=2,
    A  RFC FRFC> fallback activ but this is not a central instance.
    A   
    A  RFC rfc/signon_error_log = -1
    A  RFC rfc/dump_connection_info = 0
    A  RFC rfc/dump_client_info = 0
    A  RFC rfc/cp_convert/ignore_error = 1
    A  RFC rfc/cp_convert/conversion_char = 23
    A  RFC rfc/wan_compress/threshold = 251
    A  RFC rfc/recorder_pcs not set, use defaule value: 2
    A  RFC rfc/delta_trc_level not set, use default value: 0
    A  RFC rfc/no_uuid_check not set, use default value: 0
    A  RFC rfc/bc_ignore_thcmaccp_retcode not set, use default value: 0
    A  RFC Method> initialize RemObjDriver for ABAP Objects
    M  ThrCreateShObjects          allocated 7406 bytes at 0FFB0040
    N  SsfSapSecin: putenv(SECUDIR=F:\usr\sap\COP\DVEBMGS04\sec): ok

    N  =================================================
    N  === SSF INITIALIZATION:
    N  ===...SSF Security Toolkit name SAPSECULIB .
    N  ===...SSF trace level is 0 .
    N  ===...SSF library is F:\usr\sap\COP\DVEBMGS04\exe\sapsecu.dll .
    N  ===...SSF hash algorithm is SHA1 .
    N  ===...SSF symmetric encryption algorithm is DES-CBC .
    N  ===...sucessfully completed.
    N  =================================================

    N Mon Jan 07 18:45:28 2008
    N  MskiInitLogonTicketCacheHandle: Logon Ticket cache pointer retrieved from shared memory.
    N  MskiInitLogonTicketCacheHandle: Workprocess runs with Logon Ticket cache.
    M  JrfcVmcRegisterNativesDriver o.k.
    W  =================================================
    W  === ipl_Init() called
    B    dbtran INFO (init_connection '<DEFAULT>' [ORACLE:700.08]):
    B     max_blocking_factor =   5,  max_in_blocking_factor      =   5,
    B     min_blocking_factor =   5,  min_in_blocking_factor      =   5,
    B     prefer_union_all    =   0,  prefer_join                 =   0,
    B     prefer_fix_blocking =   0,  prefer_in_itab_opt          =   1,
    B     convert AVG         =   0,  alias table FUPD            =   0,
    B     escape_as_literal   =   1,  opt GE LE to BETWEEN        =   0,
    B     select *            =0x0f,  character encoding          = STD / <none>:-,
    B     use_hints           = abap->1, dbif->0x1, upto->2147483647, rule_in->0,
    B                           rule_fae->0, concat_fae->0, concat_fae_or->0
    W    ITS Plugin: Path dw_gui
    W    ITS Plugin: Description ITS Plugin - ITS rendering DLL
    W    ITS Plugin: sizeof(SAP_UC) 2
    W    ITS Plugin: Release: 700, [7000.0.111.20050900]
    W    ITS Plugin: Int.version, [33]
    W    ITS Plugin: Feature set: [14]
    W    ===... Calling itsp_Init in external dll ===>
    W  === ipl_Init() returns 0, ITSPE_OK: OK
    W  =================================================
    E  Enqueue Info: rdisp/wp_no_enq=1, rdisp/enqname=<empty>, assume hydhtc24738_COP_04
    E  Replication is disabled
    E  EnqCcInitialize: local lock table initialization o.k.
    E  EnqId_SuppressIpc: local EnqId initialization o.k.
    E  EnqCcInitialize: local enqueue client init o.k.
    M  MBUF info for hooks: MS component UP
    M  ThSetEnqName: set enqname by server list
    M  ThISetEnqname: enq name = >hydhtc24738_COP_04                      <

    E  *************** EnqId_EN_ActionAtMsUpHook ***************
    E  Hook on upcoming Ms (with EnqSrv), get auth EnqId and check it locally

    E  *************** ObjShMem_CheckAuthoritativeEnqId ***************
    E  Checking authoritative EnqId from EnqSrv into ObjShMem
    E  ObjShMem_CheckAuthoritativeEnqId: ObjShMem ...
    E  EnqId.EnqTabCreaTime    = -999
    E  EnqId.RandomNumber      = -999
    E  ReqOrd.TimeInSecs       = -999
    E  ReqOrd.ReqNumberThisSec = -999
    E  ObjShMem_CheckAuthoritativeEnqId: ObjShMem ...
    E  EnqId.EnqTabCreaTime    = -999
    E  EnqId.RandomNumber      = -999
    E  ReqOrd.TimeInSecs       = -999
    E  ReqOrd.ReqNumberThisSec = -999
    E  ObjShMem_CheckAuthoritativeEnqId: EnqId is initial in ShMem
    E  ObjShMem_CheckAuthoritativeEnqId: Overwrite incoming auth EnqId, continue
    E  EnqId inscribed into initial ObjShMem: (ObjShMem_CheckAuthoritativeEnqId)
    E  -SHMEM--
    E  EnqId:          EnqTabCreaTime/RandomNumber    = 07.01.2008 18:45:27  1199711727 / 1692
    E  ReqOrd at Srv:  TimeInSecs/ReqNumberThisSec    = 07.01.2008 18:45:28  1199711728 / 1
    E  ReqOrd at Cli:  TimeInSecs/ReqNumberThisSec    = 07.01.2008 18:45:28  1199711728 / 1
    E  Status:         STATUS_OK
    E  -
    M  ThActivateServer: state = STARTING
    L  BtcSysStartRaise: Begin
    L  Raise event SAP_SYSTEM_START with parameter <hydhtc24738_COP_04  >
    L  BtcSysStartRaise: End

    S Mon Jan 07 18:45:36 2008
    S  server @>SSRV:hydhtc24738_COP_04@< appears or changes (state 1)
    M  SecAudit(RsauShmInit): WP attached to existing shared memory.
    M  SecAudit(RsauShmInit): addr of SCSA........... = 05E90040
    M  SecAudit(RsauShmInit): addr of RSAUSHM........ = 05E907A8
    M  SecAudit(RsauShmInit): addr of RSAUSLOTINFO... = 05E907E0
    M  SecAudit(RsauShmInit): addr of RSAUSLOTS...... = 05E907EC

    S Mon Jan 07 18:45:44 2008
    S  server @>SSRV:hydhtc24738_COP_04@< appears or changes (state 1)

    B Mon Jan 07 18:47:27 2008
    B  dbmyclu : info : my major identification is 3244494858, minor one 4.
    B  dbmyclu : info : Time Reference is 1.12.2001 00:00:00h GMT.
    B  dbmyclu : info : my initial uuid is DCBD22E36FC346F1BF890002E339BE1E.
    B  dbmyclu : info : current optimistic cluster level: 0
    B  dbmyclu : info : pessimistic reads set to 2.

    A Mon Jan 07 18:47:55 2008
    A  TH VERBOSE LEVEL FULL
    A  ** RABAX: level LEV_RX_PXA_RELEASE_MTX entered.
    A  ** RABAX: level LEV_RX_PXA_RELEASE_MTX completed.
    A  ** RABAX: level LEV_RX_COVERAGE_ANALYSER entered.
    A  ** RABAX: level LEV_RX_COVERAGE_ANALYSER completed.
    A  ** RABAX: level LEV_RX_ROLLBACK entered.
    A  ** RABAX: level LEV_RX_ROLLBACK completed.
    A  ** RABAX: level LEV_RX_DB_ALIVE entered.
    A  ** RABAX: level LEV_RX_DB_ALIVE completed.
    A  ** RABAX: level LEV_RX_HOOKS entered.
    A  ** RABAX: level LEV_RX_HOOKS completed.
    A  ** RABAX: level LEV_RX_STANDARD entered.
    A  ** RABAX: level LEV_RX_STANDARD completed.
    A  ** RABAX: level LEV_RX_STOR_VALUES entered.
    A  ** RABAX: level LEV_RX_STOR_VALUES completed.
    A  ** RABAX: level LEV_RX_C_STACK entered.

    A Mon Jan 07 18:48:02 2008
    A  ** RABAX: level LEV_RX_C_STACK completed.
    A  ** RABAX: level LEV_RX_MEMO_CHECK entered.
    A  ** RABAX: level LEV_RX_MEMO_CHECK completed.
    A  ** RABAX: level LEV_RX_AFTER_MEMO_CHECK entered.
    A  ** RABAX: level LEV_RX_AFTER_MEMO_CHECK completed.
    A  ** RABAX: level LEV_RX_INTERFACES entered.
    A  ** RABAX: level LEV_RX_INTERFACES completed.
    A  ** RABAX: level LEV_RX_GET_MESS entered.
    A  ** RABAX: level LEV_RX_GET_MESS completed.
    A  ** RABAX: level LEV_RX_INIT_SNAP entered.
    A  ** RABAX: level LEV_RX_INIT_SNAP completed.
    A  ** RABAX: level LEV_RX_WRITE_SYSLOG entered.
    A  ** RABAX: level LEV_RX_WRITE_SYSLOG completed.
    A  ** RABAX: level LEV_RX_WRITE_SNAP entered.

    A Mon Jan 07 18:48:03 2008
    A  ** RABAX: level LEV_SN_END completed.
    A  ** RABAX: level LEV_RX_SET_ALERT entered.

    A Mon Jan 07 18:48:04 2008
    A  ** RABAX: level LEV_RX_SET_ALERT completed.
    A  ** RABAX: level LEV_RX_COMMIT entered.
    A  ** RABAX: level LEV_RX_COMMIT completed.
    A  ** RABAX: level LEV_RX_SNAP_SYSLOG entered.
    A  ** RABAX: level LEV_RX_SNAP_SYSLOG completed.
    A  ** RABAX: level LEV_RX_RESET_PROGS entered.
    A  ** RABAX: level LEV_RX_RESET_PROGS completed.
    A  ** RABAX: level LEV_RX_STDERR entered.
    A  Mon Jan 07 18:48:04 2008

    A  ABAP Program SAPLSUGI                                .
    A  Source LSUGIU08                                 Line 77.
    A  Error Code RAISE_EXCEPTION.
    A  Module  $Id: //bas/700_REL/src/krn/runt/abfunc.c#10 $ SAP.
    A  Function ab_jfune Line 2561.
    A  ** RABAX: level LEV_RX_STDERR completed.
    A  ** RABAX: level LEV_RX_RFC_ERROR entered.
    A  ** RABAX: level LEV_RX_RFC_ERROR completed.
    A  ** RABAX: level LEV_RX_RFC_CLOSE entered.
    A  ** RABAX: level LEV_RX_RFC_CLOSE completed.
    A  ** RABAX: level LEV_RX_IMC_ERROR entered.
    A  ** RABAX: level LEV_RX_IMC_ERROR completed.
    A  ** RABAX: level LEV_RX_DATASET_CLOSE entered.
    A  ** RABAX: level LEV_RX_DATASET_CLOSE completed.
    A  ** RABAX: level LEV_RX_RESET_SHMLOCKS entered.
    A  ** RABAX: level LEV_RX_RESET_SHMLOCKS completed.
    A  ** RABAX: level LEV_RX_ERROR_SAVE entered.
    A  ** RABAX: level LEV_RX_ERROR_SAVE completed.
    A  ** RABAX: level LEV_RX_ERROR_TPDA entered.
    A  ** RABAX: level LEV_RX_ERROR_TPDA completed.
    A  ** RABAX: level LEV_RX_PXA_RELEASE_RUDI entered.
    A  ** RABAX: level LEV_RX_PXA_RELEASE_RUDI completed.
    A  ** RABAX: level LEV_RX_LIVE_CACHE_CLEANUP entered.
    A  ** RABAX: level LEV_RX_LIVE_CACHE_CLEANUP completed.
    A  ** RABAX: level LEV_RX_END entered.
    A  ** RABAX: level LEV_RX_END completed.
    A  ** RABAX: end no http/smtp
    A  ** RABAX: end RX_GOTO_RABAX
    A  Exception condition "WRITE_FAILED" raised..


    S Mon Jan 07 18:53:35 2008
    S  found spool memory service RSPO-ACTIONS at 1D8C9978

    B Mon Jan 07 20:31:35 2008
    B  table logging switched off for all clients
    Regards,
    Sameer

  • How to implement Strategy pattern in ABAP Objects?

    Hello,
    I have a problem where I need to implement different algorithms, depending on the type of input. Example: I have to calculate a Present Value, sometimes with payments in advance, sometimes payment in arrear.
    From documentation and to enhance my ABAP Objects skills, I would like to implement the strategy pattern. It sounds the right solution for the problem.
    Hence I need some help in implementing this pattern in OO. I have some basic OO skills, but still learning.
    Has somebody already implemented this pattern in ABAP OO and can give me some input. Or is there any documentation how to implement it?
    Thanks and regards,
    Tapio

    Keshav has already outlined required logic, so let me fulfill his answer with a snippet
    An Interface
    INTERFACE lif_payment.
      METHODS pay CHANGING c_val TYPE p.
    ENDINTERFACE.
    Payment implementations
    CLASS lcl_payment_1 DEFINITION.
      PUBLIC SECTION.
      INTERFACES lif_payment.
      ALIASES pay for lif_payment~pay.
    ENDCLASS.                 
    CLASS lcl_payment_2 DEFINITION.
      PUBLIC SECTION.
      INTERFACES lif_payment.
      ALIASES pay for lif_payment~pay.
    ENDCLASS.                   
    CLASS lcl_payment_1 IMPLEMENTATION.
      METHOD pay.
        "do something with c_val i.e.
        c_val = c_val - 10.
      ENDMETHOD.                   
    ENDCLASS.                  
    CLASS lcl_payment_2 IMPLEMENTATION.
      METHOD pay.
        "do something else with c_val i.e.
        c_val = c_val + 10.
      ENDMETHOD.  
    Main class which uses strategy pattern
    CLASS lcl_main DEFINITION.
      PUBLIC SECTION.
        "during main object creation you pass which payment you want to use for this object
        METHODS constructor IMPORTING ir_payment TYPE REF TO lif_payment.
        "later on you can change this dynamicaly
        METHODS set_payment IMPORTING ir_payment TYPE REF TO lif_payment.
        METHODS show_payment_val.
        METHODS pay.
      PRIVATE SECTION.
        DATA payment_value TYPE p.
        "reference to your interface whcih you will be working with
        "polimorphically
        DATA mr_payment TYPE REF TO lif_payment.
    ENDCLASS.                  
    CLASS lcl_main IMPLEMENTATION.
      METHOD constructor.
        IF ir_payment IS BOUND.
          me->mr_payment = ir_payment.
        ENDIF.
      ENDMETHOD.                  
      METHOD set_payment.
        IF ir_payment IS BOUND.
          me->mr_payment = ir_payment.
        ENDIF.
      ENDMETHOD.                  
      METHOD show_payment_val.
        WRITE /: 'Payment value is now ', me->payment_value.
      ENDMETHOD.                  
      "hide fact that you are using composition to access pay method
      METHOD pay.
        mr_payment->pay( CHANGING c_val = payment_value ).
      ENDMETHOD.                   ENDCLASS.                  
    Client application
    PARAMETERS pa_pay TYPE c. "1 - first payment, 2 - second
    DATA gr_main TYPE REF TO lcl_main.
    DATA gr_payment TYPE REF TO lif_payment.
    START-OF-SELECTION.
      "client application (which uses stategy pattern)
      CASE pa_pay.
        WHEN 1.
          "create first type of payment
          CREATE OBJECT gr_payment TYPE lcl_payment_1.
        WHEN 2.
          "create second type of payment
          CREATE OBJECT gr_payment TYPE lcl_payment_2.
      ENDCASE.
      "pass payment type to main object
      CREATE OBJECT gr_main
        EXPORTING
          ir_payment = gr_payment.
      gr_main->show_payment_val( ).
      "now client doesn't know which object it is working with
      gr_main->pay( ).
      gr_main->show_payment_val( ).
      "you can also use set_payment method to set payment type dynamically
      "client would see no change
      if pa_pay = 1.
        "now create different payment to set it dynamically
        CREATE OBJECT gr_payment TYPE lcl_payment_2.
        gr_main->set_payment( gr_payment ).
        gr_main->pay( ).
        gr_main->show_payment_val( ).
      endif.
    Regads
    Marcin

  • Abap wp table stop reason rpc when  u0131 want login as turkish

    hi gurus anyone help me ;
    abap wp table is stopped reason rpc when ı want login turkish language
    please help me ı cant solve this problem..
    trc file: "dev_w4", trc level: 1, release: "700"
    ACTIVE TRACE LEVEL           1
    ACTIVE TRACE COMPONENTS      all, MJ

    B Tue Aug 26 05:24:30 2008
    B  create_con (con_name=R/3)
    B  Loading DB library 'G:\usr\sap\SPT\DVEBMGS00\exe\dbmssslib.dll' ...
    B  Library 'G:\usr\sap\SPT\DVEBMGS00\exe\dbmssslib.dll' loaded
    B  Version of 'G:\usr\sap\SPT\DVEBMGS00\exe\dbmssslib.dll' is "700.08", patchlevel (0.109)
    B  New connection 0 created
    M sysno      00
    M sid        SPT
    M systemid   560 (PC with Windows NT)
    M relno      7000
    M patchlevel 0
    M patchno    111
    M intno      20050900
    M make:      multithreaded, ASCII, optimized
    M pid        3468
    M
    M  kernel runs with dp version 229(ext=109) (@(#) DPLIB-INT-VERSION-229)
    M  length of sys_adm_ext is 364 bytes
    M  ***LOG Q0Q=> tskh_init, WPStart (Workproc 4 3468) [dpxxdisp.c   1301]
    I  MtxInit: 30000 0 0
    M  DpSysAdmExtCreate: ABAP is active
    M  DpSysAdmExtCreate: VMC (JAVA VM in WP) is not active
    M  DpShMCreate: sizeof(wp_adm)          15440     (908)
    M  DpShMCreate: sizeof(tm_adm)          3605136     (17936)
    M  DpShMCreate: sizeof(wp_ca_adm)          18000     (60)
    M  DpShMCreate: sizeof(appc_ca_adm)     6000     (60)
    M  DpCommTableSize: max/headSize/ftSize/tableSize=500/8/528040/528048
    M  DpShMCreate: sizeof(comm_adm)          528048     (1048)
    M  DpSlockTableSize: max/headSize/ftSize/fiSize/tableSize=0/0/0/0/0
    M  DpShMCreate: sizeof(slock_adm)          0     (96)
    M  DpFileTableSize: max/headSize/ftSize/tableSize=0/0/0/0
    M  DpShMCreate: sizeof(file_adm)          0     (72)
    M  DpShMCreate: sizeof(vmc_adm)          0     (1296)
    M  DpShMCreate: sizeof(wall_adm)          (22440/34344/56/100)
    M  DpShMCreate: sizeof(gw_adm)     48
    M  DpShMCreate: SHM_DP_ADM_KEY          (addr: 064B0040, size: 4236528)
    M  DpShMCreate: allocated sys_adm at 064B0040
    M  DpShMCreate: allocated wp_adm at 064B1B30
    M  DpShMCreate: allocated tm_adm_list at 064B5780
    M  DpShMCreate: allocated tm_adm at 064B57B0
    M  DpShMCreate: allocated wp_ca_adm at 06825A40
    M  DpShMCreate: allocated appc_ca_adm at 0682A090
    M  DpShMCreate: allocated comm_adm at 0682B800
    M  DpShMCreate: system runs without slock table
    M  DpShMCreate: system runs without file table
    M  DpShMCreate: allocated vmc_adm_list at 068AC6B0
    M  DpShMCreate: allocated gw_adm at 068AC6F0
    M  DpShMCreate: system runs without vmc_adm
    M  DpShMCreate: allocated ca_info at 068AC720
    M  DpShMCreate: allocated wall_adm at 068AC728
    X  EmInit: MmSetImplementation( 2 ).
    X  MM global diagnostic options set: 0
    X  <ES> client 4 initializing ....
    X  Using implementation view
    X  <EsNT> Using memory model view.
    M  <EsNT> Memory Reset disabled as NT default
    X  ES initialized.

    M Tue Aug 26 05:24:31 2008
    M  ThInit: running on host prodeaserver

    M Tue Aug 26 05:24:32 2008
    M  calling db_connect ...
    C  Thread ID:3480
    C  Thank You for using the SLOLEDB-interface
    C  Using dynamic link library 'G:\usr\sap\SPT\DVEBMGS00\exe\dbmssslib.dll'
    C  dbmssslib.dll patch info
    C    patchlevel   0
    C    patchno      110
    C    patchcomment MSSQL: Connect error handling (1053754)
    C  np:(local) connection used on PRODEASERVER
    C  CopyLocalParameters: dbuser is 'spt'
    C  Using Provider SQLNCLI
    C  OpenOledbConnection: MARS property was set successfully.
    C  Provider Release:9.00.1399.06
    C  Using Provider SQLNCLI
    C  OpenOledbConnection: MARS property was set successfully.
    C  Cache sizes: header 52 bytes, 20000 names (26880000 bytes), 500 dynamic statements (2728000 bytes), total 29608052 bytes
    C  Using shared procedure name cache PRODEASERVER_SPTSPT_SPT_MEM initialized by another process.
    C  Connected to db server : [PRODEASERVER] server_used : [np:(local)], dbname: SPT, dbuser: spt
    C  pn_id:PRODEASERVER_SPTSPT_SPT
    C  Using MARS (on sql 9.0)
    B  Connection 0 opened (DBSL handle 0)
    B  Wp  Hdl ConName          ConId     ConState     TX  PRM RCT TIM MAX OPT Date     Time   DBHost         
    B  000 000 R/3              000000000 ACTIVE       NO  YES NO  000 255 255 20080826 052432 PRODEASERVER   

    C Tue Aug 26 05:24:33 2008
    C  The IRow interface is supported by this OLEDB provider
    M  db_connect o.k.
    M  ICT: exclude compression: .zip,.cs,.rar,.arj,.z,.gz,.tar,.lzh,.cab,.hqx,.ace,.jar,.ear,.war,.css,.pdf,.js,.gzip,.uue,.bz2,.iso,.sda,.sar,.gif

    I Tue Aug 26 05:24:43 2008
    I  MtxInit: 4 0 0
    M  SHM_PRES_BUF               (addr: 0B740040, size: 24880128)
    M  SHM_ROLL_AREA          (addr: 788A0040, size: 61440000)
    M  SHM_PAGING_AREA          (addr: 0CF00040, size: 32768000)
    M  SHM_ROLL_ADM               (addr: 08900040, size: 615040)
    M  SHM_PAGING_ADM          (addr: 089A0040, size: 525344)
    M  ThCreateNoBuffer          allocated 324144 bytes for 1000 entries at 08A30040
    M  ThCreateNoBuffer          index size: 3000 elems
    M  ThCreateVBAdm          allocated 7424 bytes (50 server) at 08A80040
    X  EmInit: MmSetImplementation( 2 ).
    X  MM global diagnostic options set: 0
    X  <ES> client 4 initializing ....
    X  Using implementation view
    X  ES initialized.
    B  db_con_shm_ini:  WP_ID = 4, WP_CNT = 17, CON_ID = -1
    B  dbtbxbuf: Buffer TABL  (addr: 613300C8, size: 101680128, end: 674284C8)
    B  dbtbxbuf: Buffer TABLP (addr: 681300C8, size: 51200000, end: 6B2040C8)
    B  dbexpbuf: Buffer EIBUF (addr: 0F9600D0, size: 4194304, end: 0FD600D0)
    B  dbexpbuf: Buffer ESM   (addr: 178200D0, size: 4194304, end: 17C200D0)
    B  dbexpbuf: Buffer CUA   (addr: 5DA800D0, size: 13312000, end: 5E7320D0)
    B  dbexpbuf: Buffer OTR   (addr: 17C300D0, size: 4194304, end: 180300D0)

    M Tue Aug 26 05:24:44 2008
    M  CCMS: AlInitGlobals : alert/use_sema_lock = TRUE.

    S Tue Aug 26 05:24:45 2008
    S  *** init spool environment
    S  initialize debug system
    T  Stack direction is downwards.
    T  debug control: prepare exclude for printer trace
    T  new memory block 0880A8A0
    S  spool kernel/ddic check: Ok
    S  using table TSP02FX for frontend printing
    S  1 spool work process(es) found
    S  frontend print via spool service enabled
    S  printer list size is 150
    S  printer type list size is 50
    S  queue size (profile)   = 300
    S  hostspool list size = 3000
    S  option list size is 30
    S      found processing queue enabled
    S  creating spool memory service RSPO-RCLOCKS at 18040098
    S  doing lock recovery
    S  setting server cache root
    S  using server cache size 100 (prof=100)
    S  creating spool memory service RSPO-SERVERCACHE at 18040488
    S    using messages for server info
    S  size of spec char cache entry: 165020 bytes (timeout 100 sec)
    S  size of open spool request entry: 1216 bytes
    S  immediate print option for implicitely closed spool requests is disabled

    A  -PXA--
    A  PXA INITIALIZATION
    A  System page size: 4kb, total admin_size: 20176kb, dir_size: 10028kb.
    A  PXA allocated (address 182F0040, size 600000K)
    A  System name
    A  MSSQL............................SPT........PRODEASERVER.......................................
    A  is used for RFC security.
    A  Sharedbuffer token: 5341...33 (len: 111)====== 4b9d4865cf825700d91be730...
    A  abap/pxa = shared protect gen_remote
    A  PXA INITIALIZATION FINISHED
    A  -PXA--


    A Tue Aug 26 05:24:46 2008
    A  ABAP ShmAdm initialized (addr=57A1A000 leng=20955136 end=58E16000)
    A  >> Shm MMADM area (addr=57D821E0 leng=134720 end=57DA3020)
    A  >> Shm MMDAT area (addr=57DA4000 leng=17244160 end=58E16000)
    A  RFC rfc/signon_error_log = -1
    A  RFC rfc/dump_connection_info = 0
    A  RFC rfc/dump_client_info = 0
    A  RFC rfc/cp_convert/ignore_error = 1
    A  RFC rfc/cp_convert/conversion_char = 23
    A  RFC rfc/wan_compress/threshold = 251
    A  RFC rfc/recorder_pcs not set, use defaule value: 1
    A  RFC rfc/delta_trc_level not set, use default value: 0
    A  RFC rfc/no_uuid_check not set, use default value: 0
    A  RFC rfc/bc_ignore_thcmaccp_retcode not set, use default value: 0
    A  RFC Method> initialize RemObjDriver for ABAP Objects
    M  ThrCreateShObjects          allocated 17730 bytes at 08AE0040
    N  SsfSapSecin: putenv(SECUDIR=G:\usr\sap\SPT\DVEBMGS00\sec): ok

    N  =================================================
    N  === SSF INITIALIZATION:
    N  ===...SSF Security Toolkit name SAPSECULIB .
    N  ===...SSF trace level is 0 .
    N  ===...SSF library is G:\usr\sap\SPT\DVEBMGS00\exe\sapsecu.dll .
    N  ===...SSF hash algorithm is SHA1 .
    N  ===...SSF symmetric encryption algorithm is DES-CBC .

    N Tue Aug 26 05:24:47 2008
    N  ===...sucessfully completed.
    N  =================================================

    N Tue Aug 26 05:24:50 2008
    N  MskiInitLogonTicketCacheHandle: Logon Ticket cache pointer retrieved from shared memory.
    N  MskiInitLogonTicketCacheHandle: Workprocess runs with Logon Ticket cache.
    M  JrfcVmcRegisterNativesDriver o.k.
    W  =================================================
    W  === ipl_Init() called
    B    dbtran INFO (init_connection '<DEFAULT>' [MSSQL:700.08]):
    B     max_blocking_factor =  50,  max_in_blocking_factor      = 255,
    B     min_blocking_factor =   5,  min_in_blocking_factor      =  10,
    B     prefer_union_all    =   1,  prefer_join                 =   1,
    B     prefer_fix_blocking =   0,  prefer_in_itab_opt          =   0,
    B     convert AVG         =   1,  alias table FUPD            =   0,
    B     escape_as_literal   =   0,  opt GE LE to BETWEEN        =   0,
    B     select *            =0x00,  character encoding          =SBCS / []:X,
    B     use_hints           = abap->1, dbif->0x1, upto->0, rule_in->0,
    B                           rule_fae->0, concat_fae->0, concat_fae_or->0
    W    ITS Plugin: Path dw_gui
    W    ITS Plugin: Description ITS Plugin - ITS rendering DLL
    W    ITS Plugin: sizeof(SAP_UC) 1
    W    ITS Plugin: Release: 700, [7000.0.111.20050900]
    W    ITS Plugin: Int.version, [33]
    W    ITS Plugin: Feature set: [14]
    W    ===... Calling itsp_Init in external dll ===>
    W  === ipl_Init() returns 0, ITSPE_OK: OK
    W  =================================================
    E  Replication is disabled
    E  EnqCcInitialize: local lock table initialization o.k.
    E  EnqId_SuppressIpc: local EnqId initialization o.k.
    E  EnqCcInitialize: local enqueue client init o.k.

    C Tue Aug 26 05:25:58 2008
    C  The IRow interface is supported by this OLEDB provider
    M  SecAudit(RsauShmInit): WP attached to existing shared memory.
    M  SecAudit(RsauShmInit): addr of SCSA........... = 04C90040
    M  SecAudit(RsauShmInit): addr of RSAUSHM........ = 04C90490
    M  SecAudit(RsauShmInit): addr of RSAUSLOTINFO... = 04C904C8
    M  SecAudit(RsauShmInit): addr of RSAUSLOTS...... = 04C904D4

    B Tue Aug 26 05:25:59 2008
    B  dbmyclu : info : my major identification is 3232235830, minor one 400.
    B  dbmyclu : info : Time Reference is 1.12.2001 01:00:00h GMT.
    B  dbmyclu : info : my initial uuid is DD736A228835A6F18D0E0016E6DE8954.
    B  dbmyclu : info : current optimistic cluster level: 3
    B  dbmyclu : info : pessimistic reads set to 2.

    Hi apache1,
    I'm afraid that this is not enough information for people to assist in solving the problem.  When and where are you receiving this message?  If you provide more details then it will be easier for people to assist you.
    Best Regards,
    Matt

  • New in ABAP

    Hello Everybody
    what is the difference between pack and floating point datatypes, i ABAP Objects book, there is mentioned that if you are concious about accuracy then use pack datatype, otherwise use floating point. i write a program
    data p1 type p.
    p = 3 / 4.
    write p.    the result of this statement is 0,75
    data f1 type f.
    f1 = 3 / 4.
    write f1 and the result of this is statement is 7,5000000E
    so when we use pack number and what floating point give me example in detail and clear
    Thanks
    Rai

    Hi,
    This is taken from ABAP Help Documentation.
    ABAP contains a range of built-in elementary data types: Character (text), Numerical character (number string), Date, Time Integer, Floating point number, Packed number, and HeX code). Some of these data types are fully types (D, T, I, F), others (C, N, P, X) are generic, in the sense that you must provide further type information (length, for type p also the number of decimal places) when you create the data object .
    The value range of type P fields depends on their length and the number of decimal places. P fields can be 1 to 16 bytes long, with two decimal digits packed into each byte, and one decimal digit and the sign packed into the last byte. There can be up to 14 decimal places. Auxiliary fields for intermediate results are always 16 bytes long and can thus hold up to 31 decimal digits. To ensure that the decimal point is correctly calculated, you should always set the program attribute "fixed point arithmetic". Otherwise, all numbers are specified as integers and all intermediate results for the next integer are rounded. If "fixed point arithmetic" is not set, the decimal places defined for the number only appear when outputting with WRITE.
    Fixed point arithmetic is decimal arithmetic and is similar to using a pocket calculator or calculating with paper and pencil.
    Type P is typically used for sizes, lengths, weights and sums of money.
    Rule: If you want to calculate "down to the last penny", you should use the type P.
    Type F values range from /- 2.2250738585072014E-308 to 1.7976931348623157E308, as well as the number 0, with an accuracy of at least 15 decimal places.
    You cannot enter floating point numbers directly in your programs. Instead, you must use text literals that can be interpreted as floating point numbers. You may use the following formats:
    Decimal numbers with or without sign, with or without decimal point. The form <mantissa> E<exponent>, where the mantissa is a decimal. The exponent may be specified either with or without sign. You may also use spaces before or after the number. Examples of text literals with "floating point numbers":
    '1', '-12.34567', '-765E-04', '1234E5', '12E34', '+12.3E-4', '1E160'.
    Use floating point arithmetic if you need a very large value range or you are making decimal calculations, but be aware of the following features of floating point arithmetic.
    Internally, the exponent and the mantissa of floating point numbers are stored separately, each in two parts. This can lead to unexpected results, despite the high degree of intrinsic accuracy. These occur mainly when performing conversions from and to type F.
    For example, the number 1.5 can be represented exactly in this notation, since 1.5 = 120 + 12**(-1), but the number 0.15 can only be represented approximately by the number 0,14999999999999999. If you round 0.15 up to 1 valid digit, the result is 0.1 rather than 0.2 as you would expect. On the other hand, the number 1.5E-12 is represented by the number 1.5000000000000001E-12, which would be rounded to 2E-12.
    Another example which actually occurred is the calculation of 7.27% of 73050 to an accuracy of 2 decimal places. The intermediate result 5.3107349999999997E+03, since the correct result, 5310.735, cannot be represented exactly in two parts with 53 bits. (If the hardware cannot represent a real number exactly, it uses the next representable floating point number. After rounding, you therefore get 5310.73 rather than 5310.74 as you would expect.
    The ABAP runtime system calculates commercially and not "numerically" like the underlying machine arithmetic. According to the rounding algorithm of the latter, the end digit 5 must always be rounded to the nearest even number (not the next largest number), i.e. from 2.5 to 2, 3.5 to 4.
    You should also note that multiplication using powers of 10 (positive or negative), is not an exact operation. For example, although 100.5 can be represented exactly in two parts, after the operation
    F = F / 100 * 100
    F has the value 100.49999999999999.
    As well as rounding errors, the restricted number of decimal places for the mantissa can lead to the loss of trailing digits. For example, 1 - 1.0000000000000001 results in zero.
    This means that you cannot rely on the last digits in floating point arithmetic. In particular, you should not usually test two floating point numbers for equality; instead, you should check whether the relative difference abs((a - b)/a) is less than a predefined limit, e.g. 10**(-7).
    Check this link also.
    http://www.sapgenie.com/abap/example_code.htm

  • InfoPackage ABAP Routine

    Hi,
    I have two text tables T1 and T2. The key in T1 and T2 are the same. Only point is T2 has very few records compared to T1.
    T1 has key and Medium Texts. T2 has the same.
    I am loading the data from T1 to T2. I need to write ABAP routine in InfoPackage to load the text data to T2 where the keys match in T1 and T2.
    Appreciate your help.
    Thanks,
    Pradeep

    Hello Kumar,
    You can do this using the following algorithm:
    1) Read the text table for T2. The text table is named /BIC/T<name of T1 infoobject). For example, if my infoobject is ZSAMPLE, then my text table for that is /BIC/TZSAMPLE.
    2) For each row in T2, check if the key can be found in T1.
    3) If yes,then place the key for that current row in a selection.
    4) if not, ignore the key
    Here's a sample code:
    data: l_sel type  rssdlrange.
    data: t_t2 type table of /BIC/TT2,
          e_t2 type  /BIC/TT2,
          e_t1 type /bic/tt1.
    select * from /BIC/TT2 into table t_t2.
    loop at t_t2 into e_t2.
      select single * from /bic/tt1 into e_t1 where
        /bic/t1 = e_t2-/bic/t2.
      if sy-subrc eq 0.
        l_sel-fieldname = '/BIC/T1'.
        l_sel-SIGN = 'I'.
        l_sel-OPTION = 'EQ'.
        l_sel-LOW = e_t2-/bic/t2.
        append l_sel to l_t_range.
      endif.
    endloop.
    Hope this helps.

  • Error during VM container communication between ABAP and JAVA

    Hello,
    While creation of SC, I am getting error "Error during VM container communication between ABAP and JAVA"
    Based on earlier responses in this forum, I checked following activity.
    1. T Code - BBP_CND_CHECK_CUST
    Result - IPC Pricing is Active and IPC is now running in VMC
    2. Run Report - RSVMCRT_HEALTH_CHECK
    Result - The Java component is deactivated
    3. As per OSS note 854170, Profile parameters were existed as below
    a) vmcj/enable - on
    b) vmcj/option/maxJavaHeap = 200M
    So, How to get Java component activated?
    Thanks,
    Rahul Mandale

    Thanks Markus,
    For SM53, I am getting resulets as " Java is not active on this application server - Message no. SVMCRT011"
    Can you suggest, what I need to do for it? I can't use SRM Shopping cart because of it. thanks in advance, Rahul
    and dev_w0 trace ....
    trc file: "dev_w0", trc level: 1, release: "700"
    ACTIVE TRACE LEVEL           1
    ACTIVE TRACE COMPONENTS      all, MJ

    B Wed Aug 31 15:45:40 2011
    B  create_con (con_name=R/3)
    B  Loading DB library 'D:\usr\sap\CUS\DVEBMGS04\exe\dboraslib.dll' ...
    B  Library 'D:\usr\sap\CUS\DVEBMGS04\exe\dboraslib.dll' loaded
    B  Version of 'D:\usr\sap\CUS\DVEBMGS04\exe\dboraslib.dll' is "700.08", patchlevel (0.46)
    B  New connection 0 created
    M sysno      04
    M sid        CUS
    M systemid   560 (PC with Windows NT)
    M relno      7000
    M patchlevel 0
    M patchno    52
    M intno      20050900
    M make:      multithreaded, Unicode, optimized
    M pid        456
    M
    M  kernel runs with dp version 210000(ext=109000) (@(#) DPLIB-INT-VERSION-210000-UC)
    M  length of sys_adm_ext is 572 bytes
    M  ***LOG Q0Q=> tskh_init, WPStart (Workproc 0 456) [dpxxdisp.c   1293]
    I  MtxInit: 30000 0 0
    M  DpSysAdmExtCreate: ABAP is active
    M  DpSysAdmExtCreate: VMC (JAVA VM in WP) is not active
    M  DpShMCreate: sizeof(wp_adm)          18304     (1408)
    M  DpShMCreate: sizeof(tm_adm)          3954072     (19672)
    M  DpShMCreate: sizeof(wp_ca_adm)          24000     (80)
    M  DpShMCreate: sizeof(appc_ca_adm)     8000     (80)
    M  DpCommTableSize: max/headSize/ftSize/tableSize=500/8/528056/528064
    M  DpShMCreate: sizeof(comm_adm)          528064     (1048)
    M  DpFileTableSize: max/headSize/ftSize/tableSize=0/0/0/0
    M  DpShMCreate: sizeof(file_adm)          0     (72)
    M  DpShMCreate: sizeof(vmc_adm)          0     (1452)
    M  DpShMCreate: sizeof(wall_adm)          (38456/34360/64/184)
    M  DpShMCreate: sizeof(gw_adm)     48
    M  DpShMCreate: SHM_DP_ADM_KEY          (addr: 05C00040, size: 4613144)
    M  DpShMCreate: allocated sys_adm at 05C00040
    M  DpShMCreate: allocated wp_adm at 05C01E28
    M  DpShMCreate: allocated tm_adm_list at 05C065A8
    M  DpShMCreate: allocated tm_adm at 05C065D8
    M  DpShMCreate: allocated wp_ca_adm at 05FCBB70
    M  DpShMCreate: allocated appc_ca_adm at 05FD1930
    M  DpShMCreate: allocated comm_adm at 05FD3870
    M  DpShMCreate: system runs without file table
    M  DpShMCreate: allocated vmc_adm_list at 06054730
    M  DpShMCreate: allocated gw_adm at 06054770
    M  DpShMCreate: system runs without vmc_adm
    M  DpShMCreate: allocated ca_info at 060547A0
    M  DpShMCreate: allocated wall_adm at 060547A8
    X  EmInit: MmSetImplementation( 2 ).
    X  MM diagnostic options set: 0
    X  <ES> client 0 initializing ....
    X  Using implementation flat
    M  <EsNT> Memory Reset disabled as NT default
    X  ES initialized.

    M Wed Aug 31 15:45:41 2011
    M  ThInit: running on host crmsys

    M Wed Aug 31 15:45:42 2011
    M  calling db_connect ...
    C  Prepending D:\usr\sap\CUS\DVEBMGS04\exe to Path.

    C Wed Aug 31 15:45:47 2011
    C  Client NLS settings: AMERICAN_AMERICA.UTF8
    C  Logon as OPS$-user to get SAPSR3's password
    C  Connecting as /@CRM on connection 0 (nls_hdl 0) ... (dbsl 700 240106)
    C  Nls CharacterSet                 NationalCharSet              C      EnvHp      ErrHp ErrHpBatch
    C    0 UTF8                                                      1   0619F158   061A46F4   061A3F7C
    C  Attaching to DB Server CRM (con_hdl=0,svchp=061A3EC8,svrhp=061B5794)
    C  Starting user session (con_hdl=0,svchp=061A3EC8,srvhp=061B5794,usrhp=061CA558)

    C Wed Aug 31 15:45:48 2011
    C  Now '/@CRM' is connected (con_hdl 0, nls_hdl 0).
    C  Got SAPSR3's password from OPS$-user
    C  Disconnecting from connection 0 ...
    C  Closing user session (con_hdl=0,svchp=061A3EC8,usrhp=061CA558)
    C  Now I'm disconnected from ORACLE
    C  Connecting as SAPSR3/<pwd>@CRM on connection 0 (nls_hdl 0) ... (dbsl 700 240106)
    C  Nls CharacterSet                 NationalCharSet              C      EnvHp      ErrHp ErrHpBatch
    C    0 UTF8                                                      1   0619F158   061A46F4   061A3F7C
    C  Starting user session (con_hdl=0,svchp=061A3EC8,srvhp=061B5794,usrhp=061CA558)
    C  Now 'SAPSR3/<pwd>@CRM' is connected (con_hdl 0, nls_hdl 0).
    C  Database NLS settings: AMERICAN_AMERICA.UTF8
    C  Database instance CRM is running on CRMSYS with ORACLE version 10.2.0.1.0 since 20110831

    B Wed Aug 31 15:45:49 2011
    B  Connection 0 opened (DBSL handle 0)
    B  Wp  Hdl ConName          ConId     ConState     TX  PRM RCT TIM MAX OPT Date     Time   DBHost         
    B  000 000 R/3              000000000 ACTIVE       NO  YES NO  000 255 255 20110831 154542 CRMSYS         
    M  db_connect o.k.
    M  ICT: exclude compression: .zip,.cs,.rar,.arj,.z,.gz,.tar,.lzh,.cab,.hqx,.ace,.jar,.ear,.war,.css,.pdf,.js,.gzip,.uue,.bz2,.iso,.sda,.sar,.gif

    I Wed Aug 31 15:46:12 2011
    I  MtxInit: 0 0 0
    M  SHM_PRES_BUF               (addr: 0A7C0040, size: 4400000)
    M  SHM_ROLL_AREA          (addr: 788A0040, size: 61440000)
    M  SHM_PAGING_AREA          (addr: 0AC00040, size: 32768000)
    M  SHM_ROLL_ADM               (addr: 0CB50040, size: 615040)
    M  SHM_PAGING_ADM          (addr: 0CBF0040, size: 525344)
    M  ThCreateNoBuffer          allocated 544152 bytes for 1000 entries at 0CC80040
    M  ThCreateNoBuffer          index size: 3000 elems
    M  ThCreateVBAdm          allocated 12160 bytes (50 server) at 0CD10040
    X  EmInit: MmSetImplementation( 2 ).
    X  MM diagnostic options set: 0
    X  <ES> client 0 initializing ....
    X  Using implementation flat
    X  ES initialized.
    B  db_con_shm_ini:  WP_ID = 0, WP_CNT = 13, CON_ID = -1
    B  dbtbxbuf: Buffer TABL  (addr: 10E700C8, size: 30000000, end: 12B0C448)
    B  dbtbxbuf: Buffer TABLP (addr: 12B100C8, size: 10240000, end: 134D40C8)
    B  dbexpbuf: Buffer EIBUF (addr: 0FBA00D0, size: 4194304, end: 0FFA00D0)
    B  dbexpbuf: Buffer ESM   (addr: 134E00D0, size: 4194304, end: 138E00D0)
    B  dbexpbuf: Buffer CUA   (addr: 138F00D0, size: 3072000, end: 13BDE0D0)
    B  dbexpbuf: Buffer OTR   (addr: 13BE00D0, size: 4194304, end: 13FE00D0)
    M  rdisp/reinitialize_code_page -> 0
    M  icm/accept_remote_trace_level -> 0
    M  rdisp/no_hooks_for_sqlbreak -> 0
    M  CCMS: AlInitGlobals : alert/use_sema_lock = TRUE.

    S Wed Aug 31 15:46:15 2011
    S  *** init spool environment
    S  initialize debug system
    T  Stack direction is downwards.
    T  debug control: prepare exclude for printer trace
    T  new memory block 1946AA80

    S Wed Aug 31 15:46:16 2011
    S  spool kernel/ddic check: Ok
    S  using table TSP02FX for frontend printing
    S  1 spool work process(es) found
    S  frontend print via spool service enabled
    S  printer list size is 150
    S  printer type list size is 50
    S  queue size (profile)   = 300
    S  hostspool list size = 3000
    S  option list size is 30
    S      found processing queue enabled
    S  found spool memory service RSPO-RCLOCKS at 1D6D00A8
    S  doing lock recovery
    S  setting server cache root
    S  found spool memory service RSPO-SERVERCACHE at 1D6D0430
    S    using messages for server info
    S  size of spec char cache entry: 297028 bytes (timeout 100 sec)
    S  size of open spool request entry: 2132 bytes
    S  immediate print option for implicitely closed spool requests is disabled

    A Wed Aug 31 15:46:18 2011

    A  -PXA--
    A  PXA INITIALIZATION
    A  PXA: Fragment Size too small: 73 MB, reducing # of fragments
    A  System page size: 4kb, total admin_size: 5132kb, dir_size: 5076kb.
    A  Attached to PXA (address 688A0040, size 150000K)
    A  abap/pxa = shared protect gen_remote
    A  PXA INITIALIZATION FINISHED
    A  -PXA--


    A Wed Aug 31 15:46:20 2011
    A  ABAP ShmAdm attached (addr=57A40000 leng=20955136 end=58E3C000)
    A  >> Shm MMADM area (addr=57EB5E58 leng=126176 end=57ED4B38)
    A  >> Shm MMDAT area (addr=57ED5000 leng=16150528 end=58E3C000)
    A  RFC Destination> destination crmsys_CUS_04 host crmsys system CUS systnr 4 (crmsys_CUS_04)

    A Wed Aug 31 15:46:21 2011
    A  RFC Options> H=crmsys,S=04,d=2,
    A  RFC FRFC> fallback activ but this is not a central instance.
    A   
    A  RFC rfc/signon_error_log = -1
    A  RFC rfc/dump_connection_info = 0
    A  RFC rfc/dump_client_info = 0
    A  RFC rfc/cp_convert/ignore_error = 1
    A  RFC rfc/cp_convert/conversion_char = 23
    A  RFC rfc/wan_compress/threshold = 251
    A  RFC rfc/recorder_pcs not set, use defaule value: 2
    A  RFC rfc/delta_trc_level not set, use default value: 0
    A  RFC rfc/no_uuid_check not set, use default value: 0
    A  RFC rfc/bc_ignore_thcmaccp_retcode not set, use default value: 0
    A  RFC Method> initialize RemObjDriver for ABAP Objects
    M  ThrCreateShObjects          allocated 13730 bytes at 0FFB0040

    N Wed Aug 31 15:46:22 2011
    N  SsfSapSecin: putenv(SECUDIR=D:\usr\sap\CUS\DVEBMGS04\sec): ok

    N  =================================================
    N  === SSF INITIALIZATION:
    N  ===...SSF Security Toolkit name SAPSECULIB .
    N  ===...SSF trace level is 0 .
    N  ===...SSF library is D:\usr\sap\CUS\DVEBMGS04\exe\sapsecu.dll .
    N  ===...SSF hash algorithm is SHA1 .
    N  ===...SSF symmetric encryption algorithm is DES-CBC .
    N  ===...sucessfully completed.
    N  =================================================

    N Wed Aug 31 15:46:23 2011
    N  MskiInitLogonTicketCacheHandle: Logon Ticket cache pointer retrieved from shared memory.
    N  MskiInitLogonTicketCacheHandle: Workprocess runs with Logon Ticket cache.
    M  JrfcVmcRegisterNativesDriver o.k.
    W  =================================================
    W  === ipl_Init() called
    B    dbtran INFO (init_connection '<DEFAULT>' [ORACLE:700.08]):
    B     max_blocking_factor =  15,  max_in_blocking_factor      =   5,
    B     min_blocking_factor =  10,  min_in_blocking_factor      =   5,
    B     prefer_union_all    =   0,  prefer_join                 =   0,
    B     prefer_fix_blocking =   0,  prefer_in_itab_opt          =   1,
    B     convert AVG         =   0,  alias table FUPD            =   0,
    B     escape_as_literal   =   1,  opt GE LE to BETWEEN        =   0,
    B     select *            =0x0f,  character encoding          = STD / <none>:-,
    B     use_hints           = abap->1, dbif->0x1, upto->2147483647, rule_in->0,
    B                           rule_fae->0, concat_fae->0, concat_fae_or->0

    W Wed Aug 31 15:46:24 2011
    W    ITS Plugin: Path dw_gui
    W    ITS Plugin: Description ITS Plugin - ITS rendering DLL
    W    ITS Plugin: sizeof(SAP_UC) 2
    W    ITS Plugin: Release: 700, [7000.0.52.20050900]
    W    ITS Plugin: Int.version, [32]
    W    ITS Plugin: Feature set: [10]
    W    ===... Calling itsp_Init in external dll ===>
    W  === ipl_Init() returns 0, ITSPE_OK: OK
    W  =================================================
    E  Enqueue Info: rdisp/wp_no_enq=1, rdisp/enqname=<empty>, assume crmsys_CUS_04
    E  Replication is disabled
    E  EnqCcInitialize: local lock table initialization o.k.
    E  EnqId_SuppressIpc: local EnqId initialization o.k.
    E  EnqCcInitialize: local enqueue client init o.k.

    B Wed Aug 31 15:46:48 2011
    B  table logging switched off for all clients

    M Wed Aug 31 15:47:55 2011
    M  SecAudit(RsauShmInit): WP attached to existing shared memory.
    M  SecAudit(RsauShmInit): addr of SCSA........... = 05BD0040
    M  SecAudit(RsauShmInit): addr of RSAUSHM........ = 05BD07A8
    M  SecAudit(RsauShmInit): addr of RSAUSLOTINFO... = 05BD07E0
    M  SecAudit(RsauShmInit): addr of RSAUSLOTS...... = 05BD07EC

    A Wed Aug 31 15:48:44 2011
    A  RFC FRFC> fallback on the central gateway crmsys sapgw04 activ

    B Wed Aug 31 15:49:47 2011
    B  dbmyclu : info : my major identification is 3232288873, minor one 4.
    B  dbmyclu : info : Time Reference is 1.12.2001 00:00:00h GMT.
    B  dbmyclu : info : my initial uuid is D98FA690E8AA314D9B69930868792664.
    B  dbmyclu : info : current optimistic cluster level: 0
    B  dbmyclu : info : pessimistic reads set to 2.

  • How to encrypt/decrypt 4 character field in ABAP?

    Hello SDN Community,
    I have done extensive searches before posting this.  Have even explored fuction modules FIEB_PASSWD_ENCRYPT/DECRYPT.  Even looked at SSF Developers Guide - chapter 4.  The FIEB function modules were dead-end.  SSF looks like it concerns securing of documents or files.  Talks about certificates.
    I also looked at the SSF_BASE64_ENCRYPT/DECRYPT function modules on my system, which is ECC 6.0.  Wasn't sure if they could be used on a stand-alone basis, plus I couldn't find any documentation about them.
    I only want to encrypt, and then decrypt, the values in a 4 character field.   
        eg- DATA: MYFIELD(4) TYPE C.
    Is there an ABAP function module, or coding example, that would demonstrate this?
    Or possibly I overlooked something in the information that I have already found?
    Thank you,
    Dean Atteberry.

    Hi Morten,
    I would recommend reading the comments to the blog as well, as there would not be much difference between a 4 char field and...
    *-- check string-to-string algorithms
      string_in = 'Au weia, der Hahn legt keine Eier'. "#EC NOTEXT
      string_out = test_object->encrypt_string2string( string_in ).
      string_expected = 'AQYRHTFUERodER9UABMRGFQaHBU8VAYREFRYFR0RA1QBNQ=='.
      if string_out <> string_expected.
        result = abap_false.
        return.
      endif.
    ...if the result can be expected (in any SAP system) or easily reversed.
    But it might fullfill a requirement for obfuscation, which is what I was asking as well.
    Cheers,
    Julius

  • Abap basics material documents

    Hi Gurus,
    i am intrested to learn basic in Abap i want to make my carrrier in  it so i kindky request you to plz send material  my [email protected]
    Thanks in Advance,
    Edited by: Krishna on Apr 23, 2008 2:16 PM
    Edited by: Krishna on Apr 23, 2008 2:17 PM

    Hi....
    Go for Siemens material. Check the following link:
    http://www.sapbrainsonline.com/TUTORIALS/TECHNICAL/ABAP_tutorial.html
    additional info
    ABAP is one of many application-specific fourth-generation languages (4GLs) first developed in the 1980s. It was originally the report language for SAP R/2, a platform that enabled large corporations to build mainframe business applications for materials management and financial and management accounting. ABAP used to be an abbreviation of Allgemeiner Berichtsaufbereitungsprozessor, the German meaning of "generic report preparation processor", but was later renamed to Advanced Business Application Programming. ABAP was one of the first languages to include the concept of Logical Databases (LDBs), which provides a high level of abstraction from the basic database level.
    The ABAP programming language was originally used by SAP developers to develop the SAP R/3 platform. It was also intended to be used by SAP customers to enhance SAP applications – customers can develop custom reports and interfaces with ABAP programming. The language is fairly easy to learn for programmers but it is not a tool for direct use by non-programmers. Good programming skills, including knowledge of relational database design and preferably also of object-oriented concepts, are required to create ABAP programs.
    ABAP remains the language for creating programs for the client-server R/3 system, which SAP first released in 1992. As computer hardware evolved through the 1990s, more and more of SAP's applications and systems were written in ABAP. By 2001, all but the most basic functions were written in ABAP. In 1999, SAP released an object-oriented extension to ABAP called ABAP Objects, along with R/3 release 4.6.
    SAP's most recent development platform, NetWeaver, supports both ABAP and Java.
    edit Implementation
    edit Where does the ABAP Program Run?
    All ABAP programs reside inside the SAP database. They are not stored in separate external files like Java or C++ programs. In the database all ABAP code exists in two forms: source code, which can be viewed and edited with the ABAP workbench, and "compiled" code ("generated" code is the more correct technical term), which is loaded and interpreted by the ABAP runtime system. Code generation happens implicitly when a unit of ABAP code is first invoked. If the source code is changed later or if one of the data objects accessed by the program has changed (e.g. fields were added to a database table), then the code is automatically regenerated.
    ABAP programs run in the SAP application server, under control of the runtime system, which is part of the SAP kernel. The runtime system is responsible for processing ABAP statements, controlling the flow logic of screens and responding to events (such as a user clicking on a screen button). A key component of the ABAP runtime system is the Database Interface, which turns database-independent ABAP statements ("Open SQL") into statements understood by the underlying DBMS ("Native SQL"). The database interface handles all the communication with the relational database on behalf of ABAP programs; it also contains extra features such as buffering of frequently accessed data in the local memory of the application server.
    Basis
    Basis sits between ABAP/4 and Operating system.Basis is like an operating system for R/3. It sits between the ABAP/4 code and the computer's operating system. SAP likes to call it middleware because it sits in the middle, between ABAP/4 and the operating system. Basis sits between ABAP/4 and the operating system. ABAP/4 cannot run directly on an operating system. It requires a set of programs (collectively called Basis) to load, interpret, and buffer its input and output. Basis, in some respects, is like the Windows environment. Windows starts up, and while running it provides an environment in which Windows programs can run. Without Windows, programs written for the Windows environment cannot run. Basis is to ABAP/4 programs as Windows is to Windows programs. Basis provides the runtime environment for ABAP/4 programs. Without Basis, ABAP/4 programs cannot run. When the operator starts up R/3, you can think of him as starting up Basis. Basis is a collection of R/3 system programs that present you with an interface. Using this interface the user can start ABAP/4 programs. To install Basis, an installer runs the program r3inst at the command-prompt level of the operating system. Like most installs, this creates a directory structure and copies a set of executables into it. These executables taken together as a unit form Basis.
    To start up the R/3 system, the operator enters the startsap command. The Basis executables start up and stay running, accepting requests from the user to run ABAP/4 programs.
    ABAP/4 programs run within the protective Basis environment; they are not executables that run on the operating system. Instead, Basis reads ABAP/4 code and interprets it into operating system instructions. ABAP/4 programs do not access operating system functions directly. Instead, they use Basis functions to perform file I/O and display data in windows. This level of isolation from the operating system enables ABAP/4 programs to be ported without modification to any system that supports R/3. This buffering is built right into the ABAP/4 language itself and is actually totally transparent to the programmer.
    Basis makes ABAP/4 programs portable. The platforms that R/3 can run on are shown in Table. For example, if you write an ABAP/4 program on Digital UNIX with an Informix database and an OSF/Motif interface, that same program should run without modification on a Windows NT machine with an Oracle database and a Windows 95 interface. Or, it could run on an AS/400 with a DB2 database using OS/2 as the front-end.
    SAP also provides a suite of tools for administering the Basis system. These tools perform tasks such as system performance monitoring, configuration, and system maintenance. To access the Basis administration tools from the main menu, choose the path Tools->Administration.
    Platforms and Databases Supported by R/3
    Operating Systems Supported Hardware Supported Front-Ends Supported Databases
    AIX SINIX IBM SNI SUN Win 3.1/95/NT DB2 for AIX
    SOLARIS HP-UX Digital HP OSF/Motif Informix-Online
    Digital-UNIX Bull OS/2 Oracle 7.1
    Windows NT AT&T Compaq Win 3.1/95/NT Oracle 7.1
    Bull/Zenith OSF/Motif SQL Server 6.0
    HP (Intel) SNI OS/2 ADABAS D
    OS/400 AS/400 Win95 OS/2 DB2/400
    edit SAP Systems and Landscapes
    All SAP data exists and all SAP software runs in the context of an SAP system. A system consists of a central relational database and one or more application servers ("instances") accessing the data and programs in this database. A SAP system contains at least one instance but may contain more, mostly for reasons of sizing and performance. In a system with multiple instances, load balancing mechanisms ensure that the load is spread evenly over the available application servers.
    Installations of the Web Application Server (landscapes) typically consist of three systems: one for development, one for testing and quality assurance, and one for production. The landscape may contain more systems, e.g. separate systems for unit testing and pre-production testing, or it may contain fewer, e.g. only development and production, without separate QA; nevertheless three is the most common configuration. ABAP programs are created and undergo first testing in the development system. Afterwards they are distributed to the other systems in the landscape. These actions take place under control of the Change and Transport System (CTS), which is responsible for concurrency control (e.g. preventing two developers from changing the same code at the same time), version management and deployment of programs on the QA and production systems.
    The Web Application Server consists of three layers: the database layer, the application layer and the presentation layer. These layers may run on the same or on different physical machines. The database layer contains the relational database and the database software. The application layer contains the instance or instances of the system. All application processes, including the business transactions and the ABAP development, run on the application layer. The presentation layer handles the interaction with users of the system. Online access to ABAP application servers can go via a proprietary graphical interface, the SAPGUI, or via a Web browser.
    edit Transactions
    We call an execution of an ABAP program using a transaction code a transaction. There are dialog, report, parameter, variant, and as of release 6.10, OO transactions. A transaction is started by entering the transaction code in the input field on the standard toolbar, or by means of the ABAP statements CALL TRANSACTION or LEAVE TO TRANSACTION. Transaction codes can also be linked to screen elements or menu entries. Selecting such an element will start the transaction.
    A transaction code is simply a twenty-character name connected with a Dynpro, another transaction code, or, as of release 6.10, a method of an ABAP program. Transaction codes linked with Dynpros are possible for executable programs, module pools, and function groups. Parameter transactions and variant transactions are linked with other transaction codes. Transaction codes that are linked with methods are allowed for all program types that can contain methods. Transaction codes are maintained in transaction SE93.
    So, a transaction is nothing more than the SAP way of program execution—but why is it called “transaction”? ABAP is a language for business applications and the most important features of business applications were and still are are transactions. Since in the early days of SAP, the execution of a program often meant the same thing as carrying out a business transaction, the terms transaction and transaction code were chosen for program execution. But never mix up the technical meaning of a transaction with business transactions. For business transactions, it is the term LUW (Logical Unit of Work) that counts. And during one transaction (program execution), there can be many different LUW’s.
    Let’s have a look at the different kind of transactions:
    edit Dialog Transaction
    These are the most common kind of transactions. The transaction code of a dialog transaction is linked to a Dynpro of an ABAP program. When the transaction is called, the respective program is loaded and the Dynpro is called. Therefore, a dialog transaction calls a Dynpro sequence rather than a program. Only during the execution of the Dynpro flow logic are the dialog modules of the ABAP program itself are called. The program flow can differ from execution to execution. You can even assign different dialog transaction codes to one program.
    edit Parameter Transaction
    In the definition of a parameter transaction code, a dialog transaction is linked with parameters. When you call a parameter transaction, the input fields of the initial Dynpro screen of the dialog transaction are filled with parameters. The display of the initial screen can be inhibited by specifying all mandatory input fields as parameters of the transaction.
    edit Variant Transaction
    In the definition of a variant transaction code, a dialog transaction is linked with a transaction variant. When a variant transaction is accessed, the dialog transaction is called and executed with the transaction variant. In transaction variants, you can assign default values to the input fields on several Dynpro screens in a transaction, change the attributes of screen elements, and hide entire screens. Transaction variants are maintained in transaction SHD0.
    edit Report Transaction
    A report transaction is the transaction code wrapping for starting the reporting process. The transaction code of a report transaction must be linked with the selection screen of an executable program. When you execute a report transaction, the runtime environment internally executes the ABAP statement SUBMIT—more to come on that.
    edit OO Transaction
    A new kind of transaction as of release 6.10. The transaction code of an OO transaction is linked with a method of a local or global class. When the transaction is called, the corresponding program is loaded, for instance methods an object of the class is generated and the method is executed.
    edit Types of ABAP programs
    In ABAP, there are two different types of programs:
    edit Report programs(Executable pools)
    A Sample ReportReport programs AKA Executable pools follow a relatively simple programming model whereby a user optionally enters a set of parameters (e.g. a selection over a subset of data) and the program then uses the input parameters to produce a report in the form of an interactive list. The output from the report program is interactive because it is not a passive display; instead it enables the user, through ABAP language constructs, to obtain a more detailed view on specific data records via drill-down functions, or to invoke further processing through menu commands, for instance to sort the data in a different way or to filter the data according to selection criteria. This method of presenting reports has great advantages for users who must deal with large quantities of information and must also have the ability to examine this information in highly flexible ways, without being constrained by the rigid formatting or unmanageable size of "listing-like" reports. The ease with which such interactive reports can be developed is one of the most striking features of the ABAP language.
    The term "report" is somewhat misleading in the sense that it is also possible to create report programs that modify the data in the underlying database instead of simply reading it.
    A customized screen created using Screen Painter,which is one of the tool available in ABAP workbench(T-code = SE51).
    edit Online programs
    Online programs (also called module pools) do not produce lists. These programs define more complex patterns of user interaction using a collection of screens. The term “screen” refers to the actual, physical image that the users sees. Each screen also has a “flow logic”; this refers to the ABAP code invoked by the screens, i.e. the logic that initializes screens, responds to a user’s requests and controls the sequence between the screens of a module pool. Each screen has its own Flow Logic, which is divided into a "PBO" (Process Before Output) and "PAI" (Process After Input) section. In SAP documentation the term “dynpro” (dynamic program) refers to the combination of the screen and its Flow Logic.
    Online programs are not invoked directly by their name, but are associated with a transaction code. Users can then invoke them through customizable, role-dependent, transaction menus.
    Apart from reports and online programs, it is also possible to develop sharable code units such as class libraries, function libraries and subroutine pools.
    edit Subroutine Pools
    Subroutine pools, as the name implies, were created to contain selections of subroutines that can be called externally from other programs. Before release 6.10, this was the only way subroutine pools could be used. But besides subroutines, subroutine pools can also contain local classes and interfaces. As of release 6.10, you can connect transaction codes to methods. Therefore, you can now also call subroutine pools via transaction codes. This is the closest to a Java program you can get in ABAP: a subroutine pool with a class containing a method – say – main connected to a transaction code!
    edit Type Pools
    Type pools are the precursors to general type definitions in the ABAP Dictionary. Before release 4.0, only elementary data types and flat structures could be defined in the ABAP Dictionary. All other types that should’ve been generally available had to be defined with TYPES in type pools. As of release 4.0, type pools were only necessary for constants. As of release 6.40, constants can be declared in the public sections of global classes and type pools can be replaced by global classes.
    edit Class Pools
    Class pools serve as containers for exactly one global class. Besides the global class, they can contain global types and local classes/interfaces to be used in the global class. A class pool is loaded into memory by using one of its components. For example, a public method can be called from any ABAP program or via a transaction code connected to the method. You maintain class pools in the class builder.
    edit Interface Pools
    Interface pools serve as containers for exactly one global interface—nothing more and nothing less. You use an interface pool by implementing its interface in classes and by creating reference variables with the type of its interface. You maintain interface pools in the class builder.
    edit ABAP Workbench
    The ABAP Workbench contains different tools for editing Repository objects. These tools provide you with a wide range of assistance that covers the entire software development cycle. The most important tools for creating and editing Repository objects are:
    ABAP Editor for writing and editing program code
    ABAP Dictionary for processing database table definitions and retrieving global types
    Menu Painter for designing the user interface (menu bar, standard toolbar, application toolbar, function key assignment)
    Screen Painter for designing screens (dynamic programs) for user dialogs
    Function Builder for displaying and processing function modules (routines with defined interfaces that are available throughout the system)
    Class Builder for displaying and processing ABAP Objects classes
    edit The ABAP Dictionary
    Enforces data integrity
    Manages data definitions without redundancy
    Is tightly integrated with the rest of the ABAP/4 Development Workbench.
    Enforcing data integrity is the process of ensuring that data entered into the system is logical, complete, and consistent. When data integrity rules are defined in the ABAP/4 Dictionary, the system automatically prevents the entry of invalid data. Defining the data integrity rules at the dictionary level means they only have to be defined once, rather than in each program that accesses that data.
    The following are examples of data lacking integrity:
    A date field with a month value of 13
    An order assigned to a customer number that doesn’t exist
    An order not assigned to a customer
    Managing data definitions without redundancy is the process of linking similar information to the same data definition. For example, a customer database is likely to contain a customer’s ID number in several places. The ABAP Dictionary provides the capability of defining the characteristics of a customer ID number in only one place. That central definition then can be used for each instance of a customer ID number.
    The ABAP Dictionary’s integration with the rest of the development environment enables ABAP programs to automatically recognize the names and characteristics of dictionary objects.
    Additionally, the system provides easy navigation between development objects and dictionary definitions. For example, as a programmer, you can double-click on the name of a dictionary object in your program code, and the system will take you directly to the definition of that object in the ABAP/4 Dictionary.
    When a dictionary object is changed, a program that references the changed object will automatically reference the new version the next time the program runs. Because ABAP is interpreted, it is not necessary to recompile programs that reference changed dictionary objects.
    edit ABAP Syntax
    The syntax of the ABAP programming language consists of the following elements:
    Statements
    An ABAP program consists of individual ABAP statements. Each statement begins with a keyword and ends with a period.
    edit "Hello World" PROGRAM
    WRITE 'Hello World'.
    This example contains two statements, one on each line. The keywords are PROGRAM and WRITE. The program displays a list on the screen. In this case, the list consists of the line "My First Program".
    The keyword determines the category of the statement. For an overview of the different categories, refer to ABAP Statements.
    edit Formatting ABAP Statements
    ABAP has no format restrictions. You can enter statements in any format, so a statement can be indented, you can write several statements on one line, or spread a single statement over several lines.
    You must separate words within a statement with at least one space. The system also interprets the end of line marker as a space.
    The program fragment
    PROGRAM TEST.
    WRITE 'This is a statement'.
    could also be written as follows:
    PROGRAM TEST. WRITE 'This is a statement'.
    or as follows:
    PROGRAM
    TEST.
    WRITE
    'This is a statement'.
    Use this free formatting to make your programs easier to understand.
    edit Special Case: Text Literals
    Text literals are sequences of alphanumeric characters in the program code that are enclosed in quotation marks. If a text literal in an ABAP statement extends across more than one line, the following difficulties can occur:
    All spaces between the quotation marks are interpreted as belonging to the text literal. Letters in text literals in a line that is not concluded with quotation marks are interpreted by the editor as uppercase. If you want to enter text literals that do not fit into a single line, you can use the ‘&’ character to combine a succession of text literals into a single one.
    The program fragment
    PROGRAM TEST.
    WRITE 'This
    is
    a statement'.
    inserts all spaces between the quotation marks into the literal, and converts the letters to uppercase.
    This program fragment
    PROGRAM TEST.
    WRITE 'This' &
    ' is ' &
    'a statement'.
    combines three text literals into one.
    edit Chained Statements
    The ABAP programming language allows you to concatenate consecutive statements with an identical first part into a chain statement.
    To concatenate a sequence of separate statements, write the identical part only once and place a colon ( after it. After the colon, write the remaining parts of the individual statements, separating them with commas. Ensure that you place a period (.) after the last part to inform the system where the chain ends.
    Statement sequence:
    WRITE SPFLI-CITYFROM.
    WRITE SPFLI-CITYTO.
    WRITE SPFLI-AIRPTO.
    Chain statement:
    WRITE: SPFLI-CITYFROM, SPFLI-CITYTO, SPFLI-AIRPTO.
    In the chain, a colon separates the beginning of the statement from the variable parts. After the colon or commas, you can insert any number of spaces.
    You could, for example, write the same statement like this:
    WRITE: SPFLI-CITYFROM,
    SPFLI-CITYTO,
    SPFLI-AIRPTO.
    In a chain statement, the first part (before the colon) is not limited to the keyword of the statements.
    Statement sequence:
    SUM = SUM + 1.
    SUM = SUM + 2.
    SUM = SUM + 3.
    SUM = SUM + 4.
    Chain statement:
    SUM = SUM + : 1, 2, 3, 4.
    edit Comments
    Comments are texts that you can write between the statements of your ABAP program to explain their purpose to a reader. Comments are distinguished by the preceding signs * (at the beginning of a line) and " (at any position in a line). If you want the entire line to be a comment, enter an asterisk (*) at the beginning of the line. The system then ignores the entire line when it generates the program. If you want part of a line to be a comment, enter a double quotation mark (") before the comment. The system interprets comments indicated by double quotation marks as spaces.
    PROGRAM SAPMTEST *
    WRITTEN BY KARL BYTE, 06/27/1995 *
    LAST CHANGED BY RITA DIGIT, 10/01/1995 *
    TASK: DEMONSTRATION *
    PROGRAM SAPMTEST.
    DECLARATIONS *
    DATA: FLAG " GLOBAL FLAG
    NUMBER TYPE I " COUNTER
    PROCESSING BLOCKS *
    Advantages of ABAP over Contemporary languages
    ABAP OBJECTS
    Object orientation in ABAP is an extension of the ABAP language that makes available the advantages of object-oriented programming, such as encapsulation, interfaces, and inheritance. This helps to simplify applications and make them more controllable.
    ABAP Objects is fully compatible with the existing language, so you can use existing statements and modularization units in programs that use ABAP Objects, and can also use ABAP Objects in existing ABAP programs.
    edit ABAP Statements – an Overview
    The first element of an ABAP statement is the ABAP keyword. This determines the category of the statement. The different statement categories are as follows:
    edit Declarative Statements
    These statements define data types or declare data objects which are used by the other statements in a program or routine. The collected declarative statements in a program or routine make up its declaration part.
    Examples of declarative keywords:
    TYPES, DATA, TABLES
    edit Modularization Statements
    These statements define the processing blocks in an ABAP program.
    The modularization keywords can be further divided into:
    · Defining keywords
    You use statements containing these keywords to define subroutines, function modules, dialog modules and methods. You conclude these processing blocks using the END statements.
    Examples of definitive keywords:
    METHOD ... ENDMETHOD, FUNCTION ... ENDFUNCTION, MODULE ... ENDMODULE.
    · Event keywords
    You use statements containing these keywords to define event blocks. There are no special statements to conclude processing blocks - they end when the next processing block is introduced.
    Examples of event key words:
    AT SELECTION SCREEN, START-OF-SELECTION, AT USER-COMMAND
    edit Control Statements
    You use these statements to control the flow of an ABAP program within a processing block according to certain conditions.
    Examples of control keywords:
    IF, WHILE, CASE
    edit Call Statements
    You use these statements to call processing blocks that you have already defined using modularization statements. The blocks you call can either be in the same ABAP program or in a different program.
    Examples of call keywords:
    CALL METHOD, CALL TRANSACTION, SUBMIT, LEAVE TO
    Operational Statements These keywords process the data that you have defined using declarative statements.
    Examples of operational keywords:
    MOVE, ADD
    edit Unique Concept of Internal Table in ABAP
    Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data objects, they save the programmer the task of dynamic memory management in his or her programs. You should use internal tables whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for storing and formatting data from a database table within a program. They are also a good way of including very complicated data structures in an ABAP program.
    Like all elements in the ABAP type concept, internal tables can exist both as data types and as data objects A data type is the abstract description of an internal table, either in a program or centrally in the ABAP Dictionary, that you use to create a concrete data object. The data type is also an attribute of an existing data object.
    edit Internal Tables as Data Types
    Internal tables and structures are the two structured data types in ABAP. The data type of an internal table is fully specified by its line type, key, and table type.
    edit Line type
    The line type of an internal table can be any data type. The data type of an internal table is normally a structure. Each component of the structure is a column in the internal table. However, the line type may also be elementary or another internal table.
    edit Key
    The key identifies table rows. There are two kinds of key for internal tables - the standard key and a user-defined key. You can specify whether the key should be UNIQUE or NON-UNIQUE. Internal tables with a unique key cannot contain duplicate entries. The uniqueness depends on the table access method.
    If a table has a structured line type, its default key consists of all of its non-numerical columns that are not references or themselves internal tables. If a table has an elementary line type, the default key is the entire line. The default key of an internal table whose line type is an internal table, the default key is empty.
    The user-defined key can contain any columns of the internal table that are not references or themselves internal tables. Internal tables with a user-defined key are called key tables. When you define the key, the sequence of the key fields is significant. You should remember this, for example, if you intend to sort the table according to the key.
    edit Table type
    The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types:
    Standard tables have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled very quickly, since the system does not have to check whether there are already existing entries.
    Sorted tables are always saved sorted by the key. They also have an internal index. The system can access records either by using the table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique or non-unique. When you define the table, you must specify whether the key is to be unique or not. Standard tables and sorted tables are known generically as index tables.
    Hashed tables have no linear index. You can only access a hashed table using its key. The response time is independent of the number of table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. When you define the table, you must specify the key as UNIQUE.
    edit Generic Internal Tables
    Unlike other local data types in programs, you do not have to specify the data type of an internal table fully. Instead, you can specify a generic construction, that is, the key or key and line type of an internal table data type may remain unspecified. You can use generic internal tables to specify the types of field symbols and the interface parameters of procedures . You cannot use them to declare data objects.
    edit Internal Tables as Dynamic Data Objects
    Data objects that are defined either with the data type of an internal table, or directly as an internal table, are always fully defined in respect of their line type, key and access method. However, the number of lines is not fixed. Thus internal tables are dynamic data objects, since they can contain any number of lines of a particular type. The only restriction on the number of lines an internal table may contain are the limits of your system installation. The maximum memory that can be occupied by an internal table (including its internal administration) is 2 gigabytes. A more realistic figure is up to 500 megabytes. An additional restriction for hashed tables is that they may not contain more than 2 million entries. The line types of internal tables can be any ABAP data types - elementary, structured, or internal tables. The individual lines of an internal table are called table lines or table entries. Each component of a structured line is called a column in the internal table.
    edit Choosing a Table Type
    The table type (and particularly the access method) that you will use depends on how the typical internal table operations will be most frequently executed.
    edit Standard tables
    This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest possible access. You should fill a standard table by appending lines (ABAP APPEND statement), and read, modify and delete entries by specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship with the number of table entries. If you need key access, standard tables are particularly useful if you can fill and process the table in separate steps. For example, you could fill the table by appending entries, and then sort it. If you use the binary search option with key access, the response time is logarithmically proportional to the number of table entries.
    edit Sorted tables
    This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERT statement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the table key in the WHERE condition.
    edit Hashed tables
    This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index. The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data.
    edit Advanced Topics
    edit Batch Input: Concepts
    Processing Sessions
    The above figure shows how a batch input session works.A batch input session is a set of one or more calls to transactions along with the data to be processed by the transactions. The system normally executes the transactions in a session non-interactively, allowing rapid entry of bulk data into an R/3 System.
    A session records transactions and data in a special format that can be interpreted by the R/3 System. When the System reads a session, it uses the data in the session to simulate on-line entry of transactions and data. The System can call transactions and enter data using most of the facilities that are available to interactive users.
    For example, the data that a session enters into transaction screens is subject to the same consistency checking as in normal interactive operation. Further, batch input sessions are subject to the user-based authorization checking that is performed by the system.
    edit Advantages of ABAP over Contemporary languages
    ABAP Objects offers a number of advantages, even if you want to continue using procedural programming. If you want to use new ABAP features, you have to use object-oriented interfaces anyway.
    Sharing Data: With ABAP shared objects, you can aggregate data once at a central location and the different users and programs can then access this data without the need for copying.
    Exception Handling: With the class-based exception concept of ABAP, you can define a special control flow for a specific error situation and provide the user with information about the error.
    Developing Persistency: For permanent storage of data in ABAP, you use relational database tables by means of database-independent Open SQL, which is integrated in ABAP. However, you can also store selected objects transparently or access the integrated database or other databases using proprietary SQL.
    Connectivity and Interoperability: The Exchange Infrastructure and Web services are the means by which developers can implement a service-oriented architecture. With Web services, you can provide and consume services independently of implementation or protocol. Furthermore, you can do so within NetWeaver and in the communication with other systems. With the features of the Exchange Infrastructure, you can enable, manage, and adapt integration scenarios between systems.
    Making Enhancements: With the Enhancement Framework, you can enhance programs, function modules, and global classes without modification as well as replace existing code. The Switch Framework enables you activate only specific development objects or enhancements in a system.
    edit Considerable Aspects
    It follows a list of aspects to be considered during development. The list of course is not complete.
    edit Dynpro persistence
    When implementing dynpros one has to care for himself to read out and persist the necessary fields. Recently it happened to me that I forgot to include a field into the UPDATE-clause which is an error not so easy to uncover if you have other problems to be solved in the same package. Here, tool-support or built-in mechanisms would help.
    The developer could help himself out by creating something like a document containing a cookbook or guide in which parts of a dynpro logic one has to care about persistence. With that at hand, it would be quite easy finding those bugs in short time. Maybe a report scanning for the definition of the dynpro fields to be persisted could scan the code automatically, too.
    edit Memory Cache
    It should be common-sense that avoiding select-statements onto the database helps reducing the server load. For that the programmer either can resort to function modules if available. This maybe is the case for important tables. Or the programmer needs to implement his own logic using internal tables. Here, the standard software package could provide the developer with a tool or a mechanism auto-generating memory cached tables resp. function modules implementing this.
    Sometimes buffering of database tables could be used, if applicable. But that would require an effort in customizing the system and could drain down system performance overall, especially if a table is involved that has a central role.
    edit Interfaces
    It should be noticed that some function modules available have an incomplete interface. That means, the interface does not include all parameters evaluated by the logic of the function module. For example, global variables from within the function group could be read out, which cannot be influenced by the general caller. Or memory parameters are used internally to feed the logic with further information.
    One workaround here would be copying the relevant parts of the logic to a newly created function module and then adapt it to the own context. This sometimes is possible, maybe if the copied code is not too lengthy and only a few or no calls to other logic is part of it.
    A modification of the SAP code could be considered, if the modification itself is unavoidable (or another solution would be not justifiable by estimated effort to spend on it) and if the location of the modification seems quite safe against future upgrades or hot fixes. The latter is something that could be evaluated by contacting the SAP hotline or working with OSS message (searching thru existing one, perhaps open a new one).
    edit Example
    'From SAP NetWeaver:'
    set an exclusive lock at level object-type & object-id
    IF NOT lf_bapi_error = true.
    IF ( NOT istourhd-doc_type IS INITIAL ) AND
    ( NOT istourhd-doc_id IS INITIAL )
    CALL FUNCTION 'ENQUEUE_/DSD/E_HH_RAREF'
    EXPORTING
    obj_typ = istourhd-doc_type
    obj_id = istourhd-doc_id
    EXCEPTIONS
    foreign_lock = 1
    system_failure = 2
    OTHERS = 3.
    IF sy-subrc 0.
    terminate processing...
    lf_bapi_error = true.—
    ...and add message to return table
    PERFORM set_msg_to_bapiret2
    USING sy-msgid gc_abort sy-msgno
    sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
    gc_istourhd gc_enqueue_refdoc space
    CHANGING lt_return.
    ENDIF.
    ENDIF.
    ENDIF. " bapi error
    edit Example Report(Type - ALV(Advanced List Viewer))
    REPORT Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB .
    *Simple example to use ALV and to define the ALV data in an internal
    *table
    *data definition
    tables:
    marav. "Table MARA and table MAKT
    Data to be displayed in ALV
    Using the following syntax, REUSE_ALV_FIELDCATALOG_MERGE can auto-
    matically determine the fieldstructure from this source program
    Data:
    begin of imat occurs 100,
    matnr like marav-matnr, "Material number
    maktx like marav-maktx, "Material short text
    matkl like marav-matkl, "Material group (so you can test to make
    " intermediate sums)
    ntgew like marav-ntgew, "Net weight, numeric field (so you can test to
    "make sums)
    gewei like marav-gewei, "weight unit (just to be complete)
    end of imat.
    Other data needed
    field to store report name
    data i_repid like sy-repid.
    field to check table length
    data i_lines like sy-tabix.
    Data for ALV display
    TYPE-POOLS: SLIS.
    data int_fcat type SLIS_T_FIELDCAT_ALV.
    select-options:
    s_matnr for marav-matnr matchcode object MAT1.
    start-of-selection.
    read data into table imat
    select * from marav
    into corresponding fields of table imat
    where
    matnr in s_matnr.
    Check if material was found
    clear i_lines.
    describe table imat lines i_lines.
    if i_lines lt 1.
    Using hardcoded write here for easy upload
    write: /
    'No materials found.'.
    exit.
    endif.
    end-of-selection.
    To use ALV, we need a DDIC-structure or a thing called Fieldcatalogue.
    The fieldcatalouge can be generated by FUNCTION
    'REUSE_ALV_FIELDCATALOG_MERGE' from an internal table from any
    report source, including this report.
    Store report name
    i_repid = sy-repid.
    Create Fieldcatalogue from internal table
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = i_repid
    I_INTERNAL_TABNAME = 'IMAT' "capital letters!
    I_INCLNAME = i_repid
    CHANGING
    CT_FIELDCAT = int_fcat
    EXCEPTIONS
    INCONSISTENT_INTERFACE = 1
    PROGRAM_ERROR = 2
    OTHERS = 3.
    *explanations:
    I_PROGRAM_NAME is the program which calls this function
    I_INTERNAL_TABNAME is the name of the internal table which you want
    to display in ALV
    I_INCLNAME is the ABAP-source where the internal table is defined
    (DATA....)
    CT_FIELDCAT contains the Fieldcatalouge that we need later for
    ALV display
    IF SY-SUBRC 0.
    write: /
    'Returncode',
    sy-subrc,
    'from FUNCTION REUSE_ALV_FIELDCATALOG_MERGE'.
    ENDIF.
    *This was the fieldcatlogue
    Call for ALV list display
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = i_repid
    IT_FIELDCAT = int_fcat
    TABLES
    T_OUTTAB = imat
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    *explanations:
    I_CALLBACK_PROGRAM is the program which calls this function
    IT_FIELDCAT (just made by REUSE_ALV_FIELDCATALOG_MERGE) contains
    now the data definition needed for display
    I_SAVE allows the user to save his own layouts
    T_OUTTAB contains the data to be displayed in ALV
    IF SY-SUBRC 0.
    write: /
    'Returncode',
    sy-subrc,
    'from FUNCTION REUSE_ALV_LIST_DISPLAY'.
    ENDIF.
    first learn basic programing afterwards
    go through commands, statements , events, functional modules.....etc.
    and implement these stuff, in programing,. and do practising.
    Check the following links:
    http://www.sapbrainsonline.com/TUTORIALS/TECHNICAL/ABAP_tutorial.html
    http://sap-img.com/
    http://sapabaplive.blogspot.com/2007/07/download-abap-in-21-days.html
    http://help.sap.com/saphelp_40b/helpdata/en/4f/991f82446d11d189700000e8322d00/applet.htm
    http://www.sapbrainsonline.com/TUTORIALS/TECHNICAL/ABAP_tutorial.html
    http://www.esnips.com/web/SAPAbapCertificationDocs/
    Start with this.Refer this
    For BDC:
    http://myweb.dal.ca/hchinni/sap/bdc_home.htm
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&
    http://www.sap-img.com/abap/learning-bdc-programming.htm
    http://www.sapdevelopment.co.uk/bdc/bdchome.htm
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
    Check these link:
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://www.sap-img.com/abap/question-about-bdc-program.htm

  • Performance of ABAP program

    How do you take care of performance issues in your abap programs?

    HI
    and you can see this also
    Ways of Performance Tuning
    1.     Selection Criteria
    2.     Select Statements
    •     Select Queries
    •     SQL Interface
    •     Aggregate Functions
    •     For all Entries
    Select Over more than one Internal table
    Selection Criteria
    1.     Restrict the data to the selection criteria itself, rather than filtering it out using the ABAP code using CHECK statement. 
    2.     Select with selection list.
    Points # 1/2
    SELECT * FROM SBOOK INTO SBOOK_WA.
      CHECK: SBOOK_WA-CARRID = 'LH' AND
             SBOOK_WA-CONNID = '0400'.
    ENDSELECT.
    The above code can be much more optimized by the code written below which avoids CHECK, selects with selection list
    SELECT  CARRID CONNID FLDATE BOOKID FROM SBOOK INTO TABLE T_SBOOK
      WHERE SBOOK_WA-CARRID = 'LH' AND
                  SBOOK_WA-CONNID = '0400'.
    Select Statements   Select Queries
    1.     Avoid nested selects
    2.     Select all the records in a single shot using into table clause of select statement rather than to use Append statements.
    3.     When a base table has multiple indices, the where clause should be in the order of the index, either a primary or a secondary index.
    4.     For testing existence , use Select.. Up to 1 rows statement instead of a Select-Endselect-loop with an Exit. 
    5.     Use Select Single if all primary key fields are supplied in the Where condition .
    Point # 1
    SELECT * FROM EKKO INTO EKKO_WA.
      SELECT * FROM EKAN INTO EKAN_WA
          WHERE EBELN = EKKO_WA-EBELN.
      ENDSELECT.
    ENDSELECT.
    The above code can be much more optimized by the code written below.
    SELECT PF1 PF2 FF3 FF4 INTO TABLE ITAB
        FROM EKKO AS P INNER JOIN EKAN AS F
          ON PEBELN = FEBELN.
    Note: A simple SELECT loop is a single database access whose result is passed to the ABAP program line by line. Nested SELECT loops mean that the number of accesses in the inner loop is multiplied by the number of accesses in the outer loop. One should therefore use nested SELECT loops  only if the selection in the outer loop contains very few lines or the outer loop is a SELECT SINGLE statement.
    Point # 2
    SELECT * FROM SBOOK INTO SBOOK_WA.
      CHECK: SBOOK_WA-CARRID = 'LH' AND
             SBOOK_WA-CONNID = '0400'.
    ENDSELECT.
    The above code can be much more optimized by the code written below which avoids CHECK, selects with selection list and puts the data in one shot using into table
    SELECT  CARRID CONNID FLDATE BOOKID FROM SBOOK INTO TABLE T_SBOOK
      WHERE SBOOK_WA-CARRID = 'LH' AND
                  SBOOK_WA-CONNID = '0400'.
    Point # 3
    To choose an index, the optimizer checks the field names specified in the where clause and then uses an index that has the same order of the fields . In certain scenarios, it is advisable to check whether a new index can speed up the performance of a program. This will come handy in programs that access data from the finance tables.
    Point # 4
    SELECT * FROM SBOOK INTO SBOOK_WA
      UP TO 1 ROWS
      WHERE CARRID = 'LH'.
    ENDSELECT.
    The above code is more optimized as compared to the code mentioned below for testing existence of a record.
    SELECT * FROM SBOOK INTO SBOOK_WA
        WHERE CARRID = 'LH'.
      EXIT.
    ENDSELECT.
    Point # 5
    If all primary key fields are supplied in the Where condition you can even use Select Single.
    Select Single requires one communication with the database system, whereas Select-Endselect needs two.
    Select Statements           contd..  SQL Interface
    1.     Use column updates instead of single-row updates
    to update your database tables.
    2.     For all frequently used Select statements, try to use an index.
    3.     Using buffered tables improves the performance considerably.
    Point # 1
    SELECT * FROM SFLIGHT INTO SFLIGHT_WA.
      SFLIGHT_WA-SEATSOCC =
        SFLIGHT_WA-SEATSOCC - 1.
      UPDATE SFLIGHT FROM SFLIGHT_WA.
    ENDSELECT.
    The above mentioned code can be more optimized by using the following code
    UPDATE SFLIGHT
           SET SEATSOCC = SEATSOCC - 1.
    Point # 2
    SELECT * FROM SBOOK CLIENT SPECIFIED INTO SBOOK_WA
      WHERE CARRID = 'LH'
        AND CONNID = '0400'.
    ENDSELECT.
    The above mentioned code can be more optimized by using the following code
    SELECT * FROM SBOOK CLIENT SPECIFIED INTO SBOOK_WA
      WHERE MANDT IN ( SELECT MANDT FROM T000 )
        AND CARRID = 'LH'
        AND CONNID = '0400'.
    ENDSELECT.
    Point # 3
    Bypassing the buffer increases the network considerably
    SELECT SINGLE * FROM T100 INTO T100_WA
      BYPASSING BUFFER
      WHERE     SPRSL = 'D'
            AND ARBGB = '00'
            AND MSGNR = '999'.
    The above mentioned code can be more optimized by using the following code
    SELECT SINGLE * FROM T100  INTO T100_WA
      WHERE     SPRSL = 'D'
            AND ARBGB = '00'
            AND MSGNR = '999'.
    Select Statements       contd…           Aggregate Functions
    •     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.
    Some of the Aggregate functions allowed in SAP are  MAX, MIN, AVG, SUM, COUNT, COUNT( * )
    Consider the following extract.
                Maxno = 0.
                Select * from zflight where airln = ‘LF’ and cntry = ‘IN’.
                 Check zflight-fligh > maxno.
                 Maxno = zflight-fligh.
                Endselect.
    The  above mentioned code can be much more optimized by using the following code.
    Select max( fligh ) from zflight into maxno where airln = ‘LF’ and cntry = ‘IN’.
    Select Statements    contd…For All Entries
    •     The for all entries creates a where clause, where all the entries in the driver table are combined with OR. If the number of entries in the driver table is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit the length of the WHERE clause.
         The plus
    •     Large amount of data
    •     Mixing processing and reading of data
    •     Fast internal reprocessing of data
    •     Fast
         The Minus
    •     Difficult to program/understand
    •     Memory could be critical (use FREE or PACKAGE size)
    Points to be must considered FOR ALL ENTRIES
    •     Check that data is present in the driver table
    •     Sorting the driver table
    •     Removing duplicates from the driver table
    Consider the following piece of extract
    Loop at int_cntry.
           Select single * from zfligh into int_fligh
    where cntry = int_cntry-cntry.
    Append int_fligh.
    Endloop.
    The above mentioned can be more optimized by using the following code.
    Sort int_cntry by cntry.
    Delete adjacent duplicates from int_cntry.
    If NOT int_cntry[] is INITIAL.
                Select * from zfligh appending table int_fligh
                For all entries in int_cntry
                Where cntry = int_cntry-cntry.
    Endif.
    Select Statements    contd…  Select Over more than one Internal table
    1.     Its better to use a views instead of nested Select statements.
    2.     To read data from several logically connected tables use a join instead of nested Select statements. Joins are preferred only if all the primary key are available in WHERE clause for the tables that are joined. If the primary keys are not provided in join the Joining of tables itself takes time.
    3.     Instead of using nested Select loops it is often better to use subqueries.
    Point # 1
    SELECT * FROM DD01L INTO DD01L_WA
      WHERE DOMNAME LIKE 'CHAR%'
            AND AS4LOCAL = 'A'.
      SELECT SINGLE * FROM DD01T INTO DD01T_WA
        WHERE   DOMNAME    = DD01L_WA-DOMNAME
            AND AS4LOCAL   = 'A'
            AND AS4VERS    = DD01L_WA-AS4VERS
            AND DDLANGUAGE = SY-LANGU.
    ENDSELECT.
    The above code can be more optimized by extracting all the data from view DD01V_WA
    SELECT * FROM DD01V INTO  DD01V_WA
      WHERE DOMNAME LIKE 'CHAR%'
            AND DDLANGUAGE = SY-LANGU.
    ENDSELECT
    Point # 2
    SELECT * FROM EKKO INTO EKKO_WA.
      SELECT * FROM EKAN INTO EKAN_WA
          WHERE EBELN = EKKO_WA-EBELN.
      ENDSELECT.
    ENDSELECT.
    The above code can be much more optimized by the code written below.
    SELECT PF1 PF2 FF3 FF4 INTO TABLE ITAB
        FROM EKKO AS P INNER JOIN EKAN AS F
          ON PEBELN = FEBELN.
    Point # 3
    SELECT * FROM SPFLI
      INTO TABLE T_SPFLI
      WHERE CITYFROM = 'FRANKFURT'
        AND CITYTO = 'NEW YORK'.
    SELECT * FROM SFLIGHT AS F
        INTO SFLIGHT_WA
        FOR ALL ENTRIES IN T_SPFLI
        WHERE SEATSOCC < F~SEATSMAX
          AND CARRID = T_SPFLI-CARRID
          AND CONNID = T_SPFLI-CONNID
          AND FLDATE BETWEEN '19990101' AND '19990331'.
    ENDSELECT.
    The above mentioned code can be even more optimized by using subqueries instead of for all entries.
    SELECT * FROM SFLIGHT AS F INTO SFLIGHT_WA
        WHERE SEATSOCC < F~SEATSMAX
          AND EXISTS ( SELECT * FROM SPFLI
                         WHERE CARRID = F~CARRID
                           AND CONNID = F~CONNID
                           AND CITYFROM = 'FRANKFURT'
                           AND CITYTO = 'NEW YORK' )
          AND FLDATE BETWEEN '19990101' AND '19990331'.
    ENDSELECT.
    1.     Table operations should be done using explicit work areas rather than via header lines.
    2.     Always try to use binary search instead of linear search. But don’t forget to sort your internal table before that.
    3.     A dynamic key access is slower than a static one, since the key specification must be evaluated at runtime.
    4.     A binary search using secondary index takes considerably less time.
    5.     LOOP ... WHERE is faster than LOOP/CHECK because LOOP ... WHERE evaluates the specified condition internally.
    6.     Modifying selected components using “ MODIFY itab …TRANSPORTING f1 f2.. “ accelerates the task of updating  a line of an internal table.
    Point # 2
    READ TABLE ITAB INTO WA WITH KEY K = 'X‘ BINARY SEARCH.
    IS MUCH FASTER THAN USING
    READ TABLE ITAB INTO WA WITH KEY K = 'X'.
    If TAB has n entries, linear search runs in O( n ) time, whereas binary search takes only O( log2( n ) ).
    Point # 3
    READ TABLE ITAB INTO WA WITH KEY K = 'X'. IS FASTER THAN USING
    READ TABLE ITAB INTO WA WITH KEY (NAME) = 'X'.
    Point # 5
    LOOP AT ITAB INTO WA WHERE K = 'X'.
    ENDLOOP.
    The above code is much faster than using
    LOOP AT ITAB INTO WA.
      CHECK WA-K = 'X'.
    ENDLOOP.
    Point # 6
    WA-DATE = SY-DATUM.
    MODIFY ITAB FROM WA INDEX 1 TRANSPORTING DATE.
    The above code is more optimized as compared to
    WA-DATE = SY-DATUM.
    MODIFY ITAB FROM WA INDEX 1.
    7.     Accessing the table entries directly in a "LOOP ... ASSIGNING ..." accelerates the task of updating a set of lines of an internal table considerably
    8.    If collect semantics is required, it is always better to use to COLLECT rather than READ BINARY and then ADD.
    9.    "APPEND LINES OF itab1 TO itab2" accelerates the task of appending a table to another table considerably as compared to “ LOOP-APPEND-ENDLOOP.”
    10.   “DELETE ADJACENT DUPLICATES“ accelerates the task of deleting duplicate entries considerably as compared to “ READ-LOOP-DELETE-ENDLOOP”.
    11.   "DELETE itab FROM ... TO ..." accelerates the task of deleting a sequence of lines considerably as compared to “  DO -DELETE-ENDDO”.
    Point # 7
    Modifying selected components only makes the program faster as compared to Modifying all lines completely.
    e.g,
    LOOP AT ITAB ASSIGNING <WA>.
      I = SY-TABIX MOD 2.
      IF I = 0.
        <WA>-FLAG = 'X'.
      ENDIF.
    ENDLOOP.
    The above code works faster as compared to
    LOOP AT ITAB INTO WA.
      I = SY-TABIX MOD 2.
      IF I = 0.
        WA-FLAG = 'X'.
        MODIFY ITAB FROM WA.
      ENDIF.
    ENDLOOP.
    Point # 8
    LOOP AT ITAB1 INTO WA1.
      READ TABLE ITAB2 INTO WA2 WITH KEY K = WA1-K BINARY SEARCH.
      IF SY-SUBRC = 0.
        ADD: WA1-VAL1 TO WA2-VAL1,
             WA1-VAL2 TO WA2-VAL2.
        MODIFY ITAB2 FROM WA2 INDEX SY-TABIX TRANSPORTING VAL1 VAL2.
      ELSE.
        INSERT WA1 INTO ITAB2 INDEX SY-TABIX.
      ENDIF.
    ENDLOOP.
    The above code uses BINARY SEARCH for collect semantics. READ BINARY runs in O( log2(n) ) time. The above piece of code can be more optimized by
    LOOP AT ITAB1 INTO WA.
      COLLECT WA INTO ITAB2.
    ENDLOOP.
    SORT ITAB2 BY K.
    COLLECT, however, uses a hash algorithm and is therefore independent
    of the number of entries (i.e. O(1)) .
    Point # 9
    APPEND LINES OF ITAB1 TO ITAB2.
    This is more optimized as compared to
    LOOP AT ITAB1 INTO WA.
      APPEND WA TO ITAB2.
    ENDLOOP.
    Point # 10
    DELETE ADJACENT DUPLICATES FROM ITAB COMPARING K.
    This is much more optimized as compared to
    READ TABLE ITAB INDEX 1 INTO PREV_LINE.
    LOOP AT ITAB FROM 2 INTO WA.
      IF WA = PREV_LINE.
        DELETE ITAB.
      ELSE.
        PREV_LINE = WA.
      ENDIF.
    ENDLOOP.
    Point # 11
    DELETE ITAB FROM 450 TO 550.
    This is much more optimized as compared to
    DO 101 TIMES.
      DELETE ITAB INDEX 450.
    ENDDO.
    12.   Copying internal tables by using “ITAB2[ ] = ITAB1[ ]” as compared to “LOOP-APPEND-ENDLOOP”.
    13.   Specify the sort key as restrictively as possible to run the program faster.
    Point # 12
    ITAB2[] = ITAB1[].
    This is much more optimized as compared to
    REFRESH ITAB2.
    LOOP AT ITAB1 INTO WA.
      APPEND WA TO ITAB2.
    ENDLOOP.
    Point # 13
    “SORT ITAB BY K.” makes the program runs faster as compared to “SORT ITAB.”
    Internal Tables         contd…
    Hashed and Sorted tables
    1.     For single read access hashed tables are more optimized as compared to sorted tables.
    2.      For partial sequential access sorted tables are more optimized as compared to hashed tables
    Hashed And Sorted Tables
    Point # 1
    Consider the following example where HTAB is a hashed table and STAB is a sorted table
    DO 250 TIMES.
      N = 4 * SY-INDEX.
      READ TABLE HTAB INTO WA WITH TABLE KEY K = N.
      IF SY-SUBRC = 0.
      ENDIF.
    ENDDO.
    This runs faster for single read access as compared to the following same code for sorted table
    DO 250 TIMES.
      N = 4 * SY-INDEX.
      READ TABLE STAB INTO WA WITH TABLE KEY K = N.
      IF SY-SUBRC = 0.
      ENDIF.
    ENDDO.
    Point # 2
    Similarly for Partial Sequential access the STAB runs faster as compared to HTAB
    LOOP AT STAB INTO WA WHERE K = SUBKEY.
    ENDLOOP.
    This runs faster as compared to
    LOOP AT HTAB INTO WA WHERE K = SUBKEY.
    ENDLOOP.

Maybe you are looking for

  • Confused iPhone wi-fi syncing to two iTunes libraries

    My iPhone is confused. It is syncing to two different computers. I have always had it synced to my home MacBook, and only charge it via USB during work on a Windows7 computer. Never a problem in three years. Now with ios5 and iTunes 10.5, after setti

  • Can't open PDF documents

    Hello! When I want to open a new PDF document this screen shows up: "Before viewing PDF documents in this browser you must launch Adobe Reader and accept the End User Agreement, then Quit and relaunch the browser." What is wrong? I have install Adobe

  • Unable to snyc calender and contacs from outlook 2011 for mac

    iTunes won't sync calenders and contacts from Outlook 2011 for Mac OS Mavericks 10.9.5 iTunes 12.0.1.26 Also tried on iTunes 11.4

  • How to create Alphanumeric Number Range

    Hello Experts , I want to create a alphanumeric number range for vendor . Could you please give some information on the the format to specify in Number range transaction ? For Example : How do I create  CDPDM01DKK   vendor Regards Shashank

  • JDK 1.5 Release Date?

    Does anyone have anymore detailed information on the 1.5 release date other than "scheduled for release in the summer of 2004" as described on sun's site? http://java.sun.com/j2se/1.5/index.jsp TIA, Chris [email protected]