Skip to Content
0
Sep 24, 2014 at 02:01 PM

Tuning performance.

28 Views

Hi Gurus.

I need improve the program performance of INTERFACE coulg you suggest me( or bapi or other way the tuning the performance)?

Suggestions are welcome.

DATA: v_resposta(3) TYPE c,

v_tabix TYPE sy-tabix.

CLEAR:t_vbak1[],

t_kna1_1[],

t_adrc1[],

t_vbap1[],

t_marc1[].

SELECT vbeln

bstnk

kunnr

FROM vbak

INTO TABLE t_vbak1

WHERE erdat IN s_erdat

AND vkorg IN s_vkorg

AND vtweg IN s_vtweg.

IF sy-subrc = 0.

SELECT vbeln

matnr

FROM vbap

INTO TABLE t_vbap1

FOR ALL ENTRIES IN t_vbak1

WHERE vbeln = t_vbak1-vbeln.

IF sy-subrc = 0.

SELECT matnr

ladgr

FROM marc

INTO TABLE t_marc1

FOR ALL ENTRIES IN t_vbap1

WHERE matnr = t_vbap1-matnr.

IF sy-subrc = 0.

SORT: t_vbak1 BY vbeln ,

t_vbap1 BY vbeln

matnr,

t_marc1 BY matnr.

LOOP AT t_vbak1 INTO w_vbak1.

v_tabix = sy-tabix.

CLEAR v_resposta.

LOOP AT t_vbap1 INTO w_vbap1 WHERE vbeln = w_vbak1-vbeln.

READ TABLE t_marc1 INTO w_marc1 WITH KEY matnr = w_vbap1-matnr BINARY SEARCH.

IF sy-subrc = 0.

IF w_marc1-ladgr = '21'.

v_resposta = 'SIM'.

ENDIF.

ENDIF.

ENDLOOP.

IF v_resposta IS INITIAL.

DELETE t_vbak1[] INDEX v_tabix.

ENDIF.

ENDLOOP.

ENDIF.

ENDIF.

ENDIF.



Thanks all