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: 

Make 2 values default in Z Report

Former Member
0 Kudos

Hi,

We want to make a Field as default in my Z Report.

For that i use default function for one values, but we have 2 values to insert in that field.

How can we make 2 values as default in field and also make non-changeable mode. means we want that user cann't change the values, inserted in that field.

Plz guide...

5 REPLIES 5

Sandra_Rossi
Active Contributor
0 Kudos

Why don't you use a program variant for defining a default value (even 2 values for the same field, which is of course defined as a select-options) and protecting the field? You'll find all the solutions in the forum and in the documentation (and please look at SAP examples in SE38 menu Environment, Examples, ABAP examples, then choose Screens and selection screens).

Former Member
0 Kudos

Try following Sample Code :


PARAMETERS:      p_todate LIKE sy-datum DEFAULT '20001220'.

* At Selection-Screen Output
AT SELECTION-SCREEN OUTPUT.
  PERFORM disable_to_date.

FORM disable_to_date.
  LOOP AT SCREEN.
    IF screen-name = 'P_TODATE'.
      screen-input = 0.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

ENDFORM.

Hope this helps.

Regards,

Chandravadan

Clemenss
Active Contributor
0 Kudos

Hi,

we have 2 values to insert in that field.

Can you explain? I don't know how to overcome the restriction to have one value in one field at a given time.

Regards,

Clemens

Former Member
0 Kudos

If the user cannot change them, make them constants and program that way. It's kinda useless to present parameters or ranges that a user cannot change, isn't it? Why even bother... And obligatory for a value that can't be changed? Why?

If on the other hand, you want them to appear on screen, you will need a select-options (ranges) statement for the value, since a parameter will hold only one value.

raymond_giuseppi
Active Contributor
0 Kudos

Define the field as a listbox, and use FM VRM_SET_VALUES or domain values to fill the list.

Regards,

Raymond