Find a value in a database
Hello,
Can you please tell me if in an Oracle 9i database with over 2000 tabels is there an easy way to find in which table can I find a specific value ( let's say text 'sample')?
Thank you!
See following threads:
http://forums.oracle.com/forums/search.jspa?threadID=&q=search+%26%26+all+%26%26+columns&objID=f61&dateRange=all&userID=&numResults=15&rankBy=10001
Similar Messages
-
SQL to find a value in a database column
Hi All,
I need to write a pl/sql block to find a given value in any database column.
Is there a written function or program which I could use.
Requirement is to see which columns in which table has the value 'ABCD123' in whole database
Thanks,
SNOT TESTED
declare
seeking varchar2(30) := 'ABCD123';
begin
create table result_table as
select owner,table_name,column_name,cast(null as varchar2(30)) column_value
from all_tab_cols
where 1 = 0;
for r in (select owner,table_name,column_name
from all_tab_cols
where data_type = 'VARCHAR2'
and data_length >= length(seeking)
loop
execute immediate 'insert into result_table ' ||
'select ' || r.owner || ',' || r.table_name || ',' || r.column_name || ',''' || seeking || '''' ||
' from dual ' ||
' where exists(select null ' ||
' from ' || r.owner || '.' || r.table_name ||
' where ' || r.column_name || ' = ''' || seeking || '''' ||
end loop;
commit;
end;Regards
Etbin -
How to search this value in oracle database to find out the table
Hi expert,
I know there is a value in oracle database, please show me how to search this value in oracle database to find out the table holding this value.
Many Thanks,918440 wrote:
Hi friends,
this question is really practical, I already know there is value from application saved in database, I want to search the whole database to figure out which table the value is contained.write SQL that writes SQL to query every table.
Handle: 918440
Status Level: Newbie
Registered: Mar 2, 2012
Total Posts: 20
Total Questions: 10 (10 unresolved)
why do you waste time here when you NEVER get any answer to any question you post? -
How to find report values using report writer
hi,
Please help me.
How to find report values using report writer
Regards,
RRK.
Edited by: Alvaro Tejada Galindo on Feb 6, 2008 12:01 PMThanks all for the reply.
I am trying to solve a problem where report parameter value that is set at Management Console is wiped out after calling replaceConnection.
databaseController.replaceConnection(oldConnectionInfo, newConnectionInfo,
null,DBOptions._doNotVerifyDB);
We have to support changing database connection from a java utility
class. But once replaceConnection is called all existing static parameter values are lost. To fix this issue we thought of getting parameters and values before calling replaceConnection and setting it after replaceConnection.
Version is CS2008 SP3 - version 12.3.0.601
If there is any other option of fixing the original wipe out issue?
ParameterValues.getValues() didn't return value. I will try ParameterValues.getCurrentCalues() but the document says ParameterValues.getValues() is equivalent to the IParameterField.getCurrentValues() method unless it is empty, in which case it is equivalent to the IParameterField.getDefaultValues() method.
So getCurrentValues() may not work. -
Task Total Slack Calculated values mismatching with the values in reporting database
Hi,
We require 'Task Total Slack' as one of the items in a report for Project Server 2010. We're developing the reports using SSRS wherein the SQL Queries are fired on the reporting database of Project Server 2010.
We've come across a situation wherein the total slack values from reporting database for tasks are mismatching with the values that are seen in either PWA or Project Professional for total slack field. We also could not find a consistent factor by which
the slack is multiplied for reflecting in the database in case the Slack in days was being converted into Hours in reporting databse.
Is there a definite way that these values are being represented in reporting database which is quite different from the way these values are seen in Project Professional? Please help resolving this issue.Hi Abhijit PS,
Can you give an example of the mismatch? Also you could tell us if this is happening for all tasks and all projects. Your concern may be seen from 2 different points of view:
Either this is indeed a bug with a slack of 2 days for example in Project Pro and 4 days in your report from the reporting DB. In this case, you should check if the projects have been published correctly and if the Reporting DB is correctly sync'ed with
the draft DB.
Or it could be the normal behavior and it is just a matter of finding why. For example, the durations are stored in the DB in minutes, meaning that a 1day duration might be stored as 480 if you have 8 working hours in a day (8*60).
Hope this helps,
Guillaume Rouyre, MBA, MVP, P-Seller | -
How will you find out no of standby databases configured for primary database from OS level
How can find the number of standby databases configured for primary database from os level
Check the alert log.
The Alert log will always have Data Guard messages in it.
Example
cd /u01/app/oracle/diag/rdbms/primary/PRIMARY/trace
tail -1700 alert_PRIMARY.log | more
Wed Nov 13 13:35:26 2013
ARC7: Standby redo logfile selected for thread 1 sequence 1164 for destination LOG_ARCHIVE_DEST_2
LNS: Standby redo logfile selected for thread 1 sequence 1165 for destination LOG_ARCHIVE_DEST_2
If you don't see messages like this it's probably not a Data Guard system.
Or search it for :
System parameters with non-default values:
Which on Data Guard system will show things like:
log_archive_dest_1 = "LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=PRIMARY"
log_archive_dest_2 = "SERVICE=STANDBY LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=STANDBY"
log_archive_dest_state_1 = "ENABLE"
log_archive_dest_state_2 = "ENABLE"
fal_server = "STANDBY"
Best Regards
mseberg -
Where can I find the value of "_kks_use_mutex_pin"??
Hi, all.
Where can I find the value of "_kks_use_mutex_pin"??
What dictionary for "_**" parameter??
Thanks and Regards.Hi,
To find the value for a hidden parameter you must look in a hidden place:
SQL> select
2 x.ksppinm name,
3 y.ksppstvl value
4 from
5 sys.x$ksppi x,
6 sys.x$ksppcv y
7 where
8 x.inst_id=sys_context('userenv', 'instance') and
9 y.inst_id=sys_context('userenv', 'instance') and
10 x.indx=y.indx AND
11 x.ksppinm = '_kks_use_mutex_pin';
NAME VALUE
kksuse_mutex_pin FALSE
SQL> show user
USER is "SYS"
SQL>Only SYS can see these special views. However, this does beg the question why do you want to see the value of this parameter? Attempting to change this value without official Oracle support is Not A Good Idea and can leave your database unsupported.
HTH
Chris
Message was edited by:
Chris Poole (because I can't spel) -
Initial value and value in the database
Hello world ,
i want to add initial value with value in the database depend on the date
for example i have initial value for 30/09/2009
i and to all it with value in the database in 31/12/2009
take a look what i did
PROCEDURE pkd_prem IS
cursor gr_pkd_prem is select
SUM(DECODE(mark,'01',FM_mark,TM_mark) A,
SUM(DECODE(FMS,'01',LS,NS) b
from fr_treaty_profile ftp, fr_monthly_summary
where
(ftp.tpr_cgp_id = fr_monthly_summary.fms_cgp_id )
AND (ftp.tpr_cmp_id = fr_monthly_summary.fms_cmp_id )
AND (ftp.tpr_treaty_origin = fr_monthly_summary.fms_treaty_origin )
AND (ftp.tpr_uw_year = fr_monthly_summary.fms_uw_year )
AND (ftp.tpr_class = fr_monthly_summary.fms_class )
AND (ftp.tpr_type = fr_monthly_summary.fms_type )
AND (ftp.tpr_serial = fr_monthly_summary.fms_serial )
AND
(fr_monthly_summary.fms_treaty_origin=:BLK1.EO_ORIGIN) AND
(fr_monthly_summary.fms_uw_year=:BLK1.EO_UW_YEAR) AND
(fr_monthly_summary.fms_class=:BLK1.EO_CLASS) AND
(fr_monthly_summary.fms_treaty_type=:BLK1.EO_TYPE) AND
( fr_monthly_summary.fms_treaty_serial=:BLK1.EO_SERIAL)
AND (FMS_TYPE ='P')
AND FMS_SERIAL = '01'
AND (FMS_OFC_ID !='X')
and (FMS_YEAR =substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),7,4))
and (FMS_PERIOD between substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)-2 and substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)) ;
---Initial value
cursor base is select EO_GR_BKD_PREM from FR_EN
where
EO_TREATY_ORIGIN=:BLK1.EO_ORIGIN AND
EO_UW_YEAR=:BLK1.EO_UW_YEAR AND
EO_CLASS=:BLK1.EO_CLASS AND
EO_TREATY_TYPE=:BLK1.EO_TYPE AND
EO_TREATY_SERIAL=:BLK1.EO_SERIAL AND
EO_YEAR=:BLK1.EO_YEAR;
A number(18,3);
B number(18,3);
v_base number(18,3);
BEGIN
open base;
open gr_pkd_prem;
fetch gr_pkd_prem into a,b;
fetch base into v_base;
:BLK1.EO_GR_BKD_PREM :=nvl(a,0)+ nvl(b,0)+ nvl(v_base,0);
close gr_pkd_prem;
close base;
END;
the proceudre is correct and the values come as i want
but here
FMS_PERIOD between substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)-2 and substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2))
suppose i will add from 6 to 9
the value will come down to add with base value
but next time i want from 10 to 12
it will add value 10 to 12 with the base for just period 10 to 12
i want to keep adding
if i start from 6 to 9
then shoud be
add the value of 6 to 9 to 10 to 12
butlook ..
i created a form and let's say there is one field called Base ..
and i inert value on that field and saved .
then
i created cursor to fetch value from another table
that value which i fetched from another table must add to past value
take this scenario
i started with value 6
then i fetch by cursor value from 1/1/2010 to 31/3/2010 and that value = 33
first action
6+33
then
i fecth by using cursor from 1/6/2010 to 30/9/2010 and that value = 2
the result of first action must add with the last value which is 2
(6+33) from first action plus(+) 2 and display the result on the secreen -
How to find the value of a variable in other program
How to find the value of a variable in other program say I am in a FM and this FM is being called in from other program and I want to know some of the variable details of the program from the FM itself. Imagine if this is a txn. and I need to know the details from some of the programs while executing the same transaction
Regards
VinHi Vinayak,
you will be having your first program values in internal table or some variables,
when you are calling the second program you wii use like this,
SUBMIT <Second Program Name> USING SELECTION-SCREEN '1000'
WITH s_emp(second program select-options) IN t_emp(first program variables)
WITH p_chk EQ t_chk
WITH p_r1 EQ t_r1
WITH p_month EQ t_month
WITH s_cust1 IN t_cust1
WITH p_r2 EQ t_r2
WITH s_cust2 IN t_cust2
WITH s_week IN t_week
AND RETURN.
you have pas like this to get your first program details. -
How to get the value from a database without submitting a jsp page
I have a jsp which has a text box depending on the value entered I want to get the value from a database for other two fields with out submitting jsp page. I am using struts.
Thanks For any assistance provided.Alright,here is an example for you for the first case.
Present.jsp:
============
<html:html>
<head>
<title><html:message key="page.title"/></title>
</head>
<body>
<html:form action="ChangeEvent.do">
<html:hidden property="method"/>
<!-- Submitting the Form onKeyUp of EmpId field and trying to save the
state of the Form in the scope of session -->
Emp Id:<html:text property="empId" size="5" onkeyup="if(true){this.form.elements[0].value='populateDetails';this.form.submit();}"/>
Emp Name:<html:text property="empName" size="10" />
Email Address:<html:text property="email" size="10" />
<html:submit>Submit</html:submit>
</html:form>
</body>
</html:html>struts-config.xml:
==================
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<!-- Form bean which stores the properties of all the Form elements -->
<form-beans>
<form-bean name="employeeFormBean" type="org.apache.struts.action.DynaActionForm">
<form-property name="empId" type="java.lang.String"/>
<form-property name="empName" type="java.lang.String"/>
<form-property name="email" type="java.lang.String" />
</form-bean>
</form-bean>
<action-mappings>
<action path="/ChangeEvent" type="Test.GetChangeAction" name="employeeFormBean" scope="request" parameter="method">
<!-- On successful call of DB the Page has to be forwarded to the same page again by
uploading updated form bean values. -->
<forward name="success" path="/Present.jsp"></forward>
<forward name="failed" path="/error.jsp"></forward>
</action>
</action-mappings>
</struts-config>GetChangeAction.java:
=====================
public class GetChangeAction extends DispatchAction{
public ActionForward populateDetails(ActionMapping mapping,ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
DynaActionForm dForm = (DynaActionForm)form;
String empId = dForm.get("empId");
// calling Model / Db and then getting back Employee Details
EmployeeBean eb = ModelUtils.getDetails(empId);
// Updating form bean by updating values from the Model
dForm.set("empName".eb.getEmpName());
dForm.set("email".eb.getEmail());
return mapping.findForward("success");
}well to me this should work regardless to any browser but we need to make sure we put in our logic properly. -
How to look for a certain value in a database using sql
Hello everyone. How do you do this in SQL? Or, is there a way to look for a certain value in a database? What I'm trying to do is this:
I want to look for the exact value "abcdefg" in the database so that oracle will return me details on the following that contains the said value:
1. the name of the table(s)
2. the column/field name(s)
Note: "abcdefg" could exist in different tables with different column names with different data types.
Any help is much appreciated. Thanks.
UPDATE: What about if I just want to check those fields/columns with string data types?
Message was edited by:
dongzky
Message was edited by:
dongzkyJust a teeny tweek
DECLARE
l_dummy VARCHAR2 (4000);
BEGIN
FOR rec IN (SELECT table_name
FROM all_tables)
LOOP
FOR rec2 IN (SELECT column_name
FROM user_tab_cols
WHERE table_name = rec.table_name)
LOOP
BEGIN
EXECUTE IMMEDIATE 'select 1 from '
|| rec.table_name
|| ' where to_char('
|| rec2.column_name
|| ') = ''CAS'' and rownum = 1'
INTO l_dummy;
DBMS_OUTPUT.PUT_LINE (rec.table_name || ' ' || rec2.column_name);
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
END;
END LOOP;
END LOOP;
END; -
Error while inserting BLOB value in the database
I am trying to insert a BLOB value in the database. This action results in the following exception:
java.sql.SQLException: ORA-22925: operation would exceed maximum size allowed for a LOB value
The method i am using is as follows:
public void insertBlob(Connection Con, StringBuffer Message)throws SQLException
String Query = "INSERT INTO MSGBLOCKS (MSGDB_ID, MSGBLOCKTYPE, MESSAGE) VALUES (20, 1 , ?)";
PreparedStatement PS = Con.prepareStatement(Query);
byte[] bytes = new String(Message).getBytes();
ByteArrayInputStream bi = new ByteArrayInputStream(bytes);
PS.setBinaryStream(1, bi, bytes.length);
PS.executeUpdate();
The manifest file of ojdbc14.jar being used is: 10.1.0.5.0 and I am using jdk 1.4.
Also the message being tried to insert is of 9 Kb only.
Any help would be greatly appreciated.
Thanks!!!Did you check if the Message is having only that small 9kb of data? also check the maximum allowed size for that column in the Oracle DB, the size can be restricted to 8Kb also.
Edited by: DynamicBasics on Jul 28, 2010 5:54 PM -
Error while populating drop down list with values from a database
Hi all,
I have a JSP page with a drop down list that is to be populated with values from a database.
This is the code in my JSP file:
<!-- Form for picking the floor -->
<!-- Get the available floors -->
<% ArrayList<Integer> floornumbers = dataManager.getAllFloorNumbers();
Iterator<Integer> iterator = floornumbers.iterator(); %>
<!-- Create the form for users to select the floor -->
<form id="floorselectionform">
<input type="hidden" name="action" value="floorselected"/> <!-- Guides the servlet to redirect to the appropriate page -->
Select floor | <select name="floorselector" id="floorselector">
<% while (iterator.hasNext()) { %>
<option value="<%=iterator.next().intValue()%>"> <%=iterator.next().intValue()%> </option>
<% } %>
</select>
<input type="submit" value="Go!"/>
</form> The DataManager.java class simply forwards this to its respective Peer class, which has the code shown below:
package seatplanner.model;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
/* This class handles all floor operations */
public class FloorPeer
/* This method returns all the floor numbers */
public static ArrayList<Integer> getAllFloorNumbers(DataManager dataManager) {
ArrayList<Integer> floornumbers = new ArrayList<Integer>();
Connection connection = dataManager.getConnection();
if (connection != null) {
try {
Statement s = connection.createStatement();
String sql = "select ID from floor order by ID asc";
try {
ResultSet rs = s.executeQuery(sql);
try {
while (rs.next()) {
floornumbers.add(rs.getInt(1));
finally { rs.close(); }
finally {s.close(); }
catch (SQLException e) {
System.out.println("Could not get floor numbers: " + e.getMessage());
finally {
dataManager.putConnection(connection);
return floornumbers;
} The classes compile properly, but when I load this page up in Tomcat it just freezes and does not load the form. I tested the DB connection and it works fine.
What am I doing wrong in the JSP code?
Thanks for the help in advance.
UPDATE: I commented out the form, and added <%=floornumbers.size()%> right above the commented code to check if the ArrayList is indeed getting populated with the values from the database (the values are of type integer in the database). The page still freezes like before. I'm puzzled now :confused: .Wrong usage of Iterator.
<!-- Form for picking the floor -->
<!-- Get the available floors -->
<% ArrayList<Integer> floornumbers = dataManager.getAllFloorNumbers();
Iterator<Integer> iterator = floornumbers.iterator(); %>
<!-- Create the form for users to select the floor -->
<form id="floorselectionform">
<input type="hidden" name="action" value="floorselected"/> <!-- Guides the servlet to redirect to the appropriate page -->
Select floor | <select name="floorselector" id="floorselector">
<% while (iterator.hasNext()) {
Integer inte = iterator.next();
%>
<option value="<%=inte.intValue()%>"><%=inte.intValue()%></option>
<% } %>
</select>
<input type="submit" value="Go!"/>
</form>or make use of enhanced loop as you are already using J2SE 5.0+ for avoiding confusions.
<!-- Form for picking the floor -->
<!-- Get the available floors -->
<% ArrayList<Integer> floornumbers = dataManager.getAllFloorNumbers(); %>
<!-- Create the form for users to select the floor -->
<form id="floorselectionform">
<input type="hidden" name="action" value="floorselected"/> <!-- Guides the servlet to redirect to the appropriate page -->
Select floor | <select name="floorselector" id="floorselector">
<% for(Integer inte:floornumbers) {%>
<option value="<%=inte.intValue()%>"><%=inte.intValue()%></option>
<%}%>
</select>
<input type="submit" value="Go!"/>
</form>and a lot better thing would be making usage of basic Taglib provided with JSTL spec or struts spec which make life easier and simple.
something like usage of <c:forEach/> or <logic:iterate/> would be lot better without writing a single scriptlet code.
Hope that might help :)
REGARDS,
RaHuL -
How to find out Locks on the database objects
how to find out Locks on the database objects
The following notes should be helpful:
Note: 200590.1 - bde_session_locks.sql - Locks for given Session ID
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=200590.1
Note: 1039273.6 - SCRIPT: VIEWING LOCKS ON OBJECTS HELD BY SPECIFIC USER
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=1039273.6
You can also search Metalink, there are many notes/scripts published there which would be also helpful. -
How to update field values in a database table using module pool prg?
hi
how to update field values in a database table using module pool prg?
we created a customized table, and we put 2 push buttons in screen painter update and display.
but update is not working?
data is enter into screen fields and to internal table, but it is not updated in database table.
thanks in adv
vidyaHI,
we already used the update statement. but its not working.
plz check this.
*& Module Pool ZCUST_CALL_REC
PROGRAM ZCUST_CALL_REC.
TABLES: ZCUST_CALL_REC,ZREMARKS.
data: v_kun_low like ZCUST_CALL_REC-kunnr ,
v_kun_high like ZCUST_CALL_REC-kunnr,
v_bud_low like ZCUST_CALL_REC-budat,
v_bud_high like ZCUST_CALL_REC-budat.
ranges r_kunnr for ZCUST_CALL_REC-kunnr .
ranges r_budat for zcust_call_rec-budat.
DATA: ITAB TYPE STANDARD TABLE OF ZCUST_CALL_REC WITH HEADER LINE,
JTAB TYPE STANDARD TABLE OF ZREMARKS WITH HEADER LINE.
*data:begin of itab occurs 0,
MANDT LIKE ZCUST_CALL_REC-MANDT,
kunnr like ZCUST_CALL_REC-kunnr,
budat like ZCUST_CALL_REC-budat,
code like ZCUST_CALL_REC-code,
remarks like ZCUST_CALL_REC-remarks,
end of itab.
*data:begin of Jtab occurs 0,
MANDT LIKE ZCUST_CALL_REC-MANDT,
kunnr like ZCUST_CALL_REC-kunnr,
budat like ZCUST_CALL_REC-budat,
code like ZCUST_CALL_REC-code,
remarks like ZCUST_CALL_REC-remarks,
end of Jtab.
CONTROLS:vcontrol TYPE TABLEVIEW USING SCREEN '9001'.
CONTROLS:vcontrol1 TYPE TABLEVIEW USING SCREEN '9002'.
*start-of-selection.
*& Module USER_COMMAND_9000 INPUT
text
MODULE USER_COMMAND_9000 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
WHEN 'ENQUIRY'.
perform multiple_selection.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9001'.
WHEN 'UPDATE'.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9002'.
perform update on commit.
WHEN 'DELETE'.
perform append_CUSTOMER_code.
PERFORM SELECT_DATA.
call screen '9002'.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*& Module STATUS_9000 OUTPUT
text
MODULE STATUS_9000 OUTPUT.
SET PF-STATUS 'ZCUSTOMER'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_9000 OUTPUT
*& Module USER_COMMAND_9001 INPUT
text
MODULE USER_COMMAND_9001 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
endcase.
ENDMODULE. " USER_COMMAND_9001 INPUT
*& Module STATUS_9001 OUTPUT
text
MODULE STATUS_9001 OUTPUT.
SET PF-STATUS 'ZCUSTOMER'.
SET TITLEBAR 'xxx'.
move itab-MANDT to zcust_call_rec-MANDT.
move itab-kunnr to zcust_call_rec-kunnr.
move itab-budat to zcust_call_rec-budat.
move itab-code to zcust_call_rec-code.
move itab-remarks to zcust_call_rec-remarks.
vcontrol-lines = sy-dbcnt.
ENDMODULE. " STATUS_9001 OUTPUT
*& Module USER_COMMAND_9002 INPUT
text
module USER_COMMAND_9002 input.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR sy-ucomm.
WHEN 'UPDATE'.
perform move_data.
UPDATE ZCUST_CALL_REC FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORDS ARE UPDATED'.
ELSE.
MESSAGE E001(0) WITH 'RECORDS ARE NOT UPDATED'.
ENDIF.
WHEN 'DELETE'.
perform move_data.
DELETE ZCUST_CALL_REC FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'RECORDS ARE DELETED'.
ELSE.
MESSAGE E001(0) WITH 'RECORDS ARE NOT DELETED'.
ENDIF.
endcase.
endmodule. " USER_COMMAND_9002 INPUT
*& Module STATUS_9002 OUTPUT
text
module STATUS_9002 output.
SET PF-STATUS 'ZCUSTOMER1'.
SET TITLEBAR 'xxx'.
endmodule. " STATUS_9002 OUTPUT
*& Module update_table OUTPUT
text
module update_table output.
move itab-MANDT to zcust_call_rec-MANDT.
move itab-kunnr to zcust_call_rec-kunnr.
move itab-budat to zcust_call_rec-budat.
move itab-code to zcust_call_rec-code.
move itab-remarks to zcust_call_rec-remarks.
vcontrol-lines = sy-dbcnt.
endmodule. " update_table OUTPUT
***Selection Data
FORM SELECT_DATA.
SELECT mandt kunnr budat code remarks FROM zcust_call_rec INTO
table itab
WHERE kunnr IN r_kunnr AND BUDAT IN R_BUDAT.
ENDFORM.
****append vendor code
FORM APPEND_CUSTOMER_CODE.
clear r_kunnr.
clear itab.
clear r_budat.
refresh r_kunnr.
refresh itab.
refresh r_kunnr.
IF r_kunnr IS INITIAL
AND NOT v_kun_low IS INITIAL
AND NOT v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_high
IMPORTING
OUTPUT = r_kunnr-high.
r_kunnr-option = 'BT'.
r_kunnr-sign = 'I'.
append r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND NOT v_kun_low IS INITIAL
AND v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
r_kunnr-SIGN = 'I'.
r_kunnr-OPTION = 'EQ'.
APPEND r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND v_kun_low IS INITIAL
AND NOT v_kun_high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kun_low
IMPORTING
OUTPUT = r_kunnr-low.
r_kunnr-SIGN = 'I'.
r_kunnr-OPTION = 'EQ'.
APPEND r_kunnr.
PERFORM V_BUDAT.
ELSEIF r_kunnr IS INITIAL
AND v_kun_low IS INITIAL
AND v_kun_high IS INITIAL.
IF SY-SUBRC = 0.
MESSAGE I003(0) WITH 'ENTER CUSTOMER NUMBER'.
CALL SCREEN '9000'.
ENDIF.
PERFORM V_BUDAT.
ENDIF.
ENDFORM.
FORM V_BUDAT.
IF R_BUDAT IS INITIAL
AND NOT v_BUD_low IS INITIAL
AND NOT v_BUD_high IS INITIAL.
r_budat-low = v_bud_low.
r_budat-high = v_bud_high.
r_budat-option = 'BT'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND NOT v_BUD_low IS INITIAL
AND v_BUD_high IS INITIAL.
r_budat-low = v_bud_low.
r_budat-high = v_bud_high.
r_budat-option = 'EQ'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND v_BUD_low IS INITIAL
AND NOT v_BUD_high IS INITIAL.
r_budat-HIGH = v_bud_HIGH.
r_budat-option = 'EQ'.
r_budat-sign = 'I'.
append r_budat.
ELSEIF R_BUDAT IS INITIAL
AND v_BUD_low IS INITIAL
AND v_BUD_high IS INITIAL.
IF SY-SUBRC = 0.
MESSAGE I002(0) WITH 'ENTER POSTING DATE'.
CALL SCREEN '9000'.
r_budat-low = ''.
r_budat-option = ''.
r_budat-sign = ''.
ENDIF.
ENDIF.
ENDFORM.
*& Form update
text
--> p1 text
<-- p2 text
form update .
commit work.
endform. " update
*& Form move_data
text
--> p1 text
<-- p2 text
form move_data .
clear itab.
refresh itab.
move-corresponding zcust_call_rec to itab.
MOVE ZCUST_CALL_REC-MANDT TO ITAB-MANDT.
MOVE ZCUST_CALL_REC-KUNNR TO ITAB-KUNNR.
MOVE ZCUST_CALL_REC-BUDAT TO ITAB-BUDAT.
MOVE ZCUST_CALL_REC-CODE TO ITAB-CODE.
MOVE ZCUST_CALL_REC-REMARKS TO ITAB-REMARKS.
APPEND ITAB.
delete itab where kunnr is initial.
endform. " move_data
thanks in adv
vidya
Maybe you are looking for
-
Is it possible to display Suffix values in ALV Report
Hi, Is it possible to display a suffix value in the output of ALV Report? If so how I can proceed? Please let me know an example. Thanks, Sekhar.J
-
Urgent plz! Help resizing photos to specific size
Am another newbie with Windows XP with Elements v.4.0. Have been handed a project by husband to take some passport-type as well as portrait type photos of relatives from overseas & resize them to certain dimenions (ex: 2" x 2", or maybe even somethin
-
Unit Selling Price - Round Off
Hi All, My requirement is to round off the unit selling price in Sales Order screen, for example Item AS16101 unit selling price is 12.99, while entering this item it should be 13, and saved to database as 13 Item AS16103 unit selling price is 12.40,
-
URL Filtering on ACE 4710 -Deny access
Hi, I have a requirement to filter (deny access) to certain URL's. The URL's are listed below. Any guidance/assitance in achieving this would be greatly appreciated. /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tst
-
Trying to recolor multiple images - Help
Hello, I have been searching for an answer of this particular problem for about a week now and this is my last resort, so hopefully someone will help me. I am working on a school project where we need to make an interactive e-store that sells carp