cancel
Showing results for 
Search instead for 
Did you mean: 

FALSE option of Alternative not being called

Former Member
0 Kudos

Hello all,

I'm having a strange problem in my smartform. I'm attempting to control the order of pages using an alternative: checklist-direct_dep = 'X'. I've put breakpoint program lines in both true and false, but the program will only ever stop with true. If I set checklist-direct_dep = '' or 'Z', the program runs without stopping at the breakpoint in false result. (This also means that the page I'm directing to in false command is not displaying.) Any ideas??

Thanks,

Lisa

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Kartik,

OK, I checked the program, and SAP has not added any of the necessary code for "False" condition. In my smartform, the conditions look like:

NEXT_PAGE alternative

- TRUE

---TRUE_BREAK program lines (break-point)

--- GOTO_DEPOSIT command setting page to DIRECT_DEPOSIT

- FALSE

--- FALSE_BREAK program lines (break-point)

--- GOTO_LIFE command setting page to LIFE

Here's the generated code:

IF ( CHECKLIST-DIRECT_DEP EQ 'X' ).

PERFORM %CO2.

IF %WEXIT <> SPACE. EXIT. ENDIF.

CALL FUNCTION 'SSFCOMP_SET_NEXT_PAGE'

EXPORTING I_NEXT_PAGE = 'DIRECT_DEPOSIT'

EXCEPTIONS OTHERS = 1.

IF SY-SUBRC <> 0. RAISE ERROR. ENDIF.

ENDIF.

SAP is clearly not inserting any "else" in the code that is generated. I tried to add alternative in another (simple) smartform, and had the same behaviour. Any ideas???

Thanks,

Lisa

former_member205763
Active Contributor

Hi Lisa,

It seems that you have added the conditions in the "conditions" tab of the alternative node. the condition should be added to "general attributes" -> node conditions(determine conditions).

if you put the condition here, your issue wouold be resolved.

Regards,

Kartik

Answers (2)

Answers (2)

Former Member
0 Kudos

Kartik,

Thanks so much!!! Adding the code in the General Attributes tab did the trick!

Lisa

former_member205763
Active Contributor
0 Kudos

you can check the smartforms function module, goto F01 include and check the code for this condition, you would get the background abap version of the node, may be it gives u a clue. put a breakpoint there and see how it works