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

select-options

Former Member
0 Likes
653

when user enters ess* in selection screen in one screen field, data related to ess will be fetched and displayed in output how to fetch this * kind of data.

6 REPLIES 6
Read only

Former Member
0 Likes
634

hi,

u can use like


select matnr from mara into corresponding fields of table itab *where matnr like '15%'.*

so u need to concatenate % and parameter value....


PARAMETERS : matnr LIKE mara-matnr.

DATA : mat(18) TYPE c,
       len TYPE i,
       off TYPE i.

DATA : BEGIN OF itab OCCURS 0,
        matnr LIKE mara-matnr,
       END OF itab.

len = STRLEN( matnr ).
off = len - 1.

mat = matnr+0(off).

CONCATENATE mat '%' INTO mat.

SELECT matnr FROM mara INTO CORRESPONDING FIELDS OF TABLE itab WHERE matnr LIKE mat.

LOOP AT itab.
  WRITE: / itab-matnr.
ENDLOOP.

<REMOVED BY MODERATOR>

Edited by: Dhwani shah on Jan 11, 2008 1:58 PM

Edited by: Dhwani shah on Jan 11, 2008 2:05 PM

Edited by: Alvaro Tejada Galindo on Jan 11, 2008 5:08 PM

Read only

Former Member
0 Likes
634

Hi,

You can do like this

Select * from DBTABLE into ITAB where field like p_var.

Regards,

Satish

Read only

RoySayak
Active Participant
0 Likes
634

Hi Farheen,

You can try like this for validation checking in selection screen...

SELECT <field name> FROM <databse table name>

INTO TABLE <internal table where the data store>

WHERE <field name> IN <select option in selection screen>.

IF sy-subrc <> 0.

MESSAGE i000(message class name).

LEAVE LIST-PROCESSING.

ENDIF.

<REMOVED BY MODERATOR>

Regards,

Sayak..

Edited by: Alvaro Tejada Galindo on Jan 11, 2008 5:09 PM

Read only

Former Member
0 Likes
634

SELECT * INTO  TABLE <itab> FROM <dbtab> WHERE <field> LIKE 'ESS%'.
Read only

Former Member
0 Likes
634

hi,

i think LIKE not possible with select options..

It only possible with parameters..

Read only

Former Member
0 Likes
634

Hi,

You can have a select-options in the selection screen instead of parameters..

Ex..

DATA: v_matnr TYPE mara-matnr.

SELECT-OPTIONS: so_matnr FOR v_matnr

NO-EXTENSION

NO INTERVALS.

START-OF-SELECTION.

  • If a single material is given then that material alone will be

  • selected..If * is given automatically those related materials

  • will be fetched.

  • get the data.

SELECT * FROM MARA

INTO TABLE T_MARA

WHERE matnr IN so_matnr.

Thanks

Naren