80 pts.
 Dynamic Select in ABAP termintes
Dear abap experts, The following sample report has a dynamic select statement which works for any table but it terminates at runtime for tables which include numeric fields of type i, p, or f. The error message is, "The data object cannot be converted to a character-type object." Is there any syntax in abap which gets around this problem? REPORT ZYJK_DYNAMIC_WA2 MESSAGE-ID ZF. parameters: ptabname type tabname default 'T001'. parameters: pcount type i default '10'. data: vcount type i. data: wa type ref to data. FIELD-SYMBOLS: <wa> TYPE ANY. create data wa type (ptabname). assign wa->* to <wa>. Select * into <wa> from (ptabname). if vcount > pcount. Exit. Endif. write: / <wa>(60). add 1 to vcount. endselect.

Software/Hardware used:
ASKED: June 19, 2009  3:47 PM
UPDATED: August 19, 2009  2:36 PM

Answer Wiki:
Try FIELD-SYMBOLS: <fs> type any. . . new-line. while sy-subrc = 0. assign component sy-index of structure <wa> to <fs>. write: <fs>. endwhile. instead of write: / <wa>(60). Best wishes VV
Last Wiki Answer Submitted:  August 19, 2009  2:36 pm  by  Bbbbbbbbbbbbbbbbbbbb   15 pts.
All Answer Wiki Contributors:  Bbbbbbbbbbbbbbbbbbbb   15 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _