Skip to Content
0
Former Member
Dec 20, 2007 at 11:27 AM

creating secondary index

28 Views

hi,

what r secondanry indexes.How to create my program selects from database table zuip5a. and selection screen consists of so many select options and parameters. so while testing the program is giving poor performance. if i create secondary indexes will this improve the performance of the code.please help me

types: begin of ty_data1,

ryear like zupi5a-ryear, "Fiscal year

rbukrs like zupi5a-rbukrs, "Company code

racct like zupi5a-racct, "Account number

rzzps_posid like zupi5a-rzzps_posid, "WBS element

rzzmtit like zupi5a-rzzmtit, "MPM title

rzzmfor like zupi5a-rzzmfor, "MPM format

rzzmatnr like zupi5a-rzzmatnr, "Material number

rzzcou like zupi5a-rzzcou, "Country

rzzfow like zupi5a-rzzfow, "Financial owner

rzzoow like zupi5a-rzzoow, "Operational owner

rzzcon like zupi5a-rzzcon, "Licensee Contract

rzzloc like zupi5a-rzzloc, "Licensor Contract

kostl like zupi5a-kostl, "Cost center

zzfam like zupi5a-zzfam, "Fame Number

zzfor like zupi5a-zzfor, "Format

zzprd like zupi5a-zzprd, "Product Line

zzwin like zupi5a-zzwin, "Window group

zzwig like zupi5a-zzwig, "Window

rtcur like zupi5a-rtcur, "Currency Key

TSL like zupi5a-TSL,

HSL like zupi5a-hSL,

KSL like zupi5a-KSL,

MSL like zupi5a-MSL,

end of ty_data1.

types: begin of ty_final,

ryear like zupi5a-ryear, "Fiscal year

rbukrs like zupi5a-rbukrs, "Company code

racct like zupi5a-racct, "Account number

rzzps_posid like zupi5a-rzzps_posid, "WBS element

rzzmtit like zupi5a-rzzmtit, "MPM title

rzzmfor like zupi5a-rzzmfor, "MPM format

rzzmatnr like zupi5a-rzzmatnr, "Material number

rzzcou like zupi5a-rzzcou, "Country

rzzfow like zupi5a-rzzfow, "Financial owner

rzzoow like zupi5a-rzzoow, "Operational owner

rzzcon like zupi5a-rzzcon, "Licensee Contract

rzzloc like zupi5a-rzzloc, "Licensor Contract

kostl like zupi5a-kostl, "Cost center

rtcur like zupi5a-rtcur, "Currency Key

zzfam like zupi5a-zzfam, "Fame Number

zzfor like zupi5a-zzfor, "Format

zzprd like zupi5a-zzprd, "Product Line

zzwin like zupi5a-zzwin, "Window group

zzwig like zupi5a-zzwig, "Window

tsl like zupi5a-tsl, "Amount Transaction currency

hsl like zupi5a-hsl, "Amount Co. code currency

ksl like zupi5a-ksl, "Amount Group currency

msl like zupi5a-msl, "Quantity

msg(83) type c, "message--Ramya

end of ty_final.

data:

i_data type standard table of ty_data1,

i_final type standard table of ty_final,

data:

wa_data type ty_data1,

wa_final type ty_final,

selection-screen begin of block 1 with frame title text-001.

parameters:

p_rldnr like zupi5a-rldnr obligatory default 'Z5', "Ledger

p_rrcty like zupi5a-rrcty obligatory default '0', "Record type

p_rvers like zupi5a-rvers obligatory default '001', "Version

p_ryear like zupi5a-ryear obligatory. "Fiscal year

select-options:

s_rpmax for zupi5a-poper obligatory no-extension. "Period

parameters:

p_rbukrs like zupi5a-rbukrs obligatory, "Company code

p_rtcur like zupi5a-rtcur. "obligatory. "Currency Key

select-options:

s_racct for zupi5a-racct obligatory, "Account number

s_rbusa for zupi5a-rbusa, "Business area

s_rzzps for zupi5a-rzzps_posid obligatory no intervals, "WBS Element

s_rzmtit for zupi5a-rzzmtit, "MPM title

s_rzmfor for zupi5a-rzzmfor, "MPM format

s_zmatnr for zupi5a-rzzmatnr, "Material number

s_rzzcou for zupi5a-rzzcou, "Country

s_rkunnr for zupi5a-rzzkunnr, "Customer number

s_rzzfow for zupi5a-rzzfow, "Financial owner

