cancel
Showing results for 
Search instead for 
Did you mean: 

Creating MACRO with condition

Former Member
0 Kudos

Hi All,

I want to create a MACRO with some condition as below Can anybody help me?

Ex :- There are 3 KFs.

A,B and C

If A is not initial (or > 0).

C = A

Else

C = B

Endif.

I tried to put condition like this but i could not achieve it. I am new to MACROs, So not aware of the operations to select.

Can anybody help?

Sameer.

Accepted Solutions (1)

Accepted Solutions (1)

former_member187488
Active Contributor
0 Kudos

Hello Sameer,

I think this should be an easy macro, so not sure why you cannot acheive it.

I suppose you should make the macro like this:

<Macro>----


Macro Name

<Step>----


Step Name (Iteration)

<Condition Statement>-------IF

<Condition>----


Condition Description

<Row>----


Row A > 0

<Row>----


Row C =

<Row>----


Row A

<Condition Statement>-------ELSE

<Row>----


Row C =

<Row>----


Row B

<Condition Statement>-------ENDIF

Two points to notice:

1) Be careful with the level of each elements. For example, <Condition Statement> and <Condition> should be on the same level, while ' <Row> Row A > 0' should be on the next level of <Condition>.

2) The above example uses 'Row A > 0'. If you want to check whether it's initial, you should use macro function IS_INITIAL() , if you're using SCM5.0 or higher. Please refer to SAP note 1068603.

Best Regards,

Ada

Former Member
0 Kudos

Hi Ada,

Thanks for your help. Could you give me a small example on How to use IS_INITIAL pleas?

Sameer

former_member187488
Active Contributor
0 Kudos

Hello Sameer,

I think SAP note 1068603 has explained this very well. For example:

<Condition Statement>----IF

<Condition> -


Description of the condition.

<Operation/Function>----


IS_INITIAL(

<Row>----


ROW A

<Operation/Function>----


) = 1

<Row>----


Row C =

... ...

For the '<Row> Row A' line, you'll need to double click it, and change the 'datasource' field as 'row attribute'.

Best Regards,

Ada

Former Member
0 Kudos

Thanks Ada.. for your help.

Resolved.

Sameer

Answers (0)