Skip to Content
0
Former Member
Dec 19, 2012 at 05:55 AM

Dynamic select statement in subroutine pool concept

39 Views

Hi Experts,

SELECT (s_column_syntax)

FROM (s_dbtab_syntax)

INTO TABLE T_FINAL1

WHERE (t_criteria).

In above statement i'm getting 450 records. but i'm passing those internal tables to as below

PERFORM pull_data IN PROGRAM (w_xprog)

TABLES S_COLUMN_SYNTAX S_DBTAB_SYNTAX T_CRITERIA.

APPEND 'FORM PULL_DATA TABLES COLUMN_SYNTAX DBTAB_SYNTAX CRITERIA.' TO int_src.

APPEND 'SELECT (COLUMN_SYNTAX)' TO INT_SRC.

APPEND 'FROM (DBTAB_SYNTAX)' TO INT_SRC.

APPEND 'INTO TABLE T_OUTREC' TO INT_SRC.

APPEND 'WHERE (CRITERIA).' TO INT_SRC.

APPEND 'ENDFORM.' TO int_src.

GENERATE SUBROUTINE POOL int_src

NAME w_xprog

MESSAGE w_msg

LINE w_len


In above we can't get data to T_OUTREC.

Getting runtime error as

A dynamically specified FROM clause has an unexpected format.

Regards,

BALAJI.