Problem in Inserting the new values into Ztable
Hi Techies,
I have a requirement that when ever user enters the value in Billing Qty input which is in VF01 tcode and the table is VBRP-FKIMG, and client want billing qty and previous month reading, the fields are not in VBRP. So I have created a custom table name as YSD-EXPORT_QTY with fields of CUSTOMER, MONTH, YEAR, BILL_QTY, PREV_READING, CUMULATIVE... When ever user enter the Billing Qty I want to update database table and initally there is no data in custom table. I tried below code but i am not getting and i am getting the error as
"The type of the database table and work area (or internal table) "WA_EXPORT" are not Unicode convertible. "
So, How can I resolve this issue.. I am trying this since from 3 days... if u have any sample code please give me...
MOVE WA_VBRP-FKIMG TO WA_EXPORT-BILL_QTY.
WA_EXPORT-CUMULATIVE = WA_EXPORT-BILL_QTY + WA_EXPORT-PREV_READING.
WA_EXPORT-PREV_READING = WA_EXPORT-CUMULATIVE.
APPEND WA_EXPORT TO IT_EXPORT.
INSERT INTO YSD_EXPORT_QTY VALUES WA_EXPORT.
If it overrides existting record, you should add new key fields to your database table, there can be only one record per set of key values.
I suppose keys look like MANDT, KUNNR, GJAHR, MONAT or MANDT VBELN POSNR or a combination of both set of keys (not sure to understand you requirement)
You have to first read from database if some data already exists,
- if yes, add the new quantities and UPDATE the record
- if no, INSERT a new record
Remember keys define a unique record, and cannot be updated once inserted.
If your program should never update records, add a "technical" key field, and fill it using a timestamp or a number range counter (FM NUMBER_GET_NEXT)
Regards,
Raymond
Similar Messages
-
Enable the field in the list display and insert the new value and save it.
Hi
In a report when I am in third list using ALV a field which is disabled should be enabled and have to insert the new value in it and save.
please tell me how to do it using classes and methods and also using ALV's.
Promise to reward points.
Regards
MacHi madan,
Please find the code sample,
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/79b5e890-0201-0010-7f8e-b7c207edf7c2
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ec31e990-0201-0010-f4b6-c02d876ce033
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/117beb90-0201-0010-67a8-fff1482209ae
Regards
Kathirvel -
Compare String in a table and insert the common values into a New table
Hi all,
Anyone has idea on how to compare a string value in a table.
I have a Students Table with Student_id and Student_Subject_list columns as below.
create table Students( Student_id number,
Student_Subject_list varchar2(2000)
INSERT INTO Students VALUES (1,'Math,Science,Arts,Music,Computers,Law,Business,Social,Language arts,History');
INSERT INTO Students VALUES (2,'Math,Law,Business,Social,Language arts,History,Biotechnology,communication');
INSERT INTO Students VALUES (3,'History,Spanish,French,Langage arts');
INSERT INTO Students VALUES (4,'History,Maths,Science,Chemistry,English,Reading');
INSERT INTO Students VALUES (5,'Math,Science,Arts,Music,Computer Programming,Language arts,History');
INSERT INTO Students VALUES (6,'Finance,Stocks');
output
Student_id Student_Subject_list
1 Math,Science,Arts,Music,Computers,Law,Business,Social,Language arts,History
2 Math,Law,Business,Social,Language arts,History,Biotechnology,communication
3 History,Spanish,French,Langage arts
4 History,Maths,Science,Chemistry,English,Reading
5 Math,Science,Arts,Music,Computer Programming,Language arts,History
6 Finance,Stocks
I need help or some suggestion in write a query which can compare each row string value of Student_Subject_list columns and insert the
common subjects into a new table(Matched_Subjects).The second table should have the below colums and data.
create table Matched_Subjects(Student_id number,
Matching_studesnt_id Number,
Matched_Student_Subject varchar2(2000)
INSERT INTO Matched_Subjects VALUES (1,2,'Math,Law,Business,Social,Language arts,History');
INSERT INTO Matched_Subjects VALUES (1,3,'History,Langage arts');
INSERT INTO Matched_Subjects VALUES (1,4,'History,Maths,Science');
INSERT INTO Matched_Subjects VALUES (1,5,'Math,Science,Arts,Music,Language arts,History');
INSERT INTO Matched_Subjects VALUES (2,3,'History,Langage arts');
INSERT INTO Matched_Subjects VALUES (2,4,'History,Maths');
INSERT INTO Matched_Subjects VALUES (2,5,'Math,Language arts,History');
INSERT INTO Matched_Subjects VALUES (3,4,'History');
INSERT INTO Matched_Subjects VALUES (3,5,'Language arts,History');
INSERT INTO Matched_Subjects VALUES (4,5,'Math,Science');
output:
Student_id Match_Student_id Matched_Student_Subject
1 2 Math,Law,Business,Social,Language arts,History
1 3 History,Langage arts
1 4 History,Maths,Science
1 5 Math,Science,Arts,Music,Language arts,History
2 3 History,Langage arts
2 4 History,Maths
2 5 Math,Language arts,History
3 4 History
3 5 Language arts,History
4 5 Math,Science
any help will be appreciated.
Thanks.
Edited by: user7988 on Sep 25, 2011 8:45 AMuser7988 wrote:
Is there an alternate approach to this without using xmlagg/xmlelement What Oracle version are you using? In 11.2 you can use LISTAGG:
insert
into Matched_Subjects
with t as (
select student_id,
column_value l,
regexp_substr(student_subject_list,'[^,]+',1,column_value) subject
from students,
table(
cast(
multiset(
select level
from dual
connect by level <= length(regexp_replace(student_subject_list || ',','[^,]'))
as sys.OdciNumberList
select t1.student_id,
t2.student_id,
listagg(t1.subject,',') within group(order by t1.l)
from t t1,
t t2
where t1.student_id < t2.student_id
and t1.subject = t2.subject
group by t1.student_id,
t2.student_id
STUDENT_ID MATCHING_STUDESNT_ID MATCHED_STUDENT_SUBJECT
1 2 Math,Law,Business,Social,Language arts,History
1 3 Language arts,History
1 4 Science,History
1 5 Math,Science,Arts,Music,Language arts,History
2 3 Language arts,History
2 4 History
2 5 Math,Language arts,History
3 4 History
3 5 History,Language arts
4 5 History,Science
10 rows selected.
SQL> Prior to 11.2 you can create your own string aggregation function STRAGG - there are plenty of example on this forum. Or use hierarchical query:
insert
into Matched_Subjects
with t1 as (
select student_id,
column_value l,
regexp_substr(student_subject_list,'[^,]+',1,column_value) subject
from students,
table(
cast(
multiset(
select level
from dual
connect by level <= length(regexp_replace(student_subject_list || ',','[^,]'))
as sys.OdciNumberList
t2 as (
select t1.student_id student_id1,
t2.student_id student_id2,
t1.subject,
row_number() over(partition by t1.student_id,t2.student_id order by t1.l) rn
from t1,
t1 t2
where t1.student_id < t2.student_id
and t1.subject = t2.subject
select student_id1,
student_id2,
ltrim(sys_connect_by_path(subject,','),',') MATCHED_STUDENT_SUBJECT
from t2
where connect_by_isleaf = 1
start with rn = 1
connect by student_id1 = prior student_id1
and student_id2 = prior student_id2
and rn = prior rn + 1
STUDENT_ID MATCHING_STUDESNT_ID MATCHED_STUDENT_SUBJECT
1 2 Math,Law,Business,Social,Language arts,History
1 3 Language arts,History
1 4 Science,History
1 5 Math,Science,Arts,Music,Language arts,History
2 3 Language arts,History
2 4 History
2 5 Math,Language arts,History
3 4 History
3 5 History,Language arts
4 5 History,Science
10 rows selected.SY. -
How CallableStatement in JSP use setDate() method to insert the date value into DB?
Dear all,
I met a strange error message when i insert a date value into DB via JSP call PL/SQL procedures.
The error seems caused by the setDate(index, date) method with CallableStatement.
The message is: Can not find the setDate(int, java.util.Date) method in the CallableStatement interfaces.
Any ideas?
Thanks advanced.Thank you!:)
I solved it using this:
String name="david";
stmt = con1.createStatement();
String prikaz1 = "INSERT INTO table (id,age,surname,name) IN 'C:\\Users\\David\\Desktop\\db.mdb' SELECT id,age,surname,' " + name + " ' FROM table2";
stmt.executeUpdate(prikaz1); -
Problem while inserting the same value on a primary key column
hi all ,
in my application there is a block with a pat_id column "primary key" ,
if the user inserts the same value in this column , a message appears asking me if i want to save the changes or not ,
i do not know what changes is the message asking about , and sure i do not want this message to appear to the user
when he insert the same values by mistake ?
thanksas a primary key field dont fill this with manually try use db seq.
Use pre-insert trigger . -
Inserting the column values into table from view through procedure!!!
below is my example code
Create or replace procedure test_proc
is
cursor test_cur is
select a.col1 , b.col2, c.col3, d.col4, e.col5
from tableA a, tableB b, tableC c, tableD d, tableE e;
test_cur_rec test_cur%rowtype;
Begin
insert into test_stg ( col1, col2, col3, col4, col5, col6, col7)
Values ( test_cur_rec. col1,
test_cur_rec .col2,
test_cur_rec .col3,
test_cur_rec .col4,
test_cur_rec .col5
-- col6, col7 );
create view test2 (
select f.col6, g.col7 from tableF f,tableG g);
I m trying to insert values into the table test_stg but for col6 and col7 i need to get the data from the view test2.
In simple word, all i need to do is get the 2 columns data from view and insert into a table through procedure. The above code is the example which looks very much like my actual code.
How do i accomplish this task ??well there is joining condition for a, b,c ,d, e tables, i have not mentioned here. The where condition has nothing to do with the other two columns of the view.
There is no relation ship between the these tables the view. The col 6 and 7 i m inserting from view is sysdate timestamp and the job_id number.
so its pretty straight forward insertion into the table from view columns. These two columns has just one row with id number and timestamp. so i need to insert these data into the the table when i run a procedure.
Thank you so much!!! -
How to insert a default value into MS server in java - help please
hi
suppose if i have a table and one of the column has a default value when the table was created. how can i insert the default value into this column? assuming that the column is the second column and i can't specify the column name when inserting. thanks.thanks for ur response, so if i have insert statement as follow
insert into someTable values (1,'val1', 'val2', 'val3', 'val4')
and column 3 has default value = DEFAULT
then, to insert default value, my insert statement will look like this
insert into someTable values (1,'val1', 'val3', 'val4')
but the number of values will not match the number of columns. -
How can we include the property value into the News RSS?
We have defined object property u201CDepartmentu201D that is used in News XML creating form. How can we include the property value into the News RSS (set value of the particular RSS XML tag)?
We have solved the issue with NWDS
-
Problem - I input a new event into my iPhone calendar and it does not update on my iMac or iPad calendars. I have loaded the latest software on all devices and have switched over to iCloud. Suggestions?
On the iMac open System Prerferences > iCloud
Deselect the box next to Calendars then reselect then restart the iMac.
On the iPad, tap Settings > iCloud
Switch Calendars off then back on then reset the iPad.
Hold the On/Off Sleep/Wake button and the Home button down at the same time for at least ten seconds, until the Apple logo appears.
Hopefully the event synced over all the devices. -
How to insert new value into an array
I have an already declared array (including the size) and want to write a method for inserting a new value. Do I have to re-declare the array to the new size? ie old size + 1, then add the new value or is there a java method for this. I can't find one.
Thanks in advance....
MikeHi,
there is no method for that. Look up class Vector. That class implements automatic growing of the Vector.
Phil -
Problems importing new values into existing hierarchy
I have a hierarchy setup with name and code fields. I have already imported the majority of the records and manually setup the hierarchy in Data Manager (as we never had hierarchy setup in the past). I now have 100 or so new entries to add to this table, but it will not let me add the new values to the hierarchy table in Import Manager. I can map the code field fine, but when I try to map the name field, the Add button is grayed out no matter what I try to do. What am I doing wrong?
Thanks!Hi Ryan,
Kindly go through the below links to understand Hierarchy importing in MDM:
https://www.sdn.sap.com/irj/sdn/advancedsearch?query=mdmhierarchyimporting&cat=sdn_all
https://www.sdn.sap.com/irj/sdn/advancedsearch?query=mdmhierarchyimporting&cat=sdn_all
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0e122d4-40ab-2a10-4a82-fe7db431fd5e
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/903c9530-52be-2a10-7d97-a48dc8082905
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/80aa6fa7-4dbe-2a10-8b8f-8f1ce6fa2f95
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/mdm/how%2bto%2bimport%2bhierarchy%2bin%2bmdm
Hope It Helped
Thanks & Regards
Simona Pinto -
How to insert an upper value into a column?
Hi!,
I need to insert an upper value into a column.
The data is on a flat file and it could be lowercase or uppercase?
Do I have to create a trigger to solve this problem?
How could the trigger be?
Thanks,
AlexIf you are using SQL*Loader to load the data from flat file into the db table, then you can achieve inserting the UPPER Case of column value in your sqlloader ctl file itself as in below example
LOAD DATA
INFILE *
APPEND INTO TABLE XXX
( field1 position(1:7) char "UPPER(:field1)",
field2 position(8:15) char "UPPER(:field2)"
BEGINDATA
Phil Locke
Jason Durbin
So in this case the Names Phil Locke and Jason Durbin will be inserted as PHIL LOCKE and JASON DURBIN into the target table.
Regards,
Murali Mohan -
Problem to insert Chinese Characters(GB3212) into MySQL
I met a problem to insert Chinese Characters (GB3212) into MySQL using Entity Bean (or JPA).
For example, when a hardcoded string "{color:#ff0000}电器me元件{color}" is inserted, it is displayed as "{color:#ff0000}??me??{color}" in MySQL.
The NamedQuery is also not working for Chinese Characters.
The setting are as following:
GlassFish JDBC connection pool: useUnicode=true, charecterEncoding=gb2312
NetBeans IDE: source encoding set to GB2312;
MySql table: the column set to CHARACTER SET gb2312;
Any experts, please give advice
Thanks lotI didn't noticed that there is a {color:#ff0000}sun-resources.xml{color} file under {color:#ff0000}<ejb project>/server resources{color}.
This file has a pool configuration. This config just overwite the paremeter i added using Admin Console every time a client is lauched. So there are two option to fix this problem.
1. Insert the follwowing two lines into the {color:#ff0000}sun-resources.xml{color}
<property name="characterEncoding" value="gb2312"/>
<property name="useUnicode" value="true"/>
2. delete the everthing in the {color:#ff0000}sun-resources.xml, using Admin Console {color}config your own pool & DataSource
I tried first option & it works. -
What will be the easy way to insert the previous value in this table, for example if you look in row 3 I want to insert 200510, in row 6 I want to insert 200390 in row 8
I want to insert 200310..
Thank you
1 SELECT
2 szslife_pidm,
3 szslife_sgbstdn_term_code_eff
4 FROM SZSLIFE
5* WHERE SZSLIFE_pidm = 1862
SQL> /
SZSLIFE_PIDM SZSLIF
1862 200410
1862 200510
1862
1862 200290
1862 200390
1862
1862 200310
1862Poster wants to update the values in rownumber 3,6,8
There is no rownum. Oracle will calculate the rownum according to you statement. Don't confuse with ROWID which is something completely different.
do you thing that the merge statemenet will work?
The problem is still: Whats the previous value. You still don't have a order by in you sql. Simply executing
alter table szslife parallel 2;
might change the result - no order by. Inserting of new rows might change the output of you sql. So how do you what to decide which one is the previous value? There is no order in a table!! You have to use order by in your sql statement.
Dim -
Mass updating a multi-valued field- to append the new value
I have a question on multi-valued fields:
I have store table with 5 multi-valued fields, say MLB, soccer, college FTBL, college Basketball, etc.
A store can have 4 MLBs, 2 soccer teams, and so on.
Say, there is a new MLB that came out called Mexico MLB team.
A user wanted to add this to 30 stores using a mass update. But remember the 30 stores can have totally different sets of values in the multi-valued fields.
How can I add this new value while still preserving the MLB teams values of each store record?
Does MDM not support this feature?
I am using SAP MDM SP6
An answer would be highly appreciated.
Thanks
SaviSavi,
I assume you are defined these fields as multi-value lookup and linked to main table. In general, you can not because it will mess up and overwrite your multi-value entries for all of your 30 store records.
Here is something in MDM come in handy. It is following the same concept but design your model a little differently. If you model your multi-value fields into qualified lookup table, it will be easier and optimized to handle.
You can select all 30 records and mass-update with adding the new MLB entry into your Q-lookup table. Once you save, this mass-update action will respect all your diversity of each individual records with the new value added.
Hope this helps
If this answers your question, please kindly reward the points.
Regards
Dawei
Maybe you are looking for
-
IDVD6 and 3rd party DVD burners
I purchased iLife for the ability to burn to a 3rd party DVD burner with iDVD6. I can't for the life of me figure how to burn to the 3rd party burner. Please help. imac G4 Mac OS X (10.3.9)
-
Yperion Financial reporting 9.3 error
hi runtime error 429 activeX component can't create object. this is what iam getting while starting my financial reporting. how to over come this error.
-
Hi All, In ECC Transaction VL10A, for example for one order having 5 QTY, user can process 2 QTY and create delivery, remaining with 3 QTY another delivery is possible. Same way i am trying to create deliverys using BAPI_OUTB_DELIVERY_CREATE_SLS. For
-
ShureSM58 not working on MacBook Pro Retina
Hello, Basically, I have bought the Shure SM58 microphone to record audio voice on my MacBook Pro Retina, but it doesn't seem to work.. The specifications and the seller clearly told me that the audio jack included output and input, is there anything
-
Hi All; I have to deploy Oracle 10gR2 Rac on SAN .U all ppl know that for rac deployment oracle use Oracle Cluster file system deploying OCFS to a shared disk device like a SAN allows database files to be shared between multiple instances.Another dis