Show TOC

Function documentationDELETESTATEMENT_FROM_FILE for GETINFO Locate this document in the navigation structure

 

This instruction scans a specified text file and builds an SQL delete query based on all different combinations of certain dimensions found in the file. The DELETESTATEMENT_FROM_FILE GETINFO type has the following syntax:

GETINFO(DELETESTATEMENT_FROM_FILE,VariableName,FileName,TableName,DimensionList, Delimiter, TimeOrTIMEID)

The following table describes the parameters that you can pass to the DELETESTATEMENT_FROM_FILE instruction.

Variable

Description

VariableName

The INFO variable in which to store the result. The default variable name is %SELECTION%.

FileName

The name of the file to scan. This is a required parameter.

TableName

The name of the table. This is a required parameter.

DimensionList

The dimensions to scan in the file. The default dimensions are as follows:

  • category

  • time

  • entity

Delimiter

The delimiter in the file. The default is a comma (,).

TimeOrTimeID

Enter a 1 for time and 0 for timeID (default is 0)

Example Example

This example uses the following GETINFO instruction:

GETINFO(DELETESTATEMENT_FROM_FILE,%STATEMENT%,MYFILE.TXT,tblFactFinance,"CATEGORY,TIME")

In this example, the contents of MYFILE.TXT are as follows:

CATEGORY, TIME, ENTITY, ACCOUNT, AMOUNT

ACTUAL,2000.JAN,ITALY,SALES,1234

ACTUAL,2000.FEB,ITALY,SALES,2345

ACTUAL,2000.JAN,FRANCE,SALES,3456

ACTUAL,2000.FEB,FRANCE,SALES,4567

BUDGET,2000.JAN,ITALY,SALES,5678

The result of the above instruction is the generation of the following INFO instruction:

INFO(%STATEMENT%, Delete from [tblFactFinance] where ([CATEGORY]='ACTUAL' and [TIMEID]='20000100') or _

([CATEGORY]='ACTUAL' and [TIMEID]='20000200') or _

([CATEGORY]='BUDGET' and [TIMEID]='20000100'))

Consider an example in which the TimeOrTimeID option is set to 1:

GETINFO(DELETESTATEMENT_FROM_FILE,%STATEMENT%,MYFILE.TXT,tblFactFinance,"CATEGORY,TIME",,1)

In this case, the following INFO statement is generated:

INFO(%STATEMENT%, Delete from [tblFactFinance] where ([CATEGORY]='ACTUAL' and [TIME]='2000.JAN') or _

([CATEGORY]='ACTUAL' and [TIME]='2000.FEB') or _

([CATEGORY]='BUDGET' and [TIME]='2000.JAN'))

End of the example.

Any software coding and/or code lines / strings ("Code") included in this documentation are only examples and are not intended to be used in a productive system environment. The Code is only intended to better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, except if such damages were caused by SAP intentionally or by its gross negligence.