cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Parameters to my xMII transaction through web call (http)

Former Member

Hi all,

We have set up in xMII Workbench an SQL Query (tested).

We have set up a Transaction which contains this SQL Query, configured the object and the 'mapping' on the object between the transaction parameters and the sql query's Param...

When testing the Transaction from SAP xMII Workbench all is okay, the values that are pushed in the db come from the preloaded values we gave the SQL Query Parameters...

Our problem arises when we try to overwrite these default values via a web call to the xMII Transaction (webservice).

Here is how we make our call:

http://<servername>/XMII/Runner?Transaction=<transactionName>/Consume&OrderNumber=7&Material=7&Quant...

Pasting the above URL in a browser will generate a 'TRANSACTION EXECUTED OK' message but the values pushed in the db are still pointing to the default values configured for our parameters.

Any idea of what I am doing wrong here?

Thanks,

Martin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

When I remove the parameter values from the Parameters' list & try to test the SQL Query the system gives me this error msg:

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Line 11: Incorrect syntax near ','.

Here is the actual code for the SQL Query:

INSERT INTO [dbo].[xMII_Transaction]

([OrderNumber]

,[Material]

,[Quantity]

,[BatchID]

,[Unit]

,[TransactionType]

,[TimeStamp]

,[Status] )

VALUES

([Param.1], [Param.2], [Param.3], [Param.4], [Param.5], [Param.6],[Param.7],[Param.8])

Regards

Former Member
0 Kudos

This is expected.

What I was trying to say is after removing the default values from the query parameters list as well as the Transaction Parameters (that you've mapped to the Query Params), test your Runner URL .

Is the above error displayed after you tested the URL or just the query?

Former Member
0 Kudos

Hi Martin,

taking your SQL Query


INSERT INTO dbo.xMII_Transaction
(OrderNumber
,Material
,Quantity
,BatchID
,Unit
,TransactionType
,TimeStamp
,Status )
VALUES
(http://Param.1, http://Param.2, http://Param.3, http://Param.4, http://Param.5, http://Param.6,http://Param.7,http://Param.8)

I guess the http:// in front of the param is just because of the auto-replace of the Board here

In generall it is suggested to remove every testing / debugging / default paramter from all of your queries and transactions after

development for your testing to be sure everything is handled as desired.

If an SQL error occurres the problem is mostly located in the corresponding parameter assignment or the format of the

parameters. Having an


VALUES
( , , , , , )

in your statement will always cause the same error being related to a wrong parameter assignment. If your direct assignment to

the query is correct try to figure out if the parameters are processed elsewhere and maybe get corrupted. Also it is recommended

to use single quotes (neccessary i.e. for string inputs) in the query itself not pushing it together with the parameter to the query

(of course only if you are pushing string values to the query ).

I hope this might help a little

Best Regards

Sebastian

agentry_src
Active Contributor
0 Kudos

INSERT INTO dbo.xMII_Transaction
(OrderNumber
,Material
,Quantity
,BatchID
,Unit
,TransactionType
,TimeStamp
,Status )
VALUES
('[Param.1]', '[Param.2]', [Param.3], '[Param.4]', '[Param.5]', '[Param.6]','[Param.7]','[Param.8]')

Note the difference in the SQL Script. Alphanumeric values need to have the single quotes. If you are pasting in numeric values, you do not need the single quotes, like Quantity. See if that helps.

Mike

Edited by: Michael Appleby on Jul 17, 2008 1:46 PM

Answers (6)

Answers (6)

Former Member
0 Kudos

BTW Michael, I came to realize that you had answered my question.

Putting the single quotes on the xMII side is better/cleaner than passing them in the URL ...

thanks

agentry_src
Active Contributor
0 Kudos

Glad to help you out. Good luck with your application.

Mike

Former Member
0 Kudos

Guys,

I solved the problem based on all of your inputs, which btw were very much appreciated.

In the end my problem was that in my URL I was passing parameter values without the single quotes for xMII define parameters as 'Strings'. So xMII did not recognize the values as valid string inputs and used the define values based on the Parameter Table.

Old URL used to pass parameters:

Link:[url] http://usmaddgnb8sd1.krft.net:50000/XMII/Runner?Transaction=<transactionPath>&OrderNumber=test&Mater...

Working URL for passing my parameters:

Link:[url] http://usmaddgnb8sd1.krft.net:50000/XMII/Runner?Transaction=<transactionPath>&OrderNumber='test'&Material='test'&Quantity=345&BatchID='Test'&Unit='be'&TransactionType='2'&TimeStamp=2008-01-01&IllumLoginName=xxxxx&IllumLoginPassword=xxxxx

Again thanks for your help.

Former Member
0 Kudos

Uduyan, you had read me right, sorry Eduardo it was my typo error. My project path is <projectName/Consume> and then I have my parameters...

Former Member
0 Kudos

Martin,

Try to create a really stupid transaction that receives a string parameter.

Try to save a local file writing to it the value of the parameter.

Now, play around calling it from your browser the same way you're doing now and see if it works.

If it does, you know you have a problem on your transaction.

It it doesn't, you know you have a problem when calling your transaction.

This should help you isolating your problem.

Good luck!

Former Member
0 Kudos

You don't need to remove the links in the transaction, otherwise how's your URL going to work?

The error you are seeing is normal because you after removing the hard-coded values from the parameters tab you query has essentially become

INSERT INTO dbo.xMII_Transaction

(OrderNumber

,Material

,Quantity

,BatchID

,Unit

,TransactionType

,TimeStamp

,Status )

VALUES

(, , , , , ,,).

So take a deep breath and relink the Transaction Parameters to the SQL Query in the SQL Query Action Block .Make sure the Transaction Parameters have no hard coded values and then run your URL from the browser and report back the results.

Former Member
0 Kudos
Former Member
0 Kudos

Good catch but if you are considering Consume as an input param then the URL should look like

http://<servername>/XMII/Runner?Transaction=<transactionName>&Consume=something&OrderNumber=7&Materi...

rather than

http://<servername>/XMII/Runner?Transaction=<transactionName>?Consume=something&OrderNumber=7&Materi...

I initially assumed the name of the transaction as Consume (Project/Consume).

Former Member
0 Kudos

Yeah, yeah, you're right, Udayan.

Thanks for correcting me!

Former Member
0 Kudos

I get the error msg after testing the query in SAP xMII Workbench.

As for the links & the default values here is what I did:

1. Removed all links between query and transaction from the 'Link Editor'.

2. Removed the 'hardcoded' values of the query parameters (Param.1, Param.2...) from the Parameters Table

Try and test my Query in the xMII Workbench & get the same error:

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Line 11: Incorrect syntax near ','.

I am under the impression that I should leave values in the Parameters' table and that it is my URL that is not overwriting the default values...

Former Member
0 Kudos

The procedure you've described above seems to be perfect , I don't see why the trx "fails".

Assuming you've properly tested each of the procedures above , how about blanking out all the default values and then use the Runner. See if you find any difference with the end result.