cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CBTA Scripting - ToolbarControl element problem

former_member725489
Discoverer
0 Likes
1,487

In order to interact with the ToolbarControl element, we use the CBTA component CBTA_GUI_TB_SELECTMENUITEM, to which we pass by parameter the URI of the element, the ID of the button to select and the Function of the sub item of the element.

What happens is that it is not possible to select the sub item of the element, since it does not exist when CBTA wants to identify it.

But if you manually click on the ToolbarControl button, you can interact with the element. When the script tries to interact autonomously with the object, it cannot and randomly shows the following error:

For a better understanding of the idea, I show below how the properties of the object (ToolbarControl) are displayed through the Object Spy, where you can visualize that the properties of the sub-items only exist once you manually click on the button and not before. In this case the example is of the ToolbarControl of transaction ME21N.

Properties without clicking on the ToolbarControl SELECT button:

Properties after clicking on the SELECT button manually:

I would appreciate if you could help me on how to solve this scripting problem, since it happens with all the ToolbarControl of all the transactions.

Thank you very much!

Greetings from Argentina!

Accepted Solutions (0)

Answers (1)

Answers (1)

vijayjeethuri
Participant
0 Likes

Hello Nicolas,

For clicking on the button, you can use CBTA_GUI_TB_SELECTMENUITEM component.

Under the component, parameters maintained as below:

URI - You can give tollbar control URI from object spy

Id - SELECT

Function Code - you have to give exact name of the button you are going to click(visible name). ex - Purchase orders - check the below screenshot

Thanks & Regards,

Vijay Jeethuri

former_member725489
Discoverer
0 Likes

Hello! Thanks for the answer, but the problem is that the sub menu items are not recognized by the component that you indicate. When I use the Object Spy, in the properties, the subitems of the SELECT button do not exist. In fact, when CBTA interacts with the component that you indicate, it usually gives the error that I shared above. Thanks for the answer anyway! I am still looking for a solution. Thanks!

vijayjeethuri
Participant
0 Likes

Hello Nicolas,

Please give data in the parameters as mentioned below and let me know that's working fine or not

URI - label=Purchase Requisitions; type=GuiToolbarControl; id=wnd[0]/shellcont/shell/shellcont[1]/shell[0]

Id - SELECT

Function code - Purchase Requisitions

Options - /pt


Regards,

Vijay

former_member725489
Discoverer
0 Likes

Hello Vijay! Sap is in Spanish. What you indicate me already tried it but it doesn't work, because the subitems don't exist when you want to select them. I share print to graph it. Greetings!