Hallo,

here is the code.

If I click in the first column, I get error message.
=====================================
Use Windows.pkg
Use DFClient.pkg
Use Ha11arti.dd
Use dbCAG_CJGrid.pkg
Use CAG_Form.pkg
Use dbHA_View.pkg
Use CAG_Form_Code.pkg
Use dbCAG_CJGrid.pkg


Use cCJStandardCommandBarSystem.pkg
Use cCJCommandBarSystem.pkg
Use cDbCJGrid.pkg
Use CAG_CheckBox.pkg
Use cdbHA_CJGrid.pkg
Use cCJGridColumn.pkg


Register_Function ExecDDFileFieldStrFunction Returns String






//Use cDbCJGridColumn.pkg


Deferred_View Activate_ovvARTI_F04 for ;
Object ovvARTI_F04 is a dbHA_View

Procedure Entering_Scope Returns Integer
Integer iRetVal
Forward Get msg_Entering_Scope to iRetVal
//Wenn Artikelmaske aktiviert war, dann werden diese Werte gesetzt deshalb Funktioniert Übergang in die Artikelmaske mit Rechten MAuscklick nicht richtig
Set pTmp_Int1 of oCag_Appl to 0
Set pTmp_Str1 of oCag_Appl to ""
Procedure_Return iRetVal
End_Procedure


Object oHA11ARTI_DD is a Ha11arti_DD
Procedure OnConstrain
String sArt sSach1 sBisSach1
Get Value of oArtArtSel to sArt
Get Value of oSach1 to sSach1
Get Value of oBisSach1 to sBisSach1
If (sArt > "") Constrain HA11ARTI.ARTIART eq sArt
If (sSach1 > "") Constrain HA11ARTI.SACH1 ge sSach1
If (sBisSach1 > "") Constrain HA11ARTI.SACH1 le sBisSach1
End_Procedure
End_Object


Set Main_DD to oHA11ARTI_DD
Set Server to oHA11ARTI_DD


Set Border_Style to Border_Thick
Set Size to 411 929
Set Location to 2 1
Set Label to "Schnelländerung HK/EK-Preis"
Set pbResize to True
Set Maximize_Icon to True


Object oArtArtSel is a CAG_Form_Code// CAG_Form
Set Size to 13 50
Set Location to 5 74
Set Label to "Nur Artikel Art:"
Set pCodeValType to "ARTART"
Set Capslock_State to True
Set Form_Margin to 1
Set peAnchors to anNone


Procedure Exiting Handle hoDestination Returns Integer
Integer iRetVal
Forward Get msg_Exiting hoDestination to iRetVal
Send OnClick of oBtAktualisieren
Procedure_Return iRetVal
End_Procedure
End_Object


Object oSach1 is a CAG_Form
Set Size to 13 100
Set Location to 5 198
Set Label to "von Sach1:"
Set Label_Col_Offset to 40
Set Capslock_State to True
Set peAnchors to anNone
End_Object


Object oBisSach1 is a CAG_Form
Set Size to 13 100
Set Location to 5 348
Set Label to "bis Sach1:"
Set Label_Col_Offset to 40
Set Capslock_State to True
Set peAnchors to anNone
End_Object


Object oBtAktualisieren is a Button
Set Size to 14 112
Set Location to 7 795
Set Label to "Ansicht aktualisieren (Strg+A)"
Set peAnchors to anTopRight

// fires when the button is clicked
Procedure OnClick
Send Cursor_Wait of Cursor_Control
Send Clear of oHA11ARTI_DD
Send Rebuild_Constraints of oHA11ARTI_DD
Send RefreshDataFromDD of oGridArtikel 0
Send MovetoFirstRow of oGridArtikel
Send Cursor_Ready of Cursor_Control
End_Procedure

End_Object


Object oGridArtikel is a cdbHA_CJGrid
Set Size to 348 901
Set Location to 39 10
Set pbAutoSave to True
Set pbSelectionEnable to True
Set pCreateView to "msg_Activate_ovvARTI_02"
Set pCloseAfterContext to False
Set peAnchors to anAll

