cancel
Showing results for 
Search instead for 
Did you mean: 

the PO number for cXML invoice mapped to SAP IDoc INVOIC.INVOIC01

fisher_li
Participant
0 Kudos

Hey, PI gurus,

I mapped a cXML invoice to SAP IDoc INVOIC.INVOIC01.

My problem was that for the multiple line items invoice, the PO number will only show up in IDoc E1EDP02->BELNR for the first line item and will not show up for the other line items.

In cXML message, the PO number is in InvoiceDetailOrder->InvoiceDetailOrderInfo->OrderReference->orderID.

I changed the value in Context for @orderID and it did not help.

Any advice?

Thank you in advance!

Fisher Li

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

if PO number(OrderId) is appearing once in cXML file and you want repeat it with every line item on the target side,

then use node funciton 'useoneasmany'.

Regards,

Suresh

fisher_li
Participant
0 Kudos

Suresh,

Thank you very much for providing me the valuable solution.

The following were how I mapped the field.

@orderID -->

InvoiceDetailItem --> UseOneAsMany --> SplitValue ---> E1EDP02->BELNR

InvoiceDetailItem -->

Now the PO number showed up correctly for every line item in IDOC.

I also thank every one who provided their input for my question.

Fisher

Answers (3)

Answers (3)

fisher_li
Participant
0 Kudos

I should mention that the cXML invoice is the incoming message.

I mapped it to IDOC and we post the IDOC in our ERP system.

Fisher

Former Member
0 Kudos

Hi,

I understand your scenario is XML to IDOC.

Now I assume one XML corresponds to One IDOC which corresponds to 1 Invoice.

In your XML, I think PO Number is coming multiple times but same value. Is my understanding correct?

If that is the case, use below mapping.

 PO Number --> Remove Context --> Colapse Context--> Target PO Number field

This will ensure, you will get only one PO number in your IDOC.

Else, Please provide your source XML sample.

-Gouri

abhay_rajhans2
Contributor
0 Kudos

Hi Fisher,

Context change may solve your problem.

1) Put context of orderID to it immediate upper header item.

2) Put Context of BELNR to E1EDP02 and of E1EDPO2 to it immediate upper item.

Former Member
0 Kudos

Hi,

I assume you have one IDOC with multiple line items for which you are creating one XML. In that case map as follows.

PO Number --> Copy Value --> target field as PO number will come only once in source IDOC.

-Gouri