Skip to Content

PERSONAS : Can we switch theme using script?

Hi experts,

I have a flavor with (among others) 2 buttons.

The first one launch tcode IW32 with a custom flavor. I have done admin maintenance to bind user/role/tcode/theme (There is a bug because custom theme is not applied, Note OSS 2492693 should correct this bug but i can't implement it but this is not the point of this post. So for now i have to activate it manually)

Now for the next button, my customer wants to launch also IW32 but the original screen, with the default sap theme.

To switch to original screen, i use "session.utils.changeToOriginalScreen()" everything is fine but my custom theme is still On...Or i want the standard SAP theme with the original screen.

How can i do that through scripting?

EDIT : My scope being very wide, i have several shortcuts for standards Tcode which must be displayed with the classic SAP theme. Or, like IW32, the custom theme is kept...


Kind Regards,


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    May 04, 2018 at 05:11 PM

    Hi Alexandre,

    This is currently not possible, since there is no script command for theme switching. As far as I heard, there was a technical (authorization-related) reason why theme switching was not implemented.

    However, you could use a workaround and switch to a different flavor, which is set up to have a direct theme link. The theme itself could be just like the default SAP theme. That way, the new flavor would also switch the theme. If your other flavor is just simply the copy of the Original Screen, then this would achieve what you are looking for. Not elegant, but it would work.

    Add comment
    10|10000 characters needed characters exceeded

    • As you said, associate a custom theme (which is like the default SAP theme) to a custom flavor (with no changes) does the trick, thank you. In the end, i would have preferred a solution with scripting because theme administration is not working well on my system, but i hear your point.

      I will not open a new thread about the theme administration bug. I just hope it will not be there when they'll upgrade to SP06.

      Have a good day.



  • May 03, 2018 at 04:39 PM

    Hi Alexandre,

    AFAIK, this is not possible. I'll do some tests and come back to you later (probably during the weekend - you might receive an answer from another colleague earlier).

    Kind regards,


    Add comment
    10|10000 characters needed characters exceeded