Skip to main content

Drilldowns im Select-Grid

Comments

1 comment

  • Lothar Hasenkämper

    Probably it is a little bit late, but I was searching a long time for a way to do it. I found it now and want to share it. Depending on Data it could be a little bit inperformant because the Event that I use is FormActivate and it will be triggered every time when the Form is activated. I did not found a better solution. I tried FormLoadComplete but then the Grid is not available.

    The Script is

    	// Verbindung mit SAP 
    	SAPbouiCOM.Application oB1App = (SAPbouiCOM.Application) SwissAddonFramework.B1Connector.GetB1Connector().Application;
    	SAPbouiCOM.Form oForm = (SAPbouiCOM.Form) oB1App.Forms.Item(pVal.Form.UniqueID);
    	
    	// Deklarieren des Grids
    	SAPbouiCOM.Grid oGrid = (SAPbouiCOM.Grid) oForm.Items.Item("grdSelect").Specific;
    		
    	// DrillDown hinzufügen
    		// Anfrage zur Bestandsumlagerung
    	SAPbouiCOM.EditTextColumn oEditTextDocEntry = (SAPbouiCOM.EditTextColumn) oGrid.Columns.Item("DocEntry");
    	oEditTextDocEntry.LinkedObjectType = "1250000001";
    
    	// GP
    	SAPbouiCOM.EditTextColumn oEditTextCardCode = (SAPbouiCOM.EditTextColumn) oGrid.Columns.Item("KdNr");
    	oEditTextCardCode.LinkedObjectType = "2";
    	
    	// Gehe in das Menü und drücke den Button für Spaltenbreite anpassen
    	MenuItem.GetFromUID("1300").Activate();

    When someone finds a better Event or solution let it me know

    regards Lothar

     

     

    0

Please sign in to leave a comment.