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

table s034

Former Member
0 Likes
1,443

hi

i fetch data from table s034 but it take more time so have any soulation ? [already use pri.key in query then also take more time]

query is:-

select cmzubb cmagbb from s034

into corresponding fields of table

t_s031 where sptag > m_budat

and werks in ('2502','1001','2002')

and charg in bwtar

and charg NOT in ('S','X')

and matnr in matnr

and ( lgort = 'FG01' or ( lgort = 'FG02' AND werks

= '2002' ) ).

1 ACCEPTED SOLUTION
Read only

former_member195383
Active Contributor
0 Likes
1,228

for table t_s031 change the declaration to..

DATA: BEGIN OF t_s031 OCCURS 0,

cmzubb type s034-cmzubb,

cmagbb type s034-cmzubb,

END OF t_s031 .

and in the select query...

remove corresponding fields of

That ll improve pervformance

8 REPLIES 8
Read only

former_member195383
Active Contributor
0 Likes
1,229

for table t_s031 change the declaration to..

DATA: BEGIN OF t_s031 OCCURS 0,

cmzubb type s034-cmzubb,

cmagbb type s034-cmzubb,

END OF t_s031 .

and in the select query...

remove corresponding fields of

That ll improve pervformance

Read only

0 Likes
1,228

if i remove corresponding fields then it dump

Read only

0 Likes
1,228

DATA: BEGIN OF t_s031 OCCURS 0,

cmzubb type s034-cmzubb,

cmagbb type s034-cmagbb,

END OF t_s031 .

hey in the previous post i have given the second declaration wrongly...declare the internal table like this......

Read only

0 Likes
1,228

ya it will improve performance but not solve

Read only

Former Member
0 Likes
1,228

hi do like this..

ranges: r_werks for t001w-werks,

r_logrt for mard-lgort .

r_werks-low = 2502.

r_werks-sign = 'I'.

r_werks-option = 'EQ'.

append r_werks.

r_werks-low = 2502.

append r_werks.

r_werks-low = 2502.

append r_werks.

r_werks-low = 2502.

append r_werks.

r_lgort-low = 'FG02'.

r_lgort-sign = 'I'.

r_lgort-option = 'EQ'.

append r_lgort.

r_lgort-low = '2002'.

append r_lgort.

select

cmzubb

cmagbb

from s034

into corresponding fields of table

t_s031 where sptag gt m_budat

and werks in r_werks

and charg in bwtar

and charg NOT in ('S','X')

and matnr in matnr

and lgort = 'FG01'

or logrt in r_lgort..

Read only

Former Member
0 Likes
1,228

Your query is OK. Simply I would recommend you Create new index on table S034 with all these parameters which you have set in query condition.

Fields for Index Creation.

werks

charg

matnr

lgort

Also change ur query as per below. I also have doubt on bold condition(Highlighted).

select cmzubb cmagbb from s034

into corresponding fields of table t_s031

where sptag > m_budat

and werks in ('2502','1001','2002')

and charg in bwtar

and charg NOT in ('S','X')

and matnr in matnr

and ( lgort eq 'FG01' or ( lgort eq 'FG02' AND werks eq '2002' ) ).

rgds

rajesh

Read only

Former Member
0 Likes
1,228

Hi krupa, use the logic below...

Types:

begin of x_s034,

CHARG type CHARG_D,

CMZUBB type MZUBB,

end of x_s034.

data:

i_s034 type standard table of x_s034.

select CHARG

CMZUBB

into table i_s034

from s034

where sptag > m_budat

and werks in ('2502','1001','2002')

and charg in bwtar

and charg NOT in ('S','X')

and matnr in matnr

and ( lgort = 'FG01' or ( lgort = 'FG02' AND werks

= '2002' ) ).

I think it will work

Read only

0 Likes
1,228

hi i do like :-

TYPES: BEGIN OF TY_S030,

cmzubb TYPE s034-cmzubb,

cmagbb TYPE s034-cmagbb,

END OF TY_S030.

DATA: T_S030 TYPE TABLE OF TY_S030 WITH HEADER LINE.

select cmzubb cmagbb from s034

into table T_S030

where matnr in matnr

and werks in ('2502','1001','2002')

and charg in bwtar

and charg NOT in ('S','X')

and sptag > m_budat

and ( lgort = 'FG01' or ( lgort = 'FG02' AND werks = '2002' ) ).

but it take time same not work