Reorganize records in table?
PartyID PartyFunctionTypeID Surname FirstName MiddleName MiddleName2 DisplayName
1 4 Yudin Michael NULL NULL Michael Yudin
2 4 Diggins Ben NULL NULL Ben Diggins
3 4 Strait Derrick NULL NULL Derrick Strait
4 4 Mazur Michelle NULL NULL Michelle Mazur
5 4 Paluga Nicki NULL NULL Nicki Paluga
6 4 Penny Kirk NULL NULL Kirk Penny
7 5 Prefab Sprout NULL NULL NULL Prefab Sprout
8 4 Sandino Moreno Catalina NULL NULL Catalina Sandino Moreno
9 4 Pyne Dan NULL NULL Dan Pyne
10 4 iShine Auge NULL NULL NULL iShine Auge
11 4 Esposito Mike NULL NULL Mike Esposito
12 4 Eason Eric NULL NULL Eric Eason
13 4 Lee Kristy NULL NULL Kristy Lee
14 5 Rubiks' Cube NULL NULL NULL Rubiks' Cube
15 4 Funk Matthew C. NULL Matthew C. Funk
16 4 Qin Haiyan NULL NULL Haiyan Qin
17 4 Borman Arthur NULL NULL Arthur Borman
18 4 Tinker Mark NULL NULL Mark Tinker
19 4 McKeand Carol Evan NULL Carol Evan McKeand
20 4 Willis Patrick NULL NULL Patrick Willis
21 5 Every Avenue NULL NULL NULL Every Avenue
This is the party table in database. party id is primary key column, records which has party function type 5 or else not required to touch. I am dealing with only partyfunction type = 4 only, partyid upto 6 is perfect. On partyid 8 sandino must be on middle
name column but that one null. Another things to fix is in partyID 10 both first name and surname on same column surname should be Augue not null. One way to fix this is manually but I have thousands of record and trying to write script to fix this scenario
any Idea?
Hi Arjunji, Pls take a look and tweak accordingly.
The assumption is display name is accurate in the form of firstName+' '+MiddleName+' '+MiddleName2+' '+SurName. It looks like some of the columns are not accurately parsed and populated and you would like to fix those for
PartyFunctionTypeID=4.
Best of luck !
declare @party as table (
PartyID int ,
PartyFunctionTypeID tinyint,
Surname varchar(25),
FirstName varchar(25),
MiddleName varchar(25),
MiddleName2 varchar(25),
DisplayName varchar(100)
insert into @party
values (
1, 4, 'Yudin', 'Michael', NULL, NULL, 'Michael Yudin'),
(2, 4, 'Diggins', 'Ben', NULL, NULL, 'Ben Diggins'),
(3, 4, 'Strait', 'Derrick', NULL, NULL, 'Derrick Strait'),
(4, 4, 'Mazur', 'Michelle', NULL, NULL, 'Michelle Mazur'),
(5, 4, 'Paluga', 'Nicki', NULL, NULL, 'Nicki Paluga'),
(6, 4, 'Penny', 'Kirk', NULL, NULL, 'Kirk Penny'),
(7, 5, 'Prefab Sprout', NULL, NULL, NULL, 'Prefab Sprout'),
(8, 4, 'Sandino Moreno','Catalina',NULL, NULL, 'Catalina Sandino Moreno'),
(9, 4, 'Pyne', 'Dan', NULL, NULL, 'Dan Pyne'),
(10, 4, 'iShine Auge', NULL, NULL, NULL, 'iShine Auge'),
(11, 4, 'Esposito', 'Mike', NULL, NULL, 'Mike Esposito'),
(12, 4, 'Eason', 'Eric', NULL, NULL, 'Eric Eason'),
(13, 4, 'Lee', 'Kristy', NULL, NULL, 'Kristy Lee'),
(14, 5, 'Rubiks'''' Cube', NULL, NULL, NULL, 'Rubiks'''' Cube'),
(15, 4, 'Funk', 'Matthew', 'C.', NULL, 'Matthew C. Funk'),
(16, 4, 'Qin', 'Haiyan', NULL, NULL, 'Haiyan Qin'),
(17, 4, 'Borman', 'Arthur', NULL, NULL, 'Arthur Borman'),
(18, 4, 'Tinker', 'Mark', NULL, NULL, 'Mark Tinker'),
(19, 4, 'McKeand', 'Carol', 'Evan', NULL, 'Carol Evan McKeand'),
(20, 4, 'Willis', 'Patrick', NULL, NULL, 'Patrick Willis'),
(21, 5, 'Every Avenue', NULL, NULL, NULL, 'Every Avenue'),
(210, 4, 'Robert', NULL, NULL, NULL, 'Robert God Father Deniro') ---//test record
UPDATE t4
SET t4.Surname = t4.Surname2,
t4.FirstName = t4.FirstName2,
t4.MiddleName = t4.MiddleName21,
t4.MiddleName2 = t4.MiddleName22
FROM
select PartyID,
PartyFunctionTypeID ,
FirstName ,
MiddleName ,
MiddleName2 ,
Surname ,
DisplayName,
name1 AS Surname2 ,
coalesce( name4,name3,name2) as firstname2,
case
when name3 is not null and name2 is not null and name1 is not null then name2
else null
end as middlename21,
case
when name4 is not null and name3 is not null and name2 is not null and name1 is not null then name3
else null
end as middlename22
from (
select PartyID,
PartyFunctionTypeID ,
FirstName ,
MiddleName ,
MiddleName2 ,
Surname ,
DisplayName,
replace(PARSENAME( (replace(replace(DisplayName,'.','*'),' ','.')),1 ),'*','.') AS name1 ,
replace(PARSENAME( (replace(replace(DisplayName,'.','*'),' ','.')),2 ),'*','.') AS name2,
replace(PARSENAME( (replace(replace(DisplayName,'.','*'),' ','.')),3 ),'*','.') AS name3,
replace(PARSENAME( (replace(replace(DisplayName,'.','*'),' ','.')),4 ),'*','.') AS name4
from @party
where PartyFunctionTypeID = 4
) as t2
where Surname<>name1
) as t4 ;
select * from @party
where PartyFunctionTypeID=4;
Similar Messages
-
Delete records from tableA which are not in tableB
Table A contains milions of records which is the best way to delete records from tableA which are not in tableB
delete from tableA where empno not in (select empno from tableb)
or
delete from tableA where empno not exists (select empno from tableb
where b.empno=a.empno)
any helpHi
If you can do this, do with this:
create table tableC
as select a.*
from tableA a,
(select empno from tableA
minus
select empno from tableB) b
where a.empno = b.empno;
drop table tableA;
rename table tableC to tableA;
Ott Karesz
http://www.trendo-kft.hu -
PDE-PLI031 Unable to fetch record from table tool_modulre
Dear ALL
I am creating PL/SQL Libraries in report builder.
but When I try to save the Library to database, a error
PDE-PLI031 Unable to fetch record from table tool_modulre.
Would you please tell me how to solve this problem
and why it coming
thankyou very much
pritam singhHi ,
Saving a library (.pll) to database would store the object inside specific tables that are to be created.
If you are using 6i, then you should find toolbild & toolgrnt.sql files which you have to run in the order specified. The above scripts creates the necessary tables and henceforth you won't get those errors while saving.
Hope this helps.
Thanks,
Vinod. -
How to insert a new record to table with foreign key
I have 3 tables like this :
CREATE TABLE PERSON (
PK INTEGER NOT NULL,
NAME VARCHAR(10),
SSNUM INTEGER,
MGR INTEGER);
ALTER TABLE PERSON ADD CONSTRAINT PK_PERSON PRIMARY KEY (PK);
ALTER TABLE PERSON ADD CONSTRAINT FK_PERSON FOREIGN KEY (MGR) REFERENCES
PERSON (PK);
/* Tables
CREATE TABLE PROJECT (
PK INTEGER NOT NULL,
CODE_NAME INTEGER);
ALTER TABLE PROJECT ADD CONSTRAINT PK_PROJECT PRIMARY KEY (PK);
/* Tables
CREATE TABLE XREF (
PERSON INTEGER NOT NULL,
PROJECT INTEGER NOT NULL);
ALTER TABLE XREF ADD CONSTRAINT PK_XREF PRIMARY KEY (PERSON, PROJECT);
ALTER TABLE XREF ADD CONSTRAINT FK_XREF1 FOREIGN KEY (PERSON) REFERENCES
PERSON (PK);
ALTER TABLE XREF ADD CONSTRAINT FK_XREF2 FOREIGN KEY (PROJECT) REFERENCES
PROJECT (PK);
I do like the way of "ReverseTutoral" and the file .jdo here :
<?xml version="1.0" encoding="UTF-8"?>
<jdo>
<package name="reversetutorial">
<class name="Person" objectid-class="PersonId">
<extension vendor-name="kodo" key="class-column" value="none"/>
<extension vendor-name="kodo" key="lock-column" value="none"/>
<extension vendor-name="kodo" key="table" value="PERSON"/>
<field name="name">
<extension vendor-name="kodo" key="data-column"
value="NAME"/>
</field>
<field name="person">
<extension vendor-name="kodo" key="pk-data-column"
value="MGR"/>
</field>
<field name="persons">
<collection element-type="Person"/>
<extension vendor-name="kodo" key="inverse"
value="person"/>
<extension vendor-name="kodo" key="inverse-owner"
value="person"/>
</field>
<field name="pk" primary-key="true">
<extension vendor-name="kodo" key="data-column"
value="PK"/>
</field>
<field name="ssnum">
<extension vendor-name="kodo" key="data-column"
value="SSNUM"/>
</field>
<field name="xrefs">
<collection element-type="Xref"/>
<extension vendor-name="kodo" key="inverse"
value="person"/>
<extension vendor-name="kodo" key="inverse-owner"
value="person"/>
</field>
</class>
<class name="Project" objectid-class="ProjectId">
<extension vendor-name="kodo" key="class-column" value="none"/>
<extension vendor-name="kodo" key="lock-column" value="none"/>
<extension vendor-name="kodo" key="table" value="PROJECT"/>
<field name="codeName">
<extension vendor-name="kodo" key="data-column"
value="CODE_NAME"/>
</field>
<field name="pk" primary-key="true">
<extension vendor-name="kodo" key="data-column"
value="PK"/>
</field>
<field name="xrefs">
<collection element-type="Xref"/>
<extension vendor-name="kodo" key="inverse"
value="project"/>
<extension vendor-name="kodo" key="inverse-owner"
value="project"/>
</field>
</class>
<class name="Xref" objectid-class="XrefId">
<extension vendor-name="kodo" key="class-column" value="none"/>
<extension vendor-name="kodo" key="lock-column" value="none"/>
<extension vendor-name="kodo" key="table" value="XREF"/>
<field name="person">
<extension vendor-name="kodo" key="pk-data-column"
value="PERSON"/>
</field>
<field name="person2" primary-key="true">
<extension vendor-name="kodo" key="data-column"
value="PERSON"/>
</field>
<field name="project">
<extension vendor-name="kodo" key="pk-data-column"
value="PROJECT"/>
</field>
<field name="project2" primary-key="true">
<extension vendor-name="kodo" key="data-column"
value="PROJECT"/>
</field>
</class>
</package>
</jdo>
Data of those tables are :
PERSON :
| PK | NAME | SSNUM | MGR |
| 1 | ABC | 1 | 1 |
| 2 | DEF | 5 | 1 |
PROJECT
| PK | CODE_NAME |
| 1 | 12 |
| 2 | 13 |
And now I want to add a new record into table XREF : insert into XREF
values (1,1);
public void createData() {
Xref xref = new Xref();
Person person = new Person(1);
Project project = new Project(1);
xref.setPerson(person);
xref.setProject(project);
person.getXrefs().add(xref);
person.getXrefs().add(xref);
pm.currentTransaction().begin();
pm.makePersistent(xref);
pm.currentTransaction().commit();
I don't know why Kodo automatically insert new record to table PERSON ->
confilct Primary Key. The errors are :
0 [main] INFO kodo.Runtime - Starting Kodo JDO version 2.4.1
(kodojdo-2.4.1-20030126-1556) with capabilities: [Enterprise Edition
Features, Standard Edition Features, Lite Edition Features, Evaluation
License, Query Extensions, Datacache Plug-in, Statement Batching, Global
Transactions, Developer Tools, Custom Database Dictionaries, Enterprise
Databases, Custom ClassMappings, Custom ResultObjectProviders]
41 [main] WARN kodo.Runtime - WARNING: Kodo JDO Evaluation expires in 29
days. Please contact [email protected] for information on extending
your evaluation period or purchasing a license.
1627 [main] INFO kodo.MetaData -
com.solarmetric.kodo.meta.JDOMetaDataParser@e28b9: parsing source:
file:/D:/AN/Test/classes/reversetutorial/reversetutorial.jdo
3092 [main] INFO jdbc.JDBC - [ C:23387093; T:19356985; D:10268916 ] open:
jdbc:firebirdsql:localhost/3050:D:/An/test/temp.gdb (sysdba)
3325 [main] INFO jdbc.JDBC - [ C:23387093; T:19356985; D:10268916 ]
close:
com.solarmetric.datasource.PoolConnection@164dbd5[[requests=0;size=0;max=70;hits=0;created=0;redundant=0;overflow=0;new=0;leaked=0;unavailable=0]]
3335 [main] INFO jdbc.JDBC - [ C:23387093; T:19356985; D:10268916 ] close
connection
3648 [main] INFO jdbc.JDBC - Using dictionary class
"com.solarmetric.kodo.impl.jdbc.schema.dict.InterbaseDictionary" to
connect to "Firebird" (version "__WI-V6.2.972 Firebird 1.0.3)WI-V6.2.972
Firebird 1.0.3/tcp (annm)/P10") with JDBC driver "firebirdsql jca/jdbc
resource adapter" (version "0.1")
4032 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ] open:
jdbc:firebirdsql:localhost/3050:D:/An/test/temp.gdb (sysdba)
4143 [main] INFO jdbc.SQL - [ C:25657668; T:19356985; D:10268916 ]
preparing statement <3098834>: INSERT INTO XREF(PERSON, PROJECT) VALUES
4224 [main] INFO jdbc.SQL - [ C:25657668; T:19356985; D:10268916 ]
executing statement <3098834>: [reused=1;params={(int)1,(int)1}]
4244 [main] INFO jdbc.SQL - [ C:25657668; T:19356985; D:10268916 ]
preparing statement <9090824>: INSERT INTO PERSON(MGR, NAME, PK, SSNUM)
VALUES (?, ?, ?, ?)
4315 [main] INFO jdbc.SQL - [ C:25657668; T:19356985; D:10268916 ]
executing statement <9090824>: [reused=1;params={null,null,(int)1,(int)0}]
4598 [main] WARN jdbc.JDBC - java.sql.SQLWarning: java.sql.SQLWarning:
resultSetType or resultSetConcurrency changed
4598 [main] WARN jdbc.JDBC - java.sql.SQLWarning: java.sql.SQLWarning:
resultSetType or resultSetConcurrency changed
4598 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ] begin
rollback
4608 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ] end
rollback 10ms
4628 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ]
close:
com.solarmetric.datasource.PoolConnection@1878144[[requests=2;size=2;max=70;hits=0;created=2;redundant=0;overflow=0;new=2;leaked=0;unavailable=0]]
4628 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ] close
connection
javax.jdo.JDOFatalDataStoreException:
com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
[SQL=INSERT INTO PERSON(MGR, NAME, PK, SSNUM) VALUES (null, null, 1, 0)]
[PRE=INSERT INTO PERSON(MGR, NAME, PK, SSNUM) VALUES (?, ?, ?, ?)]
GDS Exception. violation of PRIMARY or UNIQUE KEY constraint "PK_PERSON"
on table "PERSON" [code=335544665;state=null]
NestedThrowables:
com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
[SQL=INSERT INTO PERSON(MGR, NAME, PK, SSNUM) VALUES (null, null, 1, 0)]
[PRE=INSERT INTO PERSON(MGR, NAME, PK, SSNUM) VALUES (?, ?, ?, ?)]
GDS Exception. violation of PRIMARY or UNIQUE KEY constraint "PK_PERSON"
on table "PERSON"
at
com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwFatal(SQLExceptions.java:17)
at
com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:416)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:575)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:438)
at reversetutorial.Finder.createData(Finder.java:74)
at reversetutorial.Finder.main(Finder.java:141)
NestedThrowablesStackTrace:
org.firebirdsql.jdbc.FBSQLException: GDS Exception. violation of PRIMARY
or UNIQUE KEY constraint "PK_PERSON" on table "PERSON"
at
org.firebirdsql.jdbc.FBPreparedStatement.internalExecute(FBPreparedStatement.java:425)
at
org.firebirdsql.jdbc.FBPreparedStatement.executeUpdate(FBPreparedStatement.java:136)
at
com.solarmetric.datasource.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:111)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatementNonBatch(SQLExecutionManagerImpl.java:542)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatement(SQLExecutionManagerImpl.java:511
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeInternal(SQLExecutionManagerImpl.java:405)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.flush(SQLExecutionManagerImpl.java:272
at
com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:411)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:575)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:438)
at reversetutorial.Finder.createData(Finder.java:74)
at reversetutorial.Finder.main(Finder.java:141)
at org.firebirdsql.gds.GDSException: violation of PRIMARY or UNIQUE KEY
constraint "PK_PERSON" on table "PERSON
at org.firebirdsql.jgds.GDS_Impl.readStatusVector(GDS_Impl.java:1683)
at org.firebirdsql.jgds.GDS_Impl.receiveResponse(GDS_Impl.java:1636)
at org.firebirdsql.jgds.GDS_Impl.isc_dsql_execute2(GDS_Impl.java:865)
at
org.firebirdsql.jca.FBManagedConnection.executeStatement(FBManagedConnection.java:782)
at
org.firebirdsql.jdbc.FBConnection.executeStatement(FBConnection.java:1072)
at
org.firebirdsql.jdbc.FBPreparedStatement.internalExecute(FBPreparedStatement.java:420)
at
org.firebirdsql.jdbc.FBPreparedStatement.executeUpdate(FBPreparedStatement.java:136)
at
com.solarmetric.datasource.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:111)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatementNonBatch(SQLExecutionManagerImpl.java:542)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatement(SQLExecutionManagerImpl.java:511)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeInternal(SQLExecutionManagerImpl.java:405)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.flush(SQLExecutionManagerImpl.java:272)
at
com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:411)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:575)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:438)
at reversetutorial.Finder.createData(Finder.java:74)
at reversetutorial.Finder.main(Finder.java:141)
Exception in thread "main"First off, use the '-primaryKeyOnJoin true' flag when running the reverse
mapping tool so that you can get rid of that useless Xref class and have
a direct relation between Person and Project. See the documentation on
reverse mapping tool options here:
http://www.solarmetric.com/Software/Documentation/latest/docs/ref_guide_pc_reverse.html
But your real problem is that you are creating new objects, assigning
primary key values, and expecting them to represent existing objects.
That's not the way JDO works. If you want to set relations to existing
objects in JDO, you use the PM to look up those objects. If you try to
create new objects, JDO will assume you want to insert new records into
the DB, and you'll get PK conflicts like you see here.
There are several good books out on JDO; if you're just starting out with
it, they might save you a lot of time and help you master JDO quickly. -
Add a new record to table control
Dear all,
How to add a new blank record to a table control?
Following code is not working for adding a new blank record to a table control
MODULE USER_COMMAND_0100 INPUT.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'APND'. " A button "Add" to add a new record to table control
REFRESH IT_KNA1.
CLEAR IT_KNA1.
APPEND IT_KNA1.
ENDCASE.
ENDMODULE.
Thanks youHope you have done all table control specific coding
refer this example program
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac5e35c111d1829f0000e829fbfe/content.htm -
How to update record in Table control
Dear Friends,
I have table control that has space for 10 records but i need to update 15 record from the flat file which is getting into the table how can i do this.
Regards,
MAHENDRA.Hi,
you record for an item and then click on page down and save it.use the loop on this bdc to populate the the bdc table no need to do manually.
LOOP AT l_i_dettab_item INTO l_wa_dettab_item..
l_cursor = l_cursor + 1.
IF l_cursor GT 1.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
ENDIF.
PERFORM cursor_pos_notation USING 'V_EAN_DET001- GTIN_VARIANT_TYP'
l_cursor
CHANGING l_cursor_notation.
PERFORM cursor_pos_notation USING 'V_EAN_DET001-VTWEG'
l_cursor
CHANGING l_cursor_notation.
PERFORM bdc_field USING l_cursor_notation
l_wa_dettab_item-vtweg.
PERFORM cursor_pos_notation USING 'V_EAN_DET001-DATEFROM'
l_cursor
CHANGING l_cursor_notation.
PERFORM bdc_field USING l_cursor_notation
l_v_date.
PERFORM bdc_field USING 'BDC_CURSOR'
l_cursor_notation.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SAVE'.
ENDLOOP.
Here my ok code for page down is =P+ so i am looping on the table control data and then populating the bdc table after this i will populate the remaing info required for the call transaction and refresh bdcdata.
thats it no need to do recording 1000 times.
now if u do like this it doesn't depend on the number of records on table control.
it will take all the records.
Reward if useful.
Regards,
sasi
Regards,
sasi -
How can we do the validation for non visible records in table control.
Hi Experts,
I have a table control which displays list of material details. I have a button to upload the material details from excel file to table control directly. I have to validate all the customers which are exist in the table. But my item (Material) table control displays only 5 rows i.e only 5 entries are visible in module pool screen. The validation is done for 5 records only in PAI event, but i need to do validation for rest of the records too (Which are not visible on items table), if validation fails then needs to display error message.
How can we do the validation for non visible records in table control.
Regards,
BujjiHi,
try validating material before displaying it in table control...'
Rgds/Abhhi -
How to create a record for table PLAF with order type 'NB'.
How to create a record for table PLAF with order type 'NB'(standard purchase order).
who can tell me the T-code or some usefull information?
Thanks.Hi
This will be updated automatically when generate planned orders thru MRP. (MD02)
regards
Srinivas -
Time out error while fetching records from table BKPF
Hi,
I am fetching records from table BKPF using BUKRS & AWKEY in where clause. Query is as follows:
SELECT BELNR XBLNR AWKEY
FROM BKPF
INTO TABLE L_I_BKPF_TEMP
PACKAGE SIZE 500
WHERE BUKRS LIKE L_C_EG
AND AWKEY IN L_R_AWKEY .
APPEND LINES OF L_I_BKPF_TEMP TO I_BKPF .
ENDSELECT .
Program is giving time out error. There are 25628 records in range L_R_AWKEY , i m fetching 500 records at a time using PACKAGE SIZE. But the execution of prog stops on this query.
Please suggest something to overcome this problem.Hi
Rui is right,
if you need to get the data by operation parameters u have to use the fields AWTYP and AWKEY.
In this selection u can omit the company code.
SELECT BELNR XBLNR AWKEY FROM BKPF
INTO TABLE L_I_BKPF_TEMP
PACKAGE SIZE 500
WHERE AWTYP = <......> "<------------
AND AWKEY IN L_R_AWKEY .
APPEND LINES OF L_I_BKPF_TEMP TO I_BKPF .
ENDSELECT .
Max -
Asset related question - How to add a record into table ANLC?
Hello experts,
Could anyone tell me how to add a record into table ANLC?
Thanks very much!
Christina.how you want add?
you want add direct in table???.
Normally if yo post any transaction this table will update.
ex;acquisition;
chandra -
FK01: Vendor Master Record Validation Table is not maintained
Hi Experts,
Appreciate your help on this matter: I have created a new Vendor Account Group and tried to used it. However, upon saving I encountered problem: error message Vendor Master Record Validation Table is not maintained. Do I missed some configuration?
Thank you very much!Hi,
STEP 3 : In Financial accounting > A/R A/P > Business Transactions > Outgoing payments > Manual Outgoing payments >
Define Tolerance (Vendors)
STEP 4 : Create a GL A/c Creditors in FS00 as a balance sheet a/c and in control tab give reconciliation type as Vendors
and Field Status Group G067. Assign this account in company code data in FK02.
Regards,
Sadashivan -
Add records in table ACCESS from labview by ActiveX
I try to add records in table of database ACCESS by an ActiveX from labview but my programme doesn't work ...
What is the problem ?
I have attached my VI
Thanks in advance
hasna
Attachments:
base1.vi 35 KBOn Thu, 11 Jul 2002 08:13:48 -0700 (PDT), Lab Viewer
wrote:
>I saw your previous posts related to ActiveX/Access. I once had the
>same kind of problems. It's not an easy task (without a toolkit)
>because you have to learn the "interface" provided by Access/DAO in
>order to manage what you are trying to do.
>In my case, the best solution it was to follow the Visual Basic for
>Applications examples included in MS Access. Even though you don't
>know VB, don't be afraid. Important is to figure out from that example
>what methods/properties you need to use, the proper order to call them
>and eventually some parameters. You are dealing with the same
>methods/properties in LabVIEW, the difference is that you have them in
>a graphical format instead of text
.You can find these examples by
>going to MS Access help > Index and type DAO objects and then choose
>one to start with (Database, recordset, field =85).
>
>Hope this helps
The examples on NI's website were originally written using the DAO
model, but the latest one was written using the ADO model.
However, I am unable to find either example LLBs on their website
anymore. Maybe they're trying to push their SQL Toolkit.
Along with the VBA help in MS Access, I *highly* recommend the book
ADO Programming for Dummies. Wonderful book. Helped me understand the
VBA help. :-)
Again, if anyone is intersted in VIs using ActiveX that works. He/she
is welcome to email me.
Linda -
Duplicate records in TABLE CONTROL
Hi folks,
i am doing a module pool where my internal table (itab) data is comming to table ontrol(ctrl).then i need to select one record in table control & then i press REFRESH push button.
after putting the refresh button, some new records are comming to that same internal table.then i need to display the modified internal table (some new records are added) data in the table control.
The modified internal table data is comming to the table control but to the last of table control, some records are repeating.
before comming to table control, i checked the modified itab. it contains correct data.i.e it contains 15 records.(previously i have 5 records.after REFRESH button 10 more records are added.). but when this table is comming to table control, it contains some 100 record.i should get only 15 record.
why these records r repeting. how to delete the duplicate records from table control?
plz suggest me where i am doing mistake.
correct answer will be rewarded
Thanks & RegardsHi ,
Thanks for ur help. but i should not refresh the internal table as some records r already present.after putting the REFRESH button, some new records r appending to this existing table.then i am going to display the previous records & the new records as well.
i checked the internal table after modification.it contains actual number of records. but after comming to table control , more records r comming.
is this the problem with scrolling or waht?
plz suggest where i am doing mistake.i am giving my coding below.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0200.
module tc_shelf_change_tc_attr.
loop at object_tab1
with control tablctrl
cursor tablctrl-current_line.
module tc_shelf_get_lines.
endloop.
PROCESS AFTER INPUT.
module set_exit AT EXIT-COMMAND.
loop at object_tab1.
chain.
field: object_tab1-prueflos,
object_tab1-matnr.
module shelf_modify on chain-request.
endchain.
field object_tab1-idx
module shelf_mark on request.
endloop.
module shelf_user_command.
module user_command_0200.
***INCLUDE Y_RQEEAL10_STATUS_0200O01 .
*& Module STATUS_0200 OUTPUT
text
MODULE STATUS_0200 OUTPUT.
SET PF-STATUS 'MAIN'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0200 OUTPUT
*& Module tc_shelf_change_tc_attr OUTPUT
text
MODULE tc_shelf_change_tc_attr OUTPUT.
delete adjacent duplicates from object_tab1 comparing prueflos matnr.
describe table object_tab1 lines tablctrl-lines.
ENDMODULE. " tc_shelf_change_tc_attr OUTPUT
*& Module tc_shelf_get_lines OUTPUT
text
MODULE tc_shelf_get_lines OUTPUT.
data: g_tc_shelf_lines like sy-loopc.
if tablctrl-current_line > tablctrl-lines.
stop.
endif.
g_tc_tablctrl_lines = sy-loopc.
*refresh control tablctrl from screen 0200.
ENDMODULE. " tc_shelf_get_lines OUTPUT
***INCLUDE Y_RQEEAL10_SHELF_MODIFYI01 .
*& Module shelf_modify INPUT
text
MODULE shelf_modify INPUT.
modify object_tab1
index tablctrl-current_line.
ENDMODULE. " shelf_modify INPUT
*& Module set_exit INPUT
text
module set_exit INPUT.
leave program.
endmodule. " set_exit INPUT
*& Module shelf_mark INPUT
text
MODULE shelf_mark INPUT.
data: g_shelf_wa2 like line of object_tab1.
if tablctrl-line_sel_mode = 1
and object_tab1-idx = 'X'.
loop at object_tab1 into g_shelf_wa2
where idx = 'X'.
g_shelf_wa2-idx = ''.
modify object_tab1
from g_shelf_wa2
transporting idx.
endloop.
endif.
modify object_tab1
index tablctrl-current_line
transporting idx plnty plnnr plnal.
ENDMODULE. " shelf_mark INPUT
*& Module shelf_user_command INPUT
text
MODULE shelf_user_command INPUT.
ok_code = sy-ucomm.
perform user_ok_tc using 'TABLCTRL'
'OBJECT_TAB1'
changing ok_code.
sy-ucomm = ok_code.
ENDMODULE. " shelf_user_command INPUT
*& Module user_command_0100 INPUT
text
MODULE user_command_0200 INPUT.
data:v_line(3).
case OK_CODE.
when 'LAST'.
read table object_tab1 with key idx = 'X'.
if sy-subrc = 0.
select * from qals
where enstehdat <= object_tab1-enstehdat
and plnty ne space
and plnnr ne space
and plnal ne space.
if sy-dbcnt > 0.
if qals-enstehdat = object_tab1-enstehdat.
check qals-entstezeit < object_tab1-entstezeit.
move-corresponding qals to object_tab2.
append object_tab2.
else.
move-corresponding qals to object_tab2.
append object_tab2.
endif.
endif.
endselect.
sort object_tab2 by enstehdat entstezeit descending.
loop at object_tab2 to 25.
if not object_tab2-prueflos is initial.
append object_tab2 to object_tab1.
endif.
clear object_tab2.
endloop.
endif.
when 'SAVE'.
loop at object_tab1 where idx = 'X'.
if ( not object_tab1-plnty is initial and
not object_tab1-plnnr is initial and
not object_tab1-plnal is initial ).
select single * from qals into corresponding fields of wa_qals
where prueflos = object_tab1-prueflos.
if sy-subrc = 0.
wa_qals-plnty = object_tab1-plnty.
wa_qals-plnnr = object_tab1-plnnr.
wa_qals-plnal = object_tab1-plnal.
update qals from wa_qals.
if sy-subrc <> 0.
Message E001 with 'plan is not assigned to lot in sap(updation)'.
else.
v_line = tablctrl-current_line - ( tablctrl-current_line - 1 ).
delete object_tab1.
endif.
endif.
endif.
endloop.
when 'BACK'.
leave program.
when 'NEXT'.
call screen 300.
ENDCASE.
***INCLUDE Y_RQEEAL10_USER_OK_TCF01 .
*& Form user_ok_tc
text
-->P_0078 text
-->P_0079 text
<--P_OK_CODE text
form user_ok_tc using p_tc_name type dynfnam
p_table_name
changing p_ok_code like sy-ucomm.
data: l_ok type sy-ucomm,
l_offset type i.
search p_ok_code for p_tc_name.
if sy-subrc <> 0.
exit.
endif.
l_offset = strlen( p_tc_name ) + 1.
l_ok = p_ok_code+l_offset.
case l_ok.
when 'P--' or "top of list
'P-' or "previous page
'P+' or "next page
'P++'. "bottom of list
perform compute_scrolling_in_tc using p_tc_name
l_ok.
clear p_ok_code.
endcase.
endform. " user_ok_tc
*& Form compute_scrolling_in_tc
text
-->P_P_TC_NAME text
-->P_L_OK text
form compute_scrolling_in_tc using p_tc_name
p_ok_code.
data l_tc_new_top_line type i.
data l_tc_name like feld-name.
data l_tc_lines_name like feld-name.
data l_tc_field_name like feld-name.
field-symbols <tc> type cxtab_control.
field-symbols <lines> type i.
assign (p_tc_name) to <tc>.
concatenate 'G_' p_tc_name '_LINES' into l_tc_lines_name.
assign (l_tc_lines_name) to <lines>.
if <tc>-lines = 0.
l_tc_new_top_line = 1.
else.
call function 'SCROLLING_IN_TABLE'
exporting
entry_act = <tc>-top_line
entry_from = 1
entry_to = <tc>-lines
last_page_full = 'X'
loops = <lines>
ok_code = p_ok_code
overlapping = 'X'
importing
entry_new = l_tc_new_top_line
exceptions
others = 0.
endif.
get cursor field l_tc_field_name
area l_tc_name.
if syst-subrc = 0.
if l_tc_name = p_tc_name.
set cursor field l_tc_field_name line 1.
endif.
endif.
<tc>-top_line = l_tc_new_top_line.
endform. " COMPUTE_SCROLLING_IN_TC
Thanks -
How to save the selected records from Table control in dialog programming
Hiiiiiiii Every1
Actually the problem is like this:-
I have to select some records from table control and then want to save the selected records in DB table.
Example
I have some rows having inforamtion bout employees...
Now what i want is that when i click on 'SAVE' button then these selected rows should be moved into DB table.
Sachin Dhingrasee below example, I have added INSERT option after DELETE option.
REPORT demo_dynpro_tabcont_loop_at.
CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
DATA cols LIKE LINE OF flights-cols.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
DATA: itab TYPE TABLE OF demo_conn.
TABLES demo_conn.
SELECT * FROM spfli INTO TABLE itab.
LOOP AT flights-cols INTO cols WHERE index GT 2.
cols-screen-input = '0'.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
CALL SCREEN 100.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE read_table_control INPUT.
MODIFY itab FROM demo_conn INDEX flights-current_line.
ENDMODULE.
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'TOGGLE'.
LOOP AT flights-cols INTO cols WHERE index GT 2.
IF cols-screen-input = '0'.
cols-screen-input = '1'.
ELSEIF cols-screen-input = '1'.
cols-screen-input = '0'.
ENDIF.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
WHEN 'SORT_UP'.
READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
IF sy-subrc = 0.
SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
cols-selected = ' '.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDIF.
WHEN 'SORT_DOWN'.
READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
IF sy-subrc = 0.
SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
cols-selected = ' '.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDIF.
WHEN 'DELETE'.
READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
IF sy-subrc = 0.
LOOP AT itab INTO demo_conn WHERE mark = 'X'.
DELETE itab.
ENDLOOP.
ENDIF.
WHEN 'INSERT'.
READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
IF sy-subrc = 0.
LOOP AT itab INTO demo_conn WHERE mark = 'X'.
itab1 = itab.
modify itab1.
ENDLOOP.
ENDIF.
if not itab1 is initial.
INSERT dbtab FROM TABLE itab1.
endif.
ENDCASE.
ENDMODULE. -
How to copy the table1selected records into table 2 in webdynpro java.
Hi
how to copy the table1selected records into table 2 in webdynpro java.
venkat
Edited by: venkatpvr on Sep 23, 2011 11:53 AMHi Venkat,
You have 2 Value Nodes one for Table1 and second for Table2.
Table1 node having one more Value Attribute i.e check Box data type is Boolean. Now you are requirement are select records from Table1 Node and click on One Method that records will moves to Second Table2 Node.
Create One Method for getting the Records from 1-Table to 2-Table
CopytoTable2 ()
In this method you have to write code like this
If (wdContext.nodeTable1.Checkbox(true))
If(1. Check the Table1 Value Node Size()>0)
Get the Table1 records and set to table2 Value node.
Else
Please select check box// Error message
Hope this helps!!
Regards
Vijay K
Maybe you are looking for
-
Can I get rid of Exchange with the new Server just released?
Hi, I saw the new 8 core machine and all the programs. I also recieved an email from Apple telling me about all the calendaring it has. I want to get rid of Exchange. I have Outlook on 99.9% the clients, however, and they're not going to get rid of W
-
How do I register as a developer in the Online Source System?
Im trying to add an ABAP program to SAP BW, and I get this message: You are not registered as a developer. Please register in the Online Source System (OSS). In the OSS you will receive an access key. I have no idea what this means. How do access
-
Every time I try to open any of the programs in my CC suite, it makes me try to sign in, then another window opens that tells me to press "continue" to begin working, but when I do this, the FIRST dialog box appears AGAIN. I can't even read a PDF wit
-
hi dear all pl go through with following details IT IS OBSERVED THAT USERS ARE CREATING DOUBLE GR WITH SAME DC NUMBER, CAN WE PROVIDE , D.C. NO VALIDATION FOR GR PREPARATION . Thanks in Advance deb
-
Rendering reduces image quality. Confused
I'm working in P Pro 7.1 with GH3 footage shot 72mbps/All-intra MOV files. I made a sequence from a clip (settings posted below). A clip in the sequence has the yellow render bars and plays back very nicely. But if I render it, a whole bunch of artif