Skip to Content
avatar image
Former Member

mandatory fields in dynpro

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Aug 20, 2007 at 09:05 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 09:07 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 20, 2007 at 09:23 AM

    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>

    Add comment
    10|10000 characters needed characters exceeded