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 without performance impact

Former Member
0 Likes
528

Im getting the input from a flat file.

I moved it to an internal table.

Please tell me the code to validate it contents <b>without performance impact</b>.

ITAB

contains fields <b>BUKRS,HKONT,GSBER,KOSTL</b>

Thanks in advance,

Viven

4 REPLIES 4
Read only

Manohar2u
Active Contributor
0 Likes
489

It depends on the file contents quantity. If you receive thousands then

1. Select all BUKRS, HKONT,GSBER,KOSTL into internal table.

2. Loop at the internal table and use READ statement to do validations.

If you have only 10's of records you can use SELECT SINGLE to do the validations.

Regards

Manohar

Read only

naimesh_patel
Active Contributor
0 Likes
489

Hello Viven,

  • validation of BUKRS

sort itab by bukrs.

loop at itab.

at new bukrs.

  • validation

endat

endloop.

  • validation of hkont

sort itab by hkont.

loop at itab.

at new hkont.

  • validation

endat

endloop.

and so on...

Regards,

Naimesh

Read only

Former Member
0 Likes
489

Hi,

You can do the following.

Declare l_too1 as type sorted table

L_ITAB = ITAB "L_ITAB is a local internal table

Sort L_ITAB BY BUKRS

Delete adjacent duplicates from L_ITAB comparing

BUKRS.

select bukrs from T001

into l_t001

for all entries into l_itab

where bukrs = l_itab-bukrs.

Loop at l_itab into <wa>

Read table l_T001 with unique key bukrs = <wa>-bukrs.

if sy-subrc <> 0.

validation message

endif.

endloop.

The same can be repeated for other fields.

Regards,

Sandeep

Read only

Former Member
0 Likes
489

Hi viven,

1. to validate it contents without performance impact

a) performance impact will only depend upon

the number of records in the internal table.

b) validations on the data of this internal table,

won't have any tangible effect on performance.

c) Further, VALIDATIONS are more important,

than performance.

regards,

amit m.