Application Development and Automation 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: 
Read only

Data validation in Table maintenance

Former Member
0 Likes
2,332

Hello,

Can anybody tell me how to validate the data while entering in table maintenance screen ? I wanted to validate data based on certain conditions on custom table. I am using VIEW_MAINTENANCE_CALL thro abap report. Also the user should not be allowed to save the data if the condition failed.How to set default values for the field created in custom table ?

Thnx in advance

Anney

13 REPLIES 13
Read only

Former Member
0 Likes
1,503

Read only

uwe_schieferstein
Active Contributor
0 Likes
1,503

Hello Anney

You have to use table maintenance events in your maintenance view (or table). Go to the table maintenance generator and choose menu Environment -> Modifications -> Events.

There you have to choose the appropriate event and define a FORM routine. This FORM routine is created within a form-include of the function group containing the maintenance dialogs.

If you want to set the default value at the start of the dialog and when the user creates new entries you will need events <b>'21' (fill hidden fields)</b> and <b>'05' (creating a new entry)</b>.

For the events define a form routine within an include in your function group. There you have access to the structure of the view (e.g. z_tabl_view). There you fill z_tabl_view-column = <fixed value>.

For checking data before saving you will need event <b>01 (before saving the data in the database)</b>.

For detailed information please refer to the SAP online documentation:

<a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/91/ca9f0ea9d111d1a5690000e82deaaa/content.htm">Extended Table Maintenance Events</a>

Regards

Uwe

Read only

0 Likes
1,503

Hi,

As suggested I tried to create using event '05' as i need to validate by existing data in the custom table . But its asking for include . And it says program L...are reserved for function group includes. So what shall i do now ?

Is there any alternative solution ?

Regds

Anney

Read only

Former Member
0 Likes
1,503

Hi,

Go to SE80 give the function group that you used for creating the table maintenance..

Choose the main program..

Get it into change mode..

Give INCLUDE Z_CUSTOM_INCLUDE..

Double click on the include..Then create it..

Thanks,

Naren

Read only

Former Member
0 Likes
1,503

you can hit enter a create the Include. The created include is a user created for the event. In Se80 for the function group check for the main program. But in the include you have give the form name. CHECK_DATA( whatever u have given for the event) is nothing but the form name you have given for event 05.

in the Include file which the system suggested

FORM CHECK_DATA

what ever the code

ENDFORM.

After activating the include also activate the main program also.

Read only

0 Likes
1,503

Hi Eda,

I tried to give the validation inside the form ... endform as suggested but it says perform is missing . Also i wanted to validate the current processing custom table so which event do i need to use .

rgds

Anney

Read only

0 Likes
1,503

This article should clear all your doubts

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8129f164-0a01-0010-2a8e-87652872...

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

0 Likes
1,503

Hi Eda,

I tried to create inside the include ,

module check_data.

perform check_data.

endmodule.

but it says 'main program for include not found'

regds

Anney

Read only

Former Member
0 Likes
1,503

are tring a new PBO or PAI or is it just for event 05 cause if its only validation then a type of subprogram should be fine and with in this

form

endform as a routine should work.

*******************************************************************

  • User-defined Include-files (if necessary). *

*******************************************************************

<b>* INCLUDE LZTABF... " Subprograms</b>

  • INCLUDE LZTABO... " PBO-Modules

  • INCLUDE LZTABI... " PAI-Modules

Read only

Former Member
0 Likes
1,503

to add on in the EVENT FORM ROUTINE

give the event as 05 and in form routine : check_data

on the right side click on the editor and it sould create the include. In this include

form check_data

break-point.

endform.

Activate the include as well as the main program from se80 before you run it in sm30.

Read only

0 Likes
1,503

Hi Eda,

I did the same whatever you have mentioned . But still when I am running the report if I click on save it throws the errror as PERFORM_NOT_FOUND.

Is there any other way that I can write include in PBO or in PAI ? As I need to have default values also. I am not sure . Kindlu suggest me.

Regards

Anney

Read only

Former Member
0 Likes
1,502

from se11 when you go to the maintenenace, was the table saved and activated after you created the event modification?