This anlage table used two time how can use only one time can you guys assist me plz.
SELECT anlage sparte vstelle anlart
FROM eanl
INTO TABLE gt_eanl
FOR ALL ENTRIES IN gt_ever
WHERE anlage = gt_ever-anlage.
SORT gt_eanl BY anlage.
IF gt_eanl[] IS NOT INITIAL.
SELECT a~anlage a~sparte b~operand b~betrag b~bis FROM
eanl AS a INNER JOIN ettifn AS b
ON a~anlage = b~anlage
INTO TABLE gt_ettifn
FOR ALL ENTRIES IN gt_eanl
WHERE a~anlage = gt_eanl-anlage
AND b~operand EQ 'YVMAKVAL'
AND a~sparte EQ '07'.
Hi,
I don't see the necessity to perform the selection by the first request. Simply use the second one:
IF gt_ever[] IS NOT INITIAL.
SELECT a~anlage a~sparte b~operand b~betrag b~bis FROM
eanl AS a INNER JOIN ettifn AS b
ON a~anlage = b~anlage
INTO TABLE gt_ettifn
FOR ALL ENTRIES IN gt_ever
WHERE a~anlage = gt_ever-anlage
AND b~operand EQ 'YVMAKVAL'
AND a~sparte EQ '07'.
ENDIF.
hi thanks for your response but it's not working in the report some fields are missing.
Well, ofc. you have to modify a little more and make sure that fields "vstelle", "anlart" are also selected from EANL table and populated to the corresponding fields in the output structure of the report.
The performance issue could be because of the condition
AND a~sparte EQ '07'.
try removing the condition and see if it is making any difference.
i.e. Remove the condition from select query, fetch all the data in internal table and the delete the unwanted data from internal table so that you have correct data without any performance issues.