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

Preselect mandatory dynpro field

Former Member
0 Likes
885

Hi all,

I want to preselect a mandatory dynpro field dependent on user inputs.

If the user pushs "enter" the field should be filled.

But there comes always the "Please fill all required fields" message.

The field is in the screen painter defined as "required".

Do I have to check the field value manually or how can I fill the field before the check occurs?

regards

Hi all,

I want to preselect a mandatory dynpro field dependent on user inputs.

If the user pushs "enter" the field should be filled.

But there comes always the "Please fill all required fields" message.

The field is in the screen painter defined as "required".

Do I have to check the field value manually or how can I fill the field before the check occurs?

regards

5 REPLIES 5
Read only

qamar_javed
Participant
0 Likes
830

Hi,

Please specify the requirement clearly

Read only

0 Likes
830

Hi,

lets say we have two dynpro fields.

Example:

field1 and field2

field2 is mandatory.

if the user enters a value in field1 the value should be automatically filled in field2 after pushing enter.

How can I do this?

I try to fill the field2 in PBO of my screen.

But there is always the "Fill all required fields" message..

regards

Read only

0 Likes
830

Hi,

Ok. for the user command of 'enter' copy the value of field 1 to field 2 in PBO.

Read only

0 Likes
830

Hi,

write a little test program and try your solution..

It will not work!!!!

regards

Edited by: Wolfgang Bauer on Dec 2, 2009 1:25 PM

Read only

0 Likes
830

Hi Wolfgang,

your requirement is not at all possible. You have to make the first field as Mandatory, other wise if you want to make second field as mandatory & press enter the system wont allow us to proceed by default since we have a mandatory field on the second line.

There is a function AT EXIT-COMMAND using which we can by pass all the mandatory fields on the screen but in your case I tried to use this function whats happening, the moment you enter some value in the first input field & hit enter the system processes AT EXIT-COMMAND but it deletes the values in the fisrt input field, so you cant move the value of the first field into the second field since it will be blank.

So What I suggest is make first field as Mandatory & proceed.

I have created a small program.

The code snippet for your perusal :-

Design two input fields of length on the screen

SE 38 code

REPORT ztest_scr .

DATA : field1(15) TYPE c,
       field2(15) TYPE c.

START-OF-SELECTION.

  CALL SCREEN 0100.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
case sy-ucomm.
when ' '.           "When you hit enter SY-UCOMM will be blank
  field2 = field1.

  endcase.
ENDMODULE.                 " USER_COMMAND_0100  INPUT

SE51 Code

PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
*
PROCESS AFTER INPUT.
 MODULE USER_COMMAND_0100.

Regards

Abhii

Edited by: Abhii on Dec 2, 2009 1:51 PM