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

open cursor

Former Member
0 Likes
445

Hello together,

Please let me know if it is possible to open a cursor on an internal table.

I have created a generic extractor for BW by function module and I have to read the data from an internal table.

Is it possible in this case to use the procedure with open cursor described in RSAX_BIW_GET_DATA_SIMPLE?

Thank you,

Iuliana

3 REPLIES 3
Read only

Former Member
0 Likes
413

1) Example from help

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3b23358411d1829f0000e829fbfe/content.htm

2) This is an easy example.

REPORT demo_select_cursor_1.

DATA: c1 TYPE cursor,

c2 TYPE cursor.

DATA: wa1 TYPE spfli,

wa2 TYPE spfli.

DATA: flag1(1) TYPE c,

flag2(1) TYPE c.

OPEN CURSOR: c1 FOR SELECT carrid connid

FROM spfli

WHERE carrid = 'LH',

c2 FOR SELECT carrid connid cityfrom cityto

FROM spfli

WHERE carrid = 'AZ'.

DO.

IF flag1 NE 'X'.

FETCH NEXT CURSOR c1 INTO CORRESPONDING FIELDS OF wa1.

IF sy-subrc <> 0.

CLOSE CURSOR c1.

flag1 = 'X'.

ELSE.

WRITE: / wa1-carrid, wa1-connid.

ENDIF.

ENDIF.

IF flag2 NE 'X'.

FETCH NEXT CURSOR c2 INTO CORRESPONDING FIELDS OF wa2.

IF sy-subrc <> 0.

CLOSE CURSOR c2.

flag2 = 'X'.

ELSE.

WRITE: / wa2-carrid, wa2-connid,

wa2-cityfrom, wa2-cityto.

ENDIF.

ENDIF.

IF flag1 = 'X' AND flag2 = 'X'.

EXIT.

ENDIF.

ENDDO.

Read only

0 Likes
413

Hello Amit,

thank you for the answer,

but this is only possible if you have a transparent table. You cannot do it on an internal table, am I right?

Read only

0 Likes
413

i don think u can ope a cursor on a internal table..

it has to be open on database table only..

u can then use fetch statement for internal tables if u want

amit