3 Replies Latest reply on Jun 4, 2014 4:10 PM by Francisco Amores

    FDMEE Mapping <Blank> Not Working / Jython Script

    MikeTO

      Hi All,

       

      Has anyone gotten the <Blank> mapping to work?  I put it in my LIKE mapping and it doesn't do anything.  Any assistance would be appreciated.

       

      As a workaround, I have been trying to add an import script to my file based import format.  I want any blank fields in ICP to be converted to [ICP None].  The process detail logs (shown below) keep giving me an error.  It doesn't seem to like dealing with nulls.  Here is my Jython import script:

       

      def OracleEBS_ICPNone(strField, strrecord):

           if strfield is not None and len(strfield) > 0:

               return "[ICP None]"

           else:

               return strfield

       

      Log error:

      2014-06-03 14:57:18,892 DEBUG [AIF]: 105039:EPMERPI - Error evaluating the expression : OracleEBS_ICPNone('','725,100151_C,,000,,16434308.16' )

      result: null

      2014-06-03 14:57:18,894 ERROR [AIF]: 105039:EPMERPI - 105042:EPMERPI - Error evaluating the script.

      null

       

      Thx,

      Mike

        • 1. Re: FDMEE Mapping <Blank> Not Working / Jython Script
          Francisco Amores

          how are your source values?

          <BLANK> does not refer to NULL.

          It will only work if your source value has a white space in it.

          So if you have a mapping like <BLANK> --> [ICP None]

          and your source value is empty string ... it will not work

          it will work if it has a white space (' ')

           

          For you script:

          def OracleEBS_ICPNone(strField, strrecord):

               if strfield is not None and len(strfield) > 0:

                   return "[ICP None]"

               else:

                   return strfield

           

          Jython is case sensitive: strField <> strfield

           

          If you want to capture source empty values in ICP:

          def OracleEBS_ICPNone(strField, strRecord):

               # You can trim your source, remove left/right white spaces and then check if length is zero

               if len(strField.strip()) == 0:

                   return "[ICP None]"

               else:

                   return strField

          • 2. Re: FDMEE Mapping <Blank> Not Working / Jython Script
            MikeTO

            Thx Francisco.  I finally got it to work yesterday by using == rather than =.  See below.  I am new to Jython.

             

            I will keep the <BLANK> point in mind.

             

            def OracleEBS_ICPNone(strField, strrecord):

                 if len(strField) == 0:

                      return "[ICP None]"

                 else:

                      return strField

             

            Thx,

            Mike

            • 3. Re: FDMEE Mapping <Blank> Not Working / Jython Script
              Francisco Amores

              No problem.

               

              You need to make sure that source ICPs are just empty strings and no string with white space.

              Otherwise len(strField) will return > 0. You can use strip (similar to trim)

               

              Regards