cancel
Showing results for 
Search instead for 
Did you mean: 

SAP VC -Procedure - IF_ELSE

former_member209175
Participant

Dear Team,

I am writing global dependency in CU01 (Dependency type: Procedure) as below. And I am getting below error. Is it not possible include ELSE also along with IF condition?

In the below dependency, if I remove the ELSE part, it working fine. How to include ELSE part also in the below dependency?

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Flavio
Active Contributor

Hi

indeed, ELSE statement is not available within the dependency code syntax.

However, we can use the following code for the present case:

Hope this could help.

Thanks and regards,

Flavio

former_member209175
Participant
0 Kudos

Hi Flavio,

Thank you for your info.

I have implemented your above code & in simulated in CU50. The characteristics is always set as 0005 even though the car type is RACE. And then I have just modified your suggested code as below & works fine.

Flavio
Active Contributor
0 Kudos

Hi

I'm happy that it's working.

The suggested code was however working for me, it's a little bit weird that it wasn't for you... Here follows my quick testing in the sandbox system:

CAR_TYPE not equal to RACE:

CAR_TYPE equal to RACE

Anyway, it's okay with your solution, too. As usual, we have several ways to reach the same aim, that are equivalent.

Thanks anfd bye,

Flavio

Sergiu
Contributor
0 Kudos

You can use NE from Syntax of Object Dependencies.

OR

" Create with CT04 COND_VAR TYPE C(4).
COND_VAR = 'FALSE',
COND_VAR = 'TRUE' IF RACE = 'ONE',
$SELF.MATERIAL_PLANT = '1001' IF COND_VAR = 'TRUE',
$SELF.MATERIAL_PLANT = '1002' IF COND_VAR = 'FALSE'.

Complex statements can be executed with ABAP developed functions in transaction CU65. Check Variant Functions with an example and Variant Function with PFUNCTION & FUNCTION call.