SAP details: Events News - Training - World wide sites  - Sap Labs SAP Magazine  - SAP Screen saver - Stock Price
Tips and Tricks  for ABAP 

  1. ABAP General....Click here.
  2. Reporting....Click here.
  3. Dialog Programming/Table Control....Click here.
  4. SAP General....Click here.
  5. How to get Developers key....Click here.
  6. What is the use of Logical file name and its object ??....Click here.
  7. Background Processing in SAP R/3....Click here.
  8. What is Batch Input objects....Click here.

Reporting

  1. How do I add a pushbutton on the application toolbar of report selection screen? 
  2. How do I indicate progress while executing a program? 
  3. How do I pop-up my own selection selection values for a select-option ?
  4. How do I let user display program documentation while on a selection screen? 
  5. How do I get report program name text?
  6. How do I protect certain field on selection screen?
  7. How do I get the address of a company  given company code?
  8. How do I read an EXCEL file for upload. How do I download to an EXCEL file?
  9. How do I add a selection screen parameter to get a local file name with pull down?
  10. How do I read a file on my C:\ drive and/or a file residing on UNIX sub-directory?
  11. How do I print standard header and footer on all pages of a report? Do you have code for standard header & footer function module? 
  12. How do I print selection screen values on a report? 
  13. How do I show valid month and their description as the pull-down option on a month seletion field? 
  14. What are the various way’s you can make the user execute a report program 
  15. There are flat files residing on UNIX sub-directory. How can a report program list all these files for the user to select one of them. 
  16. How do I let user to decide the format of the report?

Dialog Programming/Table Control

  1. How do I hide a column in a table control at runtime? 
  2. How do I change attributes of an item in a screen and in a table control at runtime? 
  3. How do I go to a transaction by double clicking on a field in the screen? 
  4. How do I know that user has changed something on a dialog screen?  

ABAP/4 General

  1. How do I send mail to a user(s) from an ABAP/4 program without using SAP Office? 
  2. How do I capture the screen sequence and values of a transaction for data transfer? 
  3. How do I copy and paste from one session to another?
  4. How do I register a function module as RFC enabled?
  5. One of my custom table has more than million records and I need to access only few thousand. When I do SELECT *  from Ztable WHERE code like P%, I get short dump because the system reads the entire Ztable to specifically select the once I require. Meanwhile the system get’s time out eventually giving a short dump. How do I handle this scenerio. 
  6. I am editing a program and get logged out by the system. The next time I login and try to edit the same program, I get a message ‘you are already editing this program’. How can I cancel the session which is still active before I got logged out. 
  7. What are the various ways UPDATE table will update all the records instead of one record. 
  8. How do I download text elements of a report program? 
  9. How do you write an ABAP program to find out menu path for a particualar transaction screen. 
  10. How can you view the entire program which will also expand all includes, function modules, subroutines & subprograms. 
  11. How do I change value of a field in debug mode? 

SAP General

  1. How do I get back to SAP screens I was working on if SAP was terminated? 
  2. How do I assign a CTS number to a local private object ($TMP)?
  3. How do I view an ABAP dump happened in the SAP system?
  4. How do I set my user information in SAP? 
  5. How do I reset my password? 
  6. How do I kill a long running job in SAP?  
  7. How do I compare two tables between two systems?  
  8. How do I compare two versions of program? 
  9. How do I find the program name if I know the transaction code?   
  10. How do I find user exit in a standard SAP program for me to include enhancement. 
  11. I added new entries to an existing table and assigned the changes to a transport number. If I want to transport the entire table (definition and data), what are the steps involved. 
  12. How do I list files residing on a Unix directory? 
  13. How do I view SAP settings?

Reporting
How do I add a pushbutton on the application toolbar of report selection screen?
Add the following code in appropriate events mentioned to display one button with label 'my_button' (You could have up to 5 buttons on the selection screen). Upon pressing the button, form 'f_my_button' get executed. 

tables sscrfields.             "Fields on selection screens

selection-screen function key 1.   "button on the application toolbar

