cancel
Showing results for 
Search instead for 
Did you mean: 

how to set mandatory fields in abap webdynpro

sreekanth_n2
Active Participant
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

sreekanth_n2
Active Participant
0 Kudos

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.

Answers (2)

Answers (2)

0 Kudos

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

0 Kudos

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-e3a562038...