cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting in se16 - Multiple Selection

05-10-2023 7:41 AM
2283 views 5 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Good morning everyone,

I would like to enhance one of my existing script.

Currently, my script runs the T-Code se16, table 'EBAN' and past some datas in 'EBELN' field.

At the beginning, the script found the line where 'EBELN' was placed (For example : wnd[0]/usr/ctxtI3-LOW)

Now, I can find the field name directly no matter the place. But i would like to push the button "Selection Multiple" linked with 'EBELN' :

I tried something like this :

<code>session.findById("wnd[0]/usr/btn%<strong>_EBELN_</strong>%_APP_%-VALU_PUSH").press

In a "classic" T-Code the field name with the Selection Multiple is indicated but not in SE16.

Do you have any suggestions ? 🙂

Thanks a lot and have a nice day.

Louis

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

script_man
Active Contributor
0 Likes

Hi Louis,

unfortunately, I do not have access to transaction SE16, but the following link may be of interest to you:

https://answers.sap.com/questions/622739/sap-scripting-select-field-in-table-se16-tablen.html

Regards, ScriptMan

Answers (3)

Answers (3)

former_member855143
Discoverer
0 Likes

Good Afternoon ScriptMan,

The attached link helps for an unique data pasted in a text field (Not for multiple selection) 🙂

However, it works with this code :

Set User = session.findById("wnd[0]/usr")
For j = 1 To User.Children.Count
If User.Children(CInt(j)).Type = "GuiTextField" Then
'--- Example for field PS_PSP_PNR (From EBKN table)
If User.Children(CInt(j)).Text = "PS_PSP_PNR" Then
'--- J+4 for 4th objects (Txt field 1; To; Txt field 2; Button 'Multiple Selection')
User.Children(CInt(j + 4)).SetFocus
User.Children(CInt(j + 4)).press
session.findById("wnd[1]/tbar[0]/btn[24]").press
session.findById("wnd[1]/tbar[0]/btn[8]").press
session.findById("wnd[0]/tbar[1]/btn[8]").press
Exit For
End If
End If
Next

Thanks to you ScriptMan, Frederic and Steffan for the raw code 🙂

Nice afternoon,

Louis

former_member855143
Discoverer
0 Likes

Hi both!

Thanks for your answers.

For now, I can only use the SE16 Tx... not SE16N or others.

@ script.man I used the script recorder but same issue (Line 19 is where my field is placed)

session.findById("wnd[0]/usr/btn%_I19_%_APP_%-VALU_PUSH").press

Any ideas ? 🙂

Thanks and nice afternoon!

Louis

script_man
Active Contributor
0 Likes

Hi Louis,


in order to find out the correct syntax at this point, I would try the SAP Scriptrecorder.


Regards, ScriptMan