4 Replies Latest reply: Jun 27, 2016 4:42 PM by Alex Valverde RSS

    Script to optimize data load

    Alex Valverde

      Good day,

      Please show your support, the following script takes an average of 00:04:30 to make the load of 90 new records in a table of SAP, with the index 'VBELN' field need to reduce optimize the same time. Thank you.

       

      SET vQVD_File = 'LIB://Qvd_Ventas/ZVTA_DIMEN_CAB.qvd';

      Temp_Tabla:

      NoConcatenate

      LOAD Distinct VBELN From $(vQVD_File) (qvd);

       

      zvta_dimencab_new:

      NoConcatenate

      LOAD VBELN, FKART, VSTEL, PSTYV, VBTYP

      where not Exists(VBELN) ;      

      SELECT VBELN, FKART, VSTEL, PSTYV, VBTYP

        FROM ZVTA_DIMEN_CAB ;

       

      If ScriptErrorCount = 0 then

         LOAD VBELN, FKART, VSTEL, PSTYV, VBTYP

         From $(vQVD_File) (qvd)    ;

         STORE * FROM [zvta_dimencab_new] INTO 'LIB://Qvd_Ventas/ZVTA_DIMEN_CAB.qvd';

          DROP TABLE [zvta_dimencab_new];

      End if

      ;

      DROP TABLE [Temp_Tabla]

      ;