My Problem:
I "loop" over a table into a local structure named ls_eban..
and with those information I must follow these instructions:
- ls_eban-matnr MUST BE in table zmd_scmi_st01 ( 1. control Table (global) )
- ls_eban-werks MUST BE in table zmd_scmi_st05 ( 2. control Table (global) )
- ls_eban-knttp MUST BE in table zmd_scmi_st06 ( 3. control Table (global) )
I need a selection that is clear and performant. I actually have one, but it isn't performant at all.
My solution:
SELECT st01~matnr st05~werks st06~knttp
FROM zmd_scmi_st01 AS st01
INNER JOIN zmd_scmi_st05 AS st05
ON st05~werks = ls_eban-werks
INNER JOIN zmd_scmi_st06 AS st06
ON knttp = ls_eban-knttp
INTO TABLE lt_control
WHERE st01~matnr = ls_eban-matnr AND st01~bedarf = 'X'
AND st05~bedarf = 'X'.
I also have to say, that the control tables doesn't have any relation with each other (no primary key and no secondary key).