cancel
Showing results for 
Search instead for 
Did you mean: 

How to Append WorkOrderNumber to OutputXML file - WorkOrderCreate Template

Former Member
0 Kudos

When I use the WorkOrderCreate Template from SAP PM module in xMII the OutputXML file saved with a name which can be configured.

In my case I need to Append SAP generated WorkOrderNumber to OutputXML file. The number that is being appended to the file by default is some sort of dynamic number (%0000000001) but the actual work order number is for example 4000240.

To be more specific what element/value should I map to the Local.SpecificName propery in BLS WorkOrderCreate transaction so that the SAP generated work order number is appended to the file name.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Siddhartha,

You already mentioned it, the JCo response will have the new number in it so just do the following:

Local.SpecificName = Local.SpecificName & JCOResponseXML.ResponseXML{/path/workordernumber}

If you're not sure which field is the work order number field then you'll have to do some work to find this out in the BAPI documentation.

Sam

Former Member
0 Kudos

As per the BAPI Documentation, there is a return structure EtNumbers which has the description:--

Return Structure with Transferred and Issued Order Numbers

Description

Table with the order numbers issued by the system. The temporary number copied to the function module and the number assigned by the system are assigned with this.

The two fields are AUFNR and AUFNR_NEW

So even if I map the folowing

MaintainWorkOrderRef.Response{/BAPI_ALM_ORDER_MAINTAIN/TABLES/ET_NUMBERS/item/AUFNR_NEW} to the SpecificName Local property the file name is still not having the actual work order number.

0 Kudos

Siddhartha,

What version of ERP/ECC are you using?

Sam

0 Kudos

Siddhartha,

I looked through the documentation that I could find on this call and see what you mean now about the order number and the temporary order numbers, %00000000001. The only other suggestion is to either get a list of orders after you commit this operation with another BAPI call (Use the Connection Pooling feature in the "SAP JCO Interface" actions)...OR...write a custom BAPI that will lookup the actual order number and return it back in the response.

Hope this helps.

Sam

0 Kudos

Now that I think about it a bit more you could asynchronously update the Order number in your system via the xMII iDoc listener which can recieve an Order IDoc upon the create/update of an order, then update your system accordingly. This is probably your best/most reliable solution.

Sam

Former Member
0 Kudos

Siddhartha/Sam,

I have been successfully using the SDN templates for the PM module for quite sometime now, I am connecting to ECC 6.0.

Siddhartha,

First things first, after executing your transaction are you sure that a Work Order is successfully created in R/3 (or ECC). Keep in mind those templates were written for ECC 5 & above so just incase if you are on a lower version you might have to think of a different approach.

If you are using the "SAP JCO Interface Actions" then @ what point do you retrieve the AUFR_NEW value?Make sure you do that after using the Commit action.

This works for me perfect and should work for you as well, but it would help if you could give the forum more details.

Former Member
0 Kudos

I am using the version 4.70 and also checked that the work orders are getting created fine in R3.

There are two JCO actions (xMII 11.5):

1> SAP ERP Interface --> SAP JCO Interface action

2> SAP JCO Interface --> SAP JCO Function

I am using the first one which does not have any explicit commint action.

I am assigning the AUFNR_NEW in the last step of the transaction WorkOrderCreate which is a Transaction Call to Save OutputXML document: OutputXMLSaver.trx

Former Member
0 Kudos

Ok.

Lets forget the OutputXMLSaver.trx for the time being.

In your main transaction (WorkOrderCreate.trx) can you do a trace (tracer action) for "Local.SpecificName & MaintainWorkOrder.Response{/BAPI_ALM_ORDER_MAINTAIN/TABLES/ET_NUMBERS/item/AUFNR_NEW}" and check if you are getting the generated WorkOrder Number because this is the value which you further pass on to the XML Saver transaction.

0 Kudos

Siddhartha,

In the action block you are using there's a check box in the action configuration to specify the commit operation.

Sam

Answers (0)