cancel
Showing results for 
Search instead for 
Did you mean: 

Modification of the XML file as the output of an IDOC during generation

Former Member
0 Kudos

Hi

I would like to ask whether we can intervene in the process while IDoc is being delivered to an XML port to change XML contents.

The problem is that, while the XML file is being generated, our namespace in segment names, i.e. /XXXX/, is replaced by '_XXXX-' which is problematic for the partner system which utilizes Delphi (or the Delphi developer says so).

It is obvious that modification may be possible after the XML file is created by reading it from the server and changing it. However, what I want is, as I mentioned, to intervene the process while it is being generated.

Besides, I do not want to change my segment names to general customer namespace, i.e. 'Z*' .

Seeking for a solution, I have traced the XML outputting FM, but there seems no user-exits or BAdIs. Nevertheless, I wonder whether there is some other place at the ALE layer or at the IDoc interface where I may utilize.

Or, any experience about Delphi being a partner system getting XML generated from IDoc will be appreciated.

Regards

*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Serdar,

Have you tried using an ABAP port? With this, you can insert your own custom function as the receiver of the Idoc.

You could then do trim out the namespace yourself before calling the standard XML generating FM.

Cheers,

Brad

ssimsekler
Active Contributor
0 Kudos

Hi Brad

Thanks for the answer. It seems a pretty genius work around. But the FM for generating XML is not so much designed for customer use. OK, I admit that we all sometimes use those kind of FMs, however as a drawback this makes me drop from the standard ALE pathway.

With the ABAP port, the IDoc status will be as 'successful', but it will have no information about the XML file and I will be obliged to maintain some other stuff to support the procedure after the IDoc is received by the ABAP port. Or do I think wrong?

So I think I need solidly some user-exit or BAdI at some level of standard ALE processing.

Thank you again.

*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

Former Member
0 Kudos

Hi Serdar,

Genius was perhaps a little bit generous...

RE your comments:

<i>With the ABAP port, the IDoc status will be as 'successful', but it will have no information about the XML file and I will be obliged to maintain some other stuff to support the procedure after the IDoc is received by the ABAP port. Or do I think wrong?</i>

I think you are right. You would probably have to do some stuff here to update XML data etc. back into the Idoc.

I've not seen any BADIs etc, that would let you manipulate the segments, other that going into the idoc output function modules (you would need to do this for every type of outbound idoc which you have extended though) and using the userexits provided in them. For example IDOC_OUTPUT_ORDERS has badi_process_segment and EXIT_SAPLEINM_002. Not really a generic solution, but again would work.

I would push harder on the delphi side, why cant they process these segment names. Seems a little strange to me.

Also, you could develop your extended segments in the Z namespace rather than using the customer namespace (its the customer namespace causing the problems right)?

Cheers,

Brad

Former Member
0 Kudos

Sorry, just saw this comment:

<i>Besides, I do not want to change my segment names to general customer namespace, i.e. 'Z*' .</i>

Brad

ssimsekler
Active Contributor
0 Kudos

Hi Brad

Saying genius, I was just motivating you for finding a better answer :). Kidding...

Since it is not a standard process I cannot make use of the BAdIs implemented for specific modules.

And Sergei

Thank you for the answer. Unfortunately, we have 4.6C and the option you mentioned does not exist for the port definition.

It seems I will go through changing segment names to have the general namespace 'Z'.

Thank you both again

*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

Answers (1)

Answers (1)

sergey_korolev
Active Contributor
0 Kudos

Hi Serdar,

If you set flag "Unicode" in XML-port properties, then BADI should be fired when creating XML file (or http request). The name of BADI is IF_EX_IDOC_XML_ENVELOPE_OU. It is valid in 4.7. It is called from function modules IDOCS_OUTPUT_VIA_XML_HTTP and IDOCS_OUTPUT_IN_XML_FORMAT. Actually, you can change entire XML string in this BADI. Sorry, have no access to lower versions of SAP at present.