09-16-2008 5:24 AM
hello friends,
i have one simple requirment even i am strugling in this. when the user enters some data in selection screen fields, i need to move that data to respective fields of tables(Z tables).
With Regards
MurugeshRajeev
09-16-2008 5:43 AM
Hi,
when you have values in the selection screen fields
the values are stored in the corresponding variables.
So in start-of-selection you can use INSERT or MODIFY statemnt to update the respective database tables.
Make sure that you are inserting the tables with the primary key, otherwise they will not get updated correctly
hey U duplicated the thread with the same question is there anything U wanted more
regards
prasanth
09-16-2008 10:11 AM
Hi,
use select-option for getting values.
then in side the program write following coding under start of selection:
if u want to add new entry :
insert dbtable set fild1 = value1 .
if table contains value already and u want to modify the particular field of that entry.
use
update dbtable set field3= val1 field4 = val2 where field1 = sel1 and field 2 = sel2.
thanks and regards,
kani.
09-16-2008 10:23 AM
you want to move the data entered by the user to respective fields.
then use 'INSERT TABLE NAME' this statement will store all the fields.
if user want to change the existing data then use
'MODIFY TABLE NAME ' .
09-16-2008 10:35 AM
Precautions to be taken while updating the tables:
1. U have to consider all the primary key fields. Then only u can update the table entries if already existing.
2. If u want to insert new records into the table then use the 'MODIFY' . With this query u can create new entry if does not exist ,if it is already exist with the key fields which modifies the record.
Now u have to pass ur selection screen values into some variables and do the update if already record existing (Consider all key fields in UPDATE statement otherwise it will not consder)
If u are using update statement should be like this....
select * from mara.............. where matnr = s_matnr.
in this table there is only one key field. Here * is mandatory.
I hope this is helpfull for u.
setty
09-16-2008 10:56 AM
hi,
If you have your selection screen fields as a internal table fields then you can use 'Move-corresponding' comand in PAI.
MOVE-CORRESPONDING ITAB TO ZMYTABLE.
MODIFY ZMYTABLE.
If you have independent fields in selection screen then you can use 'Insert' statement in PAI.
09-22-2008 5:57 AM
Hi,
use insert/ modify stmts to update the respective d-base table
and using move-corresponding <i-table name> to ztable......
Regards
Shaik.
09-24-2008 4:59 AM