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

Tables Wa ?

Former Member
0 Likes
831

TABLES: LFA1.

IN SELECT-OPTINS IT IS MANDATORY,BUT IT IS NOT MANDATORY FOR PARAMETERS WHY? WHAT IS THIS ? EXPLAIN PLZ ?

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
791

Please read this, and you will discover that the TABLES statement is not required, you can also use a DATA statement to describe the field.

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dba74635c111d1829f0000e829fbfe/frameset.htm

Regards,

Rich HEilman

TABLES: LFA1.

IN SELECT-OPTINS IT IS MANDATORY,BUT IT IS NOT MANDATORY FOR PARAMETERS WHY? WHAT IS THIS ? EXPLAIN PLZ ?

5 REPLIES 5
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
792

Please read this, and you will discover that the TABLES statement is not required, you can also use a DATA statement to describe the field.

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dba74635c111d1829f0000e829fbfe/frameset.htm

Regards,

Rich HEilman

Read only

Former Member
0 Likes
791

REPORT demo_sel_screen_select_options.

DATA wa_carrid TYPE spfli-carrid.

SELECT-OPTIONS airline FOR wa_carrid.

LOOP AT airline.

WRITE: / 'SIGN:', airline-sign,

'OPTION:', airline-option,

'LOW:', airline-low,

'HIGH:', airline-high.

ENDLOOP.

Read only

Former Member
0 Likes
791

Hi,

in Select options tables declaration is not mandatory you can also define by using Data typ.

see the following syntaz declaration.

DATA a TYPE matnr.

SELECT-OPTIONS zmatnr FOR a.

data : begin of tbl_mara occurs 0,

zmatnr like mara-matnr,

end of tbl_mara.

select matnr from mara into tbl_mara where matnr in zmatnr.

<b>reward with points if helpful.</b>

regards,

vijay

Read only

Former Member
0 Likes
791

hi,

check the declaration of select options and parameter

if

select options s_xxxx for mara-xxxx.

then you need to define tables

if

data :it_mara type standard table of mara.

select-options s_xxxx for it_mara-xxxx.

the it is not required because it is fetching the details from the itab and indirectly from the dbtab mara as it has been defines with a data statement.

for parameter

parameter : p_xxxx type xxxx.(here you are directly giving the se11 type).

this is a difference between using FOR and using TYPE

i hope you are clear now.

thanks

vivekanand

Read only

varma_narayana
Active Contributor
0 Likes
791

Hi...

In SELECT-OPTIONS it is must to Refer an Existing Variable or Data type.

Bcoz SELECT-OPTIONS creates an Internal Table based on this .

Whereas PARAMETERs is a single field only.

Eg:

DATA : WA LIKE MARA.

TABLES : MARA.

SELECT-OPTIONS: S_MATNR FOR MARA-MATNR,

S_MTART FOR MARA-MTART.

<b>reward if Helpful</b>