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: 

required values in parameter list box

Former Member
0 Kudos

HI

i want to display a parameter with the list box only with 7 values but it has some 20 values in that.

P_DATETY TYPE CRMV_TIMECTEV-NAME_EVENT AS LISTBOX VISIBLE LENGTH 99

USER-COMMAND ACTT,

i tried to create a data element then domain and set the required values in the fixed values but the fixed value colom contain only char of 10. but the value i need to fix is of char 12.

Please help me on this.

5 REPLIES 5

Former Member
0 Kudos

Hi,

if you want to see the parameter as 12 char, increase the visible length of the parameter.

Parameters : p_XXXX TYPE XXXXX visible length 12.

Hoope it helps!!

Regards,

Pavan

0 Kudos

That is ok.......

but i want to display only 7 values in the list box......... but have 20 ......... help me on this

0 Kudos

Hi,

SAP fixed values is only 10 chars (DD07D-DOMVALUE), u can't change it!

For your listbox, this is what SAP said:

"If the parameter is created with a data type from the ABAP Dictionary, and the data type is linked to the input help in the Dictionary the first column of the input help is displayed in the list box. Otherwise, a single-line list box is displayed containing the current value of the parameter.

So if the data type that currently you used linked with input help which return 20 records, it will show 20 records. How to show only 7, the logic is you have to create your own data type, with your own input help that linked to your data type and only return 7 records.

Hope it helps,

Victor.

Former Member
0 Kudos

Hi,

Syntax

... [DEFAULT val]

[LOWER CASE]

[MATCHCODE OBJECT search_help]

[MEMORY ID pid]

[VALUE CHECK] ... .

Extras:

1. ... DEFAULT val

2. ... LOWER CASE

3. ... MATCHCODE OBJECT search_help

4. ... MEMORY ID pid

5. ... VALUE CHECK

Effect

Using these additions, you can define a start value that allows lowercase lettering, a search help, a SPA/GPA parameter, or execution of a check against a value list.

Addition 1

... DEFAULT val

Effect

This addition creates a start value for the content of the parameter para. The start value val can either be specified as a literal or as a data object already defined.

If the data type of the specified start value does not match the data type of the declaration, it is converted according to the conversion rules. Without the addition DEFAULT, the initial value that suits the data type is used as a start value.

There are two times when a start value can be passed to the parameter:

When an executable program is started using SUBMIT, all the values val specified using DEFAULT are passed at program start between the events LOAD-OF-PROGRAM and LOAD-OF-PROGRAM and INITIALIZATION to the respective parameter para.

If a program is not loaded into internal mode using a call with SUBMIT, but using a dialog or a OOtransaction, or through an external procedure call, all the values val specified using DEFAULT are passed to the respective parameters para when an arbitrary selection screen is called for the first time using CALL SELECTION-SCREEN before the event AT SELECTION-SCREEN OUTPUT.

In both cases, all the parameters are supplied with their start values, irrespective of the selection screen on which they are defined. If a parameter is not initial at the time of the data transfer, the start value will not be passed.

Note

The respective input field on the selection screen is only filled with the start value if the value for para is no longer changed before the selection screen is transmitted. The system displays exactly that value that the parameter has at the end of processing of the event AT SELECTION-SCREEN OUTPUT.

Addition 2

... LOWER CASE

Effect

This addition prevents the content of character-type fields from being converted to uppercase letters when the input field on the selection screen is transported to the data object para in the program and vice versa.

The addition LOWER CASE cannot be used together with the additions AS CHECKBOX or RADIOBUTTON.

Addition 3

... MATCHCODE OBJECT search_help

Effect

This addition links the input field of the parameter with a search help search_help from the ABAP Dictionary. The name of the search help must be entered directly. For the input field of the parameter on the selection screen , the input help key is displayed. When the input help (F4) is requested, the user is displayed the hit list from the search help. When an entry is selected, the respective value is placed into the input field. If no search help for the specified name exists in the ABAP Dictionary, a message is displayed in the status line when the input help is requested.

The addition MATCHCODE OBJECT cannot be used together with the additions AS CHECKBOX or RADIOBUTTON.

Note

The predecessors of search helps in the ABAP Dictionary were socalled matchcode objects. This is why you have the name MATCHCODE OBJECT for this addition. Matchcode objects that have not yet been replaced by search helps continue to be supported by this addition.

Example

Linking the parameter p_carrid with a suitable search help. When you choose the input help on the selection screen, a list with the names of the airline carriers is displayed. If a name is selected, the corresponding abbreviation is placed in the input field.

PARAMETERS p_carrid TYPE s_carr_id

MATCHCODE OBJECT demo_f4_de.

Addition 4

... MEMORY ID pid

Effect

This addition links the input field of the parameter with a SPA/GPA parameter in the SAP Memory. The name of the SPA/GPA parameter must be specified directly and with a maximum of 20 characters

The input.field is filled - when the selection screen is called - with the current value of the SAP/GPA parameter in the SAP memory, provided the data object para is initial after processing of the event AT SELECTION-SCREEN OUTPUT. Otherwise, the value of para is displayed. If there is a user action on the selection screen, the content of the input field is assigned to the SPA/GPA parameter in the SAP memory. If no SPA/GPA parameter exists for the specified name, it will be created.

Note

The addition DEFAULT overrides the addition MEMORY ID.

Example

The parameter p_prog is linked with the SPA/GPA parameter RID, which, in turn, is linked with the input field for the program name in the screens of the ABAP Workbench. Accordingly, the input field of the parameter is filled with the name of the program last processed.

PARAMETERS p_prog TYPE sy-repid MEMORY ID rid.

Addition 5

... VALUE CHECK

Effect

This addition can only be specified if the type of parameter is defined through a reference to a data type from the ABAP Dictionary.

If you have a user action on the selection screen , the current content of the input field is checked against the fixed values possibly defined in the domain of the data type. If the data type is a component of a foreign key table, a check against the check table is executed. If the check is not successful, an error message is displayed in the status line of the selection screen. If the program was called through SUBMIT without display of the selection screen, it is displayed in case of error.

The addition VALUE CHECK cannot be used together with the additions AS CHECKBOX, RADIOBUTTON, or NO-DISPLAY.

Note

The check against a check table is executed even if the input field is empty.

Check the SAP documentation in SAP for more help on parameters.

Regards

Rajesh Kumar

Former Member
0 Kudos

as