If there is a single line with the FLAG column containing "S" and another line containing the "E" value, both of which meet the filter defined in the WHERE clause, the code below returns what is requested.
-- código #1
SELECT @dataInicio= case when FLAG = 'E' then DTDIGIT else @dataInicio end,
@dataFim= case when FLAG = 'S' then EMISSAO else @dataFim end
from tabela
where ...;
Example:
-- código #2
CREATE TABLE Config (FLAG char(1), DTDIGIT date, EMISSAO date);
INSERT into Config values
('E', '20120303', NULL), ('S', NULL, '20120403');
declare @dataInicio date, @dataFim date;
SELECT @dataInicio= case when FLAG = 'E' then DTDIGIT else @dataInicio end,
@dataFim= case when FLAG = 'S' then EMISSAO else @dataFim end
from Config;
SELECT @dataInicio, @dataFim;
However, if there is more than one line with the same value for the FLAG column, the variable fill is undetermined.