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: 

mandatory fields in dynpro

Former Member
0 Kudos

Hi!

I have some mandatory fields in my dynpro, but i also have a option to fill data in the dynpro after filling 2 fields and clickin a button.

The problem is that if I click the button, it says that I have to fill the mandatory fields. Is there a way to stop the control-function only for this button-click?

i tried it with exit-commands, but so i don´t get the data from the 2 filled fields, because it only transports the user-command.

thank you in advance!

Andreas

3 REPLIES 3

Former Member
0 Kudos

Hi Andreas,

As you said there are few mandatory fields in the dynpro, i dont think it is possible to skip them with out entering data in those fields.

Instead, what you can do is -

Do not make those fields as mandatory during design time.

Instead write code in PAI Module to check if values are entered in those fields if the button is not clicked.

<i>Reward points for informatory answers.</i>

Best Regards,

Ram.

former_member667836
Active Participant
0 Kudos

Hi Andreas,

How you set the mandatory check for the field?is it through screen painter or you use the chain..endchain statement for the mandatory check.if you are using the chain .. endchain statement for madatory check you can write inside the module

In PAI of the screen

chain.

field field1 module check.

endchain

in module check you have to write following code

module check input.

if sy-ucomm <> 'BUTTON'

check here the field is empty

then give appropriate message

endif.

endmodule

Hop this will be helpfule for u.

reward if helpful.

shibu

varma_narayana
Active Contributor
0 Kudos

Hii Andreas..

This is the Solution for u..

You are using the Module AT EXIT-COMMAND to avoid the Mandatory field checks. But in this module the Screen fields are not Copied to Program Variables.

Only the OK_CODE(SY-UCOMM) will be copied.

But you can read the Values of the SCREEN FIELDS by Calling the FM

<b>DYNP_VALUES_READ</b>

(This Fm reads the Screen field values even before they are transported to program)

EG:

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

TABLES

dynpfields = h_dynpfields

EXCEPTIONS

OTHERS = 1.

Let me know if there are any issues.

<b>Reward if Helpful</b>