cancel
Showing results for 
Search instead for 
Did you mean: 

IDoc to File Scenario

Former Member
0 Kudos

Hi,

In IDoc to File Scenario, I am using Java Mapping Program to do the Transformation. In the Ouput File I require to Map the IDoc Number, Segment Number, Number of Superior Parent Segments, Hierarchy Level of SAP Segment.

Please let me know how can I access these fields from the Java Mapping Program?

Thanks,

Yogi.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi ,

You can have 2 parsers SAX and DOM to access the fields in Java Mapping.

On how to create XML docs with SAX and DOM go thruugh these links:

http://www.cafeconleche.org/books/xmljava/chapters/ch09.html

http://www.cafeconleche.org/books/xmljava/chapters/ch06.html

Check these blogs for reference..

/people/udo.martens/blog/2006/08/23/comparing-performance-of-mapping-programs

/people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping

Regards,

Former Member
0 Kudos

Hi All,

The fields which I specified are not coming with IDoc, i.e., IDoc Number, Segment Number and so on. How can I access these fields?

Thanks,

Yogi.

prabhu_s2
Active Contributor
0 Kudos

u can find those in the header details of the idoc...whats the idoc u r using?...idocs coming out from sap will def have idoc num generated by the system

Message was edited by:

Prabhu S

Former Member
0 Kudos

In R/3 if they are not sending values for these fields then you wont get these fields

if you need these fields you create intermidate mapping in that use mapwithdefault node fucntion for these fields thenin target side IDOC you will see the fields then use IDOC for prasering

Regards

Sreeram.G.Reddy

Former Member
0 Kudos

Hi Yogendranath,

see in your IDOC, there will be a EDIDC segment which will have the DOCNUM field containing the IDOC number of your IDOC.....take this field for target data for idoc number.

regarding segment number, you can have an integer variable in your JAVA mapping prg, to count the number of segments when you will be looping in your source XML data... similar thing you can do for Number of Superior Parent Segments, Hierarchy Level of SAP Segment also.

Thanks,

Rajeev Gupta

Message was edited by:

RAJEEV GUPTA

Former Member
0 Kudos

Hi Rajeev,

Thank you for your Information.

Hope my problem will be resolved with this information.

Yogi.

Former Member
0 Kudos

Hi,

Please see the below links...

/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i

/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii

/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii

/people/amol.joshi2/blog/2006/03/10/think-objects-when-creating-java-mappings

Regards

Chilla..

bhavesh_kantilal
Active Contributor
0 Kudos

You need to use either a SAX and a DOM parser and write the code to access the same fields

Read through these blogs,

/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i

/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii

/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii

Regards

Bhavesh