Skip to Content
author's profile photo Former Member
Former Member

2 IDOC scenarios

Hi Experts,

I need help on the following two scenarios , and wanted to know if some one can help me with the code or if this can be done through PI standard functions

a) File to IDOC scenario - where in the File the first 6 characters of a line item will determine the number of IDOCS i.e

for every change of the combination of first 6 characters a new IDOC should be generated

for eg

abc def ............

abc def...............

abc def............ will be one idoc and

abc rty .............will be 2nd idoc and

def ghr

def ghr

deg ghr.............will be 3rd IDOC

So in all ,3 idocs from these 7 lines , each time the combination of first 6 characters changes a new target IDOC should be generated.

b) File to IDOC scenario

One field will come in a serial number and as soon as it starts with 1 again a new IDOC should be generated

ie. the line items with that filed need to be grouped in one IDOC.

for eg

......1 .....1st target IDOC starts here ..

......2.......

......3.....

......1......2nd IDOC should start as soon as this field is 1 again

......2.....

......1.....3rd IDOC starts here

so every time this field in the legacy file(fixed length) comes as 1 , a new target IDOC needs to be generated

Thanks

Rohan

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 23, 2009 at 04:35 AM

    Hi,

    For

    So in all ,3 idocs from these 7 lines , each time the combination of first 6 characters changes a new target IDOC should be generated.
    

    Use this:

    [sourcefield]--->splitByValue(changevalue)->collapse context-->[Target Field]
    

    For:

    so every time this field in the legacy file(fixed length) comes as 1 , a new target IDOC needs to be generated
    

    Use this:

    [sourcefield]--->
                               [Equals]--->createIf---->[Target Field]
    constant = 1
    

    Regards

    Ivan

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      So Use this:

      [sourcefield]----->spliByValue(valueChange)->[targetfield]
      

      This is going to put in different context your invoices, It means put in different IDOCs.

      *For Idoc creation, preserve the last logic

      Regards

      Ivan

  • author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2009 at 04:59 AM
     File to IDOC scenario - where in the File the first 6 characters of a line item will determine the number of IDOCS i.e 
    for every change of the combination of first 6 characters a new IDOC should be generated
    

    use

    sourcefield--->subString(0..5)---->splitByValue(changevalue)->collapse context-->Target Field
    

    to specify the properties for subString double click it ans specify 0 for starting position and 5 for No. of characters.

    if required use removeContext before subString std function.

    One field will come in a serial number and as soon as it starts with 1 again a new IDOC should be generated 
    

    use

    sourcefield--->
                              equalS--->ifWithoutElse---->Target Field
    constant = 1                         Sourcefield/
    

    Edited by: Kubra fatima on Aug 24, 2009 7:10 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 22, 2009 at 12:32 PM

    Hi ,

    you can achieve this by writting an UDF . No standard function will help .

    Else you can use the combination of UDF and Remove Context , etc

    Regards,

    Jude

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 23, 2009 at 06:18 AM

    Hi,

    You can read the file either using a [java mapping|https://wiki.sdn.sap.com/wiki/display/XI/WholePayloadtoaXML+field](if your input file has no delimiter or its not well defined structure)

    or go for FCC to read the file.

    Once you bring the values to be checked in the field, you can use split by value change function in the mapping as suggested above.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.