cancel
Showing results for 
Search instead for 
Did you mean: 

If aninados

0 Kudos

Buenos días,

Estoy intentado meter IF aninados en una función, pero siempre me da error de sintaxis;

Por ejemplo tengo esto metido en la función, pero claro, si se cumple el primero, el segundo ya no sale datos, ¿hay alguna manera de que filtrando por OF me puedan salir varios datos que yo quiera?

if {OPPOR.YTIPOMERCADO_0} = 'OF' then

OFX := OFX+{ZDATCOM.COSTEPROD_0};

else

if {OPPOR.YTIPOMERCADO_0} = 'OF' then

MTOFX := MTOFX+{ZDATCOM.COSTEMAT_0}

Un saludo

Accepted Solutions (0)

Answers (1)

Answers (1)

DellSC
Active Contributor
0 Kudos

It looks like you're trying to update two different values based on the same condition. Assuming that OFX and MTOFX are variables that you're setting, you need to change this part of your formula to this:

if {OPPOR.YTIPOMERCADO_0} = 'OF' then
(
    OFX := OFX+{ZDATCOM.COSTEPROD_0};
MTOFX := MTOFX+{ZDATCOM.COSTEMAT_0};
);

-Dell