How to insert alternative comand in SAP smartforms

The alternative command looks like IF statement in ABAP/4.

IF (condition) {
*** True ***
  ...
} ELSE {
*** False ***
  ...
}.

You can insert alternative command as follows:

  • Select window that you want to insert alternative command and right click. System will list object that you can create.
    img146
    In the example, I have window name ’%WINDOW1’ and I want to insert alternative command in this window.
  • On popup menu, you will select Create -> Flow Logic -> Alternative
    img147

    img148
    System will default value of Alternative name and description but you can change them.
  • In General Attributes tab, you can define condition to determine the alternative ways.
    img149
    System will default operator for concatenate these conditions by ’AND’ by you can add operator ’OR’ by select img157.
  • Under alternative command, system define 2 ways when verify condition that defined in General Attributes.
    img150
    • If system verify the alternative command is true, system will operate command in True node.
      img151
      In the example, we will show %TEXT1 if alternative command is true.
    • If system verify the alternative command is false, system will operate command in False node.
      img152
      In the example, we will show %TEXT2 if alternative command is false.
  • The output when alternative command is true:
    img153

    img154
  • The output when alternative command is false:
    img155

    img156

Technorati Tags: ,

Post new comment