Validation of entry in custom table
Hi ppl,
I have one requirement where users can maintain value into a custom table. While entering a new value, if the similar primary key entries already exist in the table then there is a requirement of giving a pop-up box to the user informing that a similar kind of entry already exist and if he wants to overwrite. If the user clicks yes, then the new record should be saved and also one of the field in old record should be modified.
I have written an event in the table maintenace by which i am able to get the pop-up and the old entry gets modifed but when the PBO module gets triggered inside a standard include i get the error mssage " Record already exist". The error is obvious as the same primary keys are used in the second entry too but i am just curious to know if there is any way by which this standard error could be overcome so that the user should get only my pop-up box and not the standard error message.
Regards,
Venkat
hey,
You are getting the standard text because you are going to insert into the table.You cannot suppress the standard message but you can do some other thing.You take the values in the table to the internal table and before insertion into the table you should check the value which the user had entered and then check the value and the key.Thus you can catch that before the insertion into the table.
You can use the READ statement with key for reading the database.if the sy-subrc is 0 you can understand a value is there in the table.
Hope this will be helpful.
Regards,
Midhun Abraham
Edited by: Midhun Abraham on Oct 5, 2008 5:23 AM
Similar Messages
-
Insert delete or update entry in Custom table from KONV entry changed
Hi All,
I have custom table ZKONV with only few required columns and should have same number of records as KONV has at any point in time.
KONV is a cluster table so its not readable from ORACLE level. So ZKONV is created. But I dont know how to keep these both tables in sync.
I need to perform insert delete or update entry in Custom table if insert delete or update happens on cluster table KONV from any transactions.
As KONV is a cluster table and does not have changed time stamp I am not able to know the number of records changed in perticulat time period.
Thanks,Thanks for reply,
There is a Outside SAP system which needs to read KONV data to feed into their system, but as KONV is cluster table they are not able to read it from ORACLE level.
To solve this we are thinking to create a transparent Z-table and will fill it with KONV and catch Update, delete or Insert statement and do same on ZKONv.
Is this possible some how? by some database event or something.... -
Unable to delete last entry in Custom table
Hi,
I have one custom table which allows only some specific entries to be maintained in the table.I have used a standard table as a check table for dis.I found no issue while maintaining entries in the table.But when i try to delete the last entry in the table i get the message "No entry exist".Long textNo entries were found when importing data from the database.
Kindly help.Hi,
If it is not possible through table maintainence then write a small Z program to delete the entries in devlopment system and then if then if you want you can transfer those to other systems.
delete from ZTABLE where {give your condition for the last record}.
Regards,
Sandipan -
For all entries on custom tables
i have created 2 custom tables::zhospital_info n zpatient_info..
zhospitalinfo tab fields:::_
doc_name::prim key
patient_name:::prim key
place::prim key
zpatientinfo tab fields::_
ZDATE ::prim key
JOINING
MEDICINE
PRICE
QUANTITY
DOC_NAME ::for key
PATIENT_NAME::for key
PLACE ::for key
and inserted some values to the table contents..
this is my logic:::
TYPES: BEGIN OF ZHOSPITAL_INFO,
DOC_NAME TYPE ZDOC_NAME,
PATIENT_NAME TYPE ZPATIENT_NAME,
PLACE TYPE ZPLACE,
END OF ZHOSPITAL_INFO.
DATA: W_HI TYPE ZHOSPITAL_INFO.
DATA:T_HI TYPE STANDARD TABLE OF ZHOSPITAL_INFO.
TYPES: BEGIN OF ZPATIENTL_INFO,
ZDATE TYPE ZDATE,
JOINING TYPE ZJOINING,
MEDICINE TYPE ZMEDICINE,
PRICE TYPE ZPRICE,
QUANTITY TYPE ZQUANTITY,
DOC_NAME TYPE ZDOC_NAME,
PATIENT_NAME TYPE ZPATIENT_NAME,
PLACE TYPE ZPLACE,
END OF ZPATIENTL_INFO.
DATA: W_PI TYPE ZPATIENTL_INFO.
DATA:T_PI TYPE STANDARD TABLE OF ZPATIENTL_INFO.
TYPES: BEGIN OF FTAB,
DOC_NAME TYPE ZDOC_NAME,
PATIENT_NAME TYPE ZPATIENT_NAME,
PLACE TYPE ZPLACE,
DATE TYPE ZDATE,
JOINING TYPE ZJOINING,
MEDICINE TYPE ZMEDICINE,
PRICE TYPE ZPRICE,
QUANTITY TYPE ZQUANTITY,
END OF FTAB.
DATA: W_FTAB TYPE FTAB,
T_FTAB TYPE STANDARD TABLE OF FTAB.
SELECT DOC_NAME
PATIENT_NAME
PLACE
INTO TABLE t_hi
FROM ZHOSPITAL_INFO .
IF NOT t_hi IS NOT INITIAL.
SELECT DOC_NAME
PATIENT_NAME
PLACE
ZDATE
MEDICINE*
PRICE
QUANTITY FROM ZPATIENTL_INFO INTO TABLE t_pi FOR ALL ENTRIES IN
t_hi
WHERE DOC_NAME = t_hi-doc_name.
ENDIF.
LOOP AT t_pi INTO w_pi.
MOVE-CORRESPONDING: w_pi TO W_FTAB.
READ TABLE t_hi INTO w_hi WITH KEY DOC_NAME = W_FTAB-DOC_NAME.
MOVE: w_hi-patient_name TO W_FTAB-PATIENT_NAME,
w_hi-place TO W_FTAB-PLACE.
APPEND W_FTAB TO T_FTAB.
ENDLOOP.
LOOP AT T_FTAB INTO W_FTAB.
WRITE:/ W_FTAB-DOC_NAME,
W_FTAB-PATIENT_NAME,
W_FTAB-PLACE,
W_FTAB-DATE,
W_FTAB-JOINING,
W_FTAB-MEDICINE,
W_FTAB-PRICE,
W_FTAB-QUANTITY.
ENDLOOP.
req output:::when i enter doc_name the related info accr to doc_name from the both tables should be display..
m getting no errors but i cant execute my prog..
please check out my code...
thanx in adv..Hi,
The problem is in the select statement:
SELECT DOC_NAME
PATIENT_NAME
PLACE
ZDATE
MEDICINE
PRICE
QUANTITY FROM ZPATIENTL_INFO INTO TABLE t_pi FOR ALL ENTRIES IN
t_hi
WHERE DOC_NAME = t_hi-doc_name.
Change this to SELECT DOC_NAME PATIENT_NAME PLACE ZDATE MEDICINE PRICE QUANTITY FROM ZPATIENTL_INFO INTO CORRESPONDING FIELDS OF TABLE t-pi FOR ALL ENTRIES IN t_hi WHERE DOC_NAME = t_hi-doc_name.
I hope the above code will help you...
Also i hope to tell the following for performance issues and also a good programming practice:
LOOP AT t_pi INTO w_pi.
MOVE-CORRESPONDING: w_pi TO W_FTAB.
READ TABLE t_hi INTO w_hi WITH KEY DOC_NAME = W_FTAB-DOC_NAME.
MOVE: w_hi-patient_name TO W_FTAB-PATIENT_NAME,
w_hi-place TO W_FTAB-PLACE.
APPEND W_FTAB TO T_FTAB.
ENDLOOP.
Please do a sy-subrc check after READ statement always...
LOOP AT t_pi INTO w_pi.
MOVE-CORRESPONDING: w_pi TO W_FTAB.
READ TABLE t_hi INTO w_hi WITH KEY DOC_NAME = W_FTAB-DOC_NAME.
If sy-subrc = 0.
MOVE: w_hi-patient_name TO W_FTAB-PATIENT_NAME,
w_hi-place TO W_FTAB-PLACE.
clear w_hi.
Endif.APPEND W_FTAB TO T_FTAB.
ENDLOOP.
Please revert back for clarifications.
Best Regards,
Suresh -
Team,
Table T77RCF_SMASK has reference to T77RCF_SMG_ASM.
When compared the two tables we found that following entries are missing in T77RCF_SMASK:
71
72
73
74
75
78
92
95
96
Can you please guide on what should be the entry for these in table T77RCF_SMASK? Would appreciate if full table entries are shown in answer for future users.
Missing entries are causing error "Customizing table T77RCF_SMASK contains no corresponding entry for SMASK_ID = 0071 and so on in SLG1 logs display.
Regards
YashThe table enteries should be as attached
Regards
Khalid -
Table Maintenance: Manual Transport for Entries in Customizing Table
Dear forum,
i'm facing a tricky problem at the moment. My customer wants the maintain a customizing table, but he does not want to transport the entries automatically (don't ask me for the reason), but manually.
The online help tells me, that this can be done.
In the SE11 i chose untilities -> table maintenance generator and for the subscreen "dialog data transport details" i chose "no or user, recording routine".
Continuing wiht the SE11 i chose untilities -> table maintenance generator -> environment -> maintenance objects -> transport "manual transport".
In the SE54 i created the events 10, 11 and 12 with the recommended coding from the online help.
But when i start the Maintenance via SM30 the points in the menue table view -> transport or edit -> transport are not active.
The function group does not include any generated statuses to activate the menue-points. What is missing toi get the popup, that asks me for the transport number?
Can somebody help me out or tried this before?
With kindly Regards,
Robertwrong!
the online documentation says:
Manual transport
The object maintenance transaction offers a manual link to transports. You can branch to it by selecting the Transport menu option. In the transport session, you can then select objects to place them in a Change request. A special transport program may be available instead of the menu option Transport, to place the object in a change request. The setting Manual transport means that changes to the object are not automatically recorded. If the maintenance transaction offers an automatic transport link, in addition to the manual one, you should select the setting Automatic transport.
What has to be done to realise it except creating the events? -
Hi,
I have created a custom table zmm which has the fields matnr, werks and art.
Is it possible to populate these fields from qmat table. Can I link this table to pick up the entries from qmat. The tables dont have a similar structure.
thanks and regards,
bindazmeHi
You can't link your table with QMAT
write a program and fetch the values from QMAT into an internal table and modify your ZMM table with that internal table values.
You can't make this as related table QMAT
<b>Reward points for useful Answers</b>
Regards
Anji -
Lock Objects Problem while updating entries in custom table
Hi Friends,
Iam updating a custom table ztable from internal table entries.
ie : Modify ZTABLE from table ITAB.
Now the entries are updating and inserting perfectly..
But my problem is i need to use lock objects before doing this..
I have created a lock obect EZTABLE with all th ekey fields of the table.. ie : it has 2 key fields
item & matnr .
Now how to use lock objects here.. do i need to loop the internal table and use enque & deque function module each and every time in loop or use it out side the loop..
Can any one explain me this..
Regards,
Kumarhi kumar,
**check if the equipment is already locked by user, if yes, trigger a mail
CALL FUNCTION 'ENQUEUE_EIEQUI'
EXPORTING
MODE_EQUI = 'E'
MANDT = SY-MANDT
equnr = lv_equi_temp
X_EQUNR = ' '
_SCOPE = '2'
_WAIT = ' '
_COLLECT = ' '
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
lv_subrc1 = sy-subrc.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
CALL FUNCTION 'DEQUEUE_EIEQUI'
EXPORTING
MODE_EQUI = 'E'
MANDT = SY-MANDT
equnr = lv_equi_temp
X_EQUNR = ' '
_SCOPE = '3'
_SYNCHRON = ' '
_COLLECT = ' '
ENDIF.
try like this to check if the object is locked....
u can also use
call function 'ENQUEUE,.
do the needful changes update the database then commit work
then call function 'DEQUEUE'
hope this helps,
tanmaya -
Deleting entries from custom tables....
Hello,
I have a custom table ZCUST (client dependent) from where I want to delete all entries. How do I achieve this ? There are two key fields in this table key1 and key2.
Regards,
Rajesh.Hi Rajesh,
try this one...
DATA: lt_add TYPE zadd OCCURS 0 WITH HEADER LINE.
SELECT *
FROM zadd
INTO TABLE lt_add.
DELETE zadd FROM TABLE lt_add.
IF sy-subrc = 0.
ULINE.
ENDIF.
Best regards,
raam -
How to find delete entries in custom table
Hi,
We have a custom table with table maintenance in Production. Some one deleted all the entries from the table. Can you please let me know how to retreive the old entries from the table and how to check who deleted the entries.
Thanks
Ramahi rama,
Please refer to the below given link,
[http://help.sap.com/saphelp_nw70/helpdata/en/43/0510abcda521abe10000000a1553f6/content.htm]
I think it will sove ur problem,
Reward points if usefull,
Thanks,
Kalyan. -
Adding entries to Custom table from IDOC User-Exit
Hi All,
I need to add an entry into a Ztable, based on the entries in the IDOC.. The user-exit available to me is EXIT_SAPLVEDF_002. But it is called a number of times... Is there any way to update the Ztable getting the data from different segments?..
Please help..
Regards.
AshaThe table INT_EDIDD type EDIDD conatined the interface tables of the FM contain all the segmanent data, you can read that and populate the Z table respectively ...
Thanks,
Adi. -
Entry in custom table in waveset database
I need to know the syntax to call scriptedJDBC resource from within workflow and pass arguments to the script.
also how to access the arguments in the script.
kindly help me with example code for both passing and accessing the arguments.
thanks in advanceYou will get the all set attributes in resourceaction script, refer the below actionscript
In below script you will see the below code which is returning all attributes in iterrator,
attrs = actionContext.get("attributes");
attrs.entrySet().iterator();
Example script: please understand the code you will find the way.
<ResourceAction id='#ID#BBE7-:27B1F07AF11:5E3B3113-:6D12B9BC57D20FF3' name='External-createUser-bsh' creator='%STARTUP%Configurator' createDate='1235458433224' lastModifier='%STARTUP%Configurator' lastModDate='1235458433224' repoMod='1235458433226'>
<ResTypeAction restype='External' actionType='BeanShell'>
<act>
import java.sql.PreparedStatement;
import java.sql.SQLException;
 
identity = actionContext.get("id");
conn = actionContext.get("conn");
attrs = actionContext.get("attributes");
adapter = actionContext.get("adapter");

String id = identity + "@" + adapter.getResource().getId();

String sql = "INSERT INTO extres.accounts (accountId) VALUES(?)";
PreparedStatement s = null;

try {
 conn.setAutoCommit(false);
 s = conn.prepareStatement(sql);
 s.setString(1, id);
 s.executeUpdate();

 Iterator it = attrs.entrySet().iterator();
 while (it.hasNext()) {
 Map.Entry pairs = (Map.Entry)it.next();
 sql = "INSERT INTO extres.attributes (accountId,name,value) VALUES(?,?,?)";
 s = conn.prepareStatement(sql);
 s.setString(1, id);
 s.setString(2, (String)pairs.getKey());
 s.setString(3, (String)pairs.getValue());
 s.executeUpdate();
 }
 conn.commit();
} catch(SQLException e){
 conn.rollback();
 throw e;
} finally {
 conn.setAutoCommit(true);
 if (s!=null)
 s.close();
}
 </act>
</ResTypeAction>
<MemberObjectGroups>
<ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
</MemberObjectGroups>
</ResourceAction> -
Data Entry into customized table
Hi All,
I have created a z-table and selection screen with four fields. Whenever I enter the data into these four fields, the data should go to the z-table through my report.
Will you please send me how to do this?
Thanks in Advance,
RamanaHi KCR,
You can do this by program or by generating a table maintanence generator using SM30.
IF you want to do this through program declare internal table with the same structure as that of your table and populate it with details as per the selection screen data and use "INSERT INTO <table name> FROM TABLE ITAB".
OR
Goto se11 give your table name change, in the attributes tab select display and maintanence allowed and then select menu path UTILITIES > Table maintanence generator . IN the next screen displayed
give Authorization groups as &NC& (if you dont want any auth check) Function group as your table name( you can give any name starting with Z), select maintanence type one step and give single screen as 100 ( you can give any number you want) and then select create button(located left top corner). this will generate a table maintanence for you.
After doing above steps go to sm30 and give your table name and select maintain which will display a nice table control with the table fields where you can maintain as many records as you want and click on save.
Thats it.
Reward if helpful.
Regards,
Kalyan. -
How to find out the changes made to the customized table entries
Hi Team
i want to know the changes made to the customized table. i have a 'Z' table in my production system, in that table i would like to know whether any table entry is deleted or not. if at all there is any deletion happened, i want to know who had done it.
So i request you to please let me know the procedure for the same.
Thanks
RajHi Nagaraju,
Go to Table Maintenance (SM30)- Display mode-- Utilities-- change Logs. Give the Date range. before giving the date range click on display status , this will show you If the display is active or not. Kindly please let me know If you need any more information on this.
Regards
Ram Pedarla -
Hello friends,
We have created a archiving object in transaction AOBJ. However when i enter this object in SARA, we get this error message.
"Entry missing in Customizing table for object Z******* "
I have matched my object with few other archiving objects and things looks similar.
Have you faced this kind of problem..
thanks
ashishHi,
I checked and i can see entry for ZSCS_TRAFO object in AOBJ.
But when i enter ZSCS_TRAFO, i get this error :
Entry missing in Customizing table for object ZSCS_TRAFO
Message no. BA057
Diagnosis
A function cannot be executed due to a missing table entry.
Procedure
Please create an entry for the archive object ZSCS_TRAFO with the AOBJ transaction.
However, a few other Z objects works well.
thanks
ashish
Maybe you are looking for
-
Error message when trying to convert video
Help! Whenever i want to try to convert a video for my iPod, an 'unknown error' (-3000) message appears. Can anyone help me? Thx
-
How do I download adobe Flash Player?
It won't load. At one poit it said temporary disconect anti virus soft wasre > I did. It goes to run I click then nothing, over and over. someone tell me whats wrong, and how to do this in the most elementary of terms.
-
Syncing more files than what is in iTunes library?
Hi All, I did some cleanup work on my MP3 collection last night through updating metadata tags, etc. I then did a reimport of my collection into iTunes. I have roughly 3300 MP3 files. When my ATV started to sync last night, I noticed it trying to syn
-
Can't get itunes updates on ipad, but can get everything else...genius, purchases, etc. When I select "updates" screen is blank. Any ideas??
-
i have an application,whenever the user fills the application and clicks on save button all the input should be stored in a file....like wise all the inputs from different users will be stored in a file ,for each user input it is called as record ok.