Application Development 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: 

Issue with fetching data from AFRU

Former Member
0 Kudos
266

Hi All,

We are trying to immitate the standard transaction COOIS but with some extra features to get a report.

We have a particular select in the custom code which is timing out and taking an unusually long time(infact never finished the select) if run in background.

*******************************

Custom Code

*******************************

SELECT RUECK

RMZHL

LMNGA

IEDD

MANUR

AUFNR

APLFL FROM AFRU

INTO TABLE GT_AFRU

FOR ALL ENTRIES IN GT_AFVC

WHERE RUECK = GT_AFVC-RUECK

  • AND RMZHL = GT_AFVC-RMZHL

AND MANUR = '1'

AND APLFL NE ' '.

*****************************************

Standard Code

*****************************************

SELECT * FROM afru INTO TABLE afru_tmp

FOR ALL ENTRIES IN rueck_tmp

WHERE rueck = rueck_tmp-rueck

AND ( canum = canum_0

OR canum IS NULL ).

The standard code returns the entries in blink of the eye whereas the custom code runs on for ever. Both the for all entries tables have the same entries and use the same primary key.

I also tried to fetch data from the table directly using SE16 and I input only 10 confirmations(RUECK-primary key) into the table and I try to execute this in background and it also seems to run for ever. Does anyone have any idea what is going wrong here? Pointers will be appreciated.

Regards,

Karthik

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos
133

YOu should make a check if the table GT_AFVC has any entries in it or not.

if not GT_AFVC[] is initial.

SELECT RUECK

RMZHL

LMNGA

IEDD

MANUR

AUFNR

APLFL FROM AFRU

INTO TABLE GT_AFRU

FOR ALL ENTRIES IN GT_AFVC

WHERE RUECK = GT_AFVC-RUECK

  • AND RMZHL = GT_AFVC-RMZHL

AND MANUR = '1'

endif.

4 REPLIES 4

former_member181962
Active Contributor
0 Kudos
134

YOu should make a check if the table GT_AFVC has any entries in it or not.

if not GT_AFVC[] is initial.

SELECT RUECK

RMZHL

LMNGA

IEDD

MANUR

AUFNR

APLFL FROM AFRU

INTO TABLE GT_AFRU

FOR ALL ENTRIES IN GT_AFVC

WHERE RUECK = GT_AFVC-RUECK

  • AND RMZHL = GT_AFVC-RMZHL

AND MANUR = '1'

endif.

0 Kudos
133

Well, I have clearly mentioned that the 'for all entries tables have same no. of entries', it implies that GT_AFVC isnt empty. I have also mentioned that the direct query on the table through SE16 with the same selection data is also not returning anything and running into long hours.

0 Kudos
133

The table AFRU has an index on RUECK and should not have a problem atleast in theory. I will wait along with your for the answer.

Regards,

Ravi

Former Member
0 Kudos
133

I think your GT_AFVC is empty so , select is trying to dump everything from that table.

Check with that

and put a condition to check the entries in the table