Procedure mPreiseSetzen
// String sArtArt sSach1 sSach2 sSach3
Handle hoDataSource
tDataSourceRow[] TheDataSource
tDataSourceRow TheRow
Integer i iRows
Boolean bAlle

Send Cursor_Wait of Cursor_Control

Number nPreis

Get Value of oPreis to nPreis



Get phoDataSource to hoDataSource
Get DataSource of hoDataSource to TheDataSource
Move (SizeOfArray(TheDataSource)) to iRows
For i from 0 to (iRows-1)
If (TheDataSource[i].sValue[0] eq 1) Begin
Send FindByRowId of oHA11ARTI_DD HA11ARTI.File_Number TheDataSource[i].riID
Set Field_Changed_Value of oHA11ARTI_DD Field HA11ARTI.HK_EK_PREIS to nPreis
Send Request_Save of oHA11ARTI_DD
End
Loop
Send Cursor_Ready of Cursor_Control
Send MovetoFirstRow
End_Procedure

Procedure mKostenstelleSetzen
// String sArtArt sSach1 sSach2 sSach3
Handle hoDataSource
tDataSourceRow[] TheDataSource
tDataSourceRow TheRow
Integer i iRows
Boolean bAlle

Send Cursor_Wait of Cursor_Control

String sKostStelle

Get Value of oKostStelle to sKostStelle



Get phoDataSource to hoDataSource
Get DataSource of hoDataSource to TheDataSource
Move (SizeOfArray(TheDataSource)) to iRows
For i from 0 to (iRows-1)
If (TheDataSource[i].sValue[0] eq 1) Begin
Send FindByRowId of oHA11ARTI_DD HA11ARTI.File_Number TheDataSource[i].riID
Set Field_Changed_Value of oHA11ARTI_DD Field HA11ARTI.KOSTST to sKostStelle
Send Request_Save of oHA11ARTI_DD
End
Loop
Send Cursor_Ready of Cursor_Control
Send MovetoFirstRow
End_Procedure



Object oCJGridColumn1 is a cCJGridColumn

Set piWidth to 32
Set psCaption to ""
Set pbCheckbox to True
End_Object


Object oHA11ARTI_ARTIART is a cDbCJGridColumn
Entry_Item HA11ARTI.ARTIART
Set piWidth to 26
Set psCaption to "Art"
Set pbComboButton to False
Set pbEditable to False
End_Object


Object oHA11ARTI_SACH1 is a cDbCJGridColumn
Entry_Item HA11ARTI.SACH1
Set piWidth to 153
Set psCaption to "SACH1"
Set pbEditable to False
End_Object


Object oHA11ARTI_SACH2 is a cDbCJGridColumn
Entry_Item HA11ARTI.SACH2
Set piWidth to 107
Set psCaption to "SACH2"
Set pbEditable to False
End_Object


Object oHA11ARTI_SACH3 is a cDbCJGridColumn
Entry_Item HA11ARTI.SACH3
Set piWidth to 106
Set psCaption to "SACH3"
Set pbEditable to False
End_Object


Object oHA11ARTI_BEZEICH1 is a cDbCJGridColumn
Entry_Item HA11ARTI.BEZEICH1
Set piWidth to 325
Set psCaption to "Bezeichnung"
Set pbEditable to False
End_Object


Object oHA11ARTI_BEZEICH2 is a cDbCJGridColumn
Entry_Item HA11ARTI.BEZEICH2
Set piWidth to 277
Set psCaption to "Bezeichnung 2"
Set pbEditable to False
End_Object


Object oHA11ARTI_HK_EK_PREIS is a cDbCJGridColumn
Entry_Item HA11ARTI.HK_EK_PREIS
Set piWidth to 83
Set psCaption to "HK/EK-Preis"

Procedure OnSetDisplayMetrics Handle hoGridItemMetrics Integer iRow String ByRef sValue
// Number nValue
Forward Send OnSetDisplayMetrics hoGridItemMetrics iRow (&sValue)

If (Number (sValue) eq 0) Begin
Set ComForeColor of hoGridItemMetrics to clRed
End
End_Procedure
End_Object


Object oHA11ARTI_MENGENFAKTOR is a cDbCJGridColumn
Entry_Item HA11ARTI.MENGENFAKTOR
Set piWidth to 60
Set psCaption to "je"
Set pbComboButton to True
Set pbEditable to False
End_Object


