Skip to Content
0

Split if the invoice line items are more than 900 in File to PROXY

Oct 31, 2016 at 06:42 AM

97

avatar image

1st requirement is to trigger a separate proxy for unique invoice ID that I am able to achieve with graphical mapping .

Eg: Invoice ID companycode company Name

100 A8xz XYZ

100 As04 MXY

100 AZBC PQR

200 AX04 ABC

200 AZ04 MNO

Then I am triggering 1 proxy for all the line item with invoice ID 100 and 2nd proxy with invoice ID 200 along with header and trailer records.

2nd Requirement:

Suppose if the line items for each invoice ID is more than 900 then I have to trigger 1 proxy with 900 line items and 2nd proxy with rest of the line items. I am not sure on how to do this .Please help me .

Thanksℜgards,

Akhila.A

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Konrad Thalheim Oct 31, 2016 at 06:52 AM
0

Hi Akhila,

Have you tried to split your target messages via the Signature Tab in the Message Mapping? This works for my split scenarios fine and it is providing the right chunks for ECC or any other ERP system.

Kind regards

Konrad

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Konard,

In signature tab I tried to edit the occurence it is not going ..I think we have to select from the drop down list which has only 3 options 1,0..1,0..unbound

Thanksℜgards,

Akhila.A

0
Raghuraman S Oct 31, 2016 at 08:08 AM
0

Hello Akhila,

check if the logic in the below link helps you

https://archive.sap.com/discussions/thread/1738784

Share
10 |10000 characters needed characters left characters exceeded
Praveen Gandepalli Oct 31, 2016 at 08:46 AM
0

Hi Ahhila,

I split based on 2 invoice numbers, use below mapping change from 2 to 900 in your side.

Execution Type: All Values Of Context.

public void split(String[] invoiceId, String[] companyCode, String[] companyName, ResultList senderDataNodeRes,
			ResultList rowNodeRes, ResultList invoiceIdRes, ResultList companyCodeRes, ResultList companyNameRes,
			Container container) throws StreamTransformationException {
		int invoiceCount = 0;
		for (int i = 0; i < invoiceId.length; i++) {
			if (!invoiceId[i].equals(ResultList.CC)) {
				invoiceCount++;
				rowNodeRes.addValue("");
				if (invoiceCount % 2 == 0) {
					senderDataNodeRes.addValue("");
					if (i != invoiceId.length - 1)
						rowNodeRes.addContextChange();
				}
				invoiceIdRes.addValue(invoiceId[i]);
				companyCodeRes.addValue(companyCode[i]);
				companyNameRes.addValue(companyName[i]);
			} else {
				invoiceIdRes.addContextChange();
				companyCodeRes.addContextChange();
				companyNameRes.addContextChange();
			}
		}
	}

Regards,

Praveen.


mapping.png (34.1 kB)
mappingtest.png (53.5 kB)
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Praveen,

I copied the code and tested with 2,4 detail records it is working fine.when I tried to test with 3,5 detail records it is not working please check and help me out.

Thanks & Regards,

Akhila.A

0
Akhila A Nov 04, 2016 at 10:32 AM
0

Any of you done this kind of scenario ? Please share your inputs

Thanks ℜgards,

Akhila.A

Share
10 |10000 characters needed characters left characters exceeded