on 03-23-2016 9:26 AM
Good day
I need to select a layout from a popup menu for layouts using the layout name. Is there a script to search and find the layout name and select it.
Regards
Chimane
Are you the only one who will be using the script? if not are your layouts shared across multiple users?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello.
I have test below code in ALV result list by getting a new layout:
This will list all available layout variants in Excel.
When you remove columns-loop and set GetCellValue hardcoded to column '0' you have layout Name. Then you can compare value with expected layout Name. Now you should be able to identify row of required layout and then select and choose for using.
Session.FindById("wnd[0]/mbar/menu[5]/menu[2]/menu[1]").Select
Set Table = Session.FindById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell")
Set Columns_Table = Table.ColumnOrder()
ROW_COUNT = Table.RowCount() - 1
col_count = Table.ColumnCount() - 1
For lng_Row = 0 To ROW_COUNT
For lng_Col = 0 To col_count
Cells((lng_Row + 2), (lng_Col + 1)).Value = (Table.GetCellValue(lng_Row, CStr(Columns_Table(lng_Col))))
Next
Next
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.