2013 Dec 30 5:33 AM
Hi All ,
Can anybody tell me what is wrong in below query ?
Im getting performance issue in the below Query ....
When im trying to execute the code program is going to dump
>>>>> Select PARTNER
356 RLTYP
357 FROM BUT100 INTO TABLE IT_BUT100
358 for all entries in t_but020
359 WHERE partner eq t_but020-partner
360 and RLTYP = ''
361 OR RLTYP = 'BUP001' .
Error in Dump : You attempted to extend an internal table, but the required space was not available.
Thanks in advance
Smitha
2013 Dec 30 5:39 AM
Hi Sumitha,
Please use like below.
Select PARTNER
356 RLTYP
357 FROM BUT100 INTO TABLE IT_BUT100
358 for all entries in t_but020
359 WHERE partner eq t_but020-partner
360 and RLTYP IN ('', 'BUP001' ).
Arivazhagan S
2013 Dec 30 5:39 AM
Hi Sumitha,
Please use like below.
Select PARTNER
356 RLTYP
357 FROM BUT100 INTO TABLE IT_BUT100
358 for all entries in t_but020
359 WHERE partner eq t_but020-partner
360 and RLTYP IN ('', 'BUP001' ).
Arivazhagan S
2013 Dec 30 5:55 AM
Use the addition into corresponding fields of
Select PARTNER
356 RLTYP
357 FROM BUT100 INTO CORRESPONDING FIELDS OF TABLE IT_BUT100
358 for all entries in t_but020
359 WHERE partner eq t_but020-partner
360 and RLTYP = ''
361 OR RLTYP = 'BUP001' .
2013 Dec 30 5:43 AM
Hello Smitha KB.
You have to put the OR condition within brackets.
Like,
and ( RLTYP = ' ' OR RLTYP = 'BUP001' ).
Your current code will fetch all data which satisfies
EITHER
partner = t_but020-partner and RLTYP = ' '
OR
RLTYP = 'BUP001'.
This is the reason for error.
Regards
2013 Dec 30 6:09 AM
Check your internal table declaration..
create a structure with required fields (PARTNER, RLTYP) & after that create an internal table of that structure type.
2013 Dec 30 6:12 AM
Can you tell me how many records you are getting for this condition? Seems that no of records are too much..
2013 Dec 30 7:46 AM
Hi Sumeet ,
Thanks for the reply .....
Yes number of records are more in the internal table im trying to extract records around 2 Lacks ....
Can you please let me know how to improve the performance for this issue ?
2013 Dec 30 6:35 AM
Hi Smitha,
Can you please check how you declared your internal table IT_BUT100.
Regards,
Rajesh.B
2013 Dec 30 7:46 AM
My internal table declaration
data: begin of it_but100 occurs 0,
PARTNER like BUT100-PARTNER,
RLTYP like BUT100-RLTYP,
end of it_but100.
2013 Dec 30 7:54 AM
Do not use occurs 0...
Create a structure & internal table.
TYPES: BEGIN OF ty_struct,
partner TYPE bu_partner,
rltyp TYPE bu_partnerrole,
END OF ty_struct.
DATA : it_but100 TYPE STANDARD TABLE OF ty_struct.
2013 Dec 30 8:00 AM
Hi-
check the NOT t_but020[] IS INITIAL
Please check the below code, it should not give you dump.
DATA: BEGIN OF t_but020 OCCURS 0,
partner LIKE but100-partner,
END OF t_but020.
DATA: BEGIN OF it_but100 OCCURS 0,
partner LIKE but100-partner,
rltyp LIKE but100-rltyp,
END OF it_but100.
IF NOT t_but020[] IS INITIAL.
SELECT partner
rltyp
FROM but100 INTO TABLE it_but100
FOR ALL ENTRIES IN t_but020
WHERE partner EQ t_but020-partner
AND ( rltyp = ' ' OR rltyp = 'BUP001' ).
IF sy-subrc = 0.
ENDIF.
ENDIF.
Let us know, in case it helps.
Regards,
Atul Mohanty
2013 Dec 30 7:57 AM
Your program reached the maximal memory allowed in your system. Try to remove unnecessary fields in the internal table, or contact system administrators. (20527 - Runtime error TSV_TNEW_PAGE_ALLOC_FAILED and similar notes for more information)
Also, never forget to check that t_but020[] is not initial, as if the internal table used in FOR ALL ENTRIES condition is empty, the whole WHERE clause is ignored, so you try to load the whole database table in memory.
Regards,
Raymond
2013 Dec 30 8:14 AM
Hi smitha,
Are you checking the table entries before using for all entries.
i.e, if t_but020[] is not initial .
Select PARTNER
356 RLTYP
357 FROM BUT100 INTO TABLE IT_BUT100
358 for all entries in t_but020
359 WHERE partner eq t_but020-partner
360 and RLTYP = ''
361 OR RLTYP = 'BUP001' .
endif.
Regards,
Mahesh Somanath.