cancel
Showing results for 
Search instead for 
Did you mean: 

How to mark webdynpro abap table columns of a table ui element as mandatory?

Former Member
0 Kudos

Hello experts This is Rajesh. I'm a new  to webdynpro and trying to gain some knowledge on it. here i've a requirement that . I've a custom table at my database side. and I've a table ui elemnt on webdynpro. and

I've to create multiple entries using webdynpro table ui. after entering all entries before saving them into database(my own custom table ) these entries should be validated. if all entries are fine, means no voilations at databse side then only these entries should be saved to database.once everything saved/commited then user has to get confirmation, so my questions are

1)  how can i make table column values as mandatory so that user must enter value for them.

2) How to insert multiple lines without voilating dabase constraints.? can you explain me how to achieve my objective?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I am not very sure if this will work or not for checking mandatory fuelds. But u can try.

1. Make the input field added as cell editor of table column to Required . i.e set property 'State' as Required.

2. Call the method CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW in your action handler - U may want to read this link http://help.sap.com/saphelp_nw70ehp1/helpdata/en/d7/ef8841e3af1609e10000000a155106/content.htm

Former Member
0 Kudos

Thank you Khushboo Sachdeva. I've found one Property at table fied level.

Property name is State and for its i've choosen required . Then i noticed a star(*) mark beside the field. Eventhough i left that field blank ,Its not stopping me. Can you find any other way. 

Former Member
0 Kudos

Before you save your data, you are validating your data.

In this piece of your code as I mentioned two times before call the method I have mentioned in my posts. This method will check for all required fields on the view.

Former Member
0 Kudos

CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW

Former Member
0 Kudos

And you are right. By setting that property, you  only get the asterisk. It does not handle anything. U have to handle the validation by yourself in the logic.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello All . I found one otion at table field level. OPTION NAME IS "STATE" FOR THIS PROPERTY WE HAVE TO SELECT REQUIRED AS VALUE. THEN IT   WILL BECOME MANDATORY. BUT EVEN THOUGH I LEFT IT BLANK ITS NOT STOPPING ME. CAN ANYONE GUIDE ME?

Former Member
0 Kudos

Hi Rajesh,

You may want to read my previous post.

You can use CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW to check for mandatory fields on view.

Former Member
0 Kudos

In applications you can check whether the fields are empty. There is a method which is

used by the application to do this.

Call the method CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTRIBUTES in

your action handler or in the method wdDoBeforeAction. A example of this is the Web

Dynpro application WDR_TEST_MANDATORY.

In applications you can check whether the required entry fields of a complete view are

empty. Any personalized required entry fields are also considered.

Call the method

CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW in your action

handler or in the method wdDoBeforeAction. A example of this is the Web Dynpro

application WDR_TEST_MANDATORY.

Please see the WD application WDR_TEST_MANDATORY.

Best regards,

Rohit

Former Member
0 Kudos

Thank you Rohit will refer that component.