how to increase abap code performance ?

10 pts.
Tags:
ABAP
how to increate abap code performace ?
ASKED: July 18, 2008  1:56 PM
UPDATED: April 10, 2012  7:29 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hello,

This website gives the ABAP Preformance Standards…

http://www.saptechnical.com/Tutorials/ABAP/PerformanceSTDs.htm

Hope it helps…

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • SuperSapper
    The first place to look is SELECT statements. Some suggestions: Nested select statements can really bog things down. Use joins instead of nested select statements. Select only the fields you need instead of the whole record. Select a table into an internal table then process the internal table instead of the SAP table during selects.
    380 pointsBadges:
    report
  • Alihussain
    HOW I CAN INCREASE THE EFFICIENCY OF THIS CODE? REPORT zaq_spec_acc_exp . TABLES: bsis, prps. SELECT-OPTIONS: ccode FOR bsis-bukrs NO-EXTENSION NO INTERVALS, ffprftcr FOR bsis-prctr, costctr FOR prps-fkstl, currdate FOR bsis-budat, ff_proj FOR prps-psphi, fiscyear FOR bsis-gjahr NO-EXTENSION NO INTERVALS. PARAMETERS: rephead(90),rephead2(90),qedate(60) , note1(200), note2(200). DATA: itab_prps LIKE TABLE OF prps WITH HEADER LINE , itab_ekkn LIKE TABLE OF ekkn WITH HEADER LINE, itab TYPE zstr_zff8 OCCURS 0 WITH HEADER LINE, itab_f TYPE zstr_zff8 OCCURS 0 WITH HEADER LINE, wa_ekkn LIKE ekkn , wa TYPE zstr_zff8 , wa_f TYPE zstr_zff8 , wa_ekko LIKE ekko , wa_prps LIKE prps , count TYPE i , scount(2). *DATA: BEGIN OF itab_rng_pspnr OCCURS 0, * zpspnr LIKE zpsfund-projk, * END OF itab_rng_pspnr. DATA: zawkey LIKE bkpf-awkey ,zprojk LIKE zpsfund-projk , tot_invamnt LIKE zstr_zff8-zwrbtr , tot_idafin LIKE zstr_zff8-zwrbtr, tot_idashare LIKE zstr_zff8-zwrbtr, tot_govothshare LIKE zstr_zff8-zwrbtr , gtot_invamnt LIKE zstr_zff8-zwrbtr , gtot_idafin LIKE zstr_zff8-zwrbtr, gtot_idashare LIKE zstr_zff8-zwrbtr, gtot_govothshare LIKE zstr_zff8-zwrbtr. . DATA: fmname_handle TYPE tdsfname. RANGES: rng_pspnr FOR prps-pspnr. DATA : BEGIN OF itab_usr OCCURS 0, * ZZPSPRNR LIKE PRPS-PSPNR, zzusr01 LIKE prps-usr01, * ZZEBELN LIKE EKKN-EBELN, END OF itab_usr. DATA wa_usr LIKE itab_usr. DATA: sgtxt LIKE bsis-sgtxt. DATA : tlinetab LIKE tline OCCURS 0 WITH HEADER LINE , wa_longtxt LIKE stxh . DATA: stxh_txt TYPE stxh-tdname , v_bukrs TYPE bsis-bukrs , v_zuonr TYPE bsis-zuonr , v_buzei TYPE bsis-buzei , v_belnr TYPE bsis-belnr , v_gjahr TYPE bsis-gjahr , v_assignno TYPE bsis-zuonr , line_item TYPE bsis-buzei. DATA: id TYPE stxh-tdid, name TYPE stxh-tdname, obj TYPE tdobject, assign_len TYPE i . START-OF-SELECTION. PERFORM getdata. PERFORM callsmartform. *&---------------------------------------------------------------------* *& Form GETDATA *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM getdata. SELECT * FROM prps INTO CORRESPONDING FIELDS OF TABLE itab_prps WHERE prctr IN ffprftcr AND psphi IN ff_proj AND pbukr IN ccode AND fkstl IN costctr. LOOP AT itab_prps. rng_pspnr-sign = 'I'. rng_pspnr-option = 'EQ'. rng_pspnr-low = itab_prps-pspnr. APPEND rng_pspnr. ENDLOOP. SELECT a~ebeln a~ps_psp_pnr b~txz01 b~konnr c~belnr c~gjahr d~usr01 d~usr03 INTO (wa-zebeln,wa-zpspnr,wa-ztxz01,wa-zkonnr,wa-zbelnr,wa-zgjahr, wa-zusr01,wa-zusr03) FROM ekkn AS a INNER JOIN ekpo AS b ON a~ebeln = b~ebeln INNER JOIN ekbe AS c ON a~ebeln = c~ebeln INNER JOIN prps AS d ON a~ps_psp_pnr EQ d~pspnr WHERE a~ps_psp_pnr IN rng_pspnr AND a~ebeln LIKE '45%' AND c~belnr LIKE '51%'. IF sy-subrc EQ 0. SELECT SINGLE a~ktwrt a~ihrez a~unsez a~bedat a~bsart b~name1 b~stras INTO (wa-zktwrt,wa-zihrez,wa-zunsez,wa-zbedat,wa-zbsart,wa-zname, wa-zstras) FROM ekko AS a INNER JOIN lfa1 AS b ON a~lifnr EQ b~lifnr WHERE a~ebeln EQ wa-zkonnr. * AND a~bsart = 'ZP02'. * ENDSELECT. CONCATENATE wa-zbelnr wa-zgjahr INTO zawkey. SELECT SINGLE b~wrbtr b~budat b~sgtxt b~bukrs b~zuonr b~buzei b~belnr b~gjahr INTO (wa-zwrbtr,wa-zbudat,wa-zsgtxt,v_bukrs,v_zuonr,v_buzei, v_belnr,v_gjahr) FROM bkpf AS a INNER JOIN bsis AS b ON a~belnr EQ b~belnr AND a~blart EQ b~blart AND a~gjahr EQ b~gjahr WHERE a~awkey EQ zawkey AND b~hkont LIKE 'A%'. * b~blart EQ 'RE' AND * b~gjahr IN fiscyear AND * b~budat IN currdate AND * b~kostl IN costctr. * ENDSELECT. IF wa-zihrez > 0. wa-zcontr_curr = wa-zktwrt / wa-zihrez . ENDIF. assign_len = strlen( v_belnr ). IF assign_len EQ 9 . CONCATENATE '0' v_belnr INTO v_belnr. ENDIF. CONCATENATE v_belnr v_gjahr INTO v_assignno. CONCATENATE v_bukrs v_assignno v_buzei INTO stxh_txt . PERFORM get_long_text. * IF wa-zusr03 EQ 'IDA Share'. IF NOT sgtxt IS INITIAL AND sgtxt > 0. wa-zida_fin = wa-zwrbtr / sgtxt. "wa-zsgtxt . wa-zida_share = wa-zwrbtr / sgtxt. "wa-zsgtxt . ENDIF. * ELSEIF wa-zusr03 EQ 'GOP Share'. * wa-zgov_share = wa-zwrbtr . * ENDIF. CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT' EXPORTING input = wa-zpspnr IMPORTING output = zprojk EXCEPTIONS not_found = 1 OTHERS = 2. IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. SELECT SINGLE per FROM zpsfund INTO wa-zper WHERE projk EQ zprojk. APPEND wa TO itab. CLEAR: wa , zprojk ,zawkey . ENDIF. ENDSELECT. CLEAR wa. DELETE itab WHERE zbsart <> 'ZP02'. SORT itab BY zusr01. SORT itab_usr BY zzusr01. LOOP AT itab INTO wa. * wa_usr-ZZPSPRNR = wa-ZPSPNR. wa_usr-zzusr01 = wa-zusr01. * wa_usr-ZZEBELN = wa-ZEBELN. APPEND wa_usr TO itab_usr. CLEAR: wa,wa_usr. ENDLOOP. CLEAR: wa,wa_usr. DELETE ADJACENT DUPLICATES FROM itab_usr. LOOP AT itab_usr INTO wa_usr. * LOOP AT itab_prps INTO wa_prps. *wa_f-zpspnr = wa_prps-pspnr. wa_f-zusr01 = wa_usr-zzusr01. * count = count + 1. * scount = count . * CONCATENATE '(' scount ')' wa_prps-usr01 INTO wa_f-zusr01. APPEND wa_f TO itab_f. CLEAR wa_f. * LOOP AT itab INTO wa WHERE zpspnr EQ wa_prps-pspnr. LOOP AT itab INTO wa WHERE "zpspnr EQ wa_usr-ZZPSPRNR AND zusr01 EQ wa_usr-zzusr01 ."AND * ZEBELN EQ wa_usr-ZZEBELN. CLEAR wa-zusr01. CONDENSE: wa-zunsez. wa_f = wa. APPEND wa_f TO itab_f. CLEAR wa_f. ***<<<Sub total tot_invamnt = tot_invamnt + wa-zwrbtr. tot_idafin = tot_idafin + wa-zida_fin. tot_idashare = tot_idashare + wa-zida_share. * tot_govothshare = tot_govothshare + wa-zgov_share. *wa_f-ZPSPNR = WA-ZPSPNR. *wa_f-zusr01 = wa-zusr01. wa_f-zname = 'Sub Total'. wa_f-zwrbtr = tot_invamnt. wa_f-zida_fin = tot_idafin. wa_f-zida_share = tot_idashare. * wa_f-zgov_share = tot_govothshare. ***>>> ***<<<Grand Total. gtot_invamnt = gtot_invamnt + wa-zwrbtr. gtot_idafin = gtot_idafin + wa-zida_fin. gtot_idashare = gtot_idashare + wa-zida_share. * gtot_govothshare = gtot_govothshare + wa-zgov_share. ***>>> *Clear: wa_f. ENDLOOP. APPEND wa_f TO itab_f. CLEAR: wa_f ,tot_invamnt,tot_idafin,tot_idashare,tot_govothshare,wa, wa_prps. ENDLOOP. wa_f-zname = 'Grand Total'. wa_f-zwrbtr = gtot_invamnt. wa_f-zida_fin = gtot_idafin. wa_f-zida_share = gtot_idashare. * wa_f-zgov_share = gtot_govothshare. APPEND wa_f TO itab_f. CLEAR: gtot_invamnt,gtot_idafin,gtot_idashare,gtot_govothshare,wa_f, count , scount. REFRESH itab. ENDFORM. " GETDATA *&---------------------------------------------------------------------* *& Form CallSmartForm *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM callsmartform. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = 'ZAQ_SMRT_SPC_ACC_EXP_FOR_CONTR' * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname_handle * EXCEPTIONS * NO_FORM = 1 * NO_FUNCTION_MODULE = 2 * OTHERS = 3 . CALL FUNCTION fmname_handle EXPORTING rephead = rephead rephead2 = rephead2 note1 = note1 note2 = note2 qedate = qedate * pend = pend TABLES itab_out = itab_f[]. ENDFORM. " CallSmartForm *&---------------------------------------------------------------------* *& Form GET_Long_Text *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM get_long_text. id = '0001' . name = stxh_txt . obj = 'DOC_ITEM'. IF sy-subrc EQ 0. CALL FUNCTION 'READ_TEXT' EXPORTING client = sy-mandt id = id "WA_LongTxt-TDID language = sy-langu name = name "WA_LongTxt-TDNAME object = obj "WA_LongTxt-TDOBJECT * ARCHIVE_HANDLE = 0 * LOCAL_CAT = ' ' * IMPORTING * HEADER = TABLES lines = tlinetab * LINES = LTEXT EXCEPTIONS id = 1 language = 2 name = 3 not_found = 4 object = 5 reference_check = 6 wrong_access_to_archive = 7 OTHERS = 8. . IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. LOOP AT tlinetab. IF NOT tlinetab-tdline IS INITIAL. sgtxt = tlinetab-tdline. ENDIF. ENDLOOP. ENDIF. CLEAR: stxh_txt , v_bukrs , v_zuonr , v_buzei , v_belnr , v_gjahr, v_assignno , assign_len , id , name , obj. REFRESH tlinetab. ENDFORM. " GET_Long_Text
    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following