on 05-29-2015 6:37 PM
Hi,
I created a SAP Scripting for run a transaction (Y_LAD_65000304) and select a specific layout for my report.
However, when I press the layout button, if the user have a default layout selected the macro didn't understant the comnad to select my specific variant.
If the layout default option is disable, the scripting works well. The problem is none of all users have this option disable.
Find below my codes:
'Select layout
session.findById("wnd[0]/tbar[1]/btn[33]").press
iRows = session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell").RowCount
For i = 0 To iRows - 1
sLayout = session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell").getCellValue(i, "VARIANT")
If sLayout = "/SCRIPT" Then Exit For
Next
session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell").currentCellRow = i
session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell").clickCurrentCell
Someone knows how to fixed it?
Hello Talita,
welcome to the SAP GUI Scripting forum.
As far as I can see your script works. I try it on the same way and it works as expected.
Set Layout = session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell")
Rows = Layout.RowCount()
For i = 0 To Rows - 1
LayoutVariant = Layout.getCellValue(i, "VARIANT")
If LayoutVariant = "STEFAN3" Then
Layout.currentCellRow = i
Layout.clickCurrentCell
Exit For
End If
Next
In my case I have no dependency to the default option.
Hint for all: The transaction code Y_LAD_65000304 is individual, but the report behind this TAC uses ABAP List Viewer (ALV) Grid. You can check it via TAC SE16 and the layout option.
Cheers
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.