on 03-30-2007 12:23 PM
Hello,
Im working with the list tile capteam2, i need to get it sorted first by the "Function" field and after that by the "Last Name" field.
I have been looking into some standard code and came across stuff like this:
objCol.Sort "field", "ASC" and ctrlctrlsgrid.sortCol = 1, is this any use to me?
and do i need to put the code in the beforeload event?
Cheers,
Maarten
Hi Maarten,
Usually you can do that in the BDOC itself, in the segment, in Columns "Sort Order" and "Sort ACS" you would put for SFAKVBEZTP - "1" and for NAME_FIRST - "2", and check "Sort ACS" for both fields. But cince I don't want you to modify standard BDOC ( CAPGEN_OBJECT_WRITE !!! ), will do it with code.
You're on the rigth track.
Do this in BOL:
If Not myCollection Is Nothing Then
With myCollection
.Sort "SFAKVBEZTP", "asc"
.Sort "NAME_FIRST", "asc"
End With
End If
You may need to sort by Long text of SFAKVBEZTP.
Let me know your results.
Regards,
Vadim.
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 put the following in the beforeLoad event of capteam2 (im not sure if this is the correct event to put it in)
Dim myCollection As BusinessCollection
Set myCollection = acapteam2DSO.bcol
If Not myCollection Is Nothing Then
With myCollection
.Sort "SFAKVBEZTP", "asc"
.Sort "SFAMITABT", "asc"
End With
End If
but it doesnt seem to work so i must be doin something wrong probably something wrong with how i define myCollection? never done it before
thx alot,
Maarten
Hi,
Try to put this in BOINTBPEMP in the Loaded Event:
Bold code - is the new code you have to add.
If ThisBO.IsNew() Then
ThisBo.Mandt = objUserDataDic.GetData("MANDT")
'Commented By Rashmi to prevent defaulting
'ThisBo.reltyp = "BUR011"
'Inserted 29.10.00 and removed from beforesave
Set mObjOwner = GetBoBp
If not mObjOwner is nothing then
If mObjOwner.COLBOBPSALESTEAM.count = 0 Then
'Commented By Rashmi to avoid defaulting for Partner functions
'Mainc = True
End If
If Kunnr = "" Then
Kunnr = mObjOwner.Kunnr
End if
End If
<b>Else
Set mObjOwner = GetBoBp
If not mObjOwner is nothing then
If mObjOwner.COLBOBPSALESTEAM.count <> 0 Then
With mObjOwner.COLBOBPSALESTEAM
.Sort "SFAKVBEZTP", "asc"
.Sort "SFAMITABT", "asc"
End With
End If</b>
end if
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.