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
872

Hello All,

What is the name of the standard SAP structure for SELECT-OPTIONS?

Thanks in Advance,

Prasad

7 REPLIES 7
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
838

Well, SELECT-OPTIONS is a internal table with 4 fields, SIGN, OPTION, LOW and HIGH. SIGN and OPTION are always 1 and 2 characters, LOW and HIGH take the type and length of the field that it references. So really, there is not a "Standard" structure, because you would want the LOW and HIGH fields to have the same data type and length as the field that you are referencing. For example, say you want a SELECT-OPTIONs for a date field.

select-options: s_datum for sy-datum.

The LOW and HIGH would have the data type D with a length of 8.

Regards,

Rich Heilman

Read only

0 Likes
838

As Rich says, the LOW & HIGH depend on the field you are have the select-option for... if you want to write something generic, you could try something like having an internal table like structure BBPF4B "BAPI Selection Options for Choosing Values via Search Help" as a way of passing parameters around, and adjust the LOW & HIGH when needed (e.g. you might need to apply conversion exits or move-corresponding into a suitable local range object before searching the database for matching values).

Read only

Former Member
0 Likes
838

Hello kln_k,

The structure is DDSHSELOPT.

Regards,

Hendy

Read only

Former Member
0 Likes
838

i am using select - option statement in dis way : -

SELECT-OPTIONS : PO_DATE FOR AUFK-ERDAT,

PO_TYPE FOR AUFK-AUART,

PO_CO_M FOR RESB-MATNR.

but i want to write po_date as PRODUCTION ORDER DATE , as i know d default value is 8 characters,i want to know the solution problem.plz help me its urgent.

Read only

0 Likes
838

Hi yakul.

(1) Sample1

REPORT demo_sel_screen_select_default.

DATA wa_spfli TYPE spfli.

SELECT-OPTIONS airline FOR wa_spfli-carrid

DEFAULT 'AA'

TO 'LH'

OPTION nb

SIGN i.

(2) Sample2

....

SELECT-OPTIONS : PO_DATE FOR AUFK-ERDAT,

PO_TYPE FOR AUFK-AUART,

PO_CO_M FOR RESB-MATNR.

.....

INITIALIZATION.

PO_DATE-LOW = SY-DATUM.

PO_DATE-OPTION = 'EQ'.

PO_DATE-SIGN = 'I'.

APPEND PO_DATE.

....

Message was edited by:

Hyejeong Baik

Read only

0 Likes
838

Hi

You have declared as below.

SELECT-OPTIONS : PO_DATE FOR AUFK-ERDAT,

PO_TYPE FOR AUFK-AUART,

PO_CO_M FOR RESB-MATNR.

To Get the Description for PO_DATE as PRODUCTION ORDER DATE

Steps:

<b>1. Activate your program.

2. In the Source code of your program Select the menu path

GOTO -> TEXT ELEMENTS -> SELECTION TEXTS

There it will show all the fields of ur selection Screen

Enter the Descriptions you want.

3. Activate the Text elements and come back to Source code

4. Execute the program</b>

<b>Reward if Helpful.</b>

Read only

0 Likes
838

THANKS A LOT FOR UR HELP AND IT WORKS TOO