Using ZIF_EXCEL_READER~LOAD to create ZCL_EXCEL_READER_2007 object
Hello ZIP, Excel and ABAP2XLSX-Experts,
I'd like to convert a given Excel-File (.xls) which has been uploaded to the DMS in SAP-DB-Tables (like DRAW etc.) via transaction CV01n to an excel_reader_2007 object.
After that I'll hopefully be able to address the excel-object and insert my report-data into the right cells given by that template.
I've managed it to that point, where I've already read the content of the file (type: xstring) in my excel class with this method:
me->mv_content = me->raw_to_xstring( input = lt_orblk ).
After that I try to instanciate an excel_reader_2007-class:
CREATE OBJECT lo_excel_reader TYPE zcl_excel_reader_2007.
co_excel = lo_excel_reader->zif_excel_reader~load(
me->mv_template_xstring ).
In this load-interfacemethod the ixml is beeing drawn from a zip-archive - whatever it's doing here with the rels thing:
me->excel2007 = i_excel2007.
rels = me->get_ixml_from_zip_archive( '_rels/.rels' ).
This method calls immediately the next method: get_from_zip_archive.
content = me->get_from_zip_archive( i_filename ). "_rels/.rels
And then, in this method a zip-object is created and loaded.
CREATE OBJECT me->zip. "CL_ABAP_ZIP
zip->load(
EXPORTING
zip = me->excel2007
I think this load-method is already the troublemaker:
In the line 75 nothing is done, because the offset is 0, maxlength = 3601404 and zip+offset(4) = 'D0CF11E0' and never '504B0304'
WHILE offset < max_length AND zip+offset(4) = '504B0304'. " local file header signature
file_no = file_no + 1.
APPEND INITIAL LINE TO files ASSIGNING <file>.
APPEND INITIAL LINE TO exts ASSIGNING <ext>.
But the zip->load( me->excel2007 ) runs without exception but the table 'Files' will not be filled. That's the crux because in the next ZIP-method in method get_from_zip_archive will be tried to read the zip-files:
zip->get(
EXPORTING
name = i_filename
IMPORTING
content = r_content " Contents
And here, the read from table files fails of course with the raise of zip_index_error.
IF index IS INITIAL.
READ TABLE files TRANSPORTING NO FIELDS WITH KEY name = name.
IF sy-subrc IS NOT INITIAL.
RAISE zip_index_error. "#EC RAISE_OK
ENDIF.
index = sy-tabix.
ENDIF.
Now, can anybody tell me, how I get my xstring - content successfully transferred to ZIP or that ZCL_EXCEL_READER_2007 class.
What went wrong?
Is it possible that it has got to do with the installation of the frontend or that the xls is maybe 2002 Version?`
It doesn't help to save it as .xml. I already tried it.
I would appreciate some help!
Version of the System is ECC 6.0, SAP-Basis 7.31, ABAP2XLSX-Version 5.0 (doesn't work with the change to 7.0, too - already tried it)
Solved: The Version of the .xls-template in the DMS (document management system) was Excel 2002.
I uploaded a Excel 2010 version in the DMS and then it worked.
Having a 2002 Excel version always creates a local header with the zip+offset(4) =
'D0CF11E0' .
Similar Messages
-
Using a variable while creating an object
I have 8 buttons called b0 to b8
Button b0 = new Button (frame, 10, 10, 50, 50,"",'0');
Button b1 = new Button (frame, 70, 10, 50, 50,"",'1');
Button b2 = new Button (frame, 130, 10, 50, 50,"",'2');
Button b3 = new Button (frame, 10, 70, 50, 50,"",'3');
Button b4 = new Button (frame, 70, 70, 50, 50,"",'4');
Button b5 = new Button (frame, 130, 70, 50, 50,"",'5');
Button b6 = new Button (frame, 10, 130, 50, 50,"",'6');
Button b7 = new Button (frame, 70, 130, 50, 50,"",'7');
Button b8 = new Button (frame, 130, 130, 50, 50,"",'8');Rather then create them seperately a for loop would make more sense I think. Something like
for (int i = 0; i < 9; i++) {
int x = (i % 3) * 60 + 10;
int y = (i / 3) * 60 + 10;
Button "b"+i = new Button (frame, x, y, 50, 50,"",i);
}But I cant make this work, what am I doing wrong.
ThanksVariable names don't mean much in Java. Certainly you can't do operations on them like
Button "b"+iBut your buttons do form a sort of group or unit - they are geometrically related for one thing. What you need to do is create an object that represents this group.
Try using an array.
Declare an array of 9 buttons. Then you can use a for loop much like you have. But instead of talking about "b"+i, you would talk about b.
Anything you were doing before with b2 you can still do - by referring to that Button as b[2]. -
Use of RSSM to create authorization objects
I have a few questions on the way of using authorization objects via RSSM.
First, i would like to know if there is a limit in the number of values used as a filter in the authorisation object.
First, what is the quantity limit of values that we can use as filter? CC00000010, CC00000011, CC00000012, ..., n. In this case what would be the value of n. In our fonctionnal need, ranges of values would not be an option.
My second question is in relation with the use of an authorization object composed of two characteristics. Is there a way to build a case in witch the authorization check return a positive answer to a logical OR between the two characteristics?
Example 2, lets say that you want to perform an authority check on the cost center OR on the profit centre. Is there a way to build the authorization object to make sure that there is no error messages when the user has the authorization for the cost center CC00000010 OR the profit center PF00000011.
Best regards,
Stéphane Beaudoinwhy would you use Pages when there are templates in iweb
as for the URL question, that is determined by the host, not iweb which just writes the page. but I would not use tinyurl since it has become a favorite of phishers and other web nasties. it might be worth getting a domain name if you can find a good deal.
i would search for some realtor sites to see the kinds of information they are giving and how they are laying it out. and make sure that all photos look really really good. nothing is more off putting on a house ad than crappy photos -
How & where to use Java script to create new button in object detail page
Hi All,
I want to create "New/Add button" in object detail page. If i am not wrong i need to use java script for that but could you please let me know how & where to use Java script to create new button in object detail page in CRMOD.
Thanks in advance.
Regards,
ManishAny related object on the detail page should have an "Add" or "New" or both buttons by default - This is vanilla functionality and will do the required action.
If you want to modify this behaviour and do something tricky you will potentially have to go for javascript. You should add the javascript on a custom web tab on that Object.
Admin --> Application Customization --> Contact -->Contact Web Applet
Now, add your javascript in the code area, after you select the type = HTML for this web applet, expose this web applet on the Contact detail layout and your javascript will be invoked whenever this page is loaded.
Check this online document to see how javascript can be embedded in CRM on Demand http://helponmyproject.com/TTOCOD/
Cheers!
Royston -
It seems you cannot clone objects with attributes using lazy loading in JPA
I have an entity with an attribute using lazy loading:
@Entity
public class B {
@ManyToOne(fetch=FetchType.LAZY)
private A a;
@Entity
public class A {
Assume the following code:
A a1 = new A();
A a2 = new A();
B b1 = EntityManager.find(B.class, ...);
b1.setA(a1);
B b2 = b1.clone();
b2.setA(a2);
Now with lazy loading enabled I get b1.getA() == a2 instead of b1.getA() == a1. Moreover, the debugger displays the same value holder in b1 and b2 for the attribute a. It appears as if cloning does not make a (deep) copy of the value holder managing the attribute a.
How can I create a copy b2 of b1, such that the value holder managing a in b1 is a different object as the value holder managing a in b2?
Thanks, Thomas.I have filed a bug to have this addressed in Oracle TopLink 11gR1. I would recommend you file a bug against TopLink Essentials in GlassFish or if you have a support contract report the issue to metalink to have the issue resolved.
If this is urgent I did try fixing the issue with a small helper method using some reflection. This method is simplified through its throwing of Exception. If you wish to use something like this I would recommend proper error handling.
* Helper method for cloning an entity and fixing the woven value-holders to
* complete a proper shallow cloning.
public static Employee clone(Employee entity) throws Exception {
Employee clone = entity.clone();
// Now fix the cloned ValueHolder references
Field[] fields = entity.getClass().getDeclaredFields();
for (int index = 0; index < fields.length; index++) {
Field field = fields[index];
if (field.getName().startsWith("_toplink_")) {
field.setAccessible(true);
ValueHolderInterface vhi = (ValueHolderInterface)field.get(entity);
Object value = vhi.isInstantiated() ? vhi.getValue() : null;
field.set(clone, new ValueHolder(value));
return clone;
}Doug -
Using PHP Data Services to create an object and accessing that objects data in an unbound way in AS
Hello,
I've been able to use the php data services and bind the results of a function to a component. However I am having a hard time figuring out the syntax to use the data services to create an object out of the results, and then use that object as an array of filenames to provide the current index of the filename to a new sound object.
My problem is obviously in not being able to figure out the specific syntax, I have declared the service and and object of the services returned type and in the creationComplete() function I have assigned object.token = service.getData();
I've tried various ways of then pulling that data out of the object, with no success.
Can someone point me in the right direction?
This code probably looks horrible because it doesn't work yet.
- Joel
import flash.media.Sound;
import flash.media.SoundChannel;
import mx.controls.Alert;
var playing:Sound = new Sound();
var channel:SoundChannel = new SoundChannel();
var sndIndex:int=0;
var skpTr:String;
public function init():void{
mp3Array.token = mp3service.getData();
currentTrack(mp3Array.lastResult.filename);
trace(mp3Array.lastResult.filename[sndIndex]);
public function currentTrack(t:String):void{
playing = new Sound();
playing.load(new URLRequest("mp3/" +t));
public function skip():void{
stop();
if (sndIndex != mp3Array.lastResult.length-1){
sndIndex++;
var skipTr:String=mp3Array.lastResult.filename[sndIndex].data;
currentTrack(skipTr);
play();
} else {
sndIndex=0;
skipTr=mp3Array.lastResult.filename[sndIndex].data;
currentTrack(skipTr);
play();
public function stop():void{
channel.stop();
public function play():void{
channel = playing.play();
<fx:Declarations>
<s:CallResponder id="mp3Array"/>
<mp3services:Mp3Service id="mp3service" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>Hello Joel;
In retrieving your data - what is your php returning to FB, an object, object array, an array? Either way, I have a brief example below that an object(s) is being returned. Pull the data from the lastResult in a ResultEvent. The object instantiated in the resultEvent will contain your data and you can do what you want from there.
Also, I always use Network Monitor to see what data (if any) is being returned from the server, you can also see how it is being sent back.
John
private function init():void
mp3Array.token = mp3service.getData();
mp3Array.addEventListener(FaultEvent.FAULT, faultHandler);
mp3Array.addEventListener(ResultEvent.RESULT, mp3Array_resultHandler);
protected function faultHandler(event:FaultEvent):void
Alert.show("There was a fault error!" + event.message, "Fault Error", Alert.OK);
protected function mp3Array_resultHandler(event:ResultEvent):void
// Not sure if your service is sending back an object or an array or ?
var info:Object = mp3Array.lastResult;
doSomeFunction(info)
protected function doSomeFunction(data:Object):void
trace(info.filename); -
Loading a tree of objects from a cache in a single call using an aggregator
Hi,
I currently have the following problem. I am trying to load a tree of objects from coherence by recursing up an object tree from a child object.
What is currently in place is something like this (not actual implementation).
Child child...// initialisation of Child;
List<Parent> parents = new LinkedList<Parent>();
Parent parent = null;
int parentId = child.getParentId();
while (true) {
parent = cache.get(parentId);
if (parent != null) {
parents.add(parent);
parentId = parent.getParentId();
} else {
break;
However, this results in a number of calls over the network to the coherence cache and is proving to be quite inefficient. What I would like is to be able to write something like a filter or an aggregation function which will simply take in the child, or the parent id of the child, and return a list of all the parents (with the recursion logic taking place on the coherence node). This will hopefully reduce network latency considerably.
Does anybody know how to go about doing this within coherence?XML might be a better solution, but using tags should work.
The Sun tutorial at http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPTags5.html#68205 should be helpful to you.
When processing a tag, determine if there is a parent tag by using getParent() or findAncestorWithClass().
If there is no parent, instantiate your site navigation object based on the tag arguments and save a reference within the tag object. You'll probably want to also add the reference to page or session scope as an attribute for later use.
If there is a parent, instantiate the new navigation object and then retrieve the parent navigation object from the parent tag (create a getNavigation() method in tag?). Then add the new navigation object to the array in the parent navigation object. -
Slow creating ReportDocument object and loading report
Hi all,
I realise this question has come up several times before, I've been searching the internet and have found similar problems but non that match my own. Sorry this is a little long winded but I would like to give as much detail as possible.
I use CR 2008 and VS2010 on my development machine. And I have installed CR 2008 Redist SP3 on the production server.
My application is a simple console application accepting parameters such as report name, print or export, and of course the report parameters.
CrystalDecisions.CrystalReports.Engine.ReportDocument rptDoc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
rptDoc.Load(sParamDOC); //sParamDOC being the report name passed in via command line
It has to be like this because it integrates into an old system in the background. Of course it being like this means I can not pre-load dll's on application startup (as I've seen suggested several times).
All of this is in house, I'm an OU administrator and an administrator on the server. The server is only accessed via remote desktop and the OS is windows server 2003. I installed all of the neccesary software to make this work.
What is really puzzling me though is that when I use this program via command prompt, logged in as me, it creates the object and loads the report in a matter of seconds. Yet if anybody else runs it (even other administrators of the server) the program can take 30-60 seconds to create the ReportDocument object and the same again to load the report.
I initially only noticed this for the standard users, which was why I created another admin to test. I don't think it's a problem with the report design because it works quick for me. I read an article about this happening with reports created in Crystal version 9. So I tested with a report made from scratch in 2008 and still get the same result. I also read another article about default printers, 'dissociate printer' option is selected and locally the default printers are set to the same printer also.
Does anybody have any suggestions as to where I could look next?
I saw in another article some registry keys you can use to turn on logging for crystal reports, I want to do this but where does it put the log files?
Oh, one more thing the server orginally had redist 2.3 on when I noticed this issue, updating to SP3 (redist 3.3) if anything made it slower, and a little more inconsistant of load times.
Thanks
GavinI figured out what this was. I thought I would come back and post incase anyone else has the same issue... the reason it was slow for the other users is because they could not access the internet. My program doesn't use the internet but the operating system is automatically trying to verify the dll's publishers. you can disable this see the following blog:
[http://blogs.msdn.com/b/amolravande/archive/2008/07/20/startup-performance-disable-the-generatepublisherevidence-property.aspx|http://blogs.msdn.com/b/amolravande/archive/2008/07/20/startup-performance-disable-the-generatepublisherevidence-property.aspx]
Regards
Gav -
When I try to open an embedded PDF file (Word doc) I get an error "The program used to create this object is AcroExch.exe. That program is either not installed on your computer, or is corrupt..." I've tried about everything from unchecking
protected mode at startup to removing & reinstalling Adobe. Nothing seems to fix this issue. Any other ideas?
This is happening on Adobe reader 9, 10 & 11 with MS Word 2010 & 2013. I've uninstalled, cleaned & reinstalled Reader 9, 10 & 11, as well as Acrobat 10 Pro & 11 Standard. Removed "Protected mode at startup, and changed
the default program for viewing from reader to Acrobat. This will not go away. It is affecting production at our company." Help > Troubleshooting Information > Profile Directory: Open Containing Folder" . i can't find open containing folder in profile directory. it does give me the option to open the places.sqlite file using graphic converter. when i try that, graphic converter gives me a window saying that it can't be opened because it is corrupted or is not a file type supported by graphic converter.
i appreciate your help with a workaround to get the old bookmarks. that works. however, the problem has morphed from that concern to why adobe reader [the default app.] won't open firefox .sqlite files. is the problem in adobe reader or firefox? also, how can i tell if the places.sqlite file is corrupt?
i'm getting in over my head here and do appreciate your help. -
Not able to create an object using dbms_metadata.put function
Hi,
I have the metadata of an object in one of my database table as xml. I failed to recreate the object in the other schema using metadata api. I developed a stored function to do the above job. My function doesn't throw any error meanwhile it doesn't create the object.
My code snippet is
CREATE OR REPLACE PROCEDURE DDI.move_table(
table_name in VARCHAR2,
from_schema in VARCHAR2,
to_schema in VARCHAR2 )
AUTHID CURRENT_USER
IS
-- Define local variables.
h1 NUMBER; -- handle returned by OPEN
h2 NUMBER; -- handle returned by OPENW
th1 NUMBER; -- handle returned by ADD_TRANSFORM for MODIFY
th2 NUMBER; -- handle returned by ADD_TRANSFORM for DDL
xml XMLTYPE; -- XML document
errs sys.ku$_SubmitResults := sys.ku$_SubmitResults();
err sys.ku$_SubmitResult;
result BOOLEAN;
BEGIN
SELECT REPOS INTO xml from ddi.ddi_repos_t where obj_id = '1801';
-- Specify the object type using OPENW (instead of OPEN).
h2 := DBMS_METADATA.OPENW('TABLE');
-- First, add the MODIFY transform.
th1 := DBMS_METADATA.ADD_TRANSFORM(h2,'MODIFY');
-- Specify the desired modification: remap the schema name.
DBMS_METADATA.SET_REMAP_PARAM(th1,'REMAP_SCHEMA',from_schema,to_schema);
-- Now add the DDL transform so that the modified XML can be
-- transformed into creation DDL.
th2 := DBMS_METADATA.ADD_TRANSFORM(h2,'DDL');
-- Call PUT to re-create the object.
result := DBMS_METADATA.PUT(h2,xml,0,errs);
DBMS_METADATA.CLOSE(h2);
IF NOT result THEN
-- Process the error information.
FOR i IN errs.FIRST..errs.LAST LOOP
err := errs(i);
FOR j IN err.errorLines.FIRST..err.errorLines.LAST LOOP
dbms_output.put_line(err.errorLines(j).errorText);
END LOOP;
END LOOP;
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR(-20510,'No xml is available as metadata');
END;
Could you tell me where is the probelm?
The schema where i created and execute my function having dba privilege also.
Regards,
Madhavi.Hi Madhavi,
The below code works for me:
SQL> conn sys as sysdba
Connected.
SQL> select count(*) from dba_objects where object_name = 'DEPT' and owner = 'OE';
COUNT(*)
0
SQL> CREATE OR REPLACE PROCEDURE move_table(
2 table_name in VARCHAR2,
3 from_schema in VARCHAR2,
4 to_schema in VARCHAR2 )
5 AUTHID CURRENT_USER
6 IS
7 -- Define local variables.
8 h1 NUMBER; -- handle returned by OPEN
9 h2 NUMBER; -- handle returned by OPENW
10 th1 NUMBER; -- handle returned by ADD_TRANSFORM for MODIFY
11 th2 NUMBER; -- handle returned by ADD_TRANSFORM for DDL
12 xml clob; -- XML document
13 errs sys.ku$_SubmitResults := sys.ku$_SubmitResults();
14 err sys.ku$_SubmitResult;
15 result BOOLEAN;
16 BEGIN
17
18 select DBMS_METADATA.GET_XML('TABLE','DEPT','SCOTT') into xml from dual;
19
20 -- Specify the object type using OPENW (instead of OPEN).
21 h2 := DBMS_METADATA.OPENW('TABLE');
22
23 -- First, add the MODIFY transform.
24 th1 := DBMS_METADATA.ADD_TRANSFORM(h2,'MODIFY');
25
26 -- Specify the desired modification: remap the schema name.
27 DBMS_METADATA.SET_REMAP_PARAM(th1,'REMAP_SCHEMA',from_schema,to_schema);
28
29 -- Now add the DDL transform so that the modified XML can be
30 -- transformed into creation DDL.
31 th2 := DBMS_METADATA.ADD_TRANSFORM(h2,'DDL');
32
33 -- Call PUT to re-create the object.
34 result := DBMS_METADATA.PUT(h2,xml,0,errs);
35
36 DBMS_METADATA.CLOSE(h2);
37 IF NOT result THEN
38
39 -- Process the error information.
40 FOR i IN errs.FIRST..errs.LAST LOOP
41 err := errs(i);
42 FOR j IN err.errorLines.FIRST..err.errorLines.LAST LOOP
43 dbms_output.put_line(err.errorLines(j).errorText);
44 END LOOP;
45 END LOOP;
46 END IF;
47 EXCEPTION
48 WHEN NO_DATA_FOUND THEN
49 RAISE_APPLICATION_ERROR(-20510,'No xml is available as metadata');
50 END;
51 /
Procedure created.
SQL> exec move_table('DEPT','SCOTT','OE');
PL/SQL procedure successfully completed.
SQL> select count(*) from dba_objects where object_name = 'DEPT' and owner = 'OE';
COUNT(*)
1
SQL> spool off;The xml returned by the get_xml function contains the tablespace name and storage parameters of the schema in which the object is present.
Check these parameters for both your schemas. -
How do I create an object (Installation Fact) using a FM?
Hello all,
Is it possible to create an object (An Installation Fact to be more precise) using FM ISU_S_INSTLN_CHANGE ?
The x_auto structure is populated as follows :
x_auto~ factsfacts_autoiquant~operand : the new operand
x_auto~ factsfacts_autoiquant~season : blank
x_auto~ factsfacts_autoiquant~auto_use : blank
x_auto~ factsfacts_autoiquant~auto_insert : checked (i.e. X)
x_auto~ factsfacts_autoiquant~auto_merge : blank
The structure x_auto~ factsfacts_autoiquant~ivalue is populated as usual.
Ok Codes are correctly filled in : X and SAVE.
Nothing happens after the run? Any idea please ?
Your help is much appreciated.
Message was edited by: GA
Goharjou ardavan -
Graphics using graphic API are drawn below the loaded content created using Flash authoring tool
Here is my problem.
I am developing a Analog Dial component. Here , I am
extending UIComponent and loading a swf file generated using Flash
CS3 authoring tool ( the swf basically has the circle and needle)
and adding the loaded content as child of Dial class.
Next I use Graphics API to draw the major and minor ticks on
the dial.
As mentioned in the curveTo method of flash.display.Graphics
class documentation (
http://livedocs.adobe.com/flex/201/langref/index.html),
if you are using graphics api and also loading content created
using the flash authoring environment the vector graphics will be
drawn underneath the loaded content.
Well , Is there any way to make the graphics appear on top of
the loaded contents?It appears that this may be accomplished more easily if I do something similar to the StrobeMediaPlayback implementation. Looking at the StrobeMediaPlayback source code it looks like Adobe has done something a little different than their ControlBarPlugin, placing the controlbar and root media element inside separate MediaContainers and then adding those containers to the display list. Is this recommended over using the frameworks ParallelElements? If so, is communication between the control bar and root media element still a matter of just updating the target reference via metadata?
-
How to create an object of our own class by using Class.forName()??
how to create an object of our own class by using Class.forName()??
plzz anser my qustion soon..Class.forName does not create an object. It returns a reference to the Class object that describes the metadata for the class in question--what methods and fields it has, etc.
To create an object--regardless of whether it's your class or some other class--you could call newInstance on the Class object returned from Class.forName, BUT only if that class has a no-arg constructor that you want to call.
Class<MyClass> clazz = Class.forName("com.mycompany.MyClass");
MyClass mine = clazz.newInstance();If you want to use a constructor that takes parameters, you'll have to use java.lang.reflect.Constructor.
Google for java reflection tutorial for more details.
BUT reflection is often abused, and often employe when not needed. Why is it that you think you need this? -
Unable to create Entity objects for tables in TimesTen database using ADF
Hi,
I am not able to create Entity and View objects for tables in TimesTen database using ADF. I have installed TimesTen client on my machine.
I have created a database connection by using connection type as "Generic JDBC" and giving driver class and JDBC URL. I am attaching screen shot of the same.
I am right clicking on Model project and selecting New option after that I am selecting ADF Business components and in it I am selecting Business components from tables and there I am querying for tables.I am getting list of tables and when I am trying to create a Entity object from the table after clicking finish Jdev is closing by itself giving an error.
Can anyone please help me how to create Entity objects for tables using TimesTen as database.I might be missing some jars or the way I am creating connection might be wrong or any plugins required to connect to TimesTen.What is the actual error being given by Jdev? Are you sure that the JDBC connection is using the TimesTen JDBC driver JAR and not some other JDBC driver or the Generic JDBC/ODBC bridge?
Is ADF even supported with TimesTen?
Chris -
Use TYPE RECORD or Create Object TYPE to build Collection?
Hi All,
I need to pull in data from our ERP system via a DB Link to keep some of our Web Data up to date. I wasn't sure if I should pull the data into my collection by creating a TYPE RECORD or Creating an Object Type and fillng it that way. Is there a preferrable method?
Record:
TYPE ItemInventory IS RECORD (
ProductID Products.ProductID%TYPE,
Qty Products.QTY%TYPE);
Object:
Create Type ProdObj as Object(
ProductID Products.ProductID%TYPE,
QTY Products.QTY%TYPE);
Maybe both are suitable....wasn't sure.
Any suggestions/info is greatly apprecaited.
S
Edited by: ScarpacciOne on Feb 21, 2010 7:54 PMScarpacciOne wrote:
We have a complex view we use from our ERP system that allows us to pull all of our available inventory and update our website with that information. What I was thinking I would do is refactor the current procedures that are in place to update this information and pull that views information into a collection so that I could speed up the update process.The basic difference between the two is that one is a dumb record structure (similar to a C struct), whereas the other is an intelligent class (similar to a class definition in Java/C++). It can have methods and constructors.
The next major difference is that one can only be use in the PL language and not in SQL. The record struct is a PL data type definition. PL cannot provide SQL engine support for it.
On the other hand, the SQL type definition is supported by both the PL and SQL languages. This allows the type to be transparently used in both languages.
I usually prefer the SQL type definition approach in general, as it allows for more flexibility.
However, for pure collection processing in PL/SQL, there's very little to choose between the two approaches as they serve the exact same purpose - increasing performance by decreasing context switching between the PL and SQL engines.
So you need to look beyond mere bulk collection and bulk processing to decide on which approach to use. For example, a SQL type definition allows for a standard SQL projection from cursors, enabling PL/SQL code to be cursor agnostic (as each cursor, irrespective of the table(s) queried, returns the same object type). However, if the aim is simply to bulk collect from that specific cursor, then it is a lot simpler to use a PL record struct.
Maybe you are looking for
-
I joined a company that uses MacBook Air. Was laid off unexpectedly. In the haste, I failed to remove my iMessages from that computer before turning it in. My phone, and all other personal devices are Apple and receive my text messages. Short of
-
My left and right arrow on my wireless keyboard are not working. I've looked at the keyboard viewer and see that they do not highlight. What do I do now?
-
User is in team state but not in team summary - Cisco supervisor desktop
We have Cisco supervisor desktop where supervisor can see user in team state but not in team summary?? Any clue why is could be happening?? Any help is much appreciated Thanks!
-
Preview zoom button doesn't respect dock location?
When I open a PDF document (perhaps others, too) in Preview and zoom in, then press the zoom button (aka enlarge, the green button on the top left of the window), the window seems to zoom to a size which leaves room for the dock at the bottom ... but
-
Is there any FM / BAPI / BADI that does a similliar operation to HR_INFOTYPE_OPERATION for PD infotypes? Kindly help.