How to use "insert into & select" in format search
Hello,
I am just wonderring whether you can help me solve this issue.
I want to change the value of a field in the title area for a sales quotation. however, this field is not shown up on the interface.
For example, there is a field in the title area, "OQUT.Ref1". You actually cannot see this field from the quotation interface or any other doc. Now I want to update the value of this field.
What I am now trying to do is to create an field named "update" in the title area, use format search to update. the code for the command will be something like
Insert into $[OQUT.Ref1.0]
select $[OQUT.U_MFG#]
here, U_MFG# is UDF. as you may understand, I want to copy the value in the U_MFG# to the field of "Ref1".
However, when I run "Execute", it gives me error. I believe there is something wrong with the code of "Insert into $[OQUT.Ref1.0]
Does anyone know how to write the code?
many thanks
Stanley
Thanks both Suda and sagar. The reason I wanted to do this is because I wanted to have UDF info be shown on the MS word-templated quotation document.
As you know, when you click the word symbol, a word-templated doc will be generated. The client needs two completely different format of quotation printout. thus I plan to print one type from PLD and other type by clicking the Word symbol. but later, I found out that the UDF field cannot be selected on the MS word template, or only system fields.
Thus, the only way I can do is to copy the value from udf to some unused sytem fields and then show that system fields on the MS word template.
any idea do you have?
I wanted to tell SAP that It is not useful if the udf fields cannot be inserted into word template.
thanks
Stanley
Similar Messages
-
How to use INSERT INTO ALL statement in jdbc prepared statement with beans
Kindly give me some example that how we can use "INSERT INTO ALL STATEMENT" in jdbc prepared statement inside a jsf bean?
Actually i want to take employee id's of present employees using single jsf page and using one textbox for each employee id.
How can i use INSERT INTO ALL statement to achieve this?
Following is my code snippet.
AttendanceBean.java:
public class AttendanceBean {
private int atteid;
private String attdname;
private int attday;
private int attmonth;
private int attyear;
public static Connection getAttConnection() throws Exception {
String driver = "oracle.jdbc.driver.OracleDriver";
String url = "jdbc:oracle:thin:@localhost:1521:globldb3";
String username = "scott";
String password = "tiger";
Class.forName(driver);
Connection conn = DriverManager.getConnection(url, username, password);
return conn;
public String addAttendance(){
Connection conn = null;
PreparedStatement pstmt = null;
boolean committed = false;
try {
conn = getAttConnection();
conn.setAutoCommit(false);
String query = "INSERT ALL INTO attendance VALUES (?,?,?,?,?)";
pstmt = conn.prepareStatement(query);
pstmt.setInt(1,this.atteid);
pstmt.setString(2,this.attdname);
pstmt.setInt(3,this.attday);
pstmt.setInt(4,this.attmonth);
pstmt.setInt(5,this.attyear);
pstmt.executeUpdate();
conn.commit();
conn.setAutoCommit(true);
committed = true;
return "home.xhtml";
} catch (Exception e) {
e.printStackTrace();
return "CRM.xhtml";
} finally {
try{
if (!committed) conn.rollback();
if (pstmt != null) pstmt.close();
if (conn != null) conn.close();
}catch(Exception e){
e.printStackTrace();
}Check this program for some info on Push buttons:
1-DEMO_DYNPRO_PUSH_BUTTON
2-DEMO_DYNPRO_MODULE
3-DEMO_DYNPRO_ON_CONDITION
Suppose Your screen is 101
Then in that screen create one push button and assign it a function code.
Now in the PAI of the 101 screen
Create Module for user command
Inside that module checc the sy-ucomm if sy-ucomm eq <Function code of your push button>
Insert the values in database.
*& Module USER_COMMAND_0101 INPUT
process after input for screen 0101 *
MODULE USER_COMMAND_0101 INPUT.
CASE OK_CODE.
WHEN 'SAVE'.
*Insert the values here
WHEN 'DISP'.
ENDCASE.
CLEAR OK_CODE.
ENDMODULE. " USER_COMMAND_0101 INPUT
Regards
Neha
Edited by: Neha Shukla on Dec 3, 2008 1:02 AM
Edited by: Neha Shukla on Dec 3, 2008 1:02 AM
Edited by: Neha Shukla on Dec 3, 2008 1:06 AM -
The source tables are having crores of data (growing tables). Tables with 4crores, 17cr. We want these tables to be copied frequently to our local database. Previously it was done by export-import through windows scheduled task. but now we are planning to do it as database jobs. We are fetching the datas with query
insert into dest_tablee( select * from source_table@dblink) when we tried with this it was throwing exception like enough table space is not there. And also it was found that frequent commits has to be used while populating datas from big tables. So tried with cursor But it was very slow and again we got the exception like 'the table space unable to extend segment by 16 in undo tablespace 'UNDOTBS1'.
After that we tried with the group by. In this case we got the exception like unable to extend table and also index in the table space. For this the solution is to add datafile. Again we have increase the table space. Now the procedure is running very slow(taking much time. It might be because of the conditions used in the query).
Is there any other option to copy the datas from such a big tables? can we use the same sort of query?
Friends please help me to sort it out.
Thanks in AdvanceHi,
you have lot of data DONT use cursor, did you try using the COPY command.
How frequently you will be doing the COPYING of the data ?
If you have any constraints you can disable and enable after all the records have been copied.
Please look at this link this should help.
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5280714813869
Thanks
Message was edited by:
hkandpal
Link added -
How do I insert cells using INSERT INTO & SET? (Excel oledb)
Updating a cell works:
oledbConnect = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\__\\test.xls;Extended Properties='Excel 12.0 Xml;HDR=NO;'");
oledbConnect.Open();
oledbCmd.Connection = oledbConnect;
string stSheetName = "Sheet2";
string sql;
sql = "UPDATE [" + stSheetName + "$A1:B1] SET F1=1";
oledbCmd.CommandText = sql;
oledbCmd.ExecuteNonQuery();
Inserting a cell does not:
sql = "INSERT INTO [" + stSheetName + "$A2:B2] SET F1=2'";
oledbCmd.CommandText = sql;
oledbCmd.ExecuteNonQuery();
I understand that inserting will add a new row ... but this doesn't work either.
sql = "INSERT INTO [" + stSheetName + "$] SET F1=3";
oledbCmd.CommandText = sql;
oledbCmd.ExecuteNonQuery();
bhs67Hi hbs67,
No, we can't use Insert into with Set, it's the basic syntax in SQL statement. Give the worksheet a header row, then use Insert into or Update syntax with the field name.
Check more information in this kb article:
https://support.microsoft.com/en-us/kb/316934?wa=wsignin1.0
If you have Office application installed on your machine, you could also automate the Excel files with Excel PIA:
How to automate Microsoft Excel from Microsoft Visual C#.NET
It's easy to insert or update cell values with the cell address.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Using INSERT INTO for FDM Memory Issue
All -
We configured FDM to run an integration script into our EBS instance upon the import step. It worked fine for a time, then we began running out of memory on the FDM server. Upon Oracle's suggestion, we stopped running through a record set to append and update the values to strWorkTableName and instead began using INSERT INTO. I admit, I have never needed to use the INSERT INTO way of doing things so I may be missing something bery basic.
Our integration script:
Function SQLIntegration2(strLoc, lngCatKey, dblPerKey, strWorkTableName)
'Oracle Hyperion FDM IMPORT Integration Script:
'Created By: karks
'Date Created: 2011-10-26 13:05:18
'Purpose:
Dim strSQL 'SQL string
Dim lngPartitionKey
Dim strConn 'Connection string to the source data
Set cnSS = CreateObject("ADODB.Connection")
lngPartitionKey = RES.PlngLocKey
strConn= "File Name=C:\Users\karksadm\Desktop\NewConnection.udl;"
cnSS.open strConn
strSQL = "Insert Into " & strWorkTableName & " (PartitionKey, CatKey, PeriodKey, DataView, Amount , Account, Entity, ICP, UD1, UD2, UD3, UD4) "
strSQL = strSQL & "SELECT " & lngPartitionKey & ", " & lngCatKey & ", TO_DATE (TO_DATE ('30/12/1899','dd/mm/yyyy')+" & dblPerKey & "), 'YTD', EBS.YTD_BALANCE, EBS.ACCOUNT, EBS.SEGMENT1, EBS.SEGMENT5, EBS.SEGMENT4, EBS.SEGMENT5, '[None]', EBS.CURRENCY_CODE FROM "
strSQL = strSQL & "(Select D.NAME, A.CODE_COMBINATION_ID, D.NAME LEDGER_NAME, A.ACTUAL_FLAG, C.PERIOD_YEAR, TO_CHAR (C.START_DATE, 'MON-YY') AS PERIOD, B.SEGMENT1, (B.SEGMENT2 || B.SEGMENT3) As ACCOUNT, B.SEGMENT4, B.SEGMENT5, A.CURRENCY_CODE, "
strSQL = strSQL & "(SUM (A.BEGIN_BALANCE_DR) + SUM (A.PERIOD_NET_DR) - SUM (A.BEGIN_BALANCE_CR) - SUM (A.PERIOD_NET_CR)) As YTD_BALANCE "
strSQL = strSQL & "FROM GL.GL_BALANCES A, GL.GL_CODE_COMBINATIONS B, GL.GL_PERIODS C, GL.GL_LEDGERS D "
strSQL = strSQL & "WHERE 1 = 1 And A.LEDGER_ID = D.LEDGER_ID And A.PERIOD_NUM = C.PERIOD_NUM And C.PERIOD_YEAR = A.PERIOD_YEAR "
strSQL = strSQL & "And A.CODE_COMBINATION_ID = B.CODE_COMBINATION_ID And B.SUMMARY_FLAG = 'N' AND C.PERIOD_SET_NAME = D.PERIOD_SET_NAME "
strSQL = strSQL & "And (B.SEGMENT1 = 001 And A.CURRENCY_CODE = 'USD' And D.LEDGER_ID = 2022) "
strSQL = strSQL & "And C.END_DATE = TO_DATE (TO_DATE ('30/12/1899','dd/mm/yyyy')+" & dblPerKey & ") "
strSQL = strSQL & "And B.CHART_OF_ACCOUNTS_ID = D.CHART_OF_ACCOUNTS_ID And A.ACTUAL_FLAG = 'A' "
strSQL = strSQL & "And ((A.BEGIN_BALANCE_DR) + (A.PERIOD_NET_DR) - ((A.BEGIN_BALANCE_CR) + (A.PERIOD_NET_CR))) <> 0 "
strSQL = strSQL & "GROUP BY A.CODE_COMBINATION_ID, D.NAME, A.CURRENCY_CODE, TO_CHAR (C.START_DATE,'MON-YY'), C.PERIOD_YEAR, A.ACTUAL_FLAG, B.SEGMENT1, (B.SEGMENT2 || B.SEGMENT3), B.SEGMENT4, B.SEGMENT5 "
strSQL = strSQL & "ORDER BY B.SEGMENT4) EBS"
DW.DataManipulation.fExecuteDML(strSQL)
'Give success message
RES.PlngActionType = 2
RES.PstrActionValue = "SQL Import successful!"
'Assign Return value
SQLIntegration2 = True
cnSS.close
Set cnSS = Nothing
End FunctionI can run the SQL minus the Insert line in my SQL Developer and it works fine. When I run the script in its entirety in FDM, we receive the following:
** Begin FDM Runtime Error Log Entry [2012-01-23 11:37:30] **
ERROR:
Code............................................. -2147217865
Description...................................... ORA-00942: table or view does not exist
Insert Into tWibison72564424799 (PartitionKey, CatKey, PeriodKey, DataView, Amount , Account, Entity, ICP, UD1, UD2, UD3, UD4) SELECT 772, 28, TO_DATE (TO_DATE (N'30/12/1899',N'dd/mm/yyyy')+40724), N'YTD', EBS.YTD_BALANCE, EBS.ACCOUNT, EBS.SEGMENT1, EBS.SEGMENT5, EBS.SEGMENT4, EBS.SEGMENT5, N'[None]', EBS.CURRENCY_CODE FROM (Select D.NAME, A.CODE_COMBINATION_ID, D.NAME LEDGER_NAME, A.ACTUAL_FLAG, C.PERIOD_YEAR, TO_CHAR (C.START_DATE, N'MON-YY') AS PERIOD, B.SEGMENT1, (B.SEGMENT2 || B.SEGMENT3) As ACCOUNT, B.SEGMENT4, B.SEGMENT5, A.CURRENCY_CODE, (SUM (A.BEGIN_BALANCE_DR) + SUM (A.PERIOD_NET_DR) - SUM (A.BEGIN_BALANCE_CR) - SUM (A.PERIOD_NET_CR)) As YTD_BALANCE FROM GL.GL_BALANCES A, GL.GL_CODE_COMBINATIONS B, GL.GL_PERIODS C, GL.GL_LEDGERS D WHERE 1 = 1 And A.LEDGER_ID = D.LEDGER_ID And A.PERIOD_NUM = C.PERIOD_NUM And C.PERIOD_YEAR = A.PERIOD_YEAR And A.CODE_COMBINATION_ID = B.CODE_COMBINATION_ID And B.SUMMARY_FLAG = N'N' AND C.PERIOD_SET_NAME = D.PERIOD_SET_NAME And (B.SEGMENT1 = 001 And A.CURRENCY_CODE = N'USD' And D.LEDGER_ID = 2022) And C.END_DATE = TO_DATE (TO_DATE (N'30/12/1899',N'dd/mm/yyyy')+40724) And B.CHART_OF_ACCOUNTS_ID = D.CHART_OF_ACCOUNTS_ID And A.ACTUAL_FLAG = N'A' And ((A.BEGIN_BALANCE_DR) + (A.PERIOD_NET_DR) - ((A.BEGIN_BALANCE_CR) + (A.PERIOD_NET_CR))) <> 0 GROUP BY A.CODE_COMBINATION_ID, D.NAME, A.CURRENCY_CODE, TO_CHAR (C.START_DATE,N'MON-YY'), C.PERIOD_YEAR, A.ACTUAL_FLAG, B.SEGMENT1, (B.SEGMENT2 || B.SEGMENT3), B.SEGMENT4, B.SEGMENT5 ORDER BY B.SEGMENT4) EBS
Procedure........................................ clsDataManipulation.fExecuteDML
Component........................................ upsWDataWindowDM
Version.......................................... 1112
Thread........................................... 4424
IDENTIFICATION:
User............................................. ibisons
Computer Name.................................... HOU-HYSDEV02
App Name......................................... SWNFDMRC
Client App....................................... WebClient
CONNECTION:
Provider......................................... ORAOLEDB.ORACLE
Data Server......................................
Database Name.................................... FDMDEV
Trusted Connect.................................. False
Connect Status.. Connection Open
GLOBALS:
Location......................................... EBSINTEGRATION
Location ID...................................... 772
Location Seg..................................... 25
Category......................................... EBS2
Category ID...................................... 28
Period........................................... Jun - 2011
Period ID........................................ 6/30/2011
POV Local........................................ False
Language......................................... 1033
User Level....................................... 1
All Partitions................................... True
Is Auditor....................................... False
** Begin FDM Runtime Error Log Entry [2012-01-23 11:37:31] **
ERROR:
Code............................................. -2147217865
Description...................................... Data access error.
At line: 33
Procedure........................................ clsImpProcessMgr.fExecuteImpScript
Component........................................ upsWObjectsDM
Version.......................................... 1112
Thread........................................... 4424
IDENTIFICATION:
User............................................. ibisons
Computer Name.................................... HOU-HYSDEV02
App Name......................................... SWNFDMRC
Client App....................................... WebClient
CONNECTION:
Provider......................................... ORAOLEDB.ORACLE
Data Server......................................
Database Name.................................... FDMDEV
Trusted Connect.................................. False
Connect Status.. Connection Open
GLOBALS:
Location......................................... EBSINTEGRATION
Location ID...................................... 772
Location Seg..................................... 25
Category......................................... EBS2
Category ID...................................... 28
Period........................................... Jun - 2011
Period ID........................................ 6/30/2011
POV Local........................................ False
Language......................................... 1033
User Level....................................... 1
All Partitions................................... True
Is Auditor....................................... False
** Begin FDM Runtime Error Log Entry [2012-01-23 11:37:31] **
ERROR:
Code............................................. -2147217865
Description...................................... Data access error.
At line: 33
Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
Component........................................ upsWObjectsDM
Version.......................................... 1112
Thread........................................... 4424
IDENTIFICATION:
User............................................. ibisons
Computer Name.................................... HOU-HYSDEV02
App Name......................................... SWNFDMRC
Client App....................................... WebClient
CONNECTION:
Provider......................................... ORAOLEDB.ORACLE
Data Server......................................
Database Name.................................... FDMDEV
Trusted Connect.................................. False
Connect Status.. Connection Open
GLOBALS:
Location......................................... EBSINTEGRATION
Location ID...................................... 772
Location Seg..................................... 25
Category......................................... EBS2
Category ID...................................... 28
Period........................................... Jun - 2011
Period ID........................................ 6/30/2011
POV Local........................................ False
Language......................................... 1033
User Level....................................... 1
All Partitions................................... True
Is Auditor....................................... False
I really think the issue is that I am not telling the script where to find the Oracle tables at. I left the code in where we were using the UDL to call in the opening of the record set, but since we are doing away with the record set how do I let FDM know where to find the Oracle tables?
Thanks in advance - I've been wrestling with this for several days.
Thanks you,
SarahHere's a script with INSERT INTO that works fine if FDM back-end is SQL DB and it's pulling from FDMHarris data warehouse which is on SQL Server.
Problem is when FDM back-end is Oracle DB and it's pulling from FDMHarris data warehouse which is on SQL Server.
I'm assuming the INSERT INTO statement needs to be written differently, syntax wise?
Here's the error message displayed.
** Begin FDM Runtime Error Log Entry [2012-06-03 21:18:15] **
ERROR:
Code............................................. -2147217900
Description...................................... ORA-00933: SQL command not properly ended
INSERT INTO tWadmin476032843931 (PartitionKey, CatKey, PeriodKey, DataView, CalcAcctType, Entity, Account, UD1, UD2, UD4, Amount) SELECT 752, 12, N'30-Apr-2012', N'YTD', 9, Entity, Account, UD1, UD2, UD4, Amount FROM FDMHarris.dbo.tdataseg4;
Procedure........................................ clsDataManipulation.fExecuteDML
Component........................................ upsWDataWindowDM
Version.......................................... 1112
Thread........................................... 3284
Function INSERTINTO(strLoc, lngCatKey, dblPerKey, strWorkTableName)
'Oracle Hyperion FDM IMPORT Integration Script:
'Created By: admin
'Date Created: 2012-06-03 11:31:39
'Purpose:
Dim objSS 'ADODB.Connection
Dim strSQL 'SQL String
Dim rs 'Recordset
Dim rsAppend 'tTB table append rs Object
Dim strPeriod
Dim strYear
'Period
'strPeriod=MonthName(Month(RES.PdtePerKey))
a=CStr(FormatDateTime(RES.PdtePerKey,1))
'Tuesday,January 30, 2012
b=Right(a,(Len(a)-Len(DW.Utilities.fParseString(a,1,1,",")))) '7
c=DW.Utilities.fParseString(b,2,2,",")
strPeriod=Left(c,3)
'Year
'strYear=Year(RES.PdtePerKey)
strYear=Right(b,4)
DW.DBTools.mLogError 1, CStr(strPeriod), CStr(strYear), Nothing
'Initialize objects
Set cnSS = CreateObject("ADODB.Connection")
'Connect To SQL Server database
cnss.open "Provider=SQLOLEDB.1;Password=datafusion;Persist Security Info=True;User ID=sa;Initial Catalog=FDMHarris;Data Source=dfv11122"
'DW.DBTools.mLogError 1, CStr(strSQL), CStr(strSQL), Nothing
'Initialize common SQL statement
strSQL = "INSERT INTO " & _
strWorkTableName & " " & _
"(PartitionKey, CatKey, PeriodKey, DataView, CalcAcctType, Entity, Account, UD1, UD2, UD4, Amount) " & _
"SELECT " & RES.PlngLocKey & ", " & RES.PlngCatKey & ", " & _
"'" & Day(RES.PdtePerKey) & "-" & MonthName(Month(RES.PdtePerKey), True) & "-" & Year(RES.PdtePerKey) & "', " & _
"'YTD', 9, Entity, Account, UD1, UD2, UD4, Amount " & _
"FROM FDMHarris.dbo.tdataseg4;" '& _
' "WHERE Month = '" & strPeriod & "' And CalYear = '" & strYear & "'"
DW.DBTools.mLogError 1, CStr(strSQL), CStr(strWorkTableName), Nothing
DW.DataManipulation.fExecuteDML(strSQL)
'cnss.Execute strSQL
'Records loaded
RES.PlngActionType = 6
RES.PstrActionValue = "SQL Import successful!"
'Assign Return value
INSERTINTO = True
cnss.Close
Set cnss = Nothing
End Function
Edited by: user12152138 on Jun 3, 2012 6:43 PM -
Commit for every 1000 records in Insert into select statment
Hi I've the following INSERT into SELECT statement .
The SELECT statement (which has joins ) has around 6 crores fo data . I need to insert that data into another table.
Please suggest me the best way to do that .
I'm using the INSERT into SELECT statement , but i want to use commit statement for every 1000 records .
How can i achieve this ..
insert into emp_dept_master
select e.ename ,d.dname ,e.empno ,e.empno ,e.sal
from emp e , dept d
where e.deptno = d.deptno ------ how to use commit for every 1000 records .ThanksSmile wrote:
Hi I've the following INSERT into SELECT statement .
The SELECT statement (which has joins ) has around 6 crores fo data . I need to insert that data into another table.Does the another table already have records or its empty?
If its empty then you can drop it and create it as
create your_another_table
as
<your select statement that return 60000000 records>
Please suggest me the best way to do that .
I'm using the INSERT into SELECT statement , but i want to use commit statement for every 1000 records .That is not the best way. Frequent commit may lead to ORA-1555 error
[url http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:275215756923]A nice artical from ASKTOM on this one
How can i achieve this ..
insert into emp_dept_master
select e.ename ,d.dname ,e.empno ,e.empno ,e.sal
from emp e , dept d
where e.deptno = d.deptno ------ how to use commit for every 1000 records .
It depends on the reason behind you wanting to split your transaction into small chunks. Most of the time there is no good reason for that.
If you are tying to imporve performance by doing so then you are wrong it will only degrade the performance.
To improve the performance you can use APPEND hint in insert, you can try PARALLEL DML and If you are in 11g and above you can use [url http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_parallel_ex.htm#CHDIJACH]DBMS_PARALLEL_EXECUTE to break your insert into chunks and run it in parallel.
So if you can tell the actual objective we could offer some help. -
Urgent : Performance Issue DELETE , INSERT INTO SELECT, UPDATE
Hi,
NEED ASSISTANCE TO OPTIMIZE THE INSERT STATEMENT (insert into select):
=================================================
We have a report.
As per current design following steps are used to populate the custom table whcih is used for reporting purpose:
1) DELETE all the recods from the custom table XXX_TEMP_REP.
2) INSERT records in custom table XXX_TEMP_REP (Assume all the records related to type A)
using
INSERT..... INTO..... SELECT.....
statement.
3) Update records in XXX_TEMP_REP
using some custom logic for the records populated .
4) INSERT records in custom table XXX_TEMP_REP (Records related to type B)
using
INSERT..... INTO..... SELECT.....
statement.
Stats gathered related to Insert statement are:
Event Wait Information
SID 460 is waiting on event : db file sequential read
P1 Text : file#
P1 Value : 20
P2 Text : block#
P2 Value : 435039
P3 Text : blocks
P3 Value : 1
Session Statistics
redo size : 293.84 M
parse count (hard) : 34
parse count (total) : 1217
user commits : 3
Transaction and Rollback Information
Rollback Used : 35.1796875 M
Rollback Records : 355886
Rollback Segment Number : 12
Rollback Segment Name : _SYSSMU12$
Logical IOs : 1627182
Physical IOs : 136409
RBS Startng Extent ID : 14
Transaction Start Time : 09/29/10 04:22:11
Transaction_Status : ACTIVE
Please suggest how this can be optimized.
Regards,
NarenderHello,
Is there any relation with the Oracle Forms tool ?
Francois -
How to use INSERT query ?
Frenz,
I have created one internal table and i am doing loop on it like...
Loop at it_data into wa_data.
Endloop.
I want to insert some data into table zdata.
How to use INSERT records on this data base table?
Give me one example.
Regards,
RHHi,
explain better what you want....
Do you want to change data in an existing raw?
Loop at tb_data into wa_data.
wa_data-field1 = 'jsahdu'.
modify tb_data from wa_data.
endloop.
If you want to add raws you use APPEND statement.
In the end you'll modify your table zdata from the internal table tb_data:
MODIFY zdata FROM TABLE tb_data.
Using modify you change raws basing on primary keys. If a raw doesn't exist it will be inserted.
Regards -
How to use at-line selection in ALV
Can someone help me about how to use at-line selection in an ALV
u can try in user_command
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
IT_FIELDCAT = GT_FIELDCATALOG
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET'
I_CALLBACK_HTML_END_OF_LIST = G_HTML_END_OF_LIST
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_GRID_SETTINGS = GS_SETTINGS
IS_LAYOUT = GS_LAYOUT
I_SAVE = G_SAVE
IS_VARIANT = GS_VARIANT
IT_EVENTS = GT_EVENTS[]
* I_SCREEN_START_COLUMN = 0 "Use coordinates for
* I_SCREEN_START_LINE = 0 "display as dialog box
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER = G_EXIT_CAUSED_BY_CALLER
ES_EXIT_CAUSED_BY_USER = GS_EXIT_CAUSED_BY_USER
TABLES
T_OUTTAB = I_REP
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
FORM USER_COMMAND USING R_UCOMM TYPE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
CASE RS_SELFIELD-FIELDNAME.
WHEN 'XXXXX'.
READ TABLE I_xxx INTO V_xxx
WITH KEY XXX = RS_SELFIELD-VALUE.
IF SY-SUBRC = 0.
ENDIF.
WHEN OTHERS
ENDCASE.
ENDCASE.
ENDFORM. -
How to use offset for select-option parameter ?
Hi experts
could anybody please let me know how to use offset for select-option parameter. i can able to use offset for table fields, variabiles and all , but don't know how to use for parameters.
following is my code
SELECT-OPTIONS: s_prctr FOR vbsegs-prctr OBLIGATORY.
here "prctr" length is 10.
i'm using two tables 1. vbsegd-bupla
2. vbsegs-prctr
here prctr+6(4) = bupla.
"Bupla" length is 4
SELECT belnr gjahr bukrs bupla sgtxt buzei FROM vbsegd INTO CORRESPONDING FIELDS OF TABLE it_vbsegd FOR ALL ENTRIES IN it_vbkpf
WHERE belnr = it_vbkpf-belnr
AND gjahr = it_vbkpf-gjahr
AND bukrs = it_vbkpf-bukrs
AND bupla IN s_prctr.
the above statement is not working as prctr and bupla lenths are different. here i want to use offset.
SELECT belnr gjahr bukrs prctr sgtxt buzei FROM vbsegs INTO CORRESPONDING FIELDS OF TABLE it_vbsegs FOR ALL ENTRIES IN it_vbkpf
WHERE belnr = it_vbkpf-belnr
AND gjahr = it_vbkpf-gjahr
AND bukrs = it_vbkpf-bukrs
AND prctr IN s_prctr.
this is working as prctr and s_prctr lengths are equal.
could anybody please help me out in this.
Thanks in advance.
regards
satishBelow code will work for you.
SELECT-OPTIONS: s_prctr FOR vbsegs-prctr OBLIGATORY.
RANGES: s_bupla FOR vbsegd-bupla.
s_bupla[] = s_prctr[].
DELETE ADJACENT DUPLICATES FROM s_bupla.
SELECT belnr gjahr bukrs bupla sgtxt buzei FROM vbsegd INTO CORRESPONDING FIELDS OF TABLE it_vbsegd FOR ALL ENTRIES IN it_vbkpf
WHERE belnr = it_vbkpf-belnr
AND gjahr = it_vbkpf-gjahr
AND bukrs = it_vbkpf-bukrs
AND bupla IN s_bupla. -
Query: how to use structure and selection and what's the difference between
Query: how to use structure and selection and what's the difference between these two?
Would be appreciated if some experts here give examples to demenstrate on how to use structure and selection in query and what's the difference between these two?
Thanks in advance!Hi Kevin,
1. Well by default all the KF that you include in your query go into a Key Figure Structure. You can additionally have another structure for defining how your chars are laid out. A common example is a Calmonth structure where you have selections for 12 months, quarers and YTD values. This would be a char structure with different selections (for each month, qtr etc)
2. Yes, a selection with a KF is the same as restricting a KF. You can use am RKF is you have one on the left hand side, or if you need to do this locally in the query, right click the structure and choose New Selection, then proceed to choose your KF and reqd char values.
Hope this helps... -
How to use external library(in .jar format) in netbeans project?
How to use external library(in .jar format) in netbeans project?
Thanks!How to use external library(in .jar format) in netbeans project?
Thanks! -
How to use Hierarchy Filter Selection?
Hi, experts !
Could anyone give me a detail for how to use hierarchy filter selection ?
When i locate a Hier filter selection in the template and execute it, a false info
accured while filtering data,and the IE inferred the hier node object was missing.
Then i add another hier filter in the same template, and the secend runs well, however the first one didn't.
At last, i hide the first one, but the second one can't either.
Help me !!!
Thx in advance!Thanks Toja !
Sorry to reply so late !
The error is line: 51. error:'document.HIERARCHY_MENU_1.NODEID' is null or is not the object.
The code on line of 51 says:document.HIERARCHY_MENU_1.NODEID.value = i_node;
Could you please give me some documents on the topic of Hierarchy Filter Selection ? -
System getting hanged whilst using Insert into table select * from table
I have a peculiar problem.
I am using the below statements:
Query 1:
insert into table ppms.erin_out@ppms_dblink select * from erin_out;
Query 2:
insert into table ppms.erin_out@ppms_dblink values(23,'dffgg',12',dfdfdgg,dfdfdg);
I am in 'interfaces' schema (testing server) and executing above statements. We have testing server and development server, both are identical, i.e one is clone of the other.
ppms_dblink is created in interfaces schema. ppms_dblink points to different database server which has two schemas 'clarity' and 'ppms'. ppms_dblink is create through authentication details of clarity schema.
erin_out table is created on ppms schema on the same dababase server pointed by ppms_dblink.
Question is :
TOAD hangs while running query 1.
Query 2 is working perfectly.
As I have pl/sql script which is using query 1. I want to know why query 1 is creating problem.
If I use query 2 in my pl/sql query then it may create performance issue as i have to use cursor then.
On clarity schema, I have insert, update, select, modify rights on ppms.erin_out.
I have tried same queries from another database server.
That is I tried queries from 'interfaces' schema of development server ( clone of the testing server ). Its working perfectly.
Message was edited by:
user484158Dhanchik:
The table from which I select rows, to insert into table on dblink, is having only one record. It may contatin maximum 100 rows at a time because I am scheduling the procedure through daemon process. Anyway transaction is not more than 100 records. I am trying with just 1 record for testing.
So 1) Problem is not about the cost, TOAD is getting hanged ( to insert 1 record, cost does not mean much)
2) there is no large amount of data, so no question of deteriorated performance
Aron Tunzi:
I think that should not be problem, because I am able to insert a record through query 2.
Warren Tolentino :
I am testing with 1 record only. Its not performance issue.
Message was edited by:
रचित -
How do i insert into table through forms
Hi
I have developed a custom form based on custom table.
the only way to insert data into database table is through form.
there are two tables: one table is to store all contract details & second table is to maintain history forthis.
one condition(col1,col2,col3,col4) are unique combination,we are not creating any PK or FK at database level.evrythng is captured at form level.
if all 4 columns combination exist thn e should not insert that record.
if 4 columns combination doesnot exist then insert into table.
I have used just pre insert,pre update triggers.
I think its a basic form functionality ,by itself it inserts ,update record.now it is doing the same thng.
But I have to add the above condition ,how can i do that.
Pl provide me some ex code .
Thank you.
Hope any one can help meSQL> create table t
2 (object_id number
3 ,object_name varchar2(30));
Table created.
SQL>
SQL> create sequence t_seq;
Sequence created.
SQL>
SQL> insert into t (object_id, object_name)
2 select t_seq.nextval
3 ,object_name
4 from all_objects
5 ;
52637 rows created.
Maybe you are looking for
-
How to use another computers internet for your own?
I tried using my brothers wireless wifi, i tried using internet sharing on his computer and fonnected us through bluetooth but it wont work i tried everything with internet sharing and it wont work what could be the problem? I cant connect to his wif
-
On my new iPhone 4S I cannot purchase songs in the iTunes Store app without answering my security questions.. Me being forgetful forget the answer which I made in 2010 and need to know the answers or reset them, but I do not wish to call apple suppor
-
Hi, I am using timer whose value needs to be changed dynamically. I am using instance variable of type Interval as timer Interval Expression.I am changing value of interval instance variable using notification and Message wait activity as explained i
-
Hi Experts, in 2lis_04_p_arbpl datasource not having field IGMNG in both extract structure & commnication structure but backend table AFKO is having this field if can i enhance this to datasource i need to write ABAP code or not let me know this . Re
-
I have had Creative Cloud on my Mac for over a year and about a week ago I updated the application and it completely disappeared from my laptop. I have tried re-installing it many times but my Mac is not allowing me to do so. This is a serious issue