Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Query For Partticular Screen

Hai To EveryOne,

I wrote query to display all fields in particular screen. Iam getting screen name as input.This is the query

SELECT T2.[Name] AS 'TableName' , T1.[Name] AS 'Name', T0.[AliasID] AS 'Title', T0.[Descr] AS 'Description', T0.[EditSize] AS 'Edit Size', T0.[EditType] AS 'Edit Type', T0.[FieldID] AS 'Field'

FROM [dbo].[CUFD] T0 , [dbo].[OUDO] T1 ,

(Select A.[Name],substring(A.[Name],2,len(A.[Name])) as tbl from [dbo].[sysobjects] A Where name like '@%') T2

WHERE T0.[TableID] like '@PUR%' and

T2.[tbl] IN (Select OUDO.[tablename] as tbl from OUDO UNION ALL Select UDO1.[tablename] as tbl from UDO1)

and T2.[tbl]=T1.[TableName]

and T2.[Name]=T0.[TableID]

order by T1.[Name] asc,T2.[Name] desc

In this @pur% is the table name.

Now my problem is if i execute this query only head table is displayed not the detail table i also need detail table.

Does anyone tell me whts the wrong in this query....

Regards,

Anitha

Former Member
Former Member replied

Hi Anitha,

Try and simplify the query a bit. I have modified your query to the query below. I hope it serves the same purpose.

SELECT T0.[TableID] AS 'TableName', 
	T1.[Name] AS 'ObjectName', 
	T0.[AliasID] AS 'Title', 
	T0.[Descr] AS 'Description', 
	T0.[EditSize] AS 'Edit Size', 
	T0.[EditType] AS 'Edit Type', 
	T0.[FieldID] AS 'Field' 
FROM [dbo].[CUFD] T0 
LEFT OUTER JOIN OUDO T1 on T1.TableName = substring(T0.TableID, 2, Len(T0.TableID)-1)
WHERE T0.[TableID] like '@PUR%'

Hope it helps,

Adele

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question