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

​How to replace SELECT ... For all entries statement in the below code in ECC.

anuja_s
Participant
0 Likes
3,062

SELECT deliv_numb deliv_item doc_number s_ord_item /bic/zsdkonnr /bic/zsdkonit
act_gi_dte material sales_unit base_uom doc_currcy
dlv_qty /bic/zdlvqty /bic/zdlvval item_del
* &0001 > F5645557 CHG0015956
ship_date
* &0001 > F5645557 CHG0015956
FROM (l_tabname)
INTO CORRESPONDING FIELDS OF TABLE l_t_deliveries
FOR ALL ENTRIES IN l_t_deliveries_keys
WHERE doc_number = l_t_deliveries_keys-doc_number
AND s_ord_item = l_t_deliveries_keys-s_ord_item.

INSERT LINES OF l_t_deliveries INTO TABLE g_st_deliveries_vbeln.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,785

I hope you have checked that the internal table used in the FOR ALL ENTRIES clause is not empty.

Do you have the possibility to either

  • Replace the FOR ALL ENTRIES with a JOIN or a SUBQUERY with the query that previously extracted the list of delivery numbers (Enhance the DataSource extractor?)
  • Split the list of items into smaller packages and either execute them in sequence (better use of memory) or in parallel (Select data in a RFC FM called DESTINATION 'NONE').
  • Check with basis for performance of FOR ALL ENTRIES (use of hints in emergency situations) such as system parameters : rsdb/max_blocking_factor, rsdb/max_in_blocking_factor, rsdb/prefer_join, rsdb/prefer_union_all.
  • If this is a transformation rule, define the required fields as attributes of some delivery item InfoObject and don't map those at loading.

SELECT deliv_numb deliv_item doc_number s_ord_item /bic/zsdkonnr /bic/zsdkonit
act_gi_dte material sales_unit base_uom doc_currcy
dlv_qty /bic/zdlvqty /bic/zdlvval item_del
* &0001 > F5645557 CHG0015956
ship_date
* &0001 > F5645557 CHG0015956
FROM (l_tabname)
INTO CORRESPONDING FIELDS OF TABLE l_t_deliveries
FOR ALL ENTRIES IN l_t_deliveries_keys
WHERE doc_number = l_t_deliveries_keys-doc_number
AND s_ord_item = l_t_deliveries_keys-s_ord_item.

INSERT LINES OF l_t_deliveries INTO TABLE g_st_deliveries_vbeln.

4 REPLIES 4
Read only

Abinathsiva
Active Contributor
2,785

Hi for quick response on question related to code. please use Code button in the editor...

Read only

michael_piesche
Active Contributor
0 Likes
2,785

You leave us guessing on what the problem is and how to fix it.

  • Why replace it and replace it with what?
  • There are several possibilities to 'replace' it, those can be based on an SQL alone but also a solution in SQL as well as ABAP (e.g. select more and reduce in ABAP)
  • Also it depends on your current ABAP version (e.g. select from l_t_deliveries and join with l_tabname)
Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,786

I hope you have checked that the internal table used in the FOR ALL ENTRIES clause is not empty.

Do you have the possibility to either

  • Replace the FOR ALL ENTRIES with a JOIN or a SUBQUERY with the query that previously extracted the list of delivery numbers (Enhance the DataSource extractor?)
  • Split the list of items into smaller packages and either execute them in sequence (better use of memory) or in parallel (Select data in a RFC FM called DESTINATION 'NONE').
  • Check with basis for performance of FOR ALL ENTRIES (use of hints in emergency situations) such as system parameters : rsdb/max_blocking_factor, rsdb/max_in_blocking_factor, rsdb/prefer_join, rsdb/prefer_union_all.
  • If this is a transformation rule, define the required fields as attributes of some delivery item InfoObject and don't map those at loading.
Read only

FredericGirod
Active Contributor
0 Likes
2,785

How did you populatethe table l_t_deliveries_key ?