‎2007 Aug 25 6:20 AM
hi experts
I dont know how to do the following,
I have the table called ZTABLE.
Inwhich i want to do insert, delete, update the records.
Can you please explain me how to do and give me the procedure and then
coding also.
Thanks in advance.
Regards
Rajaram
‎2007 Aug 25 6:25 AM
Hi,
For editing table.....use this path....
SE11--> Utilites menu ---> Table Contents ---> Create Entries
For deleting data
SE11--> PRess content button which is beside of technical setting button --> there is one button on application tool bar
Rewards point is it is useful
‎2007 Aug 25 6:25 AM
Hi,
For editing table.....use this path....
SE11--> Utilites menu ---> Table Contents ---> Create Entries
For deleting data
SE11--> PRess content button which is beside of technical setting button --> there is one button on application tool bar
Rewards point is it is useful
‎2007 Aug 25 6:37 AM
sorry to all for the inconvenience.
I am talking about the insert, delete and modify the recording in the table using table control.
pls provide me the coding and the procedure also.
thanks in advance.
Regards
Rajaram
‎2007 Aug 25 8:45 AM
HI ,
CHECK THIS CODE FOR INSERT
TABLES:BKPF,J_1IPART2.
PARAMETERS:P_FAWREF LIKE J_1IPART2-FAWREF,
P_FAWRE1 LIKE J_1IPART2-FAWREF.
DATA: P_FAWREF2 LIKE J_1IPART2-FAWREF,
P_FAWRE3 LIKE J_1IPART2-FAWREF.
MOVE P_FAWREF TO P_FAWREF2.
MOVE P_FAWRE1 TO P_FAWRE3.
UPDATE J_1IPART2 SET FAWREF = P_FAWRE3
WHERE FAWREF = P_FAWREF2.
IF SY-SUBRC = 0.
MESSAGE S000.
ELSE.
MESSAGE E001.
ENDIF.
CHECK BELOW CODE FOR MODIFY
TABLES : AFKO,
AFPO.
DATA : BEGIN OF GI_AFKO OCCURS 1,
AUFNR LIKE AFKO-AUFNR,
END OF GI_AFKO.
data gi_AFPO like ZPRODUCT occurs 0 with header line.
*DATA : BEGIN OF GI_AFPO OCCURS 100,
MANDT LIKE
MATNR LIKE AFPO-MATNR,
DWERK LIKE AFPO-DWERK,
END OF GI_AFPO.
DATA: gv_date(11)," LIKE ekpo-aedat,
gv_date1(11),
year(4),
month(2),
day(2),
flag(1),
read_flag(1).
START-OF-SELECTION.
gv_date1 = sy-datum.
year = gv_date1+0(4).
month = gv_date1+4(2).
day = gv_date1+6(2).
year = year - 3.
CLEAR gv_date1.
CONCATENATE year month day INTO gv_date1.
select aufnr
from afko
into table gi_afko
where ( GLTRP <= sy-datum AND gltrp >= gv_date1 ) .
IF SY-SUBRC = 0.
select matnr
dwerk
from afpo
into CORRESPONDING FIELDS OF table gi_afpo
for all entries in gi_afko
where aufnr = gi_afko-aufnr.
ENDIF.
SORT GI_AFPO BY MATNR.
IF NOT GI_AFPO[] IS INITIAL.
<b>MODIFY ZPRODUCT FROM TABLE GI_AFPO.</b>
IF SY-SUBRC = 0.
MESSAGE I003 WITH 'VALUES UPDATED IN TO TABLE ZPRODUCT'.
ELSE.
MESSAGE I003 WITH 'VALUES NOT UPDATED IN TO TABLE ZPRODUCT'.
ENDIF.
IF U WANT TO USE DELETE
REPLACE THE BOLD LETTERS WITH BELOW STATEMENT.
DELETE ZPRODUCT FROM TABLE GI_AFPO.
‎2007 Aug 25 6:25 AM
INSERT { {INTO target VALUES source }
| { target FROM source } }.
Effect
The INSERT statement inserts one or more rows specified in source in the database table specified in target. The two variants with INTO and VALUES or without INTO with FROM behave identically, with the exception that you cannot specify any internal tables in source after VALUES.
DELETE { {FROM target [WHERE sql_cond]}
| {target FROM source} }.
Effect
The statement DELETE deletes one or more rows from the database table specified in target. The rows that are to be deleted are specified either in a WHERE condition sql_cond or with data objects in source.
System Fields
The statement DELETE sets the values of the system fields sy-subrc and sy-dbcnt.
UPDATE dbtab - target
Syntax
... {dbtab|(dbtab_syntax)} [CLIENT SPECIFIED]
[CONNECTION {con|(con_syntax)}] ... .
Alternatives:
1. ... dbtab
2. ... (dbtab_syntax)
Extras:
1. ... CLIENT SPECIFIED
2. ... CONNECTION {con|(con_syntax)}
Effect:
The entries in target determine, statically or dynamically, which database table or which view is accessed, and control client handling.
Alternative 1
... dbtab
Effect:
For dbtab, a database table defined in the ABAP Dictionary or a view defined in the ABAP Dictionary can be specified.
Only views that refer to a single database table, and whose maintenance status in the ABAP Dictionary permits change access can be specified.
Alternative 2
... (dbtab_syntax)
Effect:
Instead of static specification, a bracketed data object dbtab_syntax can be specified, which must contain the name of the database table or the view when the statement is executed. A character-type data object can be specified for the data object dbtab_syntax. The syntax in dbtab_syntax, as in the AAP Editor, is not case-sensitive.
‎2007 Aug 25 6:33 AM
Hi Rajaram..
Better way to Handle this is thru Table maintenace and Parameter transactions.
Instead of developing any code follow these steps...
Parameter Transaction can be created for Table Maintenance program of a Custom Table in SAP.
Steps:
1. Create a Z table and Activate - SE11
2. Generate the Table Maintenance using SE54
It will Generate the Function group and Screens.
3. Create a Parameter transaction to Call this Table maintenace program
Goto SE93.
Create a Tcode :
Name : ZTCODE1
Type : Parameter Transaction
In the Attributes of Parameter Transaction
Enter The Transaction SM30
Select the Checkbox : Skip first Screen
Enter the Following Fields below in the Table provide.
<b> FieldName FieldValue</b>
VIEWNAME <YOUR ZTABLE>
UPDATE X
Save the Parameter Transaction and execute it like ant other Tcode..
It will allow you to maintain the Table entries.
<b>Reward if Helpful</b>