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

For all entries problem

Former Member
0 Likes
1,248

Hi experts,

I have a below statement in my code

"SELECT on EKPO for all entries on ITAB (which is having 4 hundread thousand recods )"

giving dump saying "MEMORY_PGFREE_FAILED" and "Error releasing memory block in paging"

i need your suggestion to avoid the memory problem

"MEMORY_PGFREE_FAILED" ?

can we go ahead with EXTRACT logic, does this solve the memory problem?

thoughts will be appriciated,

Thanks,

Shaik bhasha

Hi experts,

I have a below statement in my code

"SELECT on EKPO for all entries on ITAB (which is having 4 hundread thousand recods )"

giving dump saying "MEMORY_PGFREE_FAILED" and "Error releasing memory block in paging"

i need your suggestion to avoid the memory problem

"MEMORY_PGFREE_FAILED" ?

can we go ahead with EXTRACT logic, does this solve the memory problem?

thoughts will be appriciated,

Thanks,

Shaik bhasha

11 REPLIES 11
Read only

Former Member
0 Likes
1,218

do you give primary key in where condition ?

and also check with basis - to increase time operation ,we used to run the report about 4 to 5 hours ( we schdule in background )..

Read only

0 Likes
1,218

thanks for ur immediate response.

i am using primary key. i dont want to change the basis memory settings.

does any other way to handle it, like packet sizing (does it handle memory issue) or EXTRACT will work.

thanks,

shaik bhasha

Read only

0 Likes
1,218

are you running foreground ?

try with fieldgroups instead of internal table ..

Read only

0 Likes
1,218

i am running in back ground.

thanks,

shaik bhasha

Read only

Former Member
0 Likes
1,218

HI

Before using for all entries, try to sort internal table.

After that delete duplicate entries from internal table.

In select for all entries use as much as key fields in a selection table.

Still u face same problem then use field groups...

Regards

Ravi

Read only

0 Likes
1,218

i dont know how to use field groups..., can you please send the sample code.

i have done all duplication deletion.. passed all key fields of where clause in for all entries

thanks,

shaik bhasha

Read only

0 Likes
1,218

See the example code :

REPORT ZSPFLI LINE-SIZE 132 LINE-COUNT 65(3)

NO STANDARD PAGE HEADING.

TABLES:SPFLI,SCARR, SFLIGHT, SBOOK.

SELECT-OPTIONS: MYCARRID FOR SPFLI-CARRID.

FIELD-GROUPS: HEADER, SPFLI_FG, SFLIGHT_FG, SBOOK_FG.

INSERT:

SPFLI-CARRID

SPFLI-CONNID

SFLIGHT-FLDATE

SBOOK-BOOKID

INTO HEADER,

SPFLI-CARRID

SPFLI-CONNID

SPFLI-CITYFROM

SPFLI-AIRPFROM

SPFLI-CITYTO

SPFLI-AIRPTO

SPFLI-DEPTIME

SCARR-CARRNAME

INTO SPFLI_FG,

SFLIGHT-FLDATE

SFLIGHT-SEATSMAX

SFLIGHT-SEATSOCC

SFLIGHT-PRICE

INTO SFLIGHT_FG,

SBOOK-BOOKID

SBOOK-CUSTOMID

SBOOK-CUSTTYPE

SBOOK-SMOKER

INTO SBOOK_FG.

SELECT * FROM SPFLI WHERE CARRID IN MYCARRID.

SELECT SINGLE * FROM SCARR WHERE CARRID = SPFLI-CARRID.

EXTRACT SPFLI_FG.

SELECT * FROM SFLIGHT

WHERE CARRID = SPFLI-CARRID AND CONNID = SPFLI-CONNID.

EXTRACT SFLIGHT_FG.

SELECT * FROM SBOOK

WHERE CARRID = SFLIGHT-CARRID AND

CONNID = SFLIGHT-CONNID AND FLDATE = SFLIGHT-FLDATE.

EXTRACT SBOOK_FG.

CLEAR SBOOK.

ENDSELECT.

CLEAR SFLIGHT.

ENDSELECT.

CLEAR SPFLI.

ENDSELECT.

SORT.

LOOP.

AT SPFLI_FG.

FORMAT COLOR COL_HEADING.

WRITE: / SCARR-CARRNAME,

SPFLI-CONNID, SPFLI-CITYFROM,

SPFLI-AIRPFROM, SPFLI-CITYTO, SPFLI-AIRPTO, SPFLI-DEPTIME.

FORMAT COLOR OFF.

ENDAT.

AT SFLIGHT_FG.

WRITE: /15 SFLIGHT-FLDATE, SFLIGHT-PRICE, SFLIGHT-SEATSMAX,

SFLIGHT-SEATSOCC.

ENDAT.

AT SBOOK_FG.

WRITE: /30 SBOOK-BOOKID, SBOOK-CUSTOMID,

SBOOK-CUSTTYPE, SBOOK-SMOKER.

ENDAT.

ENDLOOP.

Read only

0 Likes
1,218

does this field-group will have same performace as for all entries?

thanks,

shaik bhasha

Read only

0 Likes
1,218

it is better than internal table ,try to test simple program with internal table and field group and do compare.

Read only

Former Member
0 Likes
1,218

Bhasha,

In this situation in select statement you have to use PACKAGE SIZE.

BAsic syntax is

SELECT ... INTO|APPENDING [CORRESPONDING FIELDS OF] TABLE <itab>

[PACKAGE SIZE <n>] ...

Here you have 2 options.

Only First if you want to append the data in internal table you can use

1.SELECT CARRID CONNID

FROM SPFLI

APPENDING TABLE ITAB

PACKAGE SIZE 30000.

ENDSELECT.

========================

2. If you want to do some functionality on data which is coming in internal table in packaze size you can use

Ex :

SELECT CARRID CONNID

FROM SPFLI

INTO TABLE ITAB

PACKAGE SIZE 30000.

-


Here you can work on 30000 data next it will get refresh and next 30000 records will come.Here no appending of data in internal table .If you want data in internal table for long time use first example.

ENDSELECT.

Don't forget to reward if useful

Read only

Former Member
0 Likes
1,218

<a href="https://websmp230.sap-ag.de/sap/support/notes/612415">Check OSS Note 612415</a>

Rewards if helpful.