Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

performance issue

Former Member
0 Kudos

Hi Experts,

Following are my coding for performance issue....

SELECT

a~erdat

a~zzstyleno

a~zzponumber

a~zzarticleno

a~zzskuno

a~zzcolour

a~zzedisize

a~zzquantity

a~zztotalnopcs

a~zzvolume

a~zzlength

a~zzwidth

a~zzheight

a~zzinchcm

a~zzhscode

a~zzunit_cost

a~zzunit_cost_unit

a~zzreference1

a~zzreference2

a~zzreference3

a~zzreference4

a~zzreference5

a~zzrel_ord_dt

a~vbeln

a~posnr

  • B~KUNNR "CHANGED BY Kishore

b~zzcrgohandoverdt

b~zzreleasedby

b~zzplacereceipt

b~zzsoquantity

b~zzairlinename1

b~zzairlineno1

b~spart

b~vkorg

b~vtweg

b~zzeta

c~kunnr "CHANGED BY Kishore

c~parvw

FROM vbap AS a INNER JOIN vbak AS b ON avbeln = bvbeln

INNER JOIN vbpa AS c ON bvbeln = cvbeln INTO CORRESPONDING FIELDS OF TABLE it_final WHERE vkorg = salesorg AND

b~spart = division AND

vtweg = distchan AND

a~erdat BETWEEN erdat1 AND erdat2 AND

b~auart NE 'ZCQT' AND

b~auart NE 'ZMCQ' AND

b~auart NE 'ZMIQ' AND

b~auart NE 'ZMQT' AND

b~auart NE 'ZMTQ' AND

b~auart NE 'ZMUQ' AND

b~auart EQ 'ZMAE' AND

c~kunnr = customerno AND

parvw IN ('ZD','ZB','AG', 'ZY','WE','ZX','ZO','ZL').

.

SORT it_final BY vbeln posnr.

DELETE ADJACENT DUPLICATES FROM it_final.

*********************************************************************

IF it_final[] IS NOT INITIAL.

SELECT

a~zzfreightmode

a~zzcrgohandoverdt

a~zzreleasedby

a~zzplacereceipt

a~zzsoquantity

a~zzhblhawbno

a~zzcomminvno

a~zzmblmawbno

  • A~KUNNR "CHANGED BY Kishore

a~vbeln

a~zzportofdest

a~audat

a~zzdocrecvdate

a~zzcustaprovdt

a~zzata_dt

a~zzairlinename1

a~zzairlineno1

a~zzeta

a~zzconsapprovdate

a~zzloadingdt

  • a~zzcostapprovdt

b~kunnr "CHANGED BY Kishore

b~parvw

c~name1

a~audat

a~zzcustaprovdt

azzata_dt FROM vbak AS a INNER JOIN vbpa AS b ON avbeln = b~vbeln

INNER JOIN kna1 AS c ON ckunnr = bkunnr

INTO CORRESPONDING FIELDS OF TABLE i_vbak1 FOR ALL ENTRIES IN it_final WHERE a~vbeln = it_final-vbeln

AND parvw IN ('ZD','ZB','AG', 'ZY','WE','ZX','ZO').

SELECT a~vbeln

  • A~KUNNR "CHANGED BY Kishore

b~kunnr "CHANGED BY Kishore

b~parvw

cname1 FROM vbak AS a INNER JOIN vbpa AS b ON avbeln = b~vbeln

INNER JOIN kna1 AS c ON ckunnr = bkunnr INTO CORRESPONDING FIELDS OF TABLE i_vbak2

FOR ALL ENTRIES IN it_final WHERE a~vbeln = it_final-vbeln

  • AND parvw IN ('ZD','ZB','AG', 'ZY','WE','ZX','ZO').

AND parvw IN ('ZB','AG').

  • PARVW = 'WE'.

ENDIF.

  • ADDED JOINING FOR MKPF,VEKP ETC TABLES

***************

IF i_vbak1[] IS NOT INITIAL.

SELECT a~mat_kdauf

a~mblnr

b~budat

b~cputm

FROM mseg AS a INNER JOIN mkpf AS b ON amblnr = bmblnr

INTO CORRESPONDING FIELDS OF TABLE t_mseg

FOR ALL ENTRIES IN i_vbak1 WHERE mat_kdauf = i_vbak1-vbeln AND

bwart = '501'.

IF t_mseg[] IS NOT INITIAL.

SELECT mblnr

zzstarttime

zzenddate

zzendtime FROM migo_badi_examp2 INTO TABLE t_migo_badi_examp2

FOR ALL ENTRIES IN t_mseg WHERE mblnr = t_mseg-mblnr.

ENDIF.

LOOP AT t_mseg.

READ TABLE t_migo_badi_examp2 WITH KEY mblnr = t_mseg-mblnr.

IF sy-subrc = 0.

t_mseg-zzstarttime = t_migo_badi_examp2-zzstarttime.

