‎2008 Jan 28 5:06 AM
How to modify my database table for new entries from the module pool program??.
‎2008 Jan 29 11:44 AM
case sy-ucomm.
WHEN 'SAVE'.
IF SAVE_OK = 'CHAN'.
MODIFY Z11KUSH_EKKO_NEW.
IF i_ekpo-EBELP = ' '.
*
INSERT Z11KUSH_EKPO_NEW FROM TABLE I_EKPO.
*
ELSE.
MODIFY Z11KUSH_EKPO_NEW FROM TABLE I_EKPO.
ENDIF.
ENDIF.
IF SAVE_OK = 'CREA'.
Z11KUSH_EKKO_NEW-EBELN = D_EBELN.
MODIFY Z11KUSH_EKKO_NEW FROM Z11KUSH_EKKO_NEW.
SELECT SINGLE * FROM z11kush_ekko_new WHERE ebeln =
**z11kush_ekko_new-ebeln.
IF sy-subrc = 0.
i_ekpo-ebeln = d_ebeln.
LOOP AT I_EKPO.
INSERT Z11KUSH_EKPO_NEW FROM TABLE I_EKPO.
INSERT INTO Z11KUSH_EKPO_NEW VALUES I_EKPO.
ENDLOOP.
ENDIF.
**
ENDIF.
CLEAR Z11KUSH_EKKO_NEW.
REFRESH I_EKPO.
LEAVE TO SCREEN 0100.
endcase.
this will help you outta ur problem.
reward points if helpful,
kushagra
‎2008 Jan 28 5:11 AM
Hi
Use Modify Statement. Hope it will help you.
Reward if help.
To insert or change a single line in a database table, use the following:
MODIFY <target> FROM <wa> .
The contents of the work area <wa> are written to the database table <dbtab>. The work area <wa> must be a data object with at least the same length and alignment as the line structure of the database table. The data is placed in the database table according to the line structure of the table, and regardless of the structure of the work area. It is a good idea to define the work area with reference to the structure of the database table.
If the database table does not already contain a line with the same primary key as specified in the work area, a new line is inserted. If the database table does already contain a line with the same primary key as specified in the work area, the existing line is overwritten. SY-SUBRC is always set to 0.
A shortened form of the above statement is:
MODIFY <dbtab>.
In this case, the contents of the table work area <dbtab> are inserted into the database table with the same name. You must declare this table work area using the TABLES statement. In this case, it is not possible to specify the name of the database table dynamically. Table work areas with the same name as the database table (necessary before Release 4.0) should no longer be used for the sake of clarity.
‎2008 Jan 28 5:11 AM
Generally table maintenance generator (SM30) view solve this purpose. If you dont not want to do the table containts modification by SM30, then just create a dialog program similar ro that SM30 view. which will Insert , delete or modify the data base tanble containts.
Display the database table containts in a tabular format in the screen ( You can use table control for that). then Insert , delete or modify the data base tanble containts and code in that way so that your change of value in screen reflect in the database tables).
‎2008 Jan 28 5:12 AM
Use update command or modify command on your database table
Regards,
siva chalasani
‎2008 Jan 28 5:12 AM
Hi,
use insert and update statements
INSERT INTO target VALUES source.
UPDATE target source.
Plzz reward points if it helps.
‎2008 Jan 28 5:13 AM
‎2008 Jan 29 11:44 AM
case sy-ucomm.
WHEN 'SAVE'.
IF SAVE_OK = 'CHAN'.
MODIFY Z11KUSH_EKKO_NEW.
IF i_ekpo-EBELP = ' '.
*
INSERT Z11KUSH_EKPO_NEW FROM TABLE I_EKPO.
*
ELSE.
MODIFY Z11KUSH_EKPO_NEW FROM TABLE I_EKPO.
ENDIF.
ENDIF.
IF SAVE_OK = 'CREA'.
Z11KUSH_EKKO_NEW-EBELN = D_EBELN.
MODIFY Z11KUSH_EKKO_NEW FROM Z11KUSH_EKKO_NEW.
SELECT SINGLE * FROM z11kush_ekko_new WHERE ebeln =
**z11kush_ekko_new-ebeln.
IF sy-subrc = 0.
i_ekpo-ebeln = d_ebeln.
LOOP AT I_EKPO.
INSERT Z11KUSH_EKPO_NEW FROM TABLE I_EKPO.
INSERT INTO Z11KUSH_EKPO_NEW VALUES I_EKPO.
ENDLOOP.
ENDIF.
**
ENDIF.
CLEAR Z11KUSH_EKKO_NEW.
REFRESH I_EKPO.
LEAVE TO SCREEN 0100.
endcase.
this will help you outta ur problem.
reward points if helpful,
kushagra