Skip to Content
avatar image
Former Member

FCC Parameters for Comments fields

My requirement to pick the text file in that comments field comes to multiple lines. What is the way to use the FCC parameters for this requirement.

Text file looks

New       Material       Comments

|            093846         Line1: Welcome

Line2:SAP PI

Line3:Netweaver

|            093847         Line1: Hello

|            093848         Line1: Hai

Line3, Line 2 is blank

Line4

Line5

|           093849          eeeee

e

e

eee

ee

|           093850          Hi

Reulst comes to Comments should be line wise

Line1: Welcome

Line2: SAP PI

Line3:Netweaver

Thanks

Ashok

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Jan 01, 2015 at 07:12 PM

    Ashok,

    If FCC doesn't work. You can use Java Mapping.

    Is input file, space separated or tab separated? Please paste part of actual input file here, we can help you.

    Space separated: in Notepad++

    Tab separated:


    space.PNG (81.6 kB)
    Tabs.PNG (69.9 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Raghu Vamseedhar Reddy KadipiReddy

      Hi Raghu,

      We change the requirement as a starting delimiter to ending delimiter in a record creating single text file, and we write a UDF to pick the material number and remaining as internal comments.

      UDF Material:

      ==========

      String material = "";

      for (int i=0;i<var1.length;i++)

      {

      if (var1[i].startsWith("|")) {

      result.addValue(var1[i].substring(2,10));

      material = var1[0].substring(2,10);

      }

      else {

      result.addValue(material);

      }

      }

      UDF Internal Comments:

      ==================

      for (int i=0; i<var1.length;i++)

      {

      if (var1[i].startsWith("|")) {

      result.addValue(var1[i].substring(11,var1[i].length()));

      }

      else

      {

      result.addValue(var1[i]);

      }

      }

      Thanks

      Ashok

  • Dec 30, 2014 at 12:46 PM

    Hi Ashok,

    I think the logic is a bit complicated to do it with FCC. In my opinion you can pick the entire file and to deal with the problem at mapping level. Also you can try with a shell batch OS file to execute before, but i think the logic can be difficult as well, Check this thread http://scn.sap.com/thread/1083737

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 30, 2014 at 01:47 PM

    Read each line into one field and during the mapping write a UDF to get the substring based on your requirement.(indexOf("Line")) something similar.


    Refer to Greg's suggestion in the below thread to read each line into a string.

    FCC with multiple structure

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 31, 2014 at 04:35 AM

    Sender Text file.

    Add comment
    10|10000 characters needed characters exceeded