cancel
Showing results for 
Search instead for 
Did you mean: 

XML Parameter Appending Values.

Former Member
0 Kudos

Hey All,

I have a web page that displays the material of a BOM. What I am doing is looping through all the material and doing a goods movement to the production order. The problem comes when I an trying to issue serialize parts.

The transaction takes an XML parameter that I put in the form:

<SERIALS>

<SERIAL>SERIAL1</SERIAL>

</SERIALS>

The webpage generates this fine but either the command, xacute query or transaction appends the serials from previous materials together.

Any help would be appreciated.

Jasper

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

So I put an assignment before generating the "<GOODSMVT_SERIALNUMBER>" XML that reset it back to just:

"<GOODSMVT_SERIALNUMBER>

</GOODSMVT_SERIALNUMBER>".

When I did just a value assign it didn't work. The werid thing is I put a file write action in between and it worked.

So I created a third local XML variable that contains "<GOODSMVT_SERIALNUMBER>

</GOODSMVT_SERIALNUMBER>" and do an assign XML to overwrite the previous serials before trying to generate the new XML.

Former Member
0 Kudos

In the web page I've done an alert on the parameter being passed and it's not getting concatenated there.

There can ba multiple <SERIAL> nodes in the <SERIALS> node because a material requirement could be greater than 1. In that case it would look like:

<SERIALS>

<SERIAL>TEST1</SERIAL>

<SERIAL>TEST2</SERIAL>

<SERIALS>

In the transaction I have 2 local variables: 1 only has a node <GOODSMVT_SERIALNUMBER>. The Other looks like the 'item" XML under the "GOODSMVT_SERIALNUMBER" XML in "BAPI_GOODSMVT_CREATE" BAPI.

The transaction loops through the serial number XML with an expression of "Transaction.SerialNumbers{/SERIALS/SERIAL}".

It then assigns the serial number to the second Local variable.

It then appends the second local variable to the first.

It then assigns this XML to the request of the "BAPI_GOODSMVT_CREATE" BAPI.

jcgood25
Active Contributor
0 Kudos

Jasper - have you considered the sample available for download here on SDN (see sticky thread at the top of the forum)?

The Module Libraries have a demonstration of BAPI_GOODSMVT_CREATE in the SAP/ModuleLibraries/MM/GoodsMovementForNItems transaction.

There were also some Link issues in earlier 12.1 versions, so you might want to check the notes. 12.1.7 P4 is the latest on Service Marketplace.

Former Member
0 Kudos

Hi Jasper,

could you give us some more details?

If I understood correctly, you pass the XML parameter, containing two node (SERIALS, SERIAL) to you MII transaction using the Xacute query. The transaction then processes not only the SERIAL passed to it, but also all SERIALS passed before.

First you should check if the input is correct by using a trace / event log action or save the XML to file.

If the input is correct, how do you process the input XML property? Do you use a mode "Append XML" in the link editor where "Assign XML" should be used? Maybe there is a missing initialization of a XML property in the transaction?

Michael