initialization. 
* Populating button text 
  move 'my_button' to sscrfields-functxt_01. 
 
at selection-screen.  
  if sscrfields-ucomm = 'FC01'. 
     perform f_my_button. 
How do I indicate progress while executing a program? 
use function 'PROGRESS_INDICATOR' 
How do I pop-up my own selection values for a select-option/parameters? 
- Help View 
- code example 
How do I let user display program documentation while on a selection screen? 
step 1: 
Create program documentation using the Documentation option on the SE38 screen.
Documentation suggestions:
Description :    Lists and describes processing steps done in the 
                 program. 
Precondition:    Lists any input and processing that is necessary 
                 before executing the program. 
Select Options:  List all the selection options and values expected 
Output:          Lists any output from the program. 
SAP function:    List of sap functions used by the program. 
Transactions called:  List of sap transactions called in the program.
Programs called: Lists all programs called by the abap program. 

step   2: 
Add the following code in approprate sections/events:

tables sscrfields.             "Fields on selection screens 
 
selection-screen function key 1.   "button on the application toolbar 
 
initialization. 
* Populating button text 
  write icon_display_note as icon to sscrfields-functxt_01. 
  concatenate sscrfields-functxt_01 'Help' into sscrfields-functxt_01. 
 
at selection-screen. 
  if sscrfields-ucomm = 'FC01'. 
    perform f_pgm_help. 
  endif. 
 
form f_pgm_help. 
   data: begin of help_infos. 
           include structure help_info. 
   data: end of help_infos. 
   data: begin of dynpselect occurs 0. 
           include structure dselc. 
   data: end of dynpselect. 
   data: begin of dynpvaluetab occurs 0. 
           include structure dval. 
   data: end of dynpvaluetab. 
 
   clear help_infos. 
   help_infos-call      = 'D'. 
   help_infos-spras     = sy-langu. 
   help_infos-docuid    = 'RE'. 
   help_infos-report    = sy-repid. 
   help_infos-title     = sy-title. 
   call function 'HELP_START' 
        exporting 
             help_infos   = help_infos 
        tables 
             dynpselect   = dynpselect 
             dynpvaluetab = dynpvaluetab. 
endform.                               " F_PGM_HELP 
 

How do I get report program name text 
Use command READ TEXT-POOL. example code 
How do I protect certain field on selection screen.
(This is to make the field output only)
parameter: p_parm1(2) default 'MY'.

at selection-screen output.
  loop at screen.                
    if screen-name = 'P_PARM1'. 
      screen-output = 1.         
      modify screen.             
      exit.                      
    endif.                       
  endloop.                   

How do I get the address of a company  given company code.
How do I read an EXCEL file for upload. How do I download to an EXCEL file.
How do I add a selection screen parameter to get a local file name with pull down?

parameters: p_infile like ibipparms-path default 'C:\'.

* Executes the pull-down to search C:\ drive for input file 
at selection-screen on value-request for p_infile. 
  call function 'F4_FILENAME'          "allows user to select path/file 
       exporting 
            program_name  = syst-repid 
            dynpro_number = syst-dynnr 
            field_name    = 'p_infile' 
       importing 
            file_name     = p_infile. 
  if sy-subrc ne 0. 
    write: / 'Error'. 
  endif.

How do I read a file on my C:\ drive and/or a file residing on UNIX sub-directory. 
How do I print standard header and footer on all pages of a report? Do you have code for standard header & footer function module?
How do I print selection screen values on a report? 
How do I show valid month and their description as the pull-down option on a month seletion field? 
What are the various way’s you can make the user execute a report program 
There are flat files residing on UNIX sub-directory. How can a report program list all these files for the user to select one of them. 
How do I let user to decide the format of the report?

Dialog Programming/Table Control
How do I hide a column in a table control at runtime?  (by Manoj Nair) 
1. define group name(s) for the columns to be hidden
2. Add the following code...
(define)
controls tbl_ctrl type tableview ...
wa like tbl_ctrl-cols.

