cancel
Showing results for 
Search instead for 
Did you mean: 

Idoc packaging

Former Member
0 Kudos

Hi there,

I am working on a XMLFile to Idoc(FIDCCP02) scenario.I am using the segments E1FIKPF,E1FISEG and E1FINBU.

Source XML Structure:

<InvoiceHDR>

.........

...........

</InvoiceHDR>

<InvoiceDTL>

............

................

................

................

................

</InvoicDTL>occurences 1----10

n number of Invoice details(A maximum of 10).

<u><b>I am using Idoc Packaging techinique.</b></u>

In message mapping I am mapping

SOURCE NODE MT_Invoice to Target node IDOC(0...unbounded).

Source node <b>InvoiceDTL</b> to Target node E1FISEG(0----999).

Source node <b>InvoiceDTL</b> to Target node E1FINBU(0--1).

So when I test the scenario, I am getting the target message as

FIDCCP02

IDOC

BEGIN1

E1FIKPF----


HEADER

E1FISEG----


InvoiceDTL1

E1FINBU

E1FISEG----


InvoiceDTL2

E1FISEG----


InvoiceDTL3

E1FISEG----


InvoiceDTL4

E1FISEG----


InvoiceDTL5

Only DTL1 is getting data for the E1FINBU, but not others.My requirement is for each InvoiceDTL in Idoc must have data from E1FISEG as well E1FINBU.

How to rectify this problem?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Ann,

Try mapping E1FINBU segment to constant 'empty'. Also check if the field of E1FINBU segment that you have mapped contain some data in the InvoiceDTL structure.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ann,

I guess u want tht both E1FISEG as well E1FINBU shud get data from InvoiceDTL. But ur E1FINBU is only occuring once, so it will only take one value. So , u hv to change the occrence of the E1FINBU segment using IDoc extension. I hope i hv understood the req correctly.

Regards,

Akshay

Former Member
0 Kudos

Hi Akshay,

Thank you for your reply.

To change the occurence of Idoc do we have any other option,other than Idoc extension?

Thank you,

Ann S.

Former Member
0 Kudos

Hi Ann,

Since u r using IDoc packaging, u must hv probably changed the occurence of the idoc..i.e. of the root. But , u want the occurence of a segment to be changed. So, in tht case u hv to make the occurence of the segment as unbounded. I dont think thr would be any other way to do it...except idoc extension.

Regards,

Akshay

Former Member
0 Kudos

Hi Akshay,

I have changed the occurence of segment but what happened is segment is repeating at DTL1 to 5 times instead of coming up at each DTL level.

Can we handle this using mapping functions?

Thank you,

Ann.

Former Member
0 Kudos

Hi Ann,

Hi Ann,

You can do the mapping in the same way as u did for the segment E1FISEG. Is E1FIBNU seg comin under E1FISEG? If yes, then u may hv to go for a udf..

Regards,

Akshay

Former Member
0 Kudos

Hi Akshay,

Thanks for your input.

Can you suggest me a sample UDF, as I am not familiar with JAVA functions.

Thank you,

Ann.

Former Member
0 Kudos

Hi Ann,

In ur case it will like this,

Just create a udf...give it a name...select the queue option, then give one input parameter as 'arg' in this case

for(int i=0; i< arg.length; i++)

{

result.addValue(arg<i>);

}

here arg = E1FIBNU

So, input to udf will be Dlt and output will be E1FIBNU

For more details how to create a udf, check the following link

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm</a>

<a href="/people/dennys.hsieh/blog/2006/11/20/how-to-parse-xxyyzzaabbcc112233-in-message-mapping:///people/dennys.hsieh/blog/2006/11/20/how-to-parse-xxyyzzaabbcc112233-in-message-mapping

<a href="/people/harrison.holland5/blog/2006/12/08/mapping-context-changes-in-xi:///people/harrison.holland5/blog/2006/12/08/mapping-context-changes-in-xi

Regards,

Akshay

Former Member
0 Kudos

Hi Akshay,

Thank you for your input.

I have used the standard function SPLIT BY VALUE instead of UDF and it worked.

I really appreciate your help.

Thank you,

Ann.