SAP ABAP - Handling with control tables -
my problem:
i "loop" on table local structure named ls_eban..
and information must follow these instructions:
- ls_eban-matnr must be in zmd_scmi_st01 ( 1. control table (global) )
- ls_eban-werks must be in zmd_scmi_st05 ( 2. control table (global) )
- ls_eban-knttp must be in zmd_scmi_st06 ( 3. control table (global) )
i need selection clear , performant. have one, isn't performant @ all.
my solution:
select st01~matnr st05~werks st06~knttp zmd_scmi_st01 st01 inner join zmd_scmi_st05 st05 on st05~werks = ls_eban-werks inner join zmd_scmi_st06 st06 on knttp = ls_eban-knttp table lt_control st01~matnr = ls_eban-matnr , st01~bedarf = 'x' , st05~bedarf = 'x'. i have say, control tables doesn't have relation each other (no primary key , no secondary key).
the first thing should not have select inside loop. instead of
loop @ lt_eban ls_eban. select .... endloop. you should single select.
if lt_eban[] not initial. select ... table ... ... entries in lt_eban ... endif. there may more inefficiencies corrected if had more info ( mentioned in comment vwegert. instance, no keys on control tables? ) select in loop first thing jumps out @ me.
Comments
Post a Comment