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

Check before update in table

mrahhaoui
Participant
0 Likes
809

Hi Guru's,

I am a new developper in abap. I have a question concerning the check before the update in a table.

I uploaded a csv file by the function module GUI_DOWNLOAD but now before to do the update I have to check if the correct value for the controlling area and profit centre are used .

I don't know where do my test.

Anyone can help me?

Regards,

Mohamed.

UPDATE

- fill table --> check all values of the file and if one error stop processing and do not update anything in the table

- check if controlling area is correct

- check if profit center is correct

/.....

.....

/

LOOP AT it_datatab INTO wa_datatab.

split wa_datatab at ';' into

wa_cepc_segm-KOKRS

wa_cepc_segm-PRCTR

wa_cepc_segm-DATBI

wa_cepc_segm-DATAB

wa_cepc_segm-SEGMENT.

APPEND i_cepc.

CLEAR i_cepc.

ENDLOOP.

END-OF-SELECTION.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
774

This message was moderated.

Hi,

Updating a database table

Single-line updates

SELECT * FROM TABLE

COLUMN-UPDATE STATEMENT

UPDATE TABLE

ENDSELECT

Column updates

UPDATE TABLE SET COLUMN-UPDATE STATEMENT

Regards

6 REPLIES 6
Read only

Former Member
0 Likes
774

Just locate the tables that data is stored in and select it. Then check the value of sy-subrc. If it's 0, the data's been located, thus it's valid.

Read only

Former Member
0 Likes
774

Before updating , you can loop the data table and check.

You can filter the wrong inputs.

Otherwise during updation only you will come to know this.

Read only

Former Member
0 Likes
775

This message was moderated.

Read only

matt
Active Contributor
0 Likes
774

The answer marked as corrrect was cut and pasted from http://www.henrikfrank.dk/abaptips/databasetablesandopensql/updating_a_databasetable.htm and has been rejected.

Read only

Former Member
0 Likes
774

Hi,

Updating a database table

Single-line updates

SELECT * FROM TABLE

COLUMN-UPDATE STATEMENT

UPDATE TABLE

ENDSELECT

Column updates

UPDATE TABLE SET COLUMN-UPDATE STATEMENT

Regards

Read only

0 Likes
774

I have to check if the record is alread present in the table and check if the record already present in table for profit center/controlling area

If yes I should have an error