Application Development 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: 

select-options

Former Member
0 Kudos

how to create select-options for each of the fields thats in internal table?

5 REPLIES 5

Former Member
0 Kudos

we use SELECT-OPTIONS system implicitly creates the select options internal table which contains the fields of SIGN,OPTION,LOW & HIGH.

eg.

SELECT-OPTIONS : VENDOR FOR LFA1-LIFNR.

Former Member
0 Kudos

hi,

you can create in this way :

select-options: <name> for itab-<field name>.

example code:

TABLES: vbak.    " standard table
 
TYPE-POOLS: slis.
 
*-- Structure to hold data from table 
TYPES: BEGIN OF tp_itab1,
       vbeln LIKE vbap-vbeln,
       posnr LIKE vbap-posnr,
       werks LIKE vbap-werks,
       lgort LIKE vbap-lgort,
       END OF tp_itab1.
 
*-- Data Declaration
 
DATA: t_itab1 TYPE TABLE OF tp_itab1.
DATA : i_fieldcat TYPE slis_t_fieldcat_alv.
 
*----------------------------------------------------------------------*
*                    Selection  Screen                                 *
*----------------------------------------------------------------------*
*--Sales document-block
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln,
                             s_posnr FOR vbap-posnr,
                             s_werks FOR vbap-werks,
                            s_lgort  FOR vbap-lgort.*
SELECTION-SCREEN END OF  BLOCK b1.

hope it will help you

regards

Rahul sharma

Edited by: RAHUL SHARMA on Sep 19, 2008 8:21 AM

Edited by: RAHUL SHARMA on Sep 19, 2008 8:22 AM

Edited by: RAHUL SHARMA on Sep 19, 2008 8:23 AM

Former Member
0 Kudos

simplly you write

select-options: <name> for itab-<field name>.

use like that.

it will surely help you.

thanks & regards

abhishek

Former Member
0 Kudos

Hi Devendra,

Do the following:

loop at itab.

s_sopt-low = itab-value.

s_sopt-option = 'EQ'.

s_sopt-sign = 'I'.

append s_opt.

clear s_opt.

endloop

Hope this will help.

Regards,

Nitin.

Former Member
0 Kudos

Hi Devendra,

Welcome to SCN!!!!.

Before posting the thread just search forum and then post the thread you will find lots of information regarding selection-options and read the rules of engagement.

Regards,

Sravanthi