1 Reply Latest reply: Sep 9, 2013 7:52 PM by Fernando Tonial RSS

    Scripting problem

    Dirk De Wispelaere

      Hi, i use the following code:

       

      Files:

      LOAD

          *,

          RowNo() as RijNr

      Resident FilesTemp Order By RepDate asc;

       

      DROP Table FilesTemp;

       

      LET vX = Peek('RijNr');

       

      FOR x = 1 to vX

       

          LOAD

              X,

              RepDate,

              'F' as filter

          Resident Files Where RijNr = $(x);

       

      LET vDate = Peek('RepDate');

      LET vFile = Peek('X');

       

      IF x = 1 then

      DataPolyvalentPersoneel:

           

              LOAD num(IDF,'000000000') as IDF,

                   num(IDF,'000000000') as IDFPoly,

                   text(num(IDF,'000000000')) as IDFData,

      //             NUM(IDF, '000000000') AS IDF,

                   left(right(IDF,5),2) as Jaar_ID,

                   NUM(%/100,'#,##') AS %,

                   'OA' as SoortOperator,

                   Kostenpl.,

                   'A' AS Groep,

                   'D' AS [D-post/Pool],

                  % as "FTE Reporting",

                  num(Inzetbaar/100,'0,00') as [$(vDate) IZ],

                  date(right(SubField(FileName(),'_',1),2)&'/'&Mid(SubField(FileName(),'_',1),5,2)&'/'&Left(SubField(FileName(),'_',1),4))as DateIZ,

                   if(% = Inzetbaar,'Y','N') as [%=IZ],

                   [Bew uit] as [IZ Bew uit],

                   date(Datum) as [IZ Datum]

              FROM

       

              [F:\B-FS102\REPORTING B-FS_EFF_SAP\Reporting voor QV\$(vFile)]

              (biff, embedded labels, table is [Lijst O_A$]);

       

      ELSE

      Add

          LOAD

          num(IDF,'000000000') as IDF,

                   num(IDF,'000000000') as IDFPoly,

                   text(num(IDF,'000000000')) as IDFData,

      //             NUM(IDF, '000000000') AS IDF,

                   left(right(IDF,5),2) as Jaar_ID,

                   NUM(%/100,'#,##') AS %,

                   'OA' as SoortOperator,

                   Kostenpl.,

                   'A' AS Groep,

                   'D' AS [D-post/Pool],

                  % as "FTE Reporting",

                  num(Inzetbaar/100,'0,00') as [$(vDate) IZ],

                  date(right(SubField(FileName(),'_',1),2)&'/'&Mid(SubField(FileName(),'_',1),5,2)&'/'&Left(SubField(FileName(),'_',1),4))as DateIZ,

                   if(% = Inzetbaar,'Y','N') as [%=IZ],

                   [Bew uit] as [IZ Bew uit],

                   date(Datum) as [IZ Datum]

              FROM

       

              [F:\B-FS102\REPORTING B-FS_EFF_SAP\Reporting voor QV\$(vFile)]

              (biff, embedded labels, table is [Lijst O_A$]);

      END If

       

      NEXT;

       

      The field X of the table Files: contains the list of filenames he has to process.

      The first time, x = 1 hi goes through the code everything OK, hi retrieves vFile and vDate,

      after the NEXT statement x becomes 2, this is OK, and then for vDate and vFile he retrieves Null for both variables???

       

      How comes?

       

      Thx in advance