cancel
Showing results for 
Search instead for 
Did you mean: 

Get IDoc-number from flat IDoc using dynamic configuration

Markus7
Participant
0 Kudos

Dear experts

In an IDoc2File scenario I have added the IDoc-number to dynamic configuration using the folling code in an UDF:

DynamicConfiguration conf = (DynamicConfiguration)

container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey FileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","DOCNUM");

conf.put(FileName, a);

The information is stored in the SOAP message

<SAP:DynamicConfiguration SOAP:mustUnderstand="1">

...

<SAP:Record namespace="http://sap.com/xi/XI/System/File" name="DOCNUM">0000000000012345</SAP:Record>

...

</SAP:DynamicConfiguration>

Can anybody tell me how I can access this information in the "variable substitution" section of the CC? Perhaps something like "message:docnum"?

Additional information:

Taking the IDoc-number from the payload using e.g. "payload:ORDERS05,1,IDOC,1,EDI_DC40,1,DOCNUM,1" does not work, since the XML-IDoc has been converted to an flat-IDoc.

Thanks in advance for any good ideas

Markus

View Entire Topic
Markus7
Participant
0 Kudos

Of course, I also changed the UDF

public String putDynamicConfiguration(String docnum, Container container) throws StreamTransformationException{
try
{
	DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
	DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
	conf.put(key, docnum);
	return docnum;
}
catch (Exception e)
{
	return docnum;
}