Generate Typed Datasets from Procs/Functions
I have a client with a DBA team that wants to use procs (or functions) to wrap all CRUD operations. They do not want any applications to be able to directly access tables.
Is there any way to have ODT generate a typed dataset based on any combination of proc/function/refcursor - anything other than a table itself?
Thanks!
Just an update on this, there seems to be some functionality along these lines, but I don't see anything in any of the documentation, and am not quite sure how it works.
Once I figured out (thanks to posts here) that I had to re-create my connections after installing the ODP.net beta, I suddently had the ability to drag a function from Server Explorer over to a blank dataset designer window. Upon configuring the generated table adapter, there are now options for stored procs, but there's a mapping/binding thing that I don't quite get in the case of an IN OUT param. It does, however seem to correctly derive the columns and data types in the ref cursor param that's being passed back.
So this thing is generating a typed dataset that mirrors a ref cursor in an out param. This is great news to me.
As no 'official' Oracle person has chimed in yet, my only concern is that this functionality is not fully implemented, or has some issues, and may go away at the end of the beta. Can anyone shed any light on this?
Similar Messages
-
Have problem when generate Web Service from bapi function
Dear all,
Please kindly help me about generating Web Service from BAPI function, It does not success only this attached function.
I have done so many function without any problems.
I found 1 case that I use specific variable to be an import/ export then, it can't create as well.
As for this one, I try so many changes but I can't success it as well.
This is my function on R/3 4.6C, Dot net connector 2.0, Dot net Frame Work 1.1.
FUNCTION Z_BAPI_ATTACHMENT_CREATE.
""Local interface: Type: Remote-enabled module
*" IMPORTING
*" VALUE(P_BOTYPE) LIKE BORIDENT-OBJTYPE
*" VALUE(P_BO_ID) LIKE BORIDENT-OBJKEY
*" VALUE(P_MSGTYP) LIKE SOFM-DOCTP
*" VALUE(P_DOCTY) LIKE BORIDENT-OBJTYPE
*" VALUE(P_RELTYP) LIKE BRELTYP-RELTYPE
*" VALUE(P_FNAME) LIKE RLGRAP-FILENAME
*" VALUE(P_OBJDES) TYPE SO_OBJ_DES
*" EXPORTING
*" VALUE(RETURNMESSAGE) TYPE CHAR50
INCLUDE : <cntn01>.
P_BOTYPE TYPE BORIDENT-OBJTYPE DEFAULT 'BUS2105'
P_BO_ID TYPE BORIDENT-OBJKEY
P_MSGTYPE TYPE SOFM-DOCTP DEFAULT 'URL'
P_DOCTY TYPE BORIDENT-OBJTYPE DEFAULT 'MESSAGE'
P_RELTYP TYPE BRELTYP-RELTYPE DEFAULT 'ATTA'
P_FNAME TYPE RLGRAP-FILENAME
P_OBJDES TYPE SO_OBJ_DES
TYPES: BEGIN OF ty_message_key,
foltp TYPE so_fol_tp,
folyr TYPE so_fol_yr,
folno TYPE so_fol_no,
doctp TYPE so_doc_tp,
docyr TYPE so_doc_yr,
docno TYPE so_doc_no,
fortp TYPE so_for_tp,
foryr TYPE so_for_yr,
forno TYPE so_for_no,
END OF ty_message_key.
DATA : lv_message_key TYPE ty_message_key.
DATA : lo_message TYPE swc_object.
DATA : lt_doc_content TYPE STANDARD TABLE OF soli-line
WITH HEADER LINE.
First derive the Attachment's ( MESSAGE )document type.
p_docty = 'MESSAGE'.
CASE p_reltyp.
In case of URls
WHEN 'URL'.
p_msgtyp = 'URL'.
In case of Notes / Private Notes
WHEN 'NOTE' OR 'PNOT'.
p_msgtyp = 'RAW'.
WHEN 'ATTA'.
Take given parameter e.g. 'DOC', 'PDF' etc.
P_MSGTYP = 'EXT'.
WHEN OTHERS.
....exit
EXIT.
ENDCASE.
Create an initial instance of BO 'MESSAGE' - to call the
instance-independent method 'Create'.
swc_create_object lo_message 'MESSAGE' lv_message_key.
define container to pass the parameter values to the method call
in next step.
swc_container lt_message_container.
Populate container with parameters for method
swc_set_element lt_message_container 'DOCUMENTTITLE' p_objdes.
swc_set_element lt_message_container 'DOCUMENTLANGU' 'E'.
swc_set_element lt_message_container 'NO_DIALOG' 'X'.
swc_set_element lt_message_container 'DOCUMENTNAME' p_docty.
swc_set_element lt_message_container 'DOCUMENTTYPE' p_msgtyp.
In case of URLs..it should be concatenated with &KEY& in the begining.
CASE p_msgtyp.
WHEN 'URL'.
lt_doc_content = '&KEY&http://www.rmtiwari.com' .
CONCATENATE '&KEY&' p_fname INTO lt_doc_content.
APPEND lt_doc_content.
In case of Notes or Private Notes, get the data from files on appl
server or from wherever(? - remember background).
WHEN 'RAW'.
lt_doc_content = p_fname.
APPEND lt_doc_content.
In case of PC File attachments
WHEN OTHERS.
OPEN DATASET p_fname FOR INPUT IN BINARY MODE.
IF sy-subrc EQ 0.
DO.
READ DATASET p_fname INTO lt_doc_content. "2 of 27
IF sy-subrc EQ 0.
APPEND lt_doc_content.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET p_fname.
ENDIF.
ENDCASE.
'DocumentContent' is a multi-line element ( itab ).
swc_set_table lt_message_container 'DocumentContent' lt_doc_content.
Size is required in case of File attachments
DATA : lv_doc_size TYPE i.
DATA : l_file_lines TYPE i.
DESCRIBE TABLE lt_doc_content LINES l_file_lines.
READ TABLE lt_doc_content INDEX l_file_lines.
lv_doc_size = ( 255 * ( l_file_lines - 1 ) ) +
STRLEN( lt_doc_content ).
swc_set_element lt_message_container 'DOCUMENTSIZE' lv_doc_size .
Refresh to get the reference of create 'MESSAGE' object for attachment
swc_refresh_object lo_message.
swc_call_method lo_message 'CREATE' lt_message_container.
Get Key of new object
swc_get_object_key lo_message lv_message_key.
Now we have attachment as a business object instance. We can now
attach it to our main business object instance.
Create main BO object_a
data: LO_IS_OBJECT_A type SIBFLPORB. "type SIBFLPORB is unknown, so I
DATA: lo_is_object_a TYPE borident.
lo_is_object_a-objkey = p_bo_id.
lo_is_object_a-objtype = p_botype.
LO_IS_OBJECT_A-CATID = 'BO'.
Create attachment BO object_b
data: LO_IS_OBJECT_B type SIBFLPORB. "type SIBFLPORB is unknown
DATA: lo_is_object_b TYPE borident.
lo_is_object_b-objkey = lv_message_key.
lo_is_object_b-objtype = p_docty.
LO_IS_OBJECT_B-CATID = 'BO'.
*TRY.
*CALL METHOD CL_BINARY_RELATION=>CREATE_LINK
EXPORTING
IS_OBJECT_A = LO_IS_OBJECT_A
IS_OBJECT_B = LO_IS_OBJECT_B
IP_RELTYPE = P_RELTYP.
CALL FUNCTION 'BINARY_RELATION_CREATE'
EXPORTING
obj_rolea = lo_is_object_a
obj_roleb = lo_is_object_b
relationtype = p_reltyp
EXCEPTIONS
OTHERS = 1.
Check if everything OK...who cares!!
COMMIT WORK.
if sy-subrc = 0.
RETURNMESSAGE = 'S-Success'.
else.
RETURNMESSAGE = 'E-Error'.
endif.
ENDFUNCTION.
Thanks in advance,
Benjawan
Edited by: Nitipat Chadchavalpanichaya on Oct 20, 2008 9:02 AMThere is no any error message show up. It just the class
Z_BAPI_ATTACHMENT_CREATE doesn't create autometically as normal. I showed you as below.
That means I can't call class z_bapi_attachment_create.
' <autogenerated>
' This code was generated by a SAP. NET Connector Proxy Generator Version 2.0
' Created at 21/10/2551
' Created from Windows
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </autogenerated>
Imports System
Imports System.Text
Imports System.Collections
Imports System.ComponentModel
Imports System.Runtime.InteropServices
Imports System.Xml.Serialization
Imports System.Web.Services
Imports System.Web.Services.Description
Imports System.Web.Services.Protocols
Imports SAP.Connector
'@ <summary>
'@ Client SAP proxy class
'@ </summary>
<WebServiceBinding(Name:="dummy.Binding", Namespace:="urn:sap-com:document:sap:rfc:functions")> _
Public Class PRAttachment
Inherits SAPClient
'@ <summary>
'@ Initializes a new PRAttachment.
'@ </summary>
Public Sub New()
End Sub
'@ <summary>
'@ Initializes a new PRAttachment with a new connection based on the specified connection string.
'@ </summary>
'@ <param name="connectionString">A connection string (e.g. RFC or URL) specifying the system where the proxy should connect to.</param>
Public Sub New(ByVal ConnectionString As String)
MyBase.New(ConnectionString)
End Sub
'@ <summary>
'@ Initializes a new PRAttachment and adds it to the given container.
'@ This allows automated connection mananged by VS component designer:
'@ If container is disposed, it will also dispose this SAPClient instance,
'@ which will dispose a contained connection if needed.
'@ </summary>
'@ <param name="Cont">The container where the new SAPClient instance is to be added.</param>
Public Sub New(ByVal Cont As Container)
MyBase.New(Cont)
End Sub
End Class -
Error while generating Web Service from a function module.
Hi Experts,
I am trying to create a web service from function module by doing the steps as mentioned in the below document:
http://www.sdn.sap.com/irj/scn/index;jsessionid=(J2EE3417800)ID1146834250DB10778842957931285337End?rid=/library/uuid/80fa3dff-ce76-2a10-3f94-f3df8f2db5a2&overridelayout=true
When i save it as an local object instead of generating the Web Service it gives me the below error:
"Error during activation of Web Service"
Kindly let me know what needs to be done inorder to resolve this issue.
I have a feeling that this error may be with respect to some authorizations, in that case how do we resolve it
Helpful Inputs Awaited.!!!
Thanks
DhwaniHi Dhawani,
Hi Pavan,
Can you please elaborate...how this will help??
Thanks
Dhwani
I dont know the specific reason but internally there may some inconsistancy but i faced the same error and i tried with saving it in the package.
Thanks -
Union dataset from oracle function with dataset from a postgres function
I retrieve two sets of data,
one from an oracle database using Command_1 select * from table(functionname(param1, param2))
one from postgres database using Command_2 select * from functionname(param1, param2)
i can join the two tables (Command_1 and Command_2) with database expert > links
I would like to know if it is possible to UNION the two setsDon't think so.
I have only done that by linking from Oracle to the other database and forming the union in Oracle.
Ian -
Getting a Sequence back from an S-P with typed DataSet problem
Hi,
I know there are loads of topics about sequences on this forum, but I can't seem to find this exact issue amongst them.
As a learning exercise, I've created a typed dataset based on the HR sample database tables Departments and Employees (through the use of the hack to get an OracleDataAdapter to generate typed datasets).
I currently have a problem with retrieving the new sequence value from the 'Insert_Department' stored procedure I've written, and the best thing I can figure is that there is a clash occurring between the type and size of the sequence and the size of the department_id column (number(4) - which maps in .Net to an int16).
The exception I get on running the dataAdapter.Update() method is:
Unable to cast object of type 'Oracle.DataAccess.Types.OracleDecimal' to type 'System.IConvertible'. Couldn't store <330> in DEPARTMENT_ID Column. Expected type is Int16
The record does get inserted into the database ok - therefore I infer that this is a problem with the handling of the return value back to the DepartmentsDataSet column.
My stored procedure is as follows:
PROCEDURE "INSERT_DEPARTMENT" (
"NEW_DEPARTMENT_ID" OUT DEPARTMENTS.DEPARTMENT_ID%TYPE,
"NEW_DEPARTMENT_NAME" IN VARCHAR2,
"NEW_MANAGER_ID" IN NUMBER,
"NEW_LOCATION_ID" IN NUMBER) IS
BEGIN
INSERT INTO DEPARTMENTS(DEPARTMENT_ID, DEPARTMENT_NAME, MANAGER_ID, LOCATION_ID)
VALUES (DEPARTMENTS_SEQ.NEXTVAL, NEW_DEPARTMENT_NAME, NEW_MANAGER_ID, NEW_LOCATION_ID);
SELECT DEPARTMENTS_SEQ.CURRVAL INTO NEW_DEPARTMENT_ID
FROM DUAL;
END "INSERT_DEPARTMENT";
I've tried lots of different things here; I started declaring the parameter as a NUMBER, now it's set to a %TYPE on the column as you can see... and I've also tried assigning the NEXTVAL to a NUMBER(4) local variable before assigning it to the OUT parameter.
Here's the C# that configures the insert command:
// Insert - note that department_id param is an output param
OracleCommand insert = new OracleCommand("odp_hr_dal.insert_department", connection);
insert.CommandType = CommandType.StoredProcedure;
insert.Parameters.Add(new OracleParameter("new_department_id", OracleDbType.Int16, 2, "department_id"));
insert.Parameters["new_department_id"].Direction = ParameterDirection.Output;
insert.Parameters.Add(new OracleParameter("new_department_name", OracleDbType.Varchar2, 30, "department_name"));
insert.Parameters.Add(new OracleParameter("new_manager_id", OracleDbType.Int32, 4, "manager_id"));
insert.Parameters.Add(new OracleParameter("new_location_id", OracleDbType.Int32, 4, "location_id"));
deptDataAdapter.InsertCommand = insert;
The key line is the adding of the "new_department_id" line where I have tried many different types in the vain hope that I can somehow override the conversion process to not think it needs to go as large as a Decimal type.
I wonder if anyone could help point me towards the (probably obvious) thing that I am missing? I've run out of ideas on things to try!
With Best Regards,
NijThank you muylaerk,
That did work.
However, this and the related link you posted raise a question: Given that (in the case of Decimal types) whichever of the DbType or OracleDbType property you set, the other value is set to Decimal also... what setting in the OracleParameter records which was the 'set' property, and therefore, which type will the Value be set to?
In other words, does anything visibly change in the debugger view of the OracleParameter type to see this?
Nij -
Generate a url from a report or function module
Hi,
I'm trying to generate a url from a report and tried using the function module WWW_ITAB_TO_HTML in the report program, as , but i'm not able to get the expected results. The code is given below. Could someone please try and help me resolve this issue. Thanks in advance.
DATA: emp_name TYPE char80.
DATA: it_itabex TYPE zdb_ex_tty,
it_emp TYPE TABLE OF zis_emp,
it_org TYPE TABLE OF zis_org,
it_pos TYPE TABLE OF zis_pos,
it_pos_alloc TYPE TABLE OF zis_pos_alloc,
it_res TYPE TABLE OF zis_res,
it_res_alloc TYPE TABLE OF zis_res_alloc,
ls_itabex TYPE zdb_ex_s.
DATA: lv_filename TYPE string,
lv_path TYPE string,
lv_fullpath TYPE string,
lv_replace TYPE i.
DATA qstring LIKE it_itabex OCCURS 10.
DATA: url(200), url2(200), url3(200), fullurl(200).
FIELD-SYMBOLS: <fs_emp> LIKE LINE OF it_emp,
<fs_org> LIKE LINE OF it_org,
<fs_pos> LIKE LINE OF it_pos,
<fs_pos_alloc> LIKE LINE OF it_pos_alloc,
<fs_res> LIKE LINE OF it_res,
<fs_res_alloc> LIKE LINE OF it_res_alloc.
** Report Program to export data from database to Excel.
** Populate all the tables that have to be exported.
SELECT * FROM zis_org INTO TABLE it_org.
SELECT * FROM zis_pos INTO TABLE it_pos.
SELECT * FROM zis_pos_alloc INTO TABLE it_pos_alloc.
SELECT * FROM zis_emp INTO TABLE it_emp.
SELECT * FROM zis_res_alloc INTO TABLE it_res_alloc.
SELECT * FROM zis_res INTO TABLE it_res.
** Append the Column Header
CLEAR ls_itabex.
ls_itabex-ipp_pos_id = 'IPP Pos ID'.
ls_itabex-emp_name = 'Name'.
ls_itabex-dt_of_join = 'JoinedOn'.
ls_itabex-emp_status = 'Status'.
ls_itabex-org_name = 'Org'.
ls_itabex-prj_name = 'Project'.
ls_itabex-mgr_name = 'Line'.
ls_itabex-designation = 'Designation'.
ls_itabex-specialization = 'Specialization'.
APPEND ls_itabex TO it_itabex.
** Append all the tables into one internal table
LOOP AT it_pos_alloc ASSIGNING <fs_pos_alloc>.
CLEAR ls_itabex.
ls_itabex-ipp_pos_id = <fs_pos_alloc>-ipp_pos_id.
READ TABLE it_emp ASSIGNING <fs_emp> WITH KEY emp_guid = <fs_pos_alloc>-emp_guid.
IF sy-subrc = 0.
CONCATENATE <fs_emp>-emp_fname <fs_emp>-emp_lname INTO ls_itabex-emp_name SEPARATED BY space.
ls_itabex-dt_of_join = <fs_emp>-dt_of_join.
ls_itabex-emp_status = <fs_emp>-emp_status.
ls_itabex-specialization = <fs_emp>-specialization.
ENDIF.
READ TABLE it_pos ASSIGNING <fs_pos> WITH KEY ipp_pos_id = <fs_pos_alloc>-ipp_pos_id.
IF sy-subrc = 0.
ls_itabex-designation = <fs_pos>-designation.
READ TABLE it_org ASSIGNING <fs_org> WITH KEY org_id = <fs_pos>-org_id.
IF sy-subrc = 0.
ls_itabex-org_name = <fs_org>-org_name.
ls_itabex-mgr_name = <fs_org>-mgr_name.
ENDIF.
ENDIF.
READ TABLE it_res ASSIGNING <fs_res> WITH KEY org_id = <fs_org>-org_id.
ls_itabex-org_name = <fs_org>-org_name.
APPEND ls_itabex TO it_itabex.
ENDLOOP.
url = 'http://testweb/scripts/wgate/zvw10a/!?~language=en'.
url2 = '&~OkCode(LGON)=LGON&login-login_user='.
url3 = '&vbcom-vbeln='.
CONCATENATE url url2 url3 INTO fullurl.
WRITE: /'Staffing Excel'.
CALL FUNCTION 'WWW_SET_URL'
EXPORTING
offset = 12
length = 10
func = fullurl
TABLES
query_string = qstring
EXCEPTIONS
invalid_table = 1
OTHERS = 2.
Thanks & Regards,
Preethi.Check the below example program :
data: begin of itab occurs 0,
matnr type mara-matnr,
mtart type mara-mtart,
matkl type mara-matkl,
groes type mara-groes,
end of itab.
data: ifields type table of w3fields with header line.
data: ihtml type table of w3html with header line.
select * into corresponding fields of table itab
from mara up to 100 rows.
call function 'WWW_ITAB_TO_HTML'
EXPORTING
TABLE_ATTRIBUTES = 'BORDER=1'
TABLE_HEADER =
ALL_FIELDS = 'X'
tables
html = ihtml
fields = ifields
ROW_HEADER =
itable = itab
check sy-subrc = 0.
call function 'GUI_DOWNLOAD'
exporting
filename = 'c:\test.html'
tables
data_tab = ihtml.
Reward points if it is helpful
Thanks
Seshu -
Derivate a waveform from a Function generator
I want to use the derivate of a waveform from a Function generator in a Formula node, but unfortunatelly I dont no how can i do this. I need the exact value of the derivate ("qpg" input variable) to use in the equation in the Formula Node.
I found a Derivate sub VI, but it gives me the derivate as a vector so i cant wire it as an input to the Formula node.
I attached pictures about my VI.As I understand it, you are using a Waveform Generator VI, and want (in addition to the Waveform) an additional output that is (an estimate of) the derivative of the Waveform.
If you consider the Waveform Generator as a "black box", something whose internals you don't know, but something that produces a new output every delta-t time increment (I'm going to call this "dt"), then you really do need to estimate the derivative. Note that since you cannot "predict the future", to estimate the derivative, you need the current data and previous data. One very common estimate for the derivative x'(t) at time t is (x(t) - x(t-dt))/dt, that is, the difference between the current point and the previous point, divided by the time increment. For a waveform generator, this will probably be a pretty good estimate, as the data should be relatively "smooth" and noise-free. Do note, however, that this estimate is really over the time interval t-dt and t, so you could consider it shifted backward in time by dt/2.
If you want a more accurate estimate of the derivative, one "centered" on the current time, t, then your formula needs to take into account not only the current value and past values but also future values. This is the reason many "derivative functions" use vectors, as this contains past and present values (with some worry about what to do at the beginning and end of the data).
On the other hand, if you are generating the data yourself (that is, if you have a VI that you input t and it outputs f(t)) and you have a "nice" function f (say a sinusoid or other non-random function), you can get the "exact" derivative just by programming it. For example, if f(t) = sin (omega * t), then f'(t) = omega * cos (omega * t).
Bob Schor -
I generated web service from function module.Where can I find .wsdl file ?
Hi,
I generated web service from function module.
Where can I find .wsdl file ?
I want to use .wsdl file in .Net application.
Thanks.Hii Cemil Bozlagan,
All Remote enabled Function Modules in Web AS 6.20 and Above are available as Webservices and the WSDL documents are available in the web service repository at
[http://<host>:<port>/sap/bc/bsp/sap/webservicebrowser/search.html]
Find the respective BAPI.
Click on the WSDL link in the browser and download the WSDL document and use it as per the requirement
Regards,
Varun -
Oracle ODP strongly typed dataset (runtime)
I am trying to use strongly typed Dataset Objects in my project but I seem to be missing something.
I created a class library project named DSCommon. I then used the Server Explorer to create an XML Schema of my Oracle table and then I generated a DataSet (http://www.developer.com/db/article.php/10920_3069061_2).
I then created a second windows application project and added a reference to DSCommon.
I have one text box, navigation buttons, and a command button on the form. I have tried the following code but I do not seem to have the benefits of a strongly typed dataset - I cannot do anything like txtPlaneType.text = ds.PlaneTypes[0].planedesc.
(I added a reference to Oracle.DataAccess to the windows app. project.)
<code>
Imports Oracle.DataAccess.Client
Imports DSCommon
Public Class Form1
Inherits System.Windows.Forms.Form
Dim conn As New OracleConnection
Dim cmPlaneTypes As CurrencyManager
Private Sub connectDatabase()
conn.ConnectionString = "User id=username;Password=password;Data Source=server.com;"
Try
conn.Open()
Catch ex As Exception
Throw ex
End Try
End Sub
Private Sub closeDatabase()
conn.Close()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Try
Me.connectDatabase()
Dim planeTypeAdapter As OracleDataAdapter = New OracleDataAdapter
planeTypeAdapter.SelectCommand = New OracleCommand("SELECT PLANETYPE, PLANETYPEDESC FROM PLANETYPES", conn)
Dim PlaneTypeDataSet As New PlaneTypes
planeTypeAdapter.Fill(PlaneTypes, "PlaneTypeDataSet")
cmPlaneTypes = CType(BindingContext(PlaneTypeDataSet, "PlaneTypes"), CurrencyManager)
AddHandler cmPlaneTypes.ItemChanged, AddressOf cmPlaneTypes_ItemChanged
AddHandler cmPlaneTypes.PositionChanged, AddressOf cmPlaneTypes_PositionChanged
txtPlaneType.DataBindings.Add("Text", PlaneTypeDataSet.PLANETYPES, "PLANETYPEDESC")
Catch ex As Exception
MessageBox.Show("At this time this information cannot be viewed or updated.", "Error retrieving records", MessageBoxButtons.OK, MessageBoxIcon.Error)
Finally
If conn.State = ConnectionState.Open Then
Me.closeDatabase()
End If
End Try
' is this needed?
conn.Dispose()
end sub
</code>
This is the schema in the first project.
<code>
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="PlaneTypes" targetNamespace="http://tempuri.org/PlaneTypes.xsd" elementFormDefault="qualified"
xmlns="http://tempuri.org/PlaneTypes.xsd" xmlns:mstns="http://tempuri.org/PlaneTypes.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="PlaneTypes">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="PLANETYPES">
<xs:complexType>
<xs:sequence>
<xs:element name="PLANETYPE" type="xs:integer" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1"
msdata:AutoIncrement="true" />
<xs:element name="PLANETYPEDESC" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="DocumentKey1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:PLANETYPES" />
<xs:field xpath="mstns:PLANETYPE" />
</xs:unique>
</xs:element>
</xs:schema>
</code>
How do I create this at run time and get the benefits in design time?
Is there a better way to reference the code for the navigation buttons?<bump>
Can anyone from Oracle assist me with this issue? -
Update query (or other method) to a typed dataset
Hi
i have created a typed DataSet in code that is created at runtime. It gets populated then it needs to be updated based on 2 paramaters
EmployeeID & AssignmentID
How can i run an update query on the runtime created Dataset? Hee is how i create my Dataset-
Private sGridDataSet As New DataSet("GridDataset")
Private tblGridTable As DataTable
sGridDataSet.CaseSensitive = False
tblGridTable = sGridDataSet.Tables.Add("tblGrid")
With tblGridTable
.Columns.Add("AssignmentID", GetType(System.String))
.Columns.Add("ProjectName", GetType(System.String))
.Columns.Add("Day1", GetType(System.String))
.Columns.Add("Day2", GetType(System.String))
.Columns.Add("Day3", GetType(System.String))
.Columns.Add("Day4", GetType(System.String))
.Columns.Add("Day5", GetType(System.String))
.Columns.Add("Day6", GetType(System.String))
.Columns.Add("Day7", GetType(System.String))
End With
'get data from qryAssignments
sAssignID = Me.AssignmentData.qryAssignments.Rows(j)(1)
sProjName = Me.AssignmentData.qryAssignments.Rows(j)(0)
newValues = {sAssignID, sProjName, Day1, Day2, Day3, Day4, Day5, Day6, Day7}
tblGridTable.Rows.Add(newValues)
Me.QryAssignmentsTableAdapter.ClearBeforeFill = True
Dim sDate As Date = Me.txtDate.Text
Dim EndDate As Date = sDate.AddDays(6)
Me.QryAssignmentTimesTableAdapter.Fill(Me.AssignmentData.qryAssignmentTimes, Me.txtEmployeeID.Text, Me.txtDate.Text, CStr(CType(CStr(EndDate), DateTime)))
Dim p As Integer = 0
For p = 0 To Me.AssignmentData.qryAssignmentTimes.Rows.Count - 1
vDayNo = Weekday(Me.AssignmentData.qryAssignmentTimes.Rows(p)(0), FirstDayOfWeek.Monday)
Dim m As String = Me.AssignmentData.qryAssignmentTimes.Rows(p)(0)
'NEED TO UPDATE DATASET TABLE HERE BASED ON EMPLOYEEID AND ASSIGNMENTID
Next
Me.GridControl1.DataSource = tblGridTable
Hopefully, someone can give me a few pointers :)
Thanks
Nigel
Nacho is the derivative of Nigel &quot;True fact!&quot;Hello,
If I have more than one table to work with, a DataSet would be the container while if one table then no DataSet, just a DataTable. I would use code similar to the following which is for MS-Access yet by changing to SqlClient data provider instead of OelDb
data provider the same methods work.
Taken from
this project.
Module DatabaseOperations
Private Builder As New OleDb.OleDbConnectionStringBuilder With
.Provider = "Microsoft.ACE.OLEDB.12.0",
.DataSource = IO.Path.Combine(Application.StartupPath, "Database1.accdb")
''' <summary>
''' Read USA customers from database into a DataTable
''' </summary>
''' <returns></returns>
''' <remarks>
''' Database is assumed to be in the Bin\Debug folder.
''' </remarks>
Public Function LoadCustomers() As DataTable
Using cn As New OleDb.OleDbConnection With {.ConnectionString = Builder.ConnectionString}
Using cmd As New OleDb.OleDbCommand With {.Connection = cn}
cmd.CommandText =
<SQL>
SELECT
Identifier,
CompanyName,
ContactName,
ContactTitle,
Address,
City,
PostalCode,
Country
FROM Customer;
</SQL>.Value
Dim dt As New DataTable With {.TableName = "Customer"}
Try
cn.Open()
dt.Load(cmd.ExecuteReader)
dt.Columns("Identifier").ColumnMapping = MappingType.Hidden
dt.Columns("Country").ColumnMapping = MappingType.Hidden
Catch ex As Exception
MessageBox.Show("Failed to load customer data. See error message below" & Environment.NewLine & ex.Message)
End Try
dt.AcceptChanges()
Return dt
End Using
End Using
End Function
Public Function RemoveCurrentCustomer(ByVal Identfier As Integer) As Boolean
Try
Using cn As New OleDb.OleDbConnection With {.ConnectionString = Builder.ConnectionString}
Using cmd As New OleDb.OleDbCommand With {.Connection = cn}
cmd.CommandText = "DELETE FROM Customer WHERE Identifier = ?"
Dim IdentifierParameter As New OleDb.OleDbParameter With
.DbType = DbType.Int32,
.ParameterName = "P1",
.Value = Identfier
cmd.Parameters.Add(IdentifierParameter)
Try
cn.Open()
Dim Affected = cmd.ExecuteNonQuery
Return Affected = 1
Catch ex As Exception
Return False
End Try
End Using
End Using
Catch ex As Exception
' Handle or not handle exceptions for failed save operation
Return False
End Try
End Function
Public Function AddNewRow(ByVal Name As String, ByVal Contact As String, ByRef Identfier As Integer) As Boolean
Dim Success As Boolean = True
Try
Using cn As New OleDb.OleDbConnection With {.ConnectionString = Builder.ConnectionString}
Using cmd As New OleDb.OleDbCommand With {.Connection = cn}
cmd.CommandText =
<SQL>
INSERT INTO Customer
CompanyName,
ContactName
Values
@CompanyName,
@ContactName
</SQL>.Value
cmd.Parameters.AddWithValue("@CompanyName", Name)
cmd.Parameters.AddWithValue("@ContactName", Contact)
cn.Open()
cmd.ExecuteNonQuery()
cmd.CommandText = "Select @@Identity"
Identfier = CInt(cmd.ExecuteScalar)
End Using
End Using
Catch ex As Exception
Success = False
End Try
Return Success
End Function
Public Function SaveChanges(ByVal sender As DataRow) As Boolean
Try
Using cn As New OleDb.OleDbConnection With {.ConnectionString = Builder.ConnectionString}
Using cmd As New OleDb.OleDbCommand With {.Connection = cn}
cmd.CommandText =
<SQL>
UPDATE
Customer
SET
CompanyName=?,
ContactName=?
WHERE Identifier = ?
</SQL>.Value
Dim CompanyNameParameter As New OleDb.OleDbParameter With
.DbType = DbType.String,
.ParameterName = "P1",
.Value = sender.Field(Of String)("CompanyName")
cmd.Parameters.Add(CompanyNameParameter)
Dim ContactNameParameter As New OleDb.OleDbParameter With
.DbType = DbType.String,
.ParameterName = "P2",
.Value = sender.Field(Of String)("ContactName")
cmd.Parameters.Add(ContactNameParameter)
Dim IdentifierParameter As New OleDb.OleDbParameter With
.DbType = DbType.Int32,
.ParameterName = "P3",
.Value = sender.Field(Of Int32)("Identifier")
cmd.Parameters.Add(IdentifierParameter)
Try
cn.Open()
Dim Affected = cmd.ExecuteNonQuery
Return Affected = 1
Catch ex As Exception
Return False
End Try
End Using
End Using
Catch ex As Exception
' Handle or not handle exceptions for failed save operation
Return False
End Try
End Function
End Module
Here is an example of retrieving a row of data via a where condition
Public Sub LoadSingle(ByVal Identifier As Integer)
Using cn As New OleDb.OleDbConnection With
.ConnectionString = Builder.ConnectionString
Using cmd As New OleDb.OleDbCommand With {.Connection = cn}
cmd.CommandText =
<SQL>
SELECT
Identifier,
CompanyName,
ContactName
FROM
Customers
WHERE Identifier=@Identifier
</SQL>.Value
cmd.Parameters.Add(New OleDb.OleDbParameter With
.DbType = DbType.Int32,
.ParameterName = "@Identifier",
.Value = Identifier
cn.Open()
Dim Reader As OleDb.OleDbDataReader = cmd.ExecuteReader
If Reader.HasRows Then
Reader.Read()
Console.WriteLine("Name: {0} Contact name: {1}",
Reader.GetString(1), Reader.GetString(2))
End If
End Using
End Using
End Sub
Here you can see (using a random example) that SQL-Server code uses the same logic and methods
Using cn As New SqlConnection With {.ConnectionString = MyConnectionString}
Dim CompanySearch As String = "An"
Using cmd As New SqlCommand With {.Connection = cn}
cmd.CommandText =
<SQL>
SELECT CompanyName
FROM
Customers
WHERE
CompanyName LIKE @CompanyName
</SQL>.Value
cmd.Parameters.Add(
New SqlParameter With
.DbType = DbType.String,
.Value = CompanySearch & "%",
.ParameterName = "@CompanyName"
cn.Open()
Dim Reader = cmd.ExecuteReader
If Reader.HasRows Then
While Reader.Read
Console.WriteLine(Reader.GetString(0))
End While
Else
Console.WriteLine("No matches")
End If
End Using
End Using
So all the above is "hand coding" and there is still the option to use Adapters but for simple stuff they are over kill. The only benefit for them with simple stuff is if you are a visual person, thats it.
See also:
This article on creating SQL statement as per how I did it in the examples above. In the next release of Visual Studio this method will be easier similar to C#
Currently in C# we can do this
string selectStatement = @"
SELECT CompanyName
FROM
Customers
WHERE
CompanyName LIKE @CompanyName";
On creating a DataTable, check out this simple utility
https://code.msdn.microsoft.com/DataTable-creator-95b655b3
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. -
How do I USE the slices I generate in Illustrator from "Save for Web"?
I am having trouble understanding slices. I want to save a raster graphic from Illustrator that takes advantage of "slices" to put hyperlinks to certain labels. I am working on a map with about 20 links to a website describing recreation sites shown on the map.
I am able to do this by bringing my map as a graphic into InDesign, and setting up links to text or picture boxes there. I can export an interactive PDF of the map, and the PDF has live links.
but the client's web host can't post the PDF with active links. (client would have to link from a static image to a copy of the PDF on a separate website). We may do this as an interim measure.
So I'd like to go back and figure out how to use slices in Illustrator to do the same thing. I've seen web pages that have a series of sliced-up graphics; I wouldn't wish that on anyone but it's the solution I want to get to.
Illustrator tutorials and help describe how to set up slices, how to type in links in the "slice options" dialogue box (in objects/slices... pulldown menu). And describe how to "save for web" to generate JPEGs or GIFs of the individual slices.
My available options in AI CC 2014 (I checked in CS6 too) are to save the slices as images. (Helpful articles which say to save as HTML and Images...aren't helpful if I don't have that option).
I get a folder called images, that contains about 74 sliced JPEGs of various sizes and shapes. I don't see, nor see an option where I can ask to make...a file that pulls all these together into a single image, with clickable links. There's no HTML file (or way to create one that I can see).
What am I missing? What application would I use to toss this folder's contents together. Or how would I create the HTML or envelope file within Illustrator?
I have entered URLs for links in three or four different places but haven't found a way to export them in such a way that they are actually useful.
Thanks for your help.
Ben PEaseThanks, I am a print guy, mostly. I've almost figured out CSS for my did-it-myself website, so buttons, actions, slices, etc. are new angles for me. I am hip to the general concept that Adobe likes certain applications to do certain things. It was certainly easier to set up links from InDesign.
In what application would you suggest I DO foolishly create my interactions (raster graphic with multiple links? Does it work any better in Photoshop? The client's web host does the web design (some sort of template thing) so I don't believe I have the option of drawing hot-spots like is (was?) possible in Dreamweaver.
(That may be a question for the web host).
One of the problems with "discontinuing this functionality" is there are about half a dozen how-to guides online that suggest it is still possible to kluge a solution in AI (sometimes in older versions) and it's hard to tell well-executed funtionality from abandoned functionality since Adobe hides instructions in multiple, random dialogue boxes, and left so many of the pieces strewn about the current versions of AI.... How would we really know? But I am not all that surprised they did. -
How to generate a report from crm table to find out user status changes
Dear all,
Could you please help me on generating a report from SAP CRM table level
to find out user status changes in crm orders for a specific period of time?
Thanks in advance,
Regards,
ShaikHi Shaik.
You would not need to write report for this. You need to create a Table view mainenance for the CRMD_ORDERADM_H or CRMD_ORDERADM_I for whichever you need.
Follow the below or search on google for more on table view maintenance.
Go to SE11, give the table name and click on change. Then Go to utilities--> Table maintenance generator.
In the table maintenance generator screen, you should give Authorization Group,
Function Group name (Function Group name can be same as table name),
Maintenance type can be one step or two step, usually you will create with one
step. You should give maintenance screen number. After clicking on create button,
a table maintenance generator will be created.
To check it go to SM30 . In SM30, you find display, Maintain options.
You can view the table contents by choosing Display and supplying the selection criteria of dates.
Regards
Apoorva -
Generating a PDF from a OTF (imported from CLOSE_FORM) and send it by mail.
Hello!
I have a problem.
I'll try to explain it toy you.
I have a SapScript that the user has the option to send it to the printer or have a Print Preview. I need to send it by mail in PDF format.
If the user select PRINT, a spool id is created, I can get the OTF, generate the PDF and send it by mail. Everything OK with that.
The problem is if the user select PRINT PREVIEW I don't get a spool id. So, what I did is to get the OTF from the CLOSE_FORM MF and generate de PDF from there. I tried several FM to generate the PDF but for sure I'm doing something wrong, because or the PDF is corrupted or I have a problem with the parameters in the SO_NEW_DOCUMENT_ATT_SEND_API1 FM.
So, what I need it: Generate a PDF from a OTF imported from CLOSE_FORM FM and send it by mail.
Examples or the FM I can use are welcome.
I tried to do search here, but I couldn't find anything that may help me..
So, please... Show me the light!!!
Thanks!!!
BettinaPart 3
* Send Report
clear: maildata, mailtxt, mailbin, mailpack, mailhead, mailrec.
refresh: mailtxt, mailbin, mailpack, mailhead, mailrec.
* Creation of the document to be sent File Name
maildata-obj_name = 'REPORT'.
* Mail Subject
maildata-obj_descr = 'Your Report'.
describe table mailtxt lines tab_lines.
read table mailtxt index tab_lines.
maildata-doc_size = ( tab_lines - 1 ) * 255 + strlen( mailtxt ).
* Creation of the entry for the compressed document
clear mailpack-transf_bin.
mailpack-head_start = 1.
mailpack-head_num = 0.
mailpack-body_start = 1.
mailpack-body_num = tab_lines.
mailpack-doc_type = 'RAW'.
append mailpack.
* Creation of the document attachment
loop at solisti1.
move-corresponding solisti1 to mailbin.
append mailbin.
endloop.
describe table mailbin lines tab_lines.
mailhead = 'REPORT.OTF'.
append mailhead.
** Creation of the entry for the compressed attachment
mailpack-transf_bin = 'X'.
mailpack-head_start = 1.
mailpack-head_num = 1.
mailpack-body_start = 1.
mailpack-body_num = tab_lines.
mailpack-doc_type = 'OTF'.
mailpack-obj_name = 'ATTACHMENT'.
mailpack-obj_descr = 'Some Report'.
mailpack-doc_size = tab_lines * 255.
append mailpack.
mailrec-receiver = lv_email_address. "<-- a valid email address
mailrec-rec_type = 'U'.
append mailrec.
* Sending the document
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = maildata
put_in_outbox = 'X'
tables
packing_list = mailpack
object_header = mailhead
contents_bin = mailbin
contents_txt = mailtxt
receivers = mailrec
exceptions
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
others = 99.
Regards,
Rich Heilman -
How to generate an alert from within a workflow?
Hi Experts,
Let me describe my scenario. Presently I am working in CRM 5.0. There is a need to generate an alert from my workflow . This alert should be generated in the Web Client in a particular tab only.
Now I have identified a function module called 'SALRT_CREATE_API' which can be used to generate alerts. But in that function module one of the import parameters is 'IP_Category' which accepts the category of the alert . Now the alerts in the WebClient do not have any such thing as 'Alert Category' . They only possess 'Alert Id' and 'Alert Class'. (spro => SAP Reference Img => Customer Relationship Management => Interaction Center Webclient =>Basic functions => Define Alert and Alert Profiles ).
So please suggest me some solution.
Thanks & Regards ,
Samrat DuttaHi,
I am not sure whether you have gone through this documentation:
http://help.sap.com/saphelp_nw2004s/helpdata/en/45/732041c877f623e10000000a155106/content.htm
Which mentions that you will have to maintain the Alert Category. You can use transaction SALRTCATDEF to define your alert. You will have to maintain the Business Object from where you are triggering the alert.
If you need it via Business workflow then you can see the documentation:
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/8f507464246353e10000000a11466f/content.htm
Hope this helps,
Sudhi -
Parsing Column Value. SQL / Stored Proc/ Function ?
Hi,
I just started writing SQL. Need your valuable input for the following query,
Need to query a table and parse a column to produce a desired output.
like suppose my column value is
#ADFA
/SDFGAS
{ABC}: 123
{BCA}: 456
{DEF}: 789
and i need to get an out put as follows
{ABC} {BCA} {DEF}
123 456 789
so the patterns are defined.
I some how tried and reached through SQL, but there should be better way than this. So posted this question.
I tried using SQL itself (using substr, instr & decode functions in the select statement)... with out using stored proc/ function as i have not created one earlier.. I am just learning the syntax and trying it.
The psuedo code i have planned is
function substring(column_value, search_string)
var start_index NUMBER;
var end_index NUMBER;
var result VARCHAR2;
result = 'N/A';
start_index = instr(column_value, search_string) + 4
if start_index >= 4
end_index = instr(substr(column_value, 0, start_index), CHR(13)-1)
if start_index >= 4 && end_index >=0
result = substr(column_value, start_index, end_index);
return result;
I just wrote it like writing in a programming language. Need to implement this through Stored Proc/ Function. Please let me know your comment on thisOops, I think regular expressions are not available in my current oracle version :-(
I am having Oracle 9i.
Got it.. Yes it is available from 10G onwards.. :-(
Message was edited by:
Thiru.Thiru
Maybe you are looking for
-
I even deleted iTunes losing all my data and thesame thing happened when I reinstalled iTunes, several times! Now I cannot use Apple TV. Frustrated.
-
I need to cancel a print job so other things behind it will print. It still appears in the 'pending jobs' list and will not go away. It says that it is 'deleting' but it's still there. What can I do to get rid of it.? Thank you.
-
Bounding Theme With Mapviewer Bean
Hello I using the MapViewer Bean to render a map in Oracle Forms. I can successfully show the map and use addJDBCTheme to add a dynamic theme. I am now trying to zoom in/out on the map so the image returned shows all items in the dynamic theme. Does
-
on my macbook pro ican't rest keychain it says Unable to obtain authorization for this operation.
-
In the image IPTC area of the MetaData... what is "Intellectual Genre" used for? I've been using the 'Scene' field for a short description of the image. Is this the best place to put that, or should that go under Content: Caption. What is the Status