cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Screen Personas - Script Object Not Found

Former Member
0 Kudos

I'm attempting to create an SAP Personas flavor for ME51N (Create PR) and I'm having an issue with a script. When ME51N loads, the contents of the screens are contained within collapse-able containers that are collapsed by default...ie, no screen controls are visible. When I moved various objects around, hid others etc, the same logic applies...they are hidden until the container is expanded.

I wanted to remove the need to expand/collapse these sections in my flavor so I recorded a script where the three buttons are clicked with the intention of adding it to the OnCreateHandler event of the UserArea. This was working beautifully for the last two day. Now the script is giving me a "Contol Not Found" error when the second button is to be "pushed". I re-recorded the script and attempted to run it on a new button by manually clicking the button and the same error is occurring.

I even unhid the three buttons so they were once again visible and that didn't work either.

Are there any other ideas that someone can offer? The error is obviously telling me it can't find the button to push but I've verified the control id and button name are correct so it should be fine.

The other side of this problem is whether or not anyone has a better way of making these objects automatically expanded so the script isn't even required.

Any and all suggestions are greatly welcomed.

Thanx in advance,

Elder

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

I've done the same thing with ME21N, to make sure the header is always expanded before I try to copy data from it. In ME21N the button and its ID changes when you expand/collapse the header. Trying to push the "expand header" button when it is already expanded produces an error because the button doesn't exist.

You need to use an IF to first detect the state and only expand the header if it isn't already. Look for the "Header" label next to the "expand" button and use an "If is not empty" test to make sure you only push the expand button when it exists. If you have SP03 installed you should instead be able to use the new "if control exists" test instead.

Steve.

Former Member
0 Kudos

Thanx Steve. I was just coming to the same conclusion when I received your post. I'm going to test on the Header label for now to see if I can get it to work. We're looking at SP3 early next week once the new kernel patch and SNOTE are released.

TobiasQueck
Advisor
Advisor
0 Kudos

Hi Steve,

You could also send the keyboard shortcut to expand the header. Sending the shortcut will not cause an error if the box is already expanded, so you do not need an IF.

Cheers,
Tobias.

Former Member
0 Kudos

Great idea...already wrote the if and have it working, but definitely something to keep in mind

abhijeet_dadarkar2
Participant
0 Kudos

Hi Tobias,

How to send keyboard shortcut? I checked the available options in a Script button, but I can only fire an F key.

Regards,

Abhijeet

Former Member
0 Kudos

Hi Tobias

How do you send a keyboard shortcut to expand / collapse the sections?  For example, to collapse the Details section is Ctrl-F7.  I can see how you send the Function key but how to send Ctrl-F7?

Thanks

Gareth

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

Did you try to use recording?

Former Member
0 Kudos

Thanks Tamas - that's the way

Answers (1)

Answers (1)

former_member105930
Active Participant
0 Kudos

I'm joining this conversation late, but I have had similar issues in the MIGO transactions and ended up creating custom exit buttons from the transaction which contains scripting which when the exit button is pressed, collapses the expanded section.

The next time the transaction is called, there is scripting which pushes the expand section button as this will always then exist.

Just another option for you to consider.

Ian