07-06-2021 8:19 AM
Hi Experts
03 and 04 .When I modify cells and delete row. But it is not successful . When I execute programe again. the data is not chaged. Can you help me ?
07-06-2021 8:24 AM
Did you try to read the code of the program ?
form update_database.
data: lt_del_rows type table of sflight,
lt_ins_keys type g_verifier->sflight_keys,
l_ins_key type g_verifier->sflight_key,
ls_sflight type sflight,
ls_outtab like line of gt_outtab,
lt_instab type table of sflight.
* §8.When all values are valid, use your internal tables
* to update your table on the database.
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* IMPORTANT: This method has been disabled, as the program logic
* was erroneous: if a user doubled a line (insert with copied values)
* the data is not accepted by alv, so the line inserted in the table
* had initial values. If he then deleted the line, the deleted line
* also had initial values. On the other hand, the line stored as
* inserted was the line with the original, copied values. So the
* data base was updated with hte copied values which lead to a
* short dump.
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
07-06-2021 8:24 AM
Did you try to read the code of the program ?
form update_database.
data: lt_del_rows type table of sflight,
lt_ins_keys type g_verifier->sflight_keys,
l_ins_key type g_verifier->sflight_key,
ls_sflight type sflight,
ls_outtab like line of gt_outtab,
lt_instab type table of sflight.
* §8.When all values are valid, use your internal tables
* to update your table on the database.
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* IMPORTANT: This method has been disabled, as the program logic
* was erroneous: if a user doubled a line (insert with copied values)
* the data is not accepted by alv, so the line inserted in the table
* had initial values. If he then deleted the line, the deleted line
* also had initial values. On the other hand, the line stored as
* inserted was the line with the original, copied values. So the
* data base was updated with hte copied values which lead to a
* short dump.
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
07-06-2021 8:36 AM
07-06-2021 8:37 AM
07-06-2021 12:55 PM
I debugged BCALV_EDIT_04 and after edited the lines of the ALV, when saving, the changed data is reflected in internal table GT_OUTTAB, so I don't understand your question. If your question is about how to update a database table from a variable, then you should ask it clearly.