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

validating data

Former Member
0 Likes
437

hi,

question is my selection screen consists of some mandatory fields aong with other fields. mandatory fields r fiscal year,period,company code,Account no.,WBS element.i am populating these fields along with other fields in a field catalog. when i execute the program with the test variant its gives the list display. the data which is displayed in the list is populated in a ztable. when i again run the program with same test data and try to execute it i should give an error message saying "ztable already consist this data u cannot update it again". Message will be triggered only when all the 4 fields (Fiscal year, Period, Company code and WBS element match).

here fiscal year, company code and wbs element fields r parameters where as period is a select option.

for example my ztable consists some records with the data

comp.code period fiscalyear wbselement

from to

1001 10 12 2007 T-010139-1001GBR-VS-EN-D

so when i give in the selction screen the following data error message should get triggered

1001 1 10 2007 T-010139-1001GBR-VS-EN-D

since period 10 record has already been updated in the table.

Error Message will be triggered only when all 4 conditions are satisfied

in the same way we need to check for all the four fields.

i am getting the logic please help me out

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
410

Hi

In ZTABLE declare four fileds as key fields..

den while inserting into ZTABLE it will give sy-subrc 4..

Or if u cant make four fileds as key in ZTABLE in program u can validate data before insertion..

do a select using the fileds before inserting into ZTABLE

if already one record exists with key fields den dnt do insert give a error message....

2 REPLIES 2
Read only

Former Member
0 Likes
411

Hi

In ZTABLE declare four fileds as key fields..

den while inserting into ZTABLE it will give sy-subrc 4..

Or if u cant make four fileds as key in ZTABLE in program u can validate data before insertion..

do a select using the fileds before inserting into ZTABLE

if already one record exists with key fields den dnt do insert give a error message....

Read only

balbino_soaresferreirafil
Active Participant
0 Likes
410

Hi,

First, check if all four fields are defined has key in your table.

if yes, try check with a "select" in your table if informed values just are inserted into your table before to do the insertion.