Application Development 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: 

record already present

mrahhaoui
Participant
0 Kudos

Hi guru's,

I have to do a test which checks if the records uploaded from the file are already present in the table system and if the records already present in table for profit center/controlling area.

Anyone can help me please.

Regards,

Mohamed.

DATA:

wa_cepc_segm TYPE zst_cepc_segm,

wa_cepc_segm2 TYPE zst_cepc_segm,

i_cepc_segm TYPE STANDARD TABLE OF zst_cepc_segm,

l_kokrs TYPE kokrs,

l_prctr TYPE prctr,

l_segment TYPE segment,

l_check TYPE sy-subrc,

wa_prtcr TYPE cepc.

>........<

LOOP at i_cepc_segm TO wa_cepc_segm.

READ TABLE zst_cepc_segm into wa_cepc_segm2.

ENDLOOP.

2 REPLIES 2

former_member242255
Active Contributor
0 Kudos

get the file data and table data into two internal tables and

check by looping the file data internal table and reading the ztable data internal table.

Former Member
0 Kudos

Hi,

1. Get the data into the internal table i_input from File .

2. Check the record existence in the database from the internal table using the FOR ALL ENTRIES on i_input in Select statement from DB table . Get the data into i_itab.

3. Now loop the i_input and check the entry exists in the i_itab. if doesnot exist append the data into i_final.

4. update the data from i_final to DB table.