[FUNCTION]
Command=/H
Title=Debugger
Type=SystemCommand
when ever you want to debug you dont have to use /h but just drag and drop this on the SAP screen this enables you to debug on popup screens
Hope this will be useful
nafran
[FUNCTION]
Command=/H
Title=Debugger
Type=SystemCommand
*get first and last date of month and year
CONCATENATE s_bdatj-low s_mnr-low '01' INTO gv_date1.
gv_month = s_mnr-low .
gv_month = gv_month + 01.
CONCATENATE s_bdatj-low gv_month '01' INTO gv_date2.
gv_date2 = gv_date2 - 1.
CALL FUNCTION 'Fetch_Data' STARTING NEW TASK 'Fetch' performing RETURN_FROM_WAIT ON END OF TASKEXPORTING input = input TABLES output = output EXCEPTIONS COMMUNICATION_FAILURE = 1 SYSTEM_FAILURE = 2. Important : you cant use any import parameters on the function no this method the only option is to using theRETURN_FROM_WAIT which is a perform. For Eg when you want to fetch data parallel do it using 2 functions and using the perform you can have a flag to make sure that fetching is completed.This is just a over view I got this document from Daniel Perecky Multi Threading this has lots of information no how to program this way. I would love to see some comments about this :)
REPORT ZPARALLEL_CURSOR.
TABLES:
likp,
lips.
DATA:
t_likp TYPE TABLE OF likp,
t_lips TYPE TABLE OF lips,
t_lips1 TYPE SORTED TABLE OF lips
WITH NON-UNIQUE KEY vbeln.
DATA:
w_runtime1 TYPE I,
w_runtime2 TYPE I,
w_counter TYPE I,
w_index LIKE sy-INDEX.
DATA:
likp_l TYPE I,
lips_l TYPE I.
PARAMETERS: rows TYPE i OBLIGATORY.
START-OF-SELECTION.
SELECT *
FROM likp
INTO TABLE t_likp up to rows ROWS.
DESCRIBE TABLE t_likp LINES likp_l.
WRITE:/ 'records in likp: ' .
WRITE likp_l.
SELECT *
INTO TABLE t_lips
FROM lips
FOR ALL ENTRIES IN t_likp
WHERE vbeln = t_likp-vbeln.
DESCRIBE TABLE t_lips LINES lips_l.
WRITE:/ 'records in lips: ' .
WRITE lips_l.
**********************************************************************
**********************************************************************
**********************************************************************
GET RUN TIME FIELD w_runtime1.
LOOP AT t_likp INTO likp.
LOOP AT t_lips INTO lips WHERE vbeln EQ likp-vbeln.
ENDLOOP.
ENDLOOP.
GET RUN TIME FIELD w_runtime2.
w_runtime2 = w_runtime2 - w_runtime1.
WRITE:/.
WRITE:/'Time taken on normal where condition:'.
WRITE: w_runtime2.
**********************************************************************
**********************************************************************
**********************************************************************
GET RUN TIME FIELD w_runtime1.
SORT t_likp BY vbeln.
SORT t_lips BY vbeln.
LOOP AT t_likp INTO likp.
LOOP AT t_lips INTO lips FROM w_index.
IF likp-vbeln NE lips-vbeln.
w_index = sy-tabix.
EXIT.
ENDIF.
ENDLOOP.
ENDLOOP.
GET RUN TIME FIELD w_runtime2.
w_runtime2 = w_runtime2 - w_runtime1.
WRITE:/.
WRITE:/.
WRITE:/'Time taken with parallel cursor:' , w_runtime2.
**********************************************************************
**********************************************************************
**********************************************************************
GET RUN TIME FIELD w_runtime1.
SORT t_lips BY vbeln.
t_lips1[] = t_lips[].
LOOP AT t_likp INTO likp.
LOOP AT t_lips1 INTO lips WHERE vbeln EQ likp-vbeln.
ENDLOOP.
ENDLOOP.
GET RUN TIME FIELD w_runtime2.
w_runtime2 = w_runtime2 - w_runtime1.
WRITE:/.
WRITE:/.
WRITE:/'Time taken for a sorted table with where condition:' , w_runtime2.
When a programmer uses the read command, the table is sequentially searched. This slows down the processing. Instead of this, use the binary search addition. The binary search algorithm helps faster search of a value in an internal table. It is advisable to sort the internal table before doing a binary search. Binary search repeatedly divides the search interval in half. If the value to be searched is less than the item in the middle of the interval, the search is narrowed to the lower half, otherwise the search is narrowed to the upper half.
Not Recommended
Read table int_fligh with key airln = ‘LF’.
Recommended
Read table int_fligh with key airln = ‘LF’ binary search.
source: http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_BinarySearch.asp
Use the variations of the modify command to speed up this kind of processing.
Not recommended
Loop at int_fligh.
If int_fligh-flag is initial.
Int_fligh-flag = ‘X’.
Endif.
Modify int_fligh.
Endloop.
Recommended
Int_fligh-flag = ‘X’.
Modify int_fligh transporting flag where flag is initial.
source: http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_ModifyingGroupOfLines.asp