I need to select distinct AUFNR OBJNR from AUFK for Plant in select screen and Order number in Selection screen.
Next I need to select the Orders from the above list with system status (TJ02T-TXT004) in the selection screen into another internal table.
The logic is -
from AUFK, we get OBJNR.
using this OBJNR in JEST table and TJO2T table, I need to extract the orders with the status in the selection screen.
Logic to use JEST, JSTO and TJ20T for getting the system status is --
SELECT SINGLE d~txt04 INTO l_zztxt04 (variable or table field)
FROM aufk AS a
INNER JOIN jest AS b ON aobjnr = bobjnr
INNER JOIN jsto AS c ON aobjnr = cobjnr
INNER JOIN tj20t AS d ON cstsma = dstsma
AND bstat = destat
WHERE a~aufnr = l_aufnr " Production Order
AND b~inact = ' '
AND d~spras = sy-langu
Please help me out how I can achieve this.