Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Type ref to a table

Former Member
0 Likes
1,075

Hi Experts,

I have an FM returning a variable which is :

abc type ref to data.

This actually returns a table at runtime.

However since its declaration is such, I capture the reference in another variable

xyz type ref to data.

Now I need to know whether the xyz table has one row or more.

How can I do that?

Thanks and Regards,

Ravi Bhatnagar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
945

data: v_lines type i.

field-symbols: <fs> type standard table.

ASSIGN xyz->* TO <fs>.

describe table <fs> lines v_lines.

v_liens you get the number of rows.

2 REPLIES 2
Read only

Former Member
0 Likes
946

data: v_lines type i.

field-symbols: <fs> type standard table.

ASSIGN xyz->* TO <fs>.

describe table <fs> lines v_lines.

v_liens you get the number of rows.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
945

Try something like this. Assign the data ref to a field symbol, then use the LINES operator to find out the number of lines.

DATA: lo_ref TYPE REF TO data.
DATA: lv_lines TYPE i.

FIELD-SYMBOLS: <fs_tab> TYPE table.

ASSIGN lo_ref->* TO <fs_tab>.

lv_lines = LINES( <fs_tab> ).

Regards,

Rich Heilman