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

performance tunning

Former Member
0 Likes
569

hi abaper's

i am having the problem in this query

SELECT ZUONR BELNR BUZEI LIFNR KUNNR GSBER PRCTR KOSTL SGTXT SHKZG DMBTR BUKRS GJAHR HKONT

FROM BSEG INTO CORRESPONDING FIELDS OF TABLE IT_BSEG1

FOR ALL ENTRIES IN IT_BKPF1

WHERE GJAHR IN FYEAR AND

BELNR = IT_BKPF1-BELNR AND BUKRS = IT_BKPF1-BUKRS.

please give me best way to write this select query.

this query is giving me dump error.

thnks

pardeep

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
552

data: begin of it_bseg1 occurs 0,

ZUONR type ZUONR

BELNR type BELNR

BUZEI...

LIFNR ...

KUNNR ..

GSBER..

PRCTR ..

KOSTL

SGTXT

SHKZG

DMBTR

BUKRS

GJAHR

HKONT

end of it_bseg1.

data: itab_bkpf like standard table of it_bkpf1.

if it_bkpf1[] is not initial.

itab_bkpf[] = it_bkpf1[].

delete adjecent duplicates from itab_bkpf comparing belnr bukrs.

sort itab_bjkf by belnr bukrs.

SELECT ZUONR BELNR BUZEI LIFNR KUNNR GSBER PRCTR KOSTL SGTXT SHKZG DMBTR BUKRS GJAHR HKONT

FROM BSEG INTO TABLE IT_BSEG1

FOR ALL ENTRIES IN IT_BKPF1

WHERE GJAHR IN FYEAR AND

BELNR = IT_BKPF1-BELNR AND BUKRS = IT_BKPF1-BUKRS.

endif.

please define your internal table in same sequence as their field in query.

reward if helpful...

and please be specify what error you r getting..in dump..

5 REPLIES 5
Read only

Former Member
0 Likes
552

Hi

Remove INTO Corresponding Fields and also sequence of the fields shoudl be same in ITAB with table position

IF IT_BSEG1 is having duplicate entries then move the same into IT_BSEG2

IT_BSEG2 delete duplicate entreis from it

USE index for the same

Regards

Shiva

Read only

Former Member
0 Likes
553

data: begin of it_bseg1 occurs 0,

ZUONR type ZUONR

BELNR type BELNR

BUZEI...

LIFNR ...

KUNNR ..

GSBER..

PRCTR ..

KOSTL

SGTXT

SHKZG

DMBTR

BUKRS

GJAHR

HKONT

end of it_bseg1.

data: itab_bkpf like standard table of it_bkpf1.

if it_bkpf1[] is not initial.

itab_bkpf[] = it_bkpf1[].

delete adjecent duplicates from itab_bkpf comparing belnr bukrs.

sort itab_bjkf by belnr bukrs.

SELECT ZUONR BELNR BUZEI LIFNR KUNNR GSBER PRCTR KOSTL SGTXT SHKZG DMBTR BUKRS GJAHR HKONT

FROM BSEG INTO TABLE IT_BSEG1

FOR ALL ENTRIES IN IT_BKPF1

WHERE GJAHR IN FYEAR AND

BELNR = IT_BKPF1-BELNR AND BUKRS = IT_BKPF1-BUKRS.

endif.

please define your internal table in same sequence as their field in query.

reward if helpful...

and please be specify what error you r getting..in dump..

Read only

Former Member
0 Likes
552

Hi,

Sort the it_bseg1 table before using for all entries.

Check it_bseg1 table is not initial.

avoid into corresponding.

check the sequence of fields.

Thanks,

Srikanth.A

Read only

Former Member
0 Likes
552

Hi,

What type of dump you are getting ? Is it memory dump or time out dump ??

First thing is BKPF-BSEG tables should be be heat unless there is absolute necessity of doing that. Discuss with your functional consultant and try to use other tables like BSIS, BSID etc etc

If not try the suggestions given by others like sort the driver table before select etc etc

If you are getting memory dump, you might have to mention the fetch size and restrict the size of the internal table processed - this might take some more time but won't give memory dump.

Read only

Former Member
0 Likes
552

thnks