I'm trying to read the field status group from T004F table for GL Balances entry. Can some one please help me read the status for fields whose MODIF in TMODU is greater than 100? There are just two 50-character long fields in T004F with status.
-
AGarcia: Here is an example for FIELD status group = '3000'. Yours could be different:
SELECT dbo.TMODU.TABNM, dbo.TMODU.FELDN, dbo.T004F.FSTAG, dbo.T004F.BUKRS, dbo.TMODU.MODIF, dbo.T004F.FAUS1, dbo.T004F.FAUS2, CASE ISNULL(NULLIF (SUBSTRING(dbo.T004F.FAUS1, CAST(dbo.TMODU.MODIF AS int), 1), ''), NULLIF (SUBSTRING(dbo.T004F.FAUS2, CAST(dbo.TMODU.MODIF AS int) - 90, 1), '')) WHEN '+' THEN 'R' WHEN '-' THEN 'S' WHEN '.' THEN 'O' ELSE 'XX' END AS Status FROM dbo.TMODU CROSS JOIN dbo.T004F WHERE (dbo.TMODU.TABNM = N'BSEG') AND (dbo.TMODU.FAUNA = N'SKB1-FAUS1') AND (dbo.TMODU.KOART = N'S') AND (dbo.TMODU.MODIF = N'001') AND (dbo.T004F.FSTAG = N'3000')
1 -
AOttone: The SQL sentence that Angel sent you works fine because SAP stores the position of field in FAUS2 in TMODU.MODIF plus 90. The TMODU.MODIF value ranges are 001-050 for T004F.FAUS1 and 091-140 for T004F.FAUS2 (position 1-50).
0
Please sign in to leave a comment.
Comments
2 comments