Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Oct 31, 2016 at 06:52 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • Oct 31, 2016 at 08:08 AM

    Hello Akhila,

    check if the logic in the below link helps you

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 31, 2016 at 08:46 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • avatar image
    Former Member
    Nov 04, 2016 at 10:32 AM

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

    Thanks ℜgards,

    Akhila.A

    Add comment
    10|10000 characters needed characters exceeded