cancel
Showing results for 
Search instead for 
Did you mean: 

Layout selection

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Are you the only one who will be using the script? if not are your layouts shared across multiple users?

holger_khn
Contributor
0 Kudos

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