Skip to Content
0
Aug 01, 2009 at 08:48 AM

Grouping two records from flat source file into one based on key fields

15 Views

Hi All,

I am working on a file to idoc scenario, where the source file structure contains matnr, quantity, movement type and batch status.

The requirement is if matnr, quantity are same and batch status is 'A' and directions are opposite (say one is having inbound

and other is having outbound), then they need to be mapped to a single record in target side (target is an idoc).

The file structure is as below.

Header RECTYP

Header TRANDATE

Header TRANTIM

Header IFTYP

Header IFSEQNO

Detail RECTYP

Detail MVT_DATE

Detail REF_NBR

Detail MVT_DIR

Detail MVT_REASON

Detail MATNR

Detail PLANT

Detail BATCH

Detail STG_LOC

Detail BOND_FLG

Detail BATCHST

Detail STK_RC

Detail QTY

Detail MATNR_TO

Detail PLANT_TO

Detail BATCH_TO

Detail STG_LOC_TO

Detail BOND_FLG_TO

Detail BATCHST_TO

Detail STK_RC_TO

Detail DELNOTE

Detail DELNITEM

Trailer

Trailer RECTYP

Trailer TRANDATE

Trailer TRANTIM

Trailer RECCOUNT

I thought of doing it by XSLT mapping- first group the records through xslt mapping in the same structure and then map the structure to target idoc i.e. through two mappings, but seems will have to go for java mapping. Please suggest.