Skip to Content
author's profile photo Former Member
Former Member

validating data


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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 05, 2007 at 10:23 AM


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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2007 at 10:46 AM


    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.