2009 May 06 1:34 PM
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.
2009 May 06 1:40 PM
This message was moderated.
2009 May 06 1:37 PM
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.
2009 May 06 1:40 PM
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.
2009 May 06 1:40 PM
2009 May 06 3:31 PM
The answer marked as corrrect was cut and pasted from http://www.henrikfrank.dk/abaptips/databasetablesandopensql/updating_a_databasetable.htm and has been rejected.
2009 May 06 1:57 PM
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
2009 May 06 3:11 PM
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
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |