Problem while mapping SAP Idoc

Hi All,

I am trying to map an SAP Idoc to a Flat File format.i was able to get an idoc populated successfully into the Idoc structure thru the TransforFlatToHierarchy serivice.But some of the fields in the Idoc structure are vanishing becoze the corresponding values are not there in the incoming SAP idoc.so when i am mapping these fields to the output structure thru an Transoformer(custom java service) its giving an Null pointer exception.

I tried many ways of initializing the Idoc but still some segments and fields are missing after it is getting populated by mapping it from boundnode.

How to solve this.please let me know if anybody faced this problem before.

Thanks,
kamal

Kamal,
The SAP IDOC structure can be downloaded from SAP R3 as a DTD(Tx. WE60, enter the IDOC type and use Documentation->Create DTD). The same can be uploaded into BC as a record(New : Record->Enter a name->Source->DTD).

Create a Record reference of this record and then map the output(boundNote) of the TransformFlatToHierarchy.

All the fields in the IDOC would appear in the structure, irrespective of the content. However, the “null pointer execption” would not get solved, as the values from the IDOC still remains NULL. One has to validate the fields contents for null values before passing the data to your transformer !

HTH
Bhavani Shankar.