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

Validation

Former Member
0 Likes
1,138

Hi abapers,

I got 10 records in table with 5 fields i need to validate each record and field.

Can any guide me in this scenario

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,104

Hi abapers,

I got 10 records in table with 5 fields i need to validate each record and field.

Can any guide me in this scenario

Hi Jansi,

Are talking of internal table or table control in module pool?

If an internal table, then logic should be as follows:

****If you want to validate data with master data, then get master data for this data.

****Then loop at internal table and apply validations.

LOOP AT itab.

      • Apply Master Data Validations or Business Validations Here

ENDLOOP.

Let me know your requirement in details.

Regards,

Anil

10 REPLIES 10
Read only

Former Member
0 Likes
1,105

Hi abapers,

I got 10 records in table with 5 fields i need to validate each record and field.

Can any guide me in this scenario

Hi Jansi,

Are talking of internal table or table control in module pool?

If an internal table, then logic should be as follows:

****If you want to validate data with master data, then get master data for this data.

****Then loop at internal table and apply validations.

LOOP AT itab.

      • Apply Master Data Validations or Business Validations Here

ENDLOOP.

Let me know your requirement in details.

Regards,

Anil

Read only

Former Member
0 Likes
1,104

Hi:

You question is little bit uncleared. Anyway please put your table under loop and mention the condition for validation.

Regards

Shashi

Read only

Former Member
0 Likes
1,104

Hi Jansi

Elaborate your query.

Meanwhile check the link

Regards

Sachin

Read only

Former Member
0 Likes
1,104

hiii

if only 10 records are there in your table then you can get one by one record using index ..then take field value in variable and use following query

SELECT SINGLE matnr

FROM makt

INTO w_matnr

WHERE matnr = w_matnr.

IF sy-subrc NE 0.

WRITE:

'Invalid Material'.

ELSE.

WRITE:

'Valid Material.'.

regards

twinkal

Read only

Former Member
0 Likes
1,104

i think u r asking about modulepool,

in flow logic, after PBO module

loop at table control.

chain.

validation conditions

endchain.

endloop.

Read only

0 Likes
1,104

hi ambar,

i got the date into internal table after uploading from presentation server,i need to validate the data for all the fields.

Read only

0 Likes
1,104

one thing still you didn't confirmed whether it is a modulepool or a report

your scenario is littlebit confusing,

if u have data in internal table, validate that data using select statements

if u have data in table control of module pool, then go for chain&endchain.

Read only

0 Likes
1,104

i got the answer

the scenario i need to validate until all the data is correct first validation after uploading which we handle in pai second validaion after modifying data which we do in data_changed method.

Edited by: Jansi Dorai on Mar 23, 2009 10:01 AM

Read only

Former Member
0 Likes
1,104

Hi Jansi,

If you wanna get the records by validating each..you can use 'WHERE' condition in 'SELECT' query.

for example:

DATA: begin of itab occurs 0,

bookid type z12_exam1-bookid,

bookname type z12_exam1-bookname,

bookprice type z12_exam1-bookprice,

end of itab.

SELECT bookid

bookname

bookprice

FROM z12_exam1

INTO table itab

WHERE bookid = 'B001'.

LOOP at itab.

write:/ itab-bookid , itab-bookname , itab-bookprice.

ENDLOOP.

above one is one kind of example without using parameters and select-options.

Regards

Rama Krishna G

Read only

0 Likes
1,104

hi rama,

I have done the validation already,When i was coding i had a doubt once first time it is validated,when the user is modifying using editable alv,i was having doubt where to validate.so i have handled it in data_changed event.this now i have posted as to make abapers aware about this if anybody has faced this issue