Application Development and Automation 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: 
Read only

Improve performance: Data from Source Table to Target Table

Former Member
0 Likes
917

I wrote the below Code WHERE

Message was edited by:

soniya kapoor

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
897

Hi Soniya,

Just do below changes and see the result.

**append wa_zdtg to /BIC/AZDBREB_000

  • Update table /BIC/AZDBREB_000 set

MODIFY /BIC/AZDPFMGL000 FROM table t_aztgl.

endif.

endloop.

TO

<b>**append wa_zdtg to /BIC/AZDBREB_000

  • Update table /BIC/AZDBREB_000 set

endif.

endloop.

MODIFY /BIC/AZDPFMGL000 FROM table t_aztgl.</b>

Regards,

Atish

10 REPLIES 10
Read only

Former Member
0 Likes
898

Hi Soniya,

Just do below changes and see the result.

**append wa_zdtg to /BIC/AZDBREB_000

  • Update table /BIC/AZDBREB_000 set

MODIFY /BIC/AZDPFMGL000 FROM table t_aztgl.

endif.

endloop.

TO

<b>**append wa_zdtg to /BIC/AZDBREB_000

  • Update table /BIC/AZDBREB_000 set

endif.

endloop.

MODIFY /BIC/AZDPFMGL000 FROM table t_aztgl.</b>

Regards,

Atish

Read only

0 Likes
897

Hello Atish and Naimesh. Atish I guess by mistake u repeated the same code withot editing . i do not see any changes. Also Naimesh To answer you we need to pick only Current Quater Data from Target Table /BIC/AZDPFMGL000

Can u help me edit the code to pick only Current Quater Data from Target Table /BIC/AZDPFMGL000 Since I only want to update the Current Quater Values for ZEMPCODE and also append t_aztgl. did not help. since it is still taking long hours like 4 -6 to load.

Please help me improve this bad performace.

Thanks

Soniya

null

Read only

0 Likes
897

Hi Soniya,

Yes there is difference.

I moved the MODIFY statement after the LOOP.

Regards,

Atish

Read only

0 Likes
897

Thanks Atish, I will implement this and test. But please suggest any more improvement. Alos can u tell me how to pick only current quater data and modify values of ZEMP CODE. Values already exist for ZEMP CODE IN Target table but we want to modify that every quater thats is why i wrote this code, since it is the most critical business load and it takes 6 hours to load

null

Read only

0 Likes
897

Hi Soniya,

I think this will make a good improvement in performance.

Regards,

Atish

Read only

0 Likes
897

If you have that much data than, you have to wait ....

One more suggetion I want to give you in the select queries:

Define your itab like this.

data: begin of itab occurs 0 with header line,

COMP_CODE like /BIC/AZDPFMGL000-COMP_CODE,

PROFIT_CTR like /BIC/AZDPFMGL000-PROFIT_CTR,

/BIC/ZEMPCODE like /BIC/AZDAMPATH00-/BIC/ZEMPCODE,

/BIC/ZSTARTD like /BIC/AZDAMPATH00-/BIC/ZEMPCODE,

/BIC/ZPRDATE like /BIC/AZDAMPATH00-/BIC/ZPRDATE,

end of itab

select a~COMP_CODE

a~PROFIT_CTR

b/BIC/ZEMPCODE b/BIC/ZSTARTD b~/BIC/ZPRDATE

  • into corresponding fields of table itab " <<<

into table itab "<<<

from /BIC/AZDPFMGL000 as a INNER join

/BIC/AZDAMPATH00 as b

ON acomp_code EQ bCOMP_CODE

AND aPROFIT_CTR EQ bPROFIT_CTR.

because into correcponding fields will take much time.....

Regards,

Naimesh Patel

Read only

0 Likes
897

Hello Atish and Naimesh. I will implement your suggestions, But can u edit my code how to pick only current quater data ie Fiscper 010 -012.2007 but this will vary as quater changes and I want to modify values of ZEMP CODE. Values already exist for ZEMP CODE IN Target table but we want to modify that every quater

Thanks

SONIYA

Read only

naimesh_patel
Active Contributor
0 Likes
897

Check out this part of code:

loop at itab into wa_itab.

read table t_aztgl with key comp_code = wa_itab-comp_code
PROFIT_CTR = wa_itab-PROFIT_CTR
into wa_zdtg
binary search.



if sy-subrc = 0.
wa_zdtg-/BIC/ZEMPCODE = wa_itab--/BIC/ZEMPCODE.

modify t_aztgl from wa_zdtg index sy-tabix.

append t_aztgl.  "<< 

**append wa_zdtg to /BIC/AZDBREB_000
* Update table /BIC/AZDBREB_000 set

endif.

endloop.


MODIFY /BIC/AZDPFMGL000 FROM table t_aztgl.  "<< I assume that you have all the data of target table /BIC/AZDPFMGL000  in the internal table T_AZTGL.

Regards,

Naimesh Patel

Read only

0 Likes
897

Hi Naimesh If I do as suggested by you

data: begin of tp_itab occurs 0 with header line,

COMP_CODE type /BIC/AZDPFMGL000-COMP_CODE,

/BIC/ZCONSUNIT type /BIC/AZDAMPATH00-/BIC/ZCONSUNIT,

PROFIT_CTR type /BIC/AZDPFMGL000-PROFIT_CTR,

/BIC/ZSTARTD type /BIC/AZDAMPATH00-/BIC/ZSTARTD,

/BIC/ZPRDATE type /BIC/AZDAMPATH00-/BIC/ZPRDATE,

end of tp_itab.

I get the error in Start Routine Code in BI

<b>E:Tables with headers are no longer supported in the OO context</b>

Read only

0 Likes
897

Than you need to define it with the types:

types: begin of tp_itab.
COMP_CODE type /BIC/AZDPFMGL000-COMP_CODE,
/BIC/ZCONSUNIT type /BIC/AZDAMPATH00-/BIC/ZCONSUNIT,
PROFIT_CTR type /BIC/AZDPFMGL000-PROFIT_CTR,
/BIC/ZSTARTD type /BIC/AZDAMPATH00-/BIC/ZSTARTD,
/BIC/ZPRDATE type /BIC/AZDAMPATH00-/BIC/ZPRDATE,
end of tp_itab.

data: itab type standarad table of tp_itab.  " Internal table
data: wa_itab type tp_itab.  " work aread

Regards,

Naimesh Patel