Skip to Content
0
Nov 28, 2003 at 02:22 PM

Using select-options table as method parameter

858 Views

How it is possible to use a select-options table as a method parameter?

Select-options table is an internal table with header line, but defining parameter with header line is not possible.

Is there a way to implement this?

Thanks in advance,

Incho

My code:

...

SELECT-OPTIONS:

so_vbeln FOR wa_vbakp-vbeln MEMORY ID aun

MATCHCODE OBJECT vmva,

so_kunnr FOR wa_vbakp-kunnr MEMORY ID vag

MATCHCODE OBJECT debi,

so_matnr FOR wa_vbakp-matnr MEMORY ID mat,

so_auart FOR wa_vbakp-auart MEMORY ID aat.

...

CLASS-METHODS:

fill_it_vbakp

IMPORTING

i_vbeln LIKE so_vbeln

i_kunnr LIKE so_kunnr

i_matnr LIKE so_matnr

i_auart LIKE so_auart

i_erdat LIKE so_erdat

i_bstdk LIKE so_bstdk

i_vkorg LIKE so_vkorg

i_vtweg LIKE so_vtweg

i_spart LIKE so_spart

RETURNING

value(r_it_vbakp) TYPE ty_t_vbakp.

....

METHOD fill_it_vbakp.

DATA: r_wa_vbakp TYPE ty_s_vbakp.

SELECT kvbeln kkunnr kerdat kbstdk k~bstnk

kvkorg kvtweg k~spart

pposnr pmatnr p~arktx

pnetwr pwaerk pkwmeng pvrkme

FROM vbak AS k INNER JOIN vbap AS p

ON kvbeln = pvbeln

INTO CORRESPONDING FIELDS OF TABLE r_it_vbakp

WHERE k~vbeln IN so_vbeln

AND k~kunnr IN so_kunnr

AND k~auart IN so_auart

AND k~erdat IN so_erdat

AND k~bstdk IN so_bstdk

AND k~vkorg IN so_vkorg

AND k~vtweg IN so_vtweg

AND k~spart IN so_spart

AND p~matnr IN so_matnr.

.......

So in the method I use so_* which are globals, so they are available within the method, but I would like to use i_* parameters somehow.