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

New to PI, text processing

Hi all,<br>

<br>

I'm not sure how clear this question is going to be....and please forgive the formatting, the message editor isn't very helpful.<br>

<br>

I'm mapping an idoc text segment into a flat file. sounds simple enough, well there are some caveats to it.<br>

<br>

I'm working with idoc WHSORD.DELVRY03, segment E1TXTH8 and it's sub-element E1TXTP8<br>

<br>

The comment line in E1TXTP8 is 132 characters. In the flat file format I'm given, I have 25 characters to work with at a time. <br>

<br>

Any time I need more that 25 characters I have to add a new line to the flat file, increment the necessary counters, and place the next group of 25 characters out there....rinse repeat...until all the E1TXTP8-TDLINEs are processed.<br>

<br>

so my idoc may have the segment below:<br>

<br>

>E1TXTH8<br>

TDOBJECT | VBBK<br>

TDOBNAME | 123456<br>

TDID | 0012<br>

TDSPRAS | E<br>

LANGUA_ISO| EN<br>

> E1TXTP8<br>

TDFORMAT | *<br>

TDLINE |The quick red fox jumped over the lazy brown dog.<br>

> E1TXTP8<br>

TDFORMAT | *<br>

TDLINE |The quick red fox jumped over the lazy brown dog.<br>

> E1TXTP8<br>

TDFORMAT | *<br>

TDLINE |The quick red fox jumped over the lazy brown dog.<br>

> E1TXTP8<br>

TDFORMAT | *<br>

TDLINE |The quick red fox jumped over the lazy brown dog.<br>

<br>

<br>

The ideal result:<br>

<br>

> File<br>

> Header (this is fine)<br>

<br>

> HComments<br>

counter | 1<br>

COMMENT | The quick red fox jumped <br>

HComments<br>

counter | 2<br>

COMMENT | over the lazy brown dog. T<br>

HComments<br>

counter | 3<br>

COMMENT | he quick red fox jumped o <br>

HComments<br>

counter | 4<br>

COMMENT | ver the lazy brown dog. Th<br>

HComments<br>

counter | 5<br>

COMMENT | e quick red fox jumped ov<br>

HComments<br>

counter | 6<br>

COMMENT | er the lazy brown dog. The<br>

HComments<br>

counter | 7<br>

COMMENT | quick red fox jumped ove<br>

HComments<br>

counter | 8<br>

COMMENT | r the lazy brown dog.<br>

<br>

> Details (this is fine)<br>

<br>

<br>

Right now I can get the HComment to show up when needed. but only once, and the text is non-existent. <br>

<br>

Other related info, I'm new to PI, I can do the basic stuff pretty well, drag-drop mapping and such. <br>

<br>

Java coding is not something I have really ever done, been strictly ABAP till recently.<br>

<br>

I'm fairly pressed for time, as the usual requirement, but any ideas or help would be greatly appreciated<br>

<br>

Thanks,<br>

<br>

Sean

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2010 at 03:54 PM

    Hi,

    Best option i feel here is to have a UDF and pass the values of TDLINE and entire array of E1TXTP8 or the field which tells how many fields in the target it should be....

    in the udf need to write the logic..as per your requirement...

    i am just guiding the solution...but not providing the exact solution.

    Happy Learnings in PI..

    Regards

    Rajesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2010 at 04:53 PM

    Hi,

    maybe this can help you,

      // value your node
           //cant size that you want to split
           
           int cant=String.valueOf(cant);
           int valueLenght=value.length();
           int pos;    
            String temp;
            while(valueLenght>cant)
            {  pos=0;
               temp=a.substring(0,cant);            
               value=value.substring(cant, valueLenght);          
               valueLenght=valueLenght-cant;                             
            }
           return value;
    

    Edited by: lpbuff on Jan 28, 2010 5:53 PM

    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.