cancel
Showing results for 
Search instead for 
Did you mean: 

XML Parameter

Former Member
0 Kudos

Hi,

I want to create 2 local parameters of type XML with the structure corresponding to -

i) a row of a input table in a BAPI and

ii) the input table itself.

What is the best way to do this - something quick and easy? Thanks.

Regards,

V M.

Accepted Solutions (0)

Answers (4)

Answers (4)

agentry_src
Active Contributor
0 Kudos

Hi Venki,

Most of the templates in SDN utilize the technique that Rick is referring to. Download them for examples of how to structure his suggestion.

Regards,

Mike

Edited by: Michael Appleby on Feb 5, 2009 4:56 PM

Former Member
0 Kudos

I have set up the xml parameters and the additional JCo Block (dummy) the way it was explained in one of those sample SDN templates. Of course, the transaction I am working with is a little different from the sample one.

I keep getting the message "[ERROR]: STEP EXCEPTION () : Target XML Node Is Null". I think this is at the item level. Not sure what seems to be wrong.

Regards,

V M.

Former Member
0 Kudos

Sounds like you're trying to do an Append or AppendAfter to an XML property that doesn't exist or hasn't been populated yet. You can add Tracer actions to print out the XML objects at various states/places in your transaction.

Former Member
0 Kudos

Not sure Rick. I am facing this error only when I assign reference document to the XML parameter; not if the structure is predefined (fixed, not dynamic).

Regards,

V M.

jcgood25
Active Contributor
0 Kudos

The reference document assignment will allow you to see it in the linke editor (DESIGN TIME), only the xml link assignment will copy the nodeset to your property (RUNTIME).

Former Member
0 Kudos

Jeremy,

I understand what you are saying. Its allowing me to assign the values and the XML links, there is no problem with this part. But, like I said before, it works fine when the XML parameter structure is pre-defined (fixed), but gives a runtime error when I use the assign reference document method.

I think I have spent a lot of time trying to figure out whats wrong. Not successful though. I will just stick to the other transaction thats working. I understand its not the best. Unless one of you guys wanna take a look at my transaction and point out the mistakes.

Appreciate it.

Regards,

V M.

Former Member
0 Kudos

Ok, I have gotten to a point where I am not receiving the runtime error message. But the transaction is not executing beyond the dummy JCo (the one with 'Execute Function' unchecked). Is there anything I need to look for here? Thanks.

Regards,

V M.

agentry_src
Active Contributor
0 Kudos

Venki,

Don't use a reference document. Just use a local or transaction property of type xml. Copy the Request segment from you Execute unchecked JCo and then use that going forward.

Regards,

Mike

Former Member
0 Kudos

"What is the best way to do this - something quick and easy?"

I wish the "best way" was always "quick and easy".

Former Member
0 Kudos

FWIW I just assign the request and responses to the trace action, run the transaction and copy the xml from the trace window.

agentry_src
Active Contributor
0 Kudos

Sounds pretty quick and easy to me.

Former Member
0 Kudos

Resolved successfully.

jcgood25
Active Contributor
0 Kudos

Have you looked at the sample content for download on SDN? There is a 12.0 project available containing all sorts of BAPI interface transactions, as well as an old school 11.5 content zip file.

Your local property can contain the sample xml stub as its default value - this will benefit both design time and runtime usage, but if the format changes then you also have some maintenance to consider because you will have a bit of a disconnect between R/3 and the local property.

Assigning a reference document for the input table itself, by associating the local property with the input table is another more dynamic approach but this only helps you out in the link editor at design time (it will be blank when the transaction is run).

Regards,

Jeremy

Former Member
0 Kudos

I palyed with it a little more. I found the following things -

i) Rolling the mouse over where it says 'Xml <Request>' in the JCo Block displays the Xml script in a pop-up window although it wouldn't let me copy it there.

ii) In the 'Outgoing' section of the link editor of the JCo block, I linked the 'Xml <Request>' to the Xml transaction parameter I created. You can copy the Xml code by clicking on the 'Evaluate' button and of course delete the link later.

Quick and dirty!

Thanks Jeremy.

Regards,

V M.

Former Member
0 Kudos

For everyone: The cut-and-paste approach, while "quick and dirty", does create a potential issue if changes to the RFC/BAPI are made.

An alternative, which is "pretty quick" and "not too dirty":

1. Insert a JCO call action, configure it, but uncheck the "Execute Function" checkbox, so the function will not actually be run.

2. In your case, create two XML Local parameters

3. Insert an Assign action, and copy the appropriate XML from the JCO action to your XML parameters

4. Using the same XPath expression you used in the Assign action, assign a reference document to each of these two Local XML parameters, using the "Link to Other Object Property" option in the assign reference dialog

Now you have XML documents that will be more dynamic when changes occur to the underlying RFC.

Rick

Former Member
0 Kudos

I like the idea. Do you have a sample transaction illustration? Thanks.

Regards,

V M.