10-26-2006 10:24 AM
Hi Abap Guru's,
I got a requirement where in I need to create a new Zprog so that it shld give a call to view v_abc and thru this view I need to update the table abc if any duplicate entries are entered then I shld popup a message.
Cld u plz help me out how to go further with this requirement and any suggestions...
if we create a table maintenance generator for the table abc then it will check for the duplicate entries are not ? if it checks for the duplicate entries then my job is done esaily but how to assign the zt-code to the table maintenance ?
awaiting for u r answer's and realyy appreciated with lots of points.
Regards,
Ravi V Ganji
10-26-2006 10:32 AM
why do you need to complicate the issue. do it in two simple ways.
1. in your prog, first try to find the value u are inserting. if not found insert. else popout messsage or update the value.
2. declare the fields as primary keys in the table so that when u attempt to insert a duplicate, sy-subrc will be 4. so you can popout the message.
Duplicate entries are checked at database level only if they are defined as unique columns for some specific purpose. This requires the design of table schema. Pl check this carefully. otherwise you can go to my way of achieving the result
regards,
Sandeep Josyula
*Mark helpful answers
10-26-2006 10:48 AM
Hi,
i need to create a zprog this shld call the view v_rf07(maintenance view) and here the user enters the field values and the values shld be updated in the table rf07.
for the above requirement how to further proceed ..
Regards,
Ravi Ganji
10-26-2006 10:41 AM
Hi,
The table maintanence will check for duplicate entries, but only for the primary keys.
http://sap-img.com/abap/create-a-table-maintance-program-for-a-z-table.htm
Check the following link on how to assign a tcode to a ztable.
Hope this helps.
Pulkit
10-26-2006 10:51 AM
Hi,
table generator will check duplicate entries as any
other table .
table maintanance Generator is used to manually
input values using transaction sm30
follow below steps
1) go to se11 check table maintanance check box under
attributes tab
2) utilities-table maintanance Generator->
create function group and assign it under
function group input box.
also assign authorization group default &NC& .
3)
select standard recording routine radio in table
table mainitainence generator to move table
contents to quality and production by assigning
it to request.
4) select maintaience type as single step.
5) maintainence screen as system generated numbers
this dialog box appears when you click on create
button
6) save and activate table
using sm30 you can create entries manually.
also check below thread to assign transaction code to
table generator
create transaction use se93
select parameter transaction and give below attributes
Transaction code ZTX1
Transaction text Maintain View ZSDCZTVIEW
Transaction SM30 Screen 0
From module pool
Name of screen field Value
VIEWNAME ZSDCZTVIEW
UPDATE X
10-26-2006 10:52 AM
if u have table maintanence
u can assign at code..
like...
1.goto -> se93-> click create
2.select (last radio button) transaction with parameters(parameter transaction). & enter short discription -> press 'ENTER'.
3. in Transaction field pass 'SM30' & check checkbox Skip initial screen.
4.check 3 checkboxes in GUI support (SAP GUI support for HTML,SAP GUI for java,SAP gui for windows).
5.In the default values table
Name of the screen field Value
-
-
VIEWNAME ZTABLE(d ztable name)
UPDATE X
6.save.
now TCode is creted for ur table...
u can check that TCOde.
ok
Regards,
Ramesh.
10-26-2006 10:57 AM
Hi,
use call transaction ztest from se38 to navigate
to table maintainence.
when duplicate entries are entered system implicitly gives error message .
Regards
amole