loop at tbl_ctrl-cols into wa.
     if wa-screen-group1 = <group defined for the column>
        wa-invisible = 1.
        modify tbl_ctrl-cols from wa
    endif
endloop

How do I change attributes of an item in a screen and in a table control at runtime?
add the following code in PBO

loop at screen.                      
      if screen-name = 'NAME_OF_FIELD_HERE_IN_CAPS'.   
  set attributes of screen such as REQUIRED, INPUT, OUTPUT, INTENSIFIED, INVISIBLE, ACTIVE, DISPLAY_3D, VALUE_HELP to 1(ON) or 0(OFF)   
         e.g. screen-output = 1.              
         modify screen.                  
      endif.                             
endloop

if the field is part of a table control, put the above code within the the loop...endloop of the table control in PBO

How do I go to a transaction by double clicking on a field in the screen? 
Define ok_code for function key <F2>
In Screen PAI when ok_code has the value defined (user has double clicked on the screen)

method 1: if parameter id is available for the field(s) to be populated
set parameter id 'XXX' field field_name_on_screen
call transaction 'TCODE' and skip first screen. 

method 2: 
1. fill bdc_table (data bdc_table like bdcdata occurs 0 with header line.) with screen info 
2. use command
call transaction 'XK03' using bdc_table ... 

How do I know that user has changed something on a dialog screen?
Check sy-datar,  It is 'X' when there was a change 

SAP General 
How do I get back to SAP screens I was working on if SAP was terminated? 
When you log back in, after entering appropriate values, select User->Copy session (instead on pressing 'Enter')

How do I assign a CTS number of a local private object ($TMP)?
Run tcode SE80 
Select 'Local priv objects' and click on 'Display'. 
Select the item you want to reassign and click on it 
Now select Development Object->Reassign or (Ctrl + F7) 

How do I view an ABAP dump happened in the SAP system?
Use path
Tools->Administration->Monitoring->Dump Analysis

How do I set my user information in SAP?
Run transaction code  SU51 or  (System->User profile->User address) 

How do I reset my password?
You can reset your own password at anytime (but not more than once a day) if you know the current password.   Passwords must be at least 6 characters and can not contain the first letters of your user id.

1. At the SAP R/3 logon screen enter your user-id and current password. 
2. Click the New password button. 
3. The SAP R/3  new password dialog box will be displayed. 
4. Type the password you wish to have in the New password field. 
5. Repeat  typing the same password in the Repeat password field. 
6. Click the Confirm button 

How do I kill a long running job in SAP?
.a.Open a new SAP session. 
   b.In the new session, from the SAP R/3 screen, follow 
      the menu path: 
                  Tools>>Administration 
                  (new screen) Monitoring >>System monitoring>>User overview 
      Fastpath: 
                  /nsm04 
     Result: the "Overview of Users" screen appears. This is a list of the jobs currently 
     running. 
   c.Find your username in the list and click on it 
   d.Click on the Sessions button . 
     Result: the Overview of Sessions screen appears. 
   e.Click on the End session button . 

How do I compare two tables between two systems? 
 The contents of a table between two systems can be checked through the transaction OY19 

How do I view SAP settings?
Use transaction code SE38
Enter Program name RSPARAM and execute

ABAP/4 General
How do I send mail to a user(s) from an ABAP/4 program without using SAP Office? 
Use, So_object_send function module. 

How do I capture the screen sequence and values of a transaction for data transfer? 
Use transaction 'SHDB' to record any SAP transaction.

How do I copy and paste from one session to another?

  1. Click on the area and press CTRL+Y. Using your mouse highlite the are and press CTRL+C. Go do desired targer location; insert necessary number of blank lines and press CTRL+V to paste.
  2. Use xx to mark and copy. Use x to paste......

How do I register a function module as RFC enabled? 
In the function module Administration screen (transaction code SE37), set the field REMOTE CALL.













 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Planetsap.com
 
Home     Post an article    Suggestion   Contact
 
Disclaimer    Copyright; 1998-2002 Softron Systems, Inc. All rights reserved.
 
Home Discussion Forum Services Advertise Contact About Us Sign Up