Skip to Content
0
Former Member
Mar 26, 2010 at 06:19 AM

Dynamic selction tables and fields

31 Views

Hi Folks,

I have an issue while creating program using field symbols My requirement is I need to develop a program to get table counts with respect to username and date .For that I wrote below program

REPORT ZDYNAMICFIELDS.

PARAMETERS: TABNAM TYPE DD03L-TABNAME.

PARAMETERS: FLD1 TYPE DD03L-FIELDNAME.

PARAMETERS: FLD2 TYPE DD03L-FIELDNAME.

DATA: FIELD1 TYPE REF TO DATA,

FIELD2 TYPE REF TO DATA.

CREATE DATA: FIELD1 TYPE (FLD1),

FIELD2 TYPE (FLD2).

*FIELD-SYMBOLS: <FLD1> TYPE ANY,

  • <FLD2> TYPE ANY.

*

ASSIGN: FIELD1-> TO <FLD1>,

  • FIELD2->* TO <FLD2>.

DATA: BEGIN OF ITAB,

FIELD1 LIKE FIELD1,

FIELD2 LIKE FIELD2,

END OF ITAB.

DATA: ITAB1 TYPE REF TO DATA.

CREATE DATA: ITAB1 TYPE TABLE OF ITAB.

FIELD-SYMBOLS: <FS_IT> type standard table.

ASSIGN: ITAB1->* TO <FS_IT> .

DATA: STR TYPE STRING.

CONCATENATE FLD1 FLD2 INTO STR SEPARATED BY ''.

CONDENSE STR.

SELECT (STR) FROM (TABNAM) INTO TABLE <FS_IT> UP TO 1000 ROWS.

write:/ 'total number of records' ,sy-dbcnt.

But this is not working for DATE and TIME fileld,

Can anyone please help me to resolve this issue....

Thanks & Regards,

Sreedhar Tammineni.