Skip to Content

how to set mandatory fields in abap webdynpro

Hi Experts.

how to set mandatory fields in abap webdynpro.

I have set of 5 fields in my view. Changed the property of input field. State-> Required .  to all fields.

If value is not entered in any of the field, output is as per the expectations.

If value is entered in any one field and click on save, then it is saving without asking to enter value in other required fields..

Please suggest.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Apr 19, 2016 at 11:06 AM

    Thnks all

    handled programatically.

            lo_nd_xxx     TYPE REF TO if_wd_context_node,

            ls_xxx        TYPE        wd_this->element_<node name>,

        lo_nd_xxx = wd_context->get_child_node( name = wd_this->wdctx_<view name>).

        lo_nd_xxx->get_static_attributes( IMPORTING static_attributes = ls_xxx).

    the above structure ls_xxx has captured whether data is being entered by user.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 15, 2016 at 07:16 AM

    DATA lo_contrl TYPE REF TO if_wd_view_controller.

    lo_contrl = wd_this->wd_get_api( ).

    CALL METHOD cl_wd_dynamic_tool=>check_mandatory_attr_on_view

    EXPORTING

    view_controller = lo_contrl. "Export current view API

    This bit of code would be helpful

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 15, 2016 at 07:14 AM

    Required validation needs to be done in WDAFTERACTION or any relevant method.Pls check below link for the same.

    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/207e4467-227e-2e10-6fbb-e3a562038296?QuickLink=index&…

    Add comment
    10|10000 characters needed characters exceeded