Google Search - Blog...........

ABAP - Fetch Data From Database Tables Using Select Queries.

REPORT YTABFLDS .
TABLES: DD02L, DD03L, DD04T.

PARAMETERS THETABLE LIKE DD02L-TABNAME OBLIGATORY.

DATA: BEGIN OF MYTABLE,
TABNAME LIKE DD02L-TABNAME,
AS4LOCAL LIKE DD02L-AS4LOCAL,
AS4VERS LIKE DD02L-AS4VERS,
END OF MYTABLE.

SELECT SINGLE TABNAME AS4LOCAL AS4VERS
INTO MYTABLE FROM DD03L
WHERE TABNAME = THETABLE.

WRITE: / MYTABLE-TABNAME, 11 MYTABLE-AS4LOCAL, 13 MYTABLE-AS4VERS.

SELECT * FROM DD03L
WHERE TABNAME = MYTABLE-TABNAME
AND AS4LOCAL = MYTABLE-AS4LOCAL AND AS4VERS = MYTABLE-AS4VERS.

WRITE: / DD03L-FIELDNAME, 11 DD03L-KEYFLAG, 13 DD03L-ROLLNAME,
24 DD03L-CHECKTABLE, 35 DD03L-INTTYPE, 37 DD03L-REFTABLE,
48 DD03L-DATATYPE.

SELECT SINGLE * FROM DD04T
WHERE ROLLNAME = DD03L-ROLLNAME AND
AS4LOCAL = MYTABLE-AS4LOCAL AND AS4VERS = MYTABLE-AS4VERS AND
DDLANGUAGE = 'E'.

WRITE: 53 DD04T-DDTEXT.
ENDSELECT.

No comments:

Post a Comment