cancel
Showing results for 
Search instead for 
Did you mean: 

Merging transaction OutputXML content through a repeater call

Former Member
0 Kudos

Hi guys,

I have a simple coding problem which I cannot figure out how to do in xMII.

(1) What I am doing is looping through the results of the 'ProcessOrderList' retrieving the OrderNumber value.

(2) I then use this value for an outside transaction call to 'ProcessOrderDetails' which returns a whole bunch of info base on the OrderNumber.

In the TRACER I can see that the repeater & outside transaction call yield the desired results, BUT the OutputXML data generated from the outside transaction call is over written at every call hence leaving me, at the of repeater, with only the data relevant the last OrderNumber processed from the list!?

I have not found a way to build an outside XML document to which I could append the generated results to each 'ProcessOrderDetail' call.

All of your help is welcomed

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Guys,

It turned out I merged the two BAPI calls into one transaction.

I start off calling the ProcessOrderList of which I use a repeater action block to iterate through the different 'OrderNumbers'.

I then use the repeater's output and feed it to the second BAPI call ProcessOrderDetails.

I had to remove the xml saver action block from the ProcessOrderDetails and move the original 4 XML documents away from the initial first sequence to above my call to the ProcessOrderList.

This allows me to populate them without having the transaction.output overwritten after each and every loop the repeater.

I am pretty sure this is not like 'best practice' design, but it works.

Thanks alot for your advice, as always they were very enlightening.

Martin

agentry_src
Active Contributor
0 Kudos

Hi Martin,

I would guess that you are using the standard ProcessOrderDetails to retrieve the specifics of each Order Number. That returns a standard formatted OutputXML. You have a couple of options depending upon what information you want to be saving. First, you could simply build a concatenated xml dataset using the Union action block (similar to the way ProcessOrderDetails uses it). If you are only interested in Header information (Quantity, UOM, Plant, etc.), then I would create an xMII_Output_XML document and add rows with the information to it. There are numerous other ways to save the data including an xml field in a database, xml files in a server folder (use the date and order number for uniqueness), save it as a file on the WEB side of the workbench.

If you can identify what you want to do with this file after receiving the information, I may be able to point to more specific solutions.

Thanks,

Mike

Former Member
0 Kudos

Mike,

Indeed I am using both standard functions (ProcessOrderList & ProcessOrderDetail)

The idea is to use this file while being disconnected from the network. Also we thought that building this larger file within one transaction call would reduce the amount of calls to the server.

Now, how it's done and how we can keep some formatting logic to the output is where I am lost.

It seems as though every call to ProcessOrderDetails generates a full XML document with the headers and unnecessary 'noise'

As an end result, I am looking to generate a clean XML file containing the concatenation of every call's valuable data ( which I believe can be referred as rowsets).

thanks Mike

Former Member
0 Kudos

... The file will be stored on a PDA for further processing

agentry_src
Active Contributor
0 Kudos

Martin,

Go to your SAP ERP system and go to the BAPI Explorer. If you look at BAPI_PROCORD_GET_DETAILS, you will see that you can select various types of information to retrieve. The standard transaction that you are using is selecting three sections to return, Header, Components and Phases (Operations). First, do you need all three? If so, you can not modify the ProcessOrderDetails transaction. However, you can determine which fields are actually of interest to you. There may some fields that you do not need and so can modify one or more of the three XML output documents. But it is unlikely it will slim down very much.

For your purposes, you may want to slim down the number of Order Numbers you save on a PDA to only those needed for some limited period of time. I am sure you don't want the entire production floors order contained in the PDA. You do want them in your production MES system, but expecting your poor PDA to hold them all is asking a bit much. So give some thought to how you can structure the dataset to something appropriate to a specific PDA. For instance, you may only use the PDA in the first three steps of the Routing. Then you could limit your download to only those components and phases associated with the first three processing steps and only to those order numbers which are using that production area. There are probably more ways to target the PDA loads, but I can't make more specific suggestions without more insight into the operations flow and production structure.

Hope this helps,

Mike

Former Member
0 Kudos

Martin, you need to create a "parent" XML document as a transaction local or output property named OutputXML, of type "XML", with one empty node such as "<Orders/>". Then, use the "Append XML" link type to append the returned XML from your order lookup to the destination: Transaction.OutputXML{/Orders}.