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

How to do without TABLES statement allowed..??

Former Member
0 Likes
6,325

Hi all,

In OO programming many things are not allowed eg the keyword TABLES is not allowed.

The statement "SELECT-OPTIONS: kunnr FOR vbak-kunnr." requires statement "TABLES vbak." but in OO we can't use "tables.." so how do we declare variables which are based on/similar to elements in database tables? How would we modify the select-options statement then?

Thanks,

Charles.

1 ACCEPTED SOLUTION
Read only

Former Member
2,162

You should do something like this

DATA: v_kunnr TYPE kunnr.

SELECT-OPTIONS s_kunnr FOR v_kunnr.

5 REPLIES 5
Read only

former_member156446
Active Contributor
0 Likes
2,162

there is some concept called constructors

and parameters are the place where we declare the variables for a method.

Read only

former_member194669
Active Contributor
0 Likes
2,162

report  zars no standard page heading
        line-size 170
        line-count 65(4).

data : xvbeln    type line of tt_vbeln.

select-options : vbeln for xvbeln.

a®

Read only

Former Member
2,163

You should do something like this

DATA: v_kunnr TYPE kunnr.

SELECT-OPTIONS s_kunnr FOR v_kunnr.

Read only

0 Likes
2,162

Worked like a charm. Note that if you use internal tables and don't have variables for some of the select-options fields you can also refer to the fields defined in the itab. However, you can't refer to the itab directly since it lacks the (deprecated) header line so you'll have to use a work area for it instead.

TYPES:

  BEGIN OF ty_vbak,

    vbeln LIKE vbak-vbeln,

    kunnr LIKE vbak-kunnr,

  END OF ty_vbak.

DATA:

    lt_vbak TYPE STANDARD TABLE OF ty_vbak,

    lwa_vbak LIKE LINE OF lt_vbak.

 

SELECT-OPTIONS : s_kunnr FOR lwa_vbak-kunnr.

Read only

Former Member
0 Likes
2,162

This message was moderated.