Performance issue in abap program
hi,
how can we improve the performance of abap program
hi,
read the follwing links
ABAP provides few tools to analyse the perfomance of the objects, which was developed by us.
Run time analysis transaction SE30
This transaction gives all the analysis of an ABAP program with respect to the database and the non-database processing.
SQL Trace transaction ST05
by using this tool we can analyse the perfomance issues related to DATABASE calls.
Perfomance Techniques for improve the perfomance of the object.
1) ABAP/4 programs can take a very long time to execute, and can make other processes have to wait before executing. Here are some tips to speed up your programs and reduce the load your programs put on the system:
2) Use the GET RUN TIME command to help evaluate performance. It's hard to know whether that optimization technique REALLY helps unless you test it out.
3) Using this tool can help you know what is effective, under what kinds of conditions. The GET RUN TIME has problems under multiple CPUs, so you should use it to test small pieces of your program, rather than the whole program.
4) Generally, try to reduce I/O first, then memory, then CPU activity. I/O operations that read/write to hard disk are always the most expensive operations. Memory, if not controlled, may have to be written to swap space on the hard disk, which therefore increases your I/O read/writes to disk. CPU activity can be reduced by careful program design, and by using commands such as SUM (SQL) and COLLECT (ABAP/4).
5) Avoid 'SELECT *', especially in tables that have a lot of fields. Use SELECT A B C INTO instead, so that fields are only read if they are used. This can make a very big difference.
6) Field-groups can be useful for multi-level sorting and displaying. However, they write their data to the system's paging space, rather than to memory (internal tables use memory). For this reason, field-groups are only appropriate for processing large lists (e.g. over 50,000 records). If you have large lists, you should work with the systems administrator to decide the maximum amount of RAM your program should use, and from that, calculate how much space your lists will use. Then you can decide whether to write the data to memory or swap space.
Use as many table keys as possible in the WHERE part of your select statements.
7)Whenever possible, design the program to access a relatively constant number of records (for instance, if you only access the transactions for one month, then there probably will be a reasonable range, like 1200-1800, for the number of transactions inputted within that month). Then use a SELECT A B C INTO TABLE ITAB statement.
8) Get a good idea of how many records you will be accessing. Log into your productive system, and use SE80 -> Dictionary Objects (press Edit), enter the table name you want to see, and press Display. Go To Utilities -> Table Contents to query the table contents and see the number of records. This is extremely useful in optimizing a program's memory allocation.
9) Try to make the user interface such that the program gradually unfolds more information to the user, rather than giving a huge list of information all at once to the user.
10) Declare your internal tables using OCCURS NUM_RECS, where NUM_RECS is the number of records you expect to be accessing. If the number of records exceeds NUM_RECS, the data will be kept in swap space (not memory).
11) Use SELECT A B C INTO TABLE ITAB whenever possible. This will read all of the records into the itab in one operation, rather than repeated operations that result from a SELECT A B C INTO ITAB... ENDSELECT statement. Make sure that ITAB is declared with OCCURS NUM_RECS, where NUM_RECS is the number of records you expect to access.
12) If the number of records you are reading is constantly growing, you may be able to break it into chunks of relatively constant size. For instance, if you have to read all records from 1991 to present, you can break it into quarters, and read all records one quarter at a time. This will reduce I/O operations. Test extensively with GET RUN TIME when using this method.
13) Know how to use the 'collect' command. It can be very efficient.
14) Use the SELECT SINGLE command whenever possible.
15) Many tables contain totals fields (such as monthly expense totals). Use these avoid wasting resources by calculating a total that has already been calculated and stored.
Some tips:
1) Use joins where possible as redundant data is not fetched.
2) Use select single where ever possible.
3) Calling methods of a global class is faster than calling function modules.
4) Use constants instead of literals
5) Use WHILE instead of a DO-EXIT-ENDDO.
6) Unnecessary MOVEs should be avoided by using the explicit work area operations
see the follwing links for a brief insifght into performance tuning,
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_Introduction.asp
http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/801f7c454211d189710000e8322d00/frameset.htm
regards
Rohan
Similar Messages
-
How to improve the performance of the abap program
hi all,
I have created an abap program. And it taking long time since the number of records are more. And can anyone let me know how to improve the performance of my abap program.
Using se30 and st05 transaction.
can anyone help me out step by step
regds
harithaHi Haritha,
->Run Any program using SE30 (performance analysis)
Note: Click on the Tips & Tricks button from SE30 to get performance improving tips.
Using this you can improve the performance by analyzing your code part by part.
->To turn runtim analysis on within ABAP code insert the following code
SET RUN TIME ANALYZER ON.
->To turn runtim analysis off within ABAP code insert the following code
SET RUN TIME ANALYZER OFF.
->Always check the driver internal tables is not empty, while using FOR ALL ENTRIES
->Avoid for all entries in JOINS
->Try to avoid joins and use FOR ALL ENTRIES.
->Try to restrict the joins to 1 level only ie only for tables
->Avoid using Select *.
->Avoid having multiple Selects from the same table in the same object.
->Try to minimize the number of variables to save memory.
->The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)
->Avoid creation of index as far as possible
->Avoid operators like <>, > , < & like % in where clause conditions
->Avoid select/select single statements in loops.
->Try to use 'binary search' in READ internal table. -->Ensure table is sorted before using BINARY SEARCH.
->Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,)
->Avoid using ORDER BY in selects
->Avoid Nested Selects
->Avoid Nested Loops of Internal Tables
->Try to use FIELD SYMBOLS.
->Try to avoid into Corresponding Fields of
->Avoid using Select Distinct, Use DELETE ADJACENT
Check the following Links
Re: performance tuning
Re: Performance tuning of program
http://www.sapgenie.com/abap/performance.htm
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
check the below link
http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
See the following link if it's any help:
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
Check also http://service.sap.com/performance
and
books like
http://www.sap-press.com/product.cfm?account=&product=H951
http://www.sap-press.com/product.cfm?account=&product=H973
http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
Performance tuning for Data Selection Statement
http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
Debugger
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
Run Time Analyser
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/content.htm
SQL trace
http://help.sap.com/saphelp_47x200/helpdata/en/d1/801f7c454211d189710000e8322d00/content.htm
CATT - Computer Aided Testing Too
http://help.sap.com/saphelp_47x200/helpdata/en/b3/410b37233f7c6fe10000009b38f936/frameset.htm
Test Workbench
http://help.sap.com/saphelp_47x200/helpdata/en/a8/157235d0fa8742e10000009b38f889/frameset.htm
Coverage Analyser
http://help.sap.com/saphelp_47x200/helpdata/en/c7/af9a79061a11d4b3d4080009b43351/content.htm
Runtime Monitor
http://help.sap.com/saphelp_47x200/helpdata/en/b5/fa121cc15911d5993d00508b6b8b11/content.htm
Memory Inspector
http://help.sap.com/saphelp_47x200/helpdata/en/a2/e5fc84cc87964cb2c29f584152d74e/content.htm
ECATT - Extended Computer Aided testing tool.
http://help.sap.com/saphelp_47x200/helpdata/en/20/e81c3b84e65e7be10000000a11402f/frameset.htm
Just refer to these links...
performance
Performance
Performance Guide
performance issues...
Performance Tuning
Performance issues
performance tuning
performance tuning
You can go to the transaction SE30 to have the runtime analysis of your program.Also try the transaction SCI , which is SAP Code Inspector.
edited by,
Naveenan -
Hi Friends,
I have one doubt , in Performance of a ABAP program.
Which one gives good performance in Select Statement
Open Cusor.. Select ... Close cusor OR
Select ..Package Size <n>
If anybody having the Idea please let me know .
With Thanx.
ElangoHi elangoraj,
1. There is no standard calculation / method
to determine the package size.
2. Its totally subjective and depends upon
- the total number of records in database table,
- the time taken to fetch one package
- how many fetches we want.
3. Usually It can be kept from 100 - 500.
regards,
amit m. -
Performance issue in customized program
Hi,
We have a performance issue in customized program.
In this program he used do-enddo twice. I mean nested do-endo.
How can we increase the performance.
And when we did the code inspector it displays 9 errors 'Char. strings w/o text elements will not be translated'.
Is there any performance issue for this error?
Regards,
Chandu.> 'Char. strings w/o text elements will not be translated'.
> Is there any performance issue for this error?
No, this is just not so clean programming. As for the rest, Please Read before Posting in the Performance and Tuning Forum and learn how to find out where the showstoppers really are.
Thomas -
Performance issue in customized program with do-enddo
Hi,
We have a performance issue in customized program.
In this program he used do-enddo twice. I mean nested do-endo.
How can we increase the performance.
And when we did the code inspector it displays 9 errors 'Char. strings w/o text elements will not be translated'.
Is there any performance issue for this error?
Regards,
Chandu.
Moderator message - Cross post locked
Edited by: Rob Burbank on Oct 20, 2009 12:42 PM> 'Char. strings w/o text elements will not be translated'.
> Is there any performance issue for this error?
No, this is just not so clean programming. As for the rest, Please Read before Posting in the Performance and Tuning Forum and learn how to find out where the showstoppers really are.
Thomas -
Performance Issue in ABAP part as suggested by SE30 for the below coding
Dear Abapers,
The below coding was done by my seniors and having performance issue i.e in SE30 the abap part is consuming 98% of time.
Pl. help us to solve this situation.
With best regards,
S. Arunachalam.
the code is:
REPORT ZOBJLIST LINE-SIZE 320 NO STANDARD PAGE HEADING. "280 to 320
TABLES: MARA, MAKT, A916, KONP, MVKE, ZSAI_PARAM.
Input parameters *****************************************************
DATA IT_MARA LIKE MARA OCCURS 0 WITH HEADER LINE.
DATA T_CLASS LIKE SCLASS OCCURS 0 WITH HEADER LINE.
DATA T_CLOBJDAT LIKE CLOBJDAT OCCURS 0 WITH HEADER LINE.
DATA FLG_COLOR TYPE C.
DATA WRK_CLASS LIKE KLAH-CLASS.
DATA WRK_PERCENT TYPE I. " Progress percentage
DATA WRK_LINES LIKE SY-TABIX. " To store the no. of lines in int.table
DATA WRK_PROGRESSTEXT(72) . " Progress indicator text
DATA : BEGIN OF IT_MATNR OCCURS 0,
MATNR LIKE MARA-MATNR,
MAKTX LIKE MAKT-MAKTX,
BISMT LIKE MARA-BISMT, "Thanikai-17.05.2002
END OF IT_MATNR.
DATA : BEGIN OF IT_HEADER OCCURS 0,
MATNR LIKE MARA-MATNR,
MAKTX LIKE MAKT-MAKTX,
CLART LIKE SCLASS-KLART,
CLASS LIKE SCLASS-CLASS,
BISMT LIKE MARA-BISMT, "Thanikai-17.05.2002
SCMNG(4) TYPE I, "Thanikai-03.10.2002
END OF IT_HEADER.
DATA : BEGIN OF IT_DETAILS OCCURS 0,
MATNR LIKE MARA-MATNR,
ZAEHL LIKE CLOBJDAT-ZAEHL,
ATNAM LIKE CLOBJDAT-ATNAM,
AUSP1 LIKE CLOBJDAT-AUSP1,
END OF IT_DETAILS.
DATA : BEGIN OF IT_DETAILS1 OCCURS 0,
MATNR LIKE MARA-MATNR,
ATNAM LIKE CLOBJDAT-ATNAM,
ZAEHL LIKE CLOBJDAT-ZAEHL,
END OF IT_DETAILS1.
DATA: IT_DETAILS2 LIKE IT_DETAILS1 OCCURS 0 WITH HEADER LINE.
DATA TMP_MATNR LIKE AUSP-OBJEK.
DATA WRK_FIELD(25).
DATA WRK_TABNAME(40). " Name of the int.table from wrk_fldname
DATA WRK_FIELDNAME(40). " Name of the fld name from wrk_fldname
DATA WRK_FLDNAME(40).
DATA T_CLOBJDAT_LINES LIKE SY-TABIX.
DATA WRK_LINES1 LIKE SY-TABIX.
DATA WRK_FIRST_TIME.
DATA TMP_STR.
DATA WRK_AUSP1 LIKE CLOBJDAT-AUSP1.
DATA: WRK_KBETR LIKE KONP-KBETR. "Thanikai-03.10.2002
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
*PARAMETERS:
SELECT-OPTIONS:
P_MATKL FOR MARA-MATKL DEFAULT 'DIAL' OBLIGATORY NO INTERVALS.
SELECT-OPTIONS : S_MATNR FOR MARA-MATNR MATCHCODE OBJECT MAT1.
SELECTION-SCREEN END OF BLOCK B3.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS: P_CLASS LIKE KLAH-CLASS,
P_KLART LIKE KLAH-KLART DEFAULT '001' OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : REQ RADIOBUTTON GROUP RGRP ,
NREQ RADIOBUTTON GROUP RGRP .
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN.
IF NOT P_CLASS IS INITIAL.
WRK_CLASS = P_CLASS.
ELSE.
WRK_CLASS = SPACE.
ENDIF.
TOP-OF-PAGE.
IF SY-BATCH NE 'X'.
PERFORM PRINT_TOP.
ENDIF.
START-OF-SELECTION.
SET PF-STATUS '9000'.
SELECT * INTO TABLE IT_MARA
FROM MARA CLIENT SPECIFIED
WHERE MANDT = SY-MANDT
AND MATKL IN P_MATKL
AND MATNR IN S_MATNR.
DESCRIBE TABLE IT_MARA LINES WRK_LINES.
MOVE 'Selecting Material Description' TO WRK_PROGRESSTEXT.
PERFORM SAPGUI USING WRK_PERCENT WRK_PROGRESSTEXT.
LOOP AT IT_MARA.
SELECT SINGLE * FROM MAKT CLIENT SPECIFIED
WHERE MANDT = SY-MANDT
AND MATNR = IT_MARA-MATNR
AND SPRAS = 'E'.
IF SY-SUBRC = 0.
IT_MATNR-MATNR = IT_MARA-MATNR.
IT_MATNR-MAKTX = MAKT-MAKTX.
IT_MATNR-BISMT = IT_MARA-BISMT. "Thanikai-17.05.2002
ENDIF.
APPEND IT_MATNR.
CLEAR IT_MATNR.
ENDLOOP.
CLEAR WRK_LINES.
DESCRIBE TABLE IT_MATNR LINES WRK_LINES.
MOVE 'Selecting Class / characteristics for the Material'
TO WRK_PROGRESSTEXT.
PERFORM SAPGUI USING WRK_PERCENT WRK_PROGRESSTEXT.
LOOP AT IT_MATNR.
CLEAR: TMP_MATNR, T_CLASS, T_CLOBJDAT. "Thanikai-26.08.2002
REFRESH: T_CLASS, T_CLOBJDAT. "Thanikai-26.08.2002
TMP_MATNR = IT_MATNR-MATNR.
CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
EXPORTING
CLASS = WRK_CLASS
CLASSTEXT = 'X'
CLASSTYPE = '001'
CLINT = ' '
FEATURES = 'X'
LANGUAGE = SY-LANGU
OBJECT = TMP_MATNR
OBJECTTABLE = 'MARA'
KEY_DATE = SY-DATUM
INITIAL_CHARACT = 'X'
NO_VALUE_DESCRIPT = 'X'
CHANGE_SERVICE_CLF = 'X'
INHERITED_CHAR = ' '
TABLES
T_CLASS = T_CLASS
T_OBJECTDATA = T_CLOBJDAT
EXCEPTIONS
NO_CLASSIFICATION = 1
NO_CLASSTYPES = 2
INVALID_CLASS_TYPE = 3
OTHERS = 4.
IF SY-SUBRC = 0.
READ TABLE T_CLASS INDEX 1.
IT_HEADER-MATNR = IT_MATNR-MATNR.
IT_HEADER-MAKTX = IT_MATNR-MAKTX.
IT_HEADER-BISMT = IT_MATNR-BISMT."Thanikai-17.05.2002
IT_HEADER-CLART = T_CLASS-KLART.
IT_HEADER-CLASS = T_CLASS-CLASS.
PERFORM PKG_DLVY_UNIT.
APPEND IT_HEADER.
CLEAR: IT_HEADER.
Code Start by Thanikai on 16.08.2002
LOOP AT T_CLOBJDAT.
IT_DETAILS-MATNR = IT_MATNR-MATNR.
IT_DETAILS-ZAEHL = T_CLOBJDAT-ZAEHL.
IT_DETAILS-ATNAM = T_CLOBJDAT-ATNAM.
IT_DETAILS-AUSP1 = T_CLOBJDAT-AUSP1.
APPEND IT_DETAILS.
ENDLOOP.
CLEAR: IT_DETAILS.
LOOP AT T_CLOBJDAT.
IT_DETAILS1-MATNR = IT_MATNR-MATNR.
IT_DETAILS1-ATNAM = T_CLOBJDAT-ATNAM.
IT_DETAILS1-ZAEHL = T_CLOBJDAT-ZAEHL.
APPEND IT_DETAILS1.
ENDLOOP.
CLEAR: IT_DETAILS1.
DESCRIBE TABLE IT_DETAILS1 LINES T_CLOBJDAT_LINES.
IF WRK_FIRST_TIME NE 'X'.
WRK_LINES1 = T_CLOBJDAT_LINES.
WRK_FIRST_TIME = 'X'.
IT_DETAILS2[] = IT_DETAILS1[].
ELSE.
IF T_CLOBJDAT_LINES GT WRK_LINES1.
WRK_LINES1 = T_CLOBJDAT_LINES.
IT_DETAILS2[] = IT_DETAILS1[].
ENDIF.
ENDIF.
CLEAR: T_CLOBJDAT_LINES.
CLEAR: IT_DETAILS1. REFRESH: IT_DETAILS1.
ENDIF.
Code end by Thanikai on 16.08.2002
ENDLOOP.
CLEAR: WRK_LINES1, WRK_FIRST_TIME.
Print Details *********************************
PERFORM PRINT_DETAILS.
AT USER-COMMAND.
GET CURSOR FIELD WRK_FIELD.
SPLIT WRK_FIELD AT '-' INTO WRK_TABNAME WRK_FLDNAME.
IF NOT WRK_FLDNAME IS INITIAL.
CASE SY-UCOMM.
WHEN 'SORA'.
IF SY-LSIND > 0.
SY-LSIND = SY-LSIND - 1. "To print in the same window
ENDIF.
PERFORM PRINT_REPORT_ASCENDING.
WHEN 'SORD'.
IF SY-LSIND > 0.
SY-LSIND = SY-LSIND - 1. "To print in the same window
ENDIF.
PERFORM PRINT_REPORT_DESCENDING.
ENDCASE.
ELSE.
MESSAGE S000(38) WITH 'Selete Material Number / Description'.
ENDIF.
*& Form SAPGUI
text
-->P_WRK_PERCENT text *
-->P_WRK_PROGRESSTEXT text *
FORM SAPGUI USING P_WRK_PERCENT
P_WRK_PROGRESSTEXT.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = WRK_PERCENT
TEXT = WRK_PROGRESSTEXT
EXCEPTIONS
OTHERS = 1.
ENDFORM. " SAPGUI
*& Form PRINT_REPORT_ASCENDING
text
--> p1 text
<-- p2 text
FORM PRINT_REPORT_ASCENDING.
IF WRK_TABNAME = 'IT_HEADER'.
SORT IT_HEADER BY (WRK_FLDNAME).
PERFORM PRINT_TOP.
PERFORM PRINT_DETAILS.
ENDIF.
ENDFORM. " PRINT_REPORT_ASCENDING
*& Form PRINT_DETAILS
text
--> p1 text
<-- p2 text
WRK_AUSP1 width chged below from (7)to(9) by Nagaraj/MKRK 24.11.05
FORM PRINT_DETAILS.
SORT IT_HEADER BY MATNR.
IF SY-BATCH EQ 'X'.
PERFORM PRINT_TOP.
ENDIF.
IF REQ = 'X'.
LOOP AT IT_HEADER.
IF FLG_COLOR = 'X'.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.
CLEAR FLG_COLOR.
ELSE.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
FLG_COLOR = 'X'.
ENDIF.
WRITE :/ SY-VLINE NO-GAP,
(18) IT_HEADER-MATNR COLOR COL_KEY NO-GAP,
SY-VLINE NO-GAP,
(40) IT_HEADER-MAKTX NO-GAP,
SY-VLINE NO-GAP,
(18) IT_HEADER-BISMT NO-GAP, "Thanikai-17.05.2002
SY-VLINE NO-GAP.
Code started by Thanikai on 16.08.2002
LOOP AT IT_DETAILS2.
CLEAR: TMP_STR, WRK_AUSP1.
IF IT_DETAILS2-ATNAM EQ 'CALIBRE'.
LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR
AND ATNAM = IT_DETAILS2-ATNAM
AND ZAEHL = IT_DETAILS2-ZAEHL.
TMP_STR = 'X'.
WRK_AUSP1 = IT_DETAILS-AUSP1.
EXIT.
ENDLOOP.
IF TMP_STR EQ 'X'.
WRITE : (9)WRK_AUSP1 NO-GAP, SY-VLINE NO-GAP.
ELSE.
WRITE : ' ', SY-VLINE NO-GAP.
ENDIF.
ELSE.
LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR
AND ATNAM = IT_DETAILS2-ATNAM.
TMP_STR = 'X'.
WRK_AUSP1 = IT_DETAILS-AUSP1.
EXIT.
ENDLOOP.
IF TMP_STR EQ 'X'.
WRITE : (9)WRK_AUSP1 NO-GAP, SY-VLINE NO-GAP.
ELSE.
WRITE : ' ', SY-VLINE NO-GAP.
ENDIF.
ENDIF.
ENDLOOP.
WRITE : (8) IT_HEADER-SCMNG NO-GAP, SY-VLINE NO-GAP.
IF SY-LINNO > 25.
IF SY-BATCH EQ 'X'.
NEW-PAGE.
PERFORM PRINT_TOP.
ENDIF.
ENDIF.
Code end by Thanikai on 16.08.2002..
ENDLOOP.
ELSEIF NREQ = 'X'.
LOOP AT IT_HEADER.
IF FLG_COLOR = 'X'.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.
CLEAR FLG_COLOR.
ELSE.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
FLG_COLOR = 'X'.
ENDIF.
WRITE :/ SY-VLINE NO-GAP,
(18) IT_HEADER-MATNR COLOR COL_KEY NO-GAP,
SY-VLINE NO-GAP,
(18) IT_HEADER-BISMT NO-GAP, "Thanikai-17.05.2002
SY-VLINE NO-GAP.
Code started by Thanikai on 16.08.2002
LOOP AT IT_DETAILS2.
CLEAR: TMP_STR, WRK_AUSP1.
IF IT_DETAILS2-ATNAM EQ 'CALIBRE'.
LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR
AND ATNAM = IT_DETAILS2-ATNAM
AND ZAEHL = IT_DETAILS2-ZAEHL.
TMP_STR = 'X'.
WRK_AUSP1 = IT_DETAILS-AUSP1.
EXIT.
ENDLOOP.
IF TMP_STR EQ 'X'.
WRITE : (9)WRK_AUSP1 NO-GAP, SY-VLINE NO-GAP.
ELSE.
WRITE : ' ', SY-VLINE NO-GAP.
ENDIF.
ELSE.
LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR
AND ATNAM = IT_DETAILS2-ATNAM.
TMP_STR = 'X'.
WRK_AUSP1 = IT_DETAILS-AUSP1.
EXIT.
ENDLOOP.
IF TMP_STR EQ 'X'.
WRITE : (9)WRK_AUSP1 NO-GAP, SY-VLINE NO-GAP.
ELSE.
WRITE : ' ', SY-VLINE NO-GAP.
ENDIF.
ENDIF.
ENDLOOP.
WRITE : (8) IT_HEADER-SCMNG NO-GAP, SY-VLINE NO-GAP.
IF SY-LINNO > 25.
IF SY-BATCH EQ 'X'.
NEW-PAGE.
PERFORM PRINT_TOP.
ENDIF.
ENDIF.
Code end by Thanikai on 16.08.2002
ENDLOOP.
ENDIF.
ULINE.
ENDFORM. " PRINT_DETAILS
*& Form PRINT_REPORT_DESCENDING
text
--> p1 text
<-- p2 text
FORM PRINT_REPORT_DESCENDING.
IF WRK_TABNAME = 'IT_HEADER'.
SORT IT_HEADER BY (WRK_FLDNAME) DESCENDING.
PERFORM PRINT_TOP.
PERFORM PRINT_DETAILS.
ENDIF.
ENDFORM. " PRINT_REPORT_DESCENDING
*& Form PRINT_TOP
text
--> p1 text
<-- p2 text
IT_DETAILS2-ATNAM width chged below from 7 to 9. Nagaraj/MKRK 24.11.05
FORM PRINT_TOP.
FORMAT COLOR COL_HEADING INTENSIFIED OFF.
ULINE.
IF REQ = 'X'.
READ TABLE IT_HEADER INDEX 1.
WRITE :/ SY-VLINE NO-GAP,(17) 'Material No' ,SY-VLINE NO-GAP.
SET LEFT SCROLL-BOUNDARY.
WRITE :(39) ' Material Description', SY-VLINE NO-GAP,
(17) ' Old Matl. Number', SY-VLINE NO-GAP. "Thanikai-17.05.2002
Comments made by Thanikai on 16.08.2002
LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR.
LOOP AT IT_DETAILS2.
WRITE : (9) IT_DETAILS1-ATNAM NO-GAP,SY-VLINE NO-GAP.
WRITE : (9) IT_DETAILS2-ATNAM NO-GAP,SY-VLINE NO-GAP.
ENDLOOP.
WRITE : (8) 'Pkg.Unit' NO-GAP, SY-VLINE NO-GAP.
ELSEIF NREQ = 'X'.
READ TABLE IT_HEADER INDEX 1.
WRITE :/ SY-VLINE NO-GAP, (17) 'Material No' ,SY-VLINE NO-GAP,
(17) ' Old Matl. Number', SY-VLINE NO-GAP. "Thanikai-17.05.2002
Comments made by Thanikai on 16.08.2002
LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR.
LOOP AT IT_DETAILS2.
WRITE : (9) IT_DETAILS-ATNAM NO-GAP,SY-VLINE NO-GAP.
WRITE : (9) IT_DETAILS2-ATNAM NO-GAP,SY-VLINE NO-GAP.
ENDLOOP.
WRITE : (8) 'Pkg.Unit' NO-GAP, SY-VLINE NO-GAP.
ENDIF.
ULINE.
FORMAT RESET.
ENDFORM. " PRINT_TOP
*& Form PKG_DLVY_UNIT
text
--> p1 text
<-- p2 text
FORM PKG_DLVY_UNIT.
SELECT SINGLE KONP~KBETR INTO WRK_KBETR
FROM ( A916 INNER JOIN KONP
ON KONP~MANDT = SY-MANDT
AND KONPKNUMH = A916KNUMH
AND KONP~KOPOS = '01' ) CLIENT SPECIFIED
WHERE A916~MANDT = SY-MANDT
AND A916~KAPPL = 'V'
AND A916~KSCHL = 'PR00'
AND A916~VKORG = 'WTCH'
AND A916~VTWEG = '01'
AND A916~SPART = '01'
AND A916~MATNR = IT_MATNR-MATNR
AND A916~DATBI >= SY-DATUM
AND A916~DATAB <= SY-DATUM.
IF SY-SUBRC EQ 0.
SELECT SINGLE * FROM ZSAI_PARAM CLIENT SPECIFIED
WHERE MANDT = SY-MANDT
AND PMFID = 'ZPKG_PRICE'
AND PMVL1 = '01'.
IF SY-SUBRC EQ 0.
IF WRK_KBETR BETWEEN 1 AND ZSAI_PARAM-PMVL2.
SELECT SINGLE * FROM MVKE CLIENT SPECIFIED
WHERE MANDT = SY-MANDT
AND MATNR = IT_MATNR-MATNR
AND VKORG = 'WTCH'
AND VTWEG = '01'.
IF SY-SUBRC EQ 0.
IF MVKE-SCMNG GE 1.
IT_HEADER-SCMNG = MVKE-SCMNG.
ELSE.
In the absence of delivery unit for a material,
delivery unit is considered as one.
IT_HEADER-SCMNG = 1.
ENDIF.
ELSE.
IT_HEADER-SCMNG = 1.
ENDIF.
ELSE.
If the price for a material is either below 1 or above 2499, then
the delivery unit is considered as one.
IT_HEADER-SCMNG = 1.
ENDIF.
ELSE.
IT_HEADER-SCMNG = 1.
ENDIF.
ELSE.
In the absence of price for a material, delivery unit is
considered as one.
IT_HEADER-SCMNG = 1.
ENDIF.
CLEAR: WRK_KBETR.
ENDFORM. " PKG_DLVY_UNITThe first point would be to change the following:
LOOP AT IT_MARA.
SELECT SINGLE * FROM MAKT CLIENT SPECIFIED
WHERE MANDT = SY-MANDT
AND MATNR = IT_MARA-MATNR
AND SPRAS = 'E'.
IF SY-SUBRC = 0.
IT_MATNR-MATNR = IT_MARA-MATNR.
IT_MATNR-MAKTX = MAKT-MAKTX.
IT_MATNR-BISMT = IT_MARA-BISMT. "Thanikai-17.05.2002
ENDIF.
APPEND IT_MATNR.
CLEAR IT_MATNR.
ENDLOOP.
I would sort IT_MARA by matnr then select for all entries into new table IT_matnr and only read when you are actuallygoing to use it for your final table.
This however will not make much difference to your problem. I suggest you put more of the code into subroutines and look at the se30 output as tyo which subroutines are actually taking most of the time. Please post the results and the subroutines which take the longest. -
Import issue for ABAP program in Production Server ?
Hi Experts,
I have an ABAP program which gets executed properly in BW Development server but getting the following error when I am trying to execute it in the BW Production while I could activate the program successfully.
Kindly help me to resolve this issue.
Thanks in advance !!!
Regards,
Gokulkumar RDHi Golkul,
Can you debug the program while execute?
I think there is some hardcoding in the program for checkiing the client and then raised a custom message in the program.
Can you share the coding of the prorgam if possible?
Try to check for any messages raised in the program. Also click on the on the message pop up and see the details on the message and let us know.
Thanks
Amit -
Increasing the performance of the abap program
Hi ,
Anybody had any document regarding how to increase the performance of ABAP program.
Regards,
baijuhi,
Refer This link.
<b>
Performance tuning for Data Selection Statement</b>
http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
<b>
1. Debugger</b>
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
<b>2. Run Time Analyser</b>
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/content.htm
<b>3. SQL trace</b>
http://help.sap.com/saphelp_47x200/helpdata/en/d1/801f7c454211d189710000e8322d00/content.htm
<b>4. CATT - Computer Aided Testing Too</b>
http://help.sap.com/saphelp_47x200/helpdata/en/b3/410b37233f7c6fe10000009b38f936/frameset.htm
<b>
5. Test Workbench</b>
http://help.sap.com/saphelp_47x200/helpdata/en/a8/157235d0fa8742e10000009b38f889/frameset.htm
<b>
6. Coverage Analyser</b>
http://help.sap.com/saphelp_47x200/helpdata/en/c7/af9a79061a11d4b3d4080009b43351/content.htm
<b>
7. Runtime Monitor</b>
http://help.sap.com/saphelp_47x200/helpdata/en/b5/fa121cc15911d5993d00508b6b8b11/content.htm
<b>
8. Memory Inspector</b>
http://help.sap.com/saphelp_47x200/helpdata/en/a2/e5fc84cc87964cb2c29f584152d74e/content.htm
<b>9. ECATT - Extended Computer Aided testing tool.</b>
http://help.sap.com/saphelp_47x200/helpdata/en/20/e81c3b84e65e7be10000000a11402f/frameset.htm -
Performance Issue with Concurrent Program
Hi Gurus,
I have a loader program which updates some information in the OM sales orders, this is been done using oe_order_pub.process_order and I do not see any performance issue in the package.
Using this program i had tried to update some huge number of orders uand it gets completed in few minutes, but at times this program runs for more than 6-7 hours even with
Pls could anyone advise what could be the issue with this?
Thanks & Regards,
GenooI have a loader program which updates some information in the OM sales orders, this is been done using oe_order_pub.process_order and I do not see any performance issue in the package.
Using this program i had tried to update some huge number of orders uand it gets completed in few minutes, but at times this program runs for more than 6-7 hours even with
Pls could anyone advise what could be the issue with this?Do you have the statistics collected up to date?
Can you find any errors in the database log file?
Any locks in the database?
Any invalid objects?
Please enable trace and generate the TKPROF file once the program is completed.
Thanks,
Hussein -
Performance Issue in ABAP coding
Hi Experts,
I am facing performance issue when fetch the data from view IAOM_CRM_AUFK.My perspective to fetch the internal order from that table by passing the OBJECT_ID which is not the primary key..Also the field IHREZ is not the primary key of table VBKD..
My code is under....
select EXT_OBJECT_ID
AUFNR
OBJECT_ID
into table IT_EXAT
from IAOM_CRM_AUFK
client specified
for all entries in IT_VBKD
where OBJECT_ID = IT_VBKD-IHREZ.
Please give the wayout by which I can fetch lot of data without performance issue..Hi,
I have maintain IHREZ of table VBKD this way.
IHREZ type IAOM_CRM_AUFK-OBJECT_ID,
I know that OBJECT_ID is no good access to view IAOM_CRM_AUFK..But I have no way..Because I have got IHREZ from VBKD table which only match with the field OBJECT_ID of view IAOM_CRM_AUFK...
I have to fetch internal order no. on the basis of Sales order no..Forr this reason First I have put Sales order no in VBKD table and get IHREZ and then put IHREZ in the field OBJECT_ID of view IAOM_CRM_AUFK..then I have got AUFNR which is internal order..
Please give me the way which will enhance my coding execution speed.. -
Performance issue with a program in HR-ABAP
Hi All,
I have a program that is taking very much time to execute please suggest some solution. I am pasting the main code below.
<large code part removed by moderator>
Moderator message: Please Read before Posting in the Performance and Tuning Forum
Moderator message: please post only relevant code parts, otherwise formatting is lost.
Edited by: Thomas Zloch on Mar 1, 2011 11:11 AM>
Aaron Shover wrote:
> OK, Aditya, I added another type pool to my program and I can now use the same type that SAP is using.
>
> Thanks for pointing out the [obvious] solution that I was overlooking!
>
> Aaron
Aaron, I was not aware of the type pools as mentioned I don't have access to the system at the moment. But type pool has type declarations as well, so what I meant was pulling out the 2 declarations that you need into your Z program could have solved the problem :). Which will happen now since you've included the type pools.
Anyways good to know that you problem is solved.
Cheers,
Advait -
Issue with ABAP program execution from process chains
Hi All:
We have a process chain with 3 steps, each of them executing the same program with three different variants. The program is ftp's the file from APO's dataexchange (mount) to another ftp server. The first variant transfers file A to a directory in the external ftp server (say /X) . The second and the third variants are supposed to transfer different files, B and C to the same directory.
That is where the problem is. After the process chain is successful, I see two files B and C but the contents are same and that of C. So, if I switch the steps in the PC to bring in A then C and then B, I see files B and C with content of C. I tried C then A then B. I see the file names correct but now the contents are A, A then B.
Have any of you come across this issue? Do you know that these is an existing problem? IF you have a solution, pl. let me know.
Thanks
NarayananNarayanan,
Instead of doing it in three steps - would it be possible for you to have one UNIX script or equivalent doing the above and calling the same from your process chain ...?
We do a lot of FTPs but then our file names are standard and we have a UNIX script for the same executed using a system command through a process chain and it has been working without issues for the past 1 year ...
Maybe I have not got your situation properly ... some more detail on the program details and what you are doing in more detail would help.... also SP levels please.. -
How Can I perform the external abap programe transmit the internal table in
Hi,all
In Sapscript,I want calculate a internal table and return the changed table to Sapscript
I know used the transmit result variable for example:
/:PERFORM GET_MAKTX IN PROGRAM ZXX
/:USING &MATNR&
/:CHANGING &MAKTX&
/:ENDPERFORM.
How can I set Using with a table?
Thanks
SunHi,
As per my knowledge it is not possible to pass the entire table at a time using PERFORM in PROGRAM ,,, USING and CHANGING.
Solutions:
1) If possible do the same thing in the Print Program:
using CONTROL_FORM call element and print in the script
2) if you know the all table entries.: Pass all records at time:
Ex: PERFORM Pxxxx in PROGRAM PROGXXXX
USING <MATNR1>
<MATNR2>
<MATNR3>..............
CHANGING < MAKTX1>
<MAKTX2>
<MAKTX3>............
ENDPERFORM -
Performance issue in report programming..
Hi,
I am using one customized Function Module whithin a loop of internal table containing fields of PROJ table for about 200 records . And in the source code of function module there is set of select queries for different tables like COSS COSP , AUFK , PRPS , BPJA PRHI , AFPO , AFKO etc . so due to that my performance of a report is very low , So how can i improve it .
Is there any other way to change a code.
regards
ChetanHi John ,
I am using SAP ECC 6.0 .
The report is used to update a ztable which is already created for Project System plan data .
So i am calling function module which will return a internal table , I am appending this to other internal table and refreshing it , like this I am doing for each project within a loop of PROJ internal table , finaly by using the final itab I am modifying the ztable fields.
Code is as below..
select pspid from proj client specified into corresponding fields of
table t_itab1 where mandt = sy-mandt
and pspnr in s_pspnr
and vbukr = p_vbukr
and prctr in s_prctr.
loop at t_itab1.
l_pspid = t_itab1-pspid.
CALL FUNCTION 'ZPS_FUN_BUDGETS'
EXPORTING
L_PSPID = l_pspid
L_VBUKR = p_vbukr
TABLES
T_DATA = t_itab2 .
loop at t_itab2.
append t_itab2 to t_itab.
endloop.
clear : t_itab2.
refresh : t_itab2.
endloop.
LOOP AT t_itab.
***MODIFY ZTABLE.*****
ENDLOOP.
Regards
Chetan -
I came across this strange issue with Variants: Please let me know if anyone has come cross this issue.
Issue: I select a variant for a Zreport which has email address in the selection screen. Now i select another variant in which there is no email address but still i see the email address. basically the first variant value is being passed when i select the second variant.
Code:
SELECTION-SCREEN : BEGIN OF BLOCK em WITH FRAME TITLE text-307.
PARAMETERS: p_send TYPE char1 AS CHECKBOX DEFAULT ''.
SELECT-OPTIONS :s_emails FOR somlreci1-receiver NO INTERVALS.
SELECTION-SCREEN : END OF BLOCK em.Hi Vasudev,
I have not seen any issue like that before,
Try creating the variant again,
Step1: enter an email address and then save
Step2: name the variant as var1 and then save
Step3: now remove the email address and then save
Step4: name the variant as var2 and then save.
Step5: refresh by /n followed by the T code
Step6: try it out now with both the variants
Revert for further clarification
Thanks
Sri
Maybe you are looking for
-
Data services with SQL Server 2008 and Invalid time format variable
Hi all Recently we have switched from DI on SQL Server 2005, to DS(Date Services) on SQL Server 2008. However I have faced an odd error on the query that I was running successfully in DI. I validate my query output using a validation object to fill e
-
How to get the content of the uploaded file.
Hi Experts, I am using a input box to get the path of the file to be uploaded.(I am not using FILE UPLOAD UI Element).Could you please let me know how to get the content of the uploaded file. Regards, Arun
-
Need a template to identify applciations which covers most options
Hi All, We r Planning for a upgradation to BI7. As part of that, First we want to identify 5 applications, Which cover all the options. If anybody has done this previously, Pls suugest me how to proceed and to make sure that not even single o
-
Can the iSight camera be used by another party without my authority?
Browsing web sites on Safari on my imac when I noticed the light for the iSight camera flashing, as if though taking a photo? This got me thinking is it actually possible that someone can access the camera without my authority??
-
After update to 4.2 my songs are not there
When i go to ipod music player in my iphone4 it says "no content" no songs? But they still show in settings>geberal>about it shows over 500 songs bu they are not in ipad library? Anybody knows how to fix this?