cancel
Showing results for 
Search instead for 
Did you mean: 

Adapter Module o write nested XML to FLat

Former Member
0 Kudos

Hi ,

My requirement is to write an Flat file out from a Nested XML( more than 3 hirarchy).

example


<?xml version="1.0" encoding="UTF-8"?>
<root>
	<grandfather>
		<father>
			<child>ABC</child>
			<child>PQR</child>
			<child>XYZ</child>
		</father>
	</grandfather>
</root>

After implementing adapter module , output should be

ABC

PQR

XYZ

My idea is to access the XML in adapter module and will get the node names as the parameter.

i have gone thro' all avaibale How to do 's of adapte module developement, searched SDn.. but coudn't found how to proceed

Can anybdy tell me how acess the XML inside the method

public ModuleData process(ModuleContext moduleContext,
			ModuleData inputModuleData)  

and how to write it in a file.

i can take care of the logic part. Just i need to know how to access the XML ( should use a parse for this , or any inbuild method?)

thnx

Accepted Solutions (0)

Answers (3)

Answers (3)

stefan_grube
Active Contributor
0 Kudos

See a code sample here:

http://wiki.sdn.sap.com/wiki/display/XI/AdaptermoduleexampleforPI+7.1

former_member200962
Active Contributor
0 Kudos

Is it mandatory for you to implement an adapter module? If no, then you can even opt for MessageTransformBean....check it here:

http://help.sap.com/saphelp_nw04/Helpdata/EN/24/4cad3baabd4737bab64d0201bc0c6c/content.htm

From the above help section refer Conversion in the Receiver Communication Channel ...a somewhat similar example is illustrated

Regards,

Abhishek.

Former Member
0 Kudos

Hi Raja and Abhisek,

i know this can be doen using XSLT , but i am looking for a genralised solution... so i want to use module,\

so that if i get some other structure i can use this module with simple modification...

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Sam,

If this is your requirement you can achieve this using XSLT mapping,select out mode as Text,simple XSL will work.

if you are trying with adapter module then search in sdn, you will tons of documents .

Regards,

Raj