s_rzzoow for zupi5a-rzzoow, "Operational owner

s_rzzcon for zupi5a-rzzcon, "Licence contract

s_raufnr for zupi5a-rzzaufnr, "Order number

s_rzzloc for zupi5a-rzzloc, "Licensor contract

s_blart for zupi5a-blart, "Document type

s_zzrrc for zupi5a-zzrrc, "Return reason code

s_zztsc for zupi5a-zztsc, "Type of sales/Sales channel

s_zzfam for zupi5a-zzfam, "Fame number

s_zzfor for zupi5a-zzfor, "Format

s_zzgen for zupi5a-zzgen, "Movie Genre

s_zzprd for zupi5a-zzprd, "Product Line

s_zzfmt for zupi5a-zzfmt, "Price point

s_zzwin for zupi5a-zzwin, "Window group

s_zzwig for zupi5a-zzwig, "Window

s_kostl for zupi5a-kostl. "Cost center

selection-screen end of block 1.

select ryear rbukrs racct rzzps_posid rzzmtit

rzzmfor rzzmatnr rzzcou rzzfow rzzoow rzzcon

rzzloc kostl

zzfam zzfor zzprd zzwin zzwig

rtcur

TSL HSL KSL MSL

from zupi5a

into table i_data bypassing buffer

where rldnr = p_rldnr

and rrcty = p_rrcty

and rvers = p_rvers

and ryear = p_ryear

  • and rtcur = p_rtcur

  • and rpmax in s_rpmax

and POPER in s_rpmax

and rbukrs = p_rbukrs

and racct in s_racct

and rbusa in s_rbusa

and rzzps_posid in s_rzzps

and rzzmtit in s_rzmtit

and rzzmfor in s_rzmfor

and rzzmatnr in s_zmatnr

and rzzcou in s_rzzcou

and rzzkunnr in s_rkunnr

and rzzfow in s_rzzfow

and rzzoow in s_rzzoow

and rzzcon in s_rzzcon

and rzzaufnr in s_raufnr

and rzzcon in s_rzzloc

and blart in s_blart

and zzrrc in s_zzrrc

and zztsc in s_zztsc

and zzfam in s_zzfam

and zzfor in s_zzfor

and zzgen in s_zzgen

and zzprd in s_zzprd

and zzfmt in s_zzfmt

and zzwin in s_zzwin

and zzwig in s_zzwig

and kostl in s_kostl.

if sy-subrc NE 0.

message i001.

endif.

FORM populate_final_table.

loop at i_data into wa_data.

wa_final-ryear = wa_data-ryear.

wa_final-rbukrs = wa_data-rbukrs.

wa_final-racct = wa_data-racct.

wa_final-rzzps_posid = wa_data-rzzps_posid.

wa_final-rzzmtit = wa_data-rzzmtit.

wa_final-rzzmfor = wa_data-rzzmfor.

wa_final-rzzmatnr = wa_data-rzzmatnr.

wa_final-rzzcou = wa_data-rzzcou.

wa_final-rzzfow = wa_data-rzzfow.

wa_final-rzzoow = wa_data-rzzoow.

wa_final-rzzcon = wa_data-rzzcon.

wa_final-rzzloc = wa_data-rzzloc.

wa_final-kostl = wa_data-kostl.

wa_final-zzfam = wa_data-zzfam.

wa_final-zzfor = wa_data-zzfor.

wa_final-zzprd = wa_data-zzprd.

wa_final-zzwin = wa_data-zzwin.

wa_final-zzwig = wa_data-zzwig.

wa_final-rtcur = wa_data-rtcur.

wa_final-tsl = wa_data-tsl.

wa_final-hsl = wa_data-hsl.

wa_final-ksl = wa_data-ksl.

wa_final-mSL = wa_data-mSL.

append wa_final to i_final.

clear : wa_final-ryear,

wa_final-rbukrs, wa_final-racct,

wa_final-rzzps_posid, wa_final-rzzmtit, wa_final-rzzmfor,

wa_final-rzzmatnr, wa_final-rzzcou,

wa_final-rzzfow, wa_final-rzzoow, wa_final-rzzcon,

wa_final-rzzloc,

wa_final-kostl,

wa_final-zzfam,

wa_final-zzfor,

wa_final-zzprd, wa_final-zzwin,

wa_final-zzwig,

wa_final-rtcur,

wa_final-tsl,

wa_final-hsl, wa_final-ksl, wa_final-msl.

endloop.

please help me out.

Thanks and Regards,

Ramya.