t_mseg-zzenddate = t_migo_badi_examp2-zzenddate.

t_mseg-zzendtime = t_migo_badi_examp2-zzendtime.

MODIFY t_mseg.

CLEAR t_mseg.

ENDIF.

ENDLOOP.

ENDIF.

IF it_final[] IS NOT INITIAL.

SELECT vbeln

posnr

ntgew

volum

vgbel

vgpos

FROM lips

INTO TABLE t_lips FOR ALL ENTRIES IN it_final

WHERE vgbel = it_final-vbeln AND

vgpos = it_final-posnr.

ENDIF.

IF t_lips[] IS NOT INITIAL.

SELECT a~venum

a~vbeln

a~posnr

a~vemng

b~vhilm

b~zzstuffingdate

bzzstuffingtime FROM vepo AS a INNER JOIN vekp AS b ON avenum = b~venum

INTO CORRESPONDING FIELDS OF TABLE t_vepo

FOR ALL ENTRIES IN t_lips WHERE vbeln = t_lips-vbeln AND

posnr = t_lips-posnr.

ENDIF.

IF t_vepo[] IS NOT INITIAL.

SELECT mara~matnr

mara~matkl

t023t~wgbez60

INTO TABLE t_mara

FROM mara INNER JOIN t023t

ON maramatkl = t023tmatkl

FOR ALL entries IN t_vepo

WHERE matnr = t_vepo-vhilm.

ENDIF.

SELECT a~vbeln

b~tknum

b~exti1

b~zzvoynam1

b~zzvoynam2

b~zzvoyno2

c~dpten

c~dptbg

c~datbg

c~knota

c~knotz

c~belad

FROM vttp AS a INNER JOIN vttk AS b ON atknum = btknum

INNER JOIN vtts AS c ON btknum = ctknum INTO TABLE t_vttk

FOR ALL ENTRIES IN t_lips WHERE vbeln = t_lips-vbeln.

IF i_vbak1[] IS NOT INITIAL.

SELECT vbeln

indate

intime

FROM zmm_provgr_hdr INTO TABLE t_zmm_provgr_hdr FOR ALL ENTRIES IN i_vbak1 WHERE vbeln = i_vbak1-vbeln.

ENDIF.

READ TABLE i_vbak1 INTO wa_vbak1 WITH KEY l_vbeln. "= NUMBER.

READ TABLE t_read INDEX sy-index .

wa_vbak-desc = t_read-tdline.

DELETE ADJACENT DUPLICATES FROM i_vbak1 COMPARING vbeln.

SELECT SINGLE zzportname FROM zsdport1 INTO wa_vbak-port_pod WHERE zzport = wa_vbak-zzportofdest.

****

SELECT SINGLE zzportname FROM zsdport1 INTO wa_vbak-port_loading WHERE zzport = wa_vbak-zzportofloading.

SELECT a~zzponumber

a~zzstyleno

a~zzreference2

a~zzarticleno

a~zzskuno

a~zzedisize

a~zzcolour

a~zzquantity

a~zzgr_wt

a~zzvolume

a~zztotalnopcs

a~zzstyleno

a~zzponumber

a~zzarticleno

a~zzskuno

a~zzcolour

a~zzusercode

a~zzsupliercode

a~zzedisize

a~zzquantity

a~zztotalnopcs

a~vbeln

a~zzvolume

a~zzrel_ord_dt

a~zzlength

a~zzwidth

a~zzheight

a~zzinchcm

a~zzhscode

a~zzunit_cost

a~zzunit_cost_unit

a~zzskuno

a~zzreference1

a~zzreference2

a~zzreference3

a~zzreference4

a~zzreference5

a~posnr

b~indate

b~intime

b~outdate

b~outtime

b~check_point

b~remarks

c~license_num

FROM vbap AS a

LEFT OUTER JOIN zmm_chkpoint_dtl AS b ON avbeln = bvbeln

LEFT OUTER JOIN zmm_chkpoint_hdr AS c ON cvbeln = avbeln

INTO CORRESPONDING FIELDS OF TABLE t_vbap FOR ALL ENTRIES IN it_final

WHERE a~vbeln = it_final-vbeln.

*

SELECT mat_kdauf

mat_kdpos

wempf

bwart

ablad

erfmg INTO CORRESPONDING FIELDS OF TABLE t_gr_mseg

FROM mseg

FOR ALL ENTRIES IN it_final

WHERE mat_kdauf = it_final-vbeln

AND mat_kdpos = it_final-posnr.

  • SELECT wempf

  • bwart

  • ablad

  • erfmg INTO (wempf,

  • bwart,

  • ablad,

  • erfmg) FROM mseg

  • WHERE mat_kdauf = it_final-vbeln

  • AND mat_kdpos = it_final-posnr.

*

l.

Please Suggest me the solution to make better performance.

Thanks Babbal

1 REPLY 1

Former Member
0 Kudos

Moderator message - Please see before posting - post locked

Rob