Object oHA11ARTI_EINHEIT is a cDbCJGridColumn
Entry_Item HA11ARTI.EINHEIT
Set piWidth to 71
Set psCaption to "Einheit"
Set pbComboButton to True
Set pbEditable to False
End_Object


Object oHA11ARTI_KOSTST1 is a cDbCJGridColumn
Entry_Item HA11ARTI.KOSTST
Set piWidth to 109
Set psCaption to "Kost.StelleNummer"
End_Object


Object oHA11ARTI_KOSTST is a cDbCJGridColumn
Entry_Item HA11ARTI.KOSTST
Set piWidth to 121
Set psCaption to "Kostenstelle Name"
Set pbComboButton to True
End_Object


Object oHA11ARTI_LFD is a cDbCJGridColumn
Entry_Item HA11ARTI.LFD
Set piWidth to 73
Set psCaption to "LFD"
End_Object



End_Object


Object oButton2 is a Button
Set Size to 14 92
Set Location to 390 820
Set Label to 'Preis setzen(Selektion)'
Set peAnchors to anBottomRight

// fires when the button is clicked
Procedure OnClick
Send mPreiseSetzen of oGridArtikel
End_Procedure

End_Object

Object oButton is a Button
Set Size to 14 92
Set Location to 390 618
Set Label to 'Kostenstelle setzen'
Set peAnchors to anBottomRight

// fires when the button is clicked
Procedure OnClick
String sKostStelle
Get Value of oKostStelle to sKostStelle
If (sKostStelle ne "" and sKostStelle ne "000") Send mKostenstelleSetzen of oGridArtikel
End_Procedure

End_Object



Object oPreis is a CAG_Form
Set Size to 13 50
Set Location to 22 74
Set Label to "HK/EK-Preis:"
Set Form_Datatype to Mask_Numeric_Window
Set Form_Mask to "*0.00"
Set peAnchors to anNone
End_Object


Object oKostStelle is a CAG_Form
Set Size to 13 51
Set Location to 22 198
Set Label to "Kostenstelle:"
Set Form_Datatype to Mask_Numeric_Window
Set Form_Mask to "000"
Set Label_Col_Offset to 40
Set peAnchors to anNone
End_Object


Object oButton2 is a Button
Set Size to 14 92
Set Location to 390 719
Set Label to 'Preis setzen(Filter)'
Set peAnchors to anBottomRight

// fires when the button is clicked
Procedure OnClick
Handle hoDD
Number nPreis
String sArtiArt sSach1 sBisSach1

Get Value of oPreis to nPreis
Get Value of oArtArtSel to sArtiArt
Get Value of oSach1 to sSach1
Get Value of oBisSach1 to sBisSach1
Move oHA11ARTI_DD to hoDD

If (sArtiArt eq "" and sSach1 eq "" and sBisSach1 eq "") Begin
Send Stop_Box "Sie haben kein Filter gesetzt. Preisänderung für alle Artikel nicht gestatet." "Kein Filter gesetzt."
Procedure_Return
End

If (nPreis = 0) Begin
Send Stop_Box "Der neue Preis ist Null. Überprüfen sie bitte Eingabe." "Preis ist Null."
Procedure_Return
End
Send Cursor_Wait of Cursor_Control
Send Clear of hoDD
Send Find of hoDD GE 1
While (Found)
Set Value of oTextBox1 to (HA11ARTI.SACH1 * HA11ARTI.SACH2 * HA11ARTI.SACH3)
Set Field_Changed_Value of hoDD Field HA11ARTI.HK_EK_PREIS to nPreis
Send Request_Save of hoDD
Send Find of hoDD GT 1
Loop
Set Value of oTextBox1 to "Preise geändert."
Send Cursor_Ready of Cursor_Control
End_Procedure

End_Object


Object oTextBox1 is a TextBox
Set Size to 10 32
Set Location to 394 13
Set Label to 'Info'
Set peAnchors to anBottomLeft
End_Object


On_Key Key_Ctrl+Key_A Send KeyAction of oBtAktualisieren
Cd_End_Object