‎2007 Sep 01 3:07 AM
Hi, I am new in abap I have a work area with 38 fields and i want to save some fields, specifically 25 fields from the work area, into a database table, maybe you can help with these.
tahnks.
Guillermo
‎2007 Sep 01 3:52 AM
Sorry I forgot to mentioning that, i create the table ztreglog, is not a abap table.
thank you for your reply it was helpful.
‎2007 Sep 01 3:21 AM
Hi ,
U have not mentioned which DB table u want to update SAP standard table or ur custom table..
SAP doesnt recommend updating its standard tables directly....it should be done only through transactions or BAPIs.
However if u still want to do it u can use the open SQL statement 'INSERT'.
‎2007 Sep 01 3:52 AM
Sorry I forgot to mentioning that, i create the table ztreglog, is not a abap table.
thank you for your reply it was helpful.
‎2007 Sep 01 3:59 AM
Check the below process:
First declare one internal table :
data : i_ztreglog like ztreglog occurs 0 with header line." Internal table
data : wa_ztreglog like line of i_ztreglog. " Work area
start-of-selection.
move wa_ztreglog to i_ztreglog.
append i_ztreglog.
MODIFY ztreglog FROM TABLE i_ztreglog.
Thanks
Seshu
‎2014 Nov 26 4:51 PM
TABLES: ZEBAN.
DATA LINE TYPE ZEBAN .
DATA: ITAB LIKE STANDARD TABLE OF LINE
WITH NON-UNIQUE KEY BANFN ZID.
DATA: BEGIN OF IT_ZEBAN OCCURS 0 ,
BANFN TYPE BANFN,
ZID TYPE ZID_N,
END OF IT_ZEBAN.
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: P_BAN TYPE BANFN.
PARAMETERS: P_ID TYPE ZEBAN-ZID.
SELECTION-SCREEN :END OF BLOCK B1.
START-OF-SELECTION.
SELECT BANFN
ZID
FROM ZEBAN INTO TABLE IT_ZEBAN
WHERE BANFN = P_BAN
AND ZID = P_ID.
LINE-BANFN = IT_ZEBAN-BANFN.
LINE-ZID = IT_ZEBAN-ZID.
APPEND LINE TO IT_ZEBAN.
LOOP AT IT_ZEBAN.
IT_ZEBAN-BANFN = P_BAN.
IT_ZEBAN-ZID = P_ID.
LINE-BANFN = IT_ZEBAN-BANFN.
LINE-ZID = IT_ZEBAN-ZID.
WRITE:/ IT_ZEBAN-BANFN,
IT_ZEBAN-ZID.
ENDLOOP.
INSERT INTO ZEBAN VALUES LINE.
‎2014 Dec 02 5:57 AM
Hi,
If u want to save the data to database table u have to folloe these steps.
1.First u declare your internal table and work area with database table names.
2.After declaring move the corresponding fields from old work area to new work area.
3.After complete these two steps then u use modify statement or insert.
ex:modify <dbtable> from <wa>.
inser <dbtable> from <wa>.