Custom sort fields
Hi,
Is it possible to add custom fields to the "Sort by" field selection?
Thanks,
Andre
Hi Rob,
I dont have a table control in which I have the custom fields.The custom fields are placed in a subscreen within acustom tab in standard screen in tcode VL31N. as shown below:
Plant:
Carrier:
Bill of lading:
Packaging list:
Damage
Now below these 5 fields ,I need to display the 2 SORT buttons/icons to change the display in ASCENDING OR DESCENDING order.
How do i do this???Is there any std FM ?
Similar Messages
-
Dear Experts,
I'm trying to take bulk/mass printouts for CRM transactions, using t.code- CRMC_ACTION_JOB.here we have a field called SORT FIELD1.please tell me the significance of this.actually there is no furthur filteration criteria for this.like-user id,service organisation etc.
My requirement is to print the service order as per the service organisations,which is not possible in t.code-CRMC_ACTION_JOB.
please provide some input for this issue.Hi,
You can use the sort fields to process a series of actions in a defined order during batch processing. For this, you have to assign an attribute of the application object to the sort field in the action Customizing. When the action is generated, the value of this attribute is then entered into the corresponding sort field. First, the sorting defines how the selected actions are displayed in the list. During the batch run, the actions are then also processed in this order.
For the sorting, you must create and specify a variant that orders the ALV according to the entries in the sort fields. The dialog allows you to check the correct sort sequence in the ALV.
For example, if the postal code of the document recipient is entered into one of the sort fields, documents can be printed sorted by their postal code.
Regards,
Madhu -
Sort field in equipment main screen
We have an equipment having some validity dates(Valid from: 20.11.2009 & valid to: 31.12.9999) . Whenever we enter sort field in the Location tab the validity start date changes to todays date (Valid from:10.06.2009). How we can avoid this changes of dates. What is relation of sort field with valid from date ?
Hi,
It appears you have the sort field marked as relevant for equipment usage period. This will cause a new usage period with valid from date to be set each time the value of this field is changed.
You can check customizing as follows:
Plant Maintenance and Customer Service
Master Data in Plant Maintenance and Customer Service
Technical Objects
Equipment
Equipment Usage Period
Define History-Related Fields
The field to look for is EQFNR.
-Paul -
Sort field in maintenance order
Hello;
I want to make sort field in maintenance order as a mandatory field. But if I make it as a mandatory field, system still allows me to save the order as long as I have not clicked 'Location' tab. So there is no positive control over this field. May I know, how do I achieve this? I have even tried to put order type as the influencing field but it does not help.
Points assured.
Regards
HemantHello Hemant,
access to the SAP service marketplace via www.service.sap.com to create an OSS message. Choose link "product errors". Therefore you need an OSS user and you have to be authorized to create OSS messages.
To create an user-exit, you have to go to transaction CMOD. There you have to create a project and assign the enhancement you want to use (I'm not really sure, but I think IWO10009 is the correct one in your case - you can search the user-exits via transaction SMOD - search for IWO*).
After this you have to implement your coding and then you have to activate the project.
The implementation of the user-exit should be done by an ABAP developer.
By the way - I've had a look at the OSS. There's note 768576.
Reason and Prerequisites
The problem is caused by a missing function.
Influences set via field selection will only become effective if a screen with the corresponding fields is processed. You must also refer to the documentation defined in the corresponding Customizing area. For the location & account assignment data, no additional check is (such as with the general order header data) is realised during the saving.
Prerequisite
Via field selection you declared fields of the location & account assignment data as mandatory field, and no screen that contains these fields was passed.
Solution
By means of the example code, you must implement a corresponding mandatory field check via customer enhancement IWO10009 at the time of the order backup.
1. Create subroutine Z_IWO10009_GET_DATA_FOR_FAW in program SAPMILA0. It would be best if you create an own include ZMILA0F1 for this so that you will not have any unnecessary expenditure for future Support Packages (via Transaction SE80).
FORM Z_IWO10009_GET_DATA_FOR_FAW.
CALL FUNCTION 'CO_IH_GET_HEADER'
IMPORTING
CAUFVD_IMP = CAUFVD.
CALL FUNCTION 'CO_IH_GET_ILOA'
EXPORTING
CAUFVD_IMP = CAUFVD
IMPORTING
ILOA_WA = ILOA.
ENDFORM. "Z_IWO10009_GET_DATA_FOR_FAW
2. Create the following source code in customer enhancement IWO10009:
STATICS: XTFAWF LIKE TFAWF OCCURS 0 WITH HEADER LINE.
tables: tfawf.
DATA: wa_screen LIKE screen.
FIELD-SYMBOLS: 'A'.
perform Z_IWO10009_GET_DATA_FOR_FAW(SAPMILA0).
if xtfawf[] is initial.
SELECT * FROM TFAWF INTO TABLE XTFAWF
WHERE PROG = 'SAPMILA0'.
endif.
LOOP AT XTFAWF WHERE CUST_M = 'X'.
CALL FUNCTION 'FIELD_SELECTION_INFLUENCE'
EXPORTING
dynprogruppe = '7 '
mode = 'C'
modulpool = 'SAPMILA0'
fieldname = XTFAWF-MFELD
IMPORTING
input = wa_screen-input
output = wa_screen-output
active = wa_screen-active
required = wa_screen-required
intensified = wa_screen-intensified
invisible = wa_screen-invisible
EXCEPTIONS
OTHERS = 1.
if wa_screen-required = 1.
clear lv_mfeld.
lv_mfeld = 'CAUFVD_IMP-'.
case XTFAWF-MFELD.
when 'ILOA-AUFNR'.
lv_mfeld+11 = 'IAUFNR'.
when 'ILOA-KOKRS'.
lv_mfeld+11 = 'IKOKRS'.
when 'ILOA-BUKRS'.
lv_mfeld+11 = 'IBUKRS'.
when 'ILOA-GSBER'.
lv_mfeld+11 = 'IGSBER'.
when 'RILA0-ARBPL'.
lv_mfeld11 = xtfawf-mfeld6.
when others.
lv_mfeld11 = xtfawf-mfeld5.
endcase.
ASSIGN (lv_mfeld) TO IS INITIAL.
Message E461(IW)
with 'Mussfelder der Standort&Kontierungsdaten füllen'.
EXIT.
ENDIF.
endif.
endloop.
endif.
3. Activate the changes
Correspondingly you can implement this solution also for the order release, for example, via customer enhancement IWO10002.
Bear in mind that this is a source code proposal. It might be useful or necessary to adjust this source code to special applications.
Best regards
Stephan
Edited by: Stephan Theis on Jan 5, 2008 11:20 AM -
Sorting entire records
Problem:
Assume you have an array of 20 items (master array), and
first 5 items are pulled into another array (paged array),
Which is the dataprovider for the datagrid. And the datagrid
has 10 columns.
When the user sorts on the datagrid, sorting should happen on
the 20 records, and
Not on the 5 records.
What i tried:
Clicking on a datagrid column header will sort only the data
provider of the datagrid. i.e., the
5 records. In order to sort all 20 records, sorting should
take place on the master array,
and not on the paged array. Sorting on 20 items seems to be
impossible.
The only logic we could think of was that, on the
headerRelease of datagrid, capture the
column header clicked(not sure if you can capture it or not).
And write custom function
for sorting based on that column. Since there are 10 columns,
the number of functions
or number of blocks of code to be written will Be 10. So did
not feel to be feasible and optimal solution.
Please advice.Hello chhavs,
If you listen to the DataGrid's headerRelease event, the event has a property columnIndex to let you know which column the user wanted to sort. So you don't need 10 functions, just one with a switch statement, which is reasonable.
private function handleHeaderRelease(event:DataGridEvent):void
var sort:Sort = new Sort();
var field:SortField;
switch (event.columnIndex)
case 0:
field = new SortField("fieldA");
break;
case 1:
field = new SortField("fieldB");
break;
case ...
sort.fields = [field];
masterRecords.sort = sort;
masterRecords.refresh();
Thanks,
Philip -
Sort Field to be made mandatory while creating maintenance plan(IP42)
Hi Experts,
Please suggest me the way by which i can make the field "Sort field" mandatory while creating maintenance plan (IP42).
Regards,
VivekVivek,
There is no std config to acheive this. Please use IPRM0004 Maintenance plan/item: Customer check for "Save" to accomplish the same.
Mahee -
I have a wierd problem that has been causing me quite a few headaches and i think if there is a way to do a custom order by, it might get rid of this annoynce.
I have an existing script that is five scripts unioned together. When i run the script on it's own, i get the desired result in the desired order, but when i run it through a data window in powerbuilder it is bringing back a different order and i can't figure out why. It's the exact same script.
Anyways, i'm wondering if i can create a custom sort order by, so that i can specify what the first and second fields are and then let the rest fall as they are supposed to:
Here is a look at my Current results:
Equip_# - Read_Desc - Date ----------- Reading
12345 - Consumption - 10/05/2008 - 1101.88
12345 - Consumption - 10/05/2008 - 0000.00
12345 - Summer Peak- 10/05/2008 - 0000.00
12345 - Winter Peak - 10/05/2008 - 0000.00
12345 - Radio Device - 10/05/2008 - 0000.00
12345 - Demand ------- 10/05/2008 - 0000.00
I need the first two fields of the table to sorted as follows and then the rest can just fall into place:
Equip_# - Read_Desc - Date ----------- Reading
12345 - Consumption - 10/05/2008 - 1101.88
12345 - Demand ------- 10/05/2008 - 0000.00
...Doesn't matter how it sorts as long as they two come first
Hope someone can help, cause this really just doens't make a lot of sense and i'm now just trying to get this done and get it behind me.
thanks in advanceJustin Cave wrote:
Can you post the actual SQL statement you are using (or at least the skeleton structure)? You want the ORDER BY to apply to the entire result, not to one individual subquery that is getting unioned with a number of other subqueries.
Is PowerBuilder trying to order the data before displaying it? Obviously, the GUI is free to disregard the order Oracle happens to return results if you've instructed it to sort the data differently.
JustinI don't believe powerbuilder is trying to order the data before displaying it. If it is, it's in a place not easily seen.
Here is my code:
SELECT equipment.equipment_number,
read_class.read_class_desc,
meter_read.effective_date,
meter_read.meter_read,' ',' ',' ',''seal_broken,'1'
FROM equipment,
meter_read,
meter_read_class,
equipment_type,
equipment_class,
read_class
WHERE meter_read.meter_read_class_id = meter_read_class.meter_read_class_id and
meter_read.equipment_id = equipment.equipment_id and
equipment.equipment_type_id = equipment_type.equipment_type_id and
equipment_type.equipment_class= equipment_class. equipment_class and
meter_read_class.read_class =read_class.read_class and
equipment_class.equipment_category = 'EMETER' AND
equipment.current_service_id = 32399 and
meter_read_class.read_class = 'ECONSUME' and
meter_read.effective_date=
(select max(mr.effective_date)
from equipment e,
meter_read mr,
meter_read_class mrc,
equipment_type et,
equipment_class ec
WHERE mr.meter_read_class_id = mrc.meter_read_class_id and
mr.equipment_id = e.equipment_id and
e.equipment_type_id = et.equipment_type_id and
et.equipment_class= ec. equipment_class and
ec.equipment_category = 'EMETER' AND
e.current_service_id = 32399 and
mrc.read_class = 'ECONSUME')
union SELECT equipment.equipment_number,
read_class.read_class_desc,
meter_read.effective_date,
meter_read.meter_read,' ',' ',' ',''seal_broken,'2'
FROM equipment,
meter_read,
meter_read_class,
equipment_type,
equipment_class,
read_class
WHERE meter_read.meter_read_class_id = meter_read_class.meter_read_class_id and
meter_read.equipment_id = equipment.equipment_id and
equipment.equipment_type_id = equipment_type.equipment_type_id and
equipment_type.equipment_class= equipment_class.equipment_class and
equipment_class.equipment_category = 'EMETER' AND
equipment.current_service_id = 32399 and
meter_read_class.read_class = 'DEMAND' and
-- read_class.read_class_desc not in ('Electrical Consumption', 'Electrical ERT Device') and
meter_read.effective_date=
(select max(mr.effective_date)
from equipment e,
meter_read mr,
meter_read_class mrc,
equipment_type et,
equipment_class ec
WHERE mr.meter_read_class_id = mrc.meter_read_class_id and
mr.equipment_id = e.equipment_id and
e.equipment_type_id = et.equipment_type_id and
et.equipment_class= ec. equipment_class and
ec.equipment_category = 'EMETER' AND
e.current_service_id = 32399 and
mrc.read_class = 'DEMAND' )
order by meter_read, decode(read_class_desc,'Electrical Consumption',1,'Electrical Demand',2), read_class_desc
I've only recently tried entering in the decode in the order by, as someone else suggested and it works fine for individual queries, but when i use it against the whole query (including the Union's), i get the following error:
ORA-01785: ORDER BY item must be the number of a SELECT-list expression -
Custom Sort records by Char length
Hello guys,
I want to sort a field in a report Cross tab by char length .... a custom sort as below order ...
XXXX - length 5
XX - length 2
XXX - Length 3
X - Length 1
Please advise ...
Thanks .......
NeoAh OK. See if this works:
1) Create a formula with this code:
If Len({field}) = 5 then "1"&{field}
Else If Len({field}) = 2 then "2"&{field}
Else If Len({field}) = 3 then "3"&{field}
Else If Len({field}) = 1 then "4"&{field}
2) Replace your existing field in the Crosstab with this formula field
3) click options > options tab > check 'Customize group name field' > from the drop down choose the Database field that you actually wish to show in the crosstab.
-Abhilash -
This was not fixed as reported by Apple with Aperture version 2. When I move custom sorted images from one project to another, or export and import a project with custom sorted images, the sort order is lost. The order after the move, or import is either in file name order or sometimes in a completly random order. This occurs on both my MacBook Pro (late 2008) and my 8 core (16GB RAM) Mac Pro.
This makes it impossible to do efficient work in the field and export the work.Followup: I spoke to Andre with Aperture support. He could not confirm this, at first, using a small number of images dragged from project A to Project B. Using a larger number (99 in his case), he was able to confirm the loss of custom sort order. The Apple web site says this has been corrected for import/exports and that is also not fixed. He will refer the problem to engineering for correction in a future update.
I suspect (have no proof) the problem relates to the way Aperture divides each download (from card or camera) to a project into separate folders. To see this, export a project and open it (show package contents). Within the project package are separate folders for each of the downloads to the project. Aperture does not consolidate the images into a single folder. It appears that when a set of images are downloaded at one time is interposed between images taken previously, the sort order is not lost when the images are moved to another project or exported as a project.
I still would like to know if there is a work around for this. -
View Customer number field in the FBL3N report
Hi All,
Is it possible to view the Customer Number Field in the FBL3N report??
Please revert asap.
Rgds,
Kunal Vichare
Moderator: Please, search SDNHello
Please find the process for adding additional field in FBL3N
SPRO->FA->GLA->GL->Line Item->Display line item with ALV->Define Special Fields for finding and sort data
Added the additional field for Customer account number.
Table Field name Field lable
BSEG KUNNR Customer
Thanks
Kameshwar Rao -
I'm trying to find a way to create custom metadata fields so I can better organize my footage. For example, say I'm filming a bunch of old cars, and I want to sort them by make and model, obviously there's no make and model field by default. I've read articles that say this is possible, but I can't seem to find a way to do it. Thanks!
Edit: And related to that, is there a way to delete any of the metadata fields? Since I'm doing video, I'd rather not have to scroll through things like Album and Artist, etc. Thanks.In the Metadata panel open the flyout menu in the upper right and choose "Metadata Display..."
Now you can turn off the metadata schemas you're not interested in seeing.
Now click the New Schema button.
Give your new Schema a name.
Now click the Add Property button next to your new custom schema.
Give it a name, like "Make", of type "Text".
Then do the same again for "Model".
Now you can select a set of clips all of the same make then enter what you'd like into the "Make" field and that metadata will be applied to the selected clips.
This is searchable, so in the Project panel you can search for the text you've entered into one of these fields and only clips containing that metadata will appear in the list (next to the search box Prelude reports "(filtered)" to let you know you're not currently seeing all of your clips.
I hope this helps! -
hi
i have created a report with 3 queries, where i had month object in it and that one is unsorted, so i have used custom sort option for sorting the month from JAN to DEC while adding first query.
when i started to add the second and third query, the custom sort option is disabled in webi.
the first one which is already sorted also became unsorted .
what to do ?
Regards
dineshkumarHi,
This may be help for you,
sorting option you see on right click short cut menu, i.e;
sort------->none
>Asending
>Desending
>custom
when you use to sort option most be click on one column and right click on that select sort and custum then select your custom order and next ok, so you get custom sorting.
and appy same procedure to second query when you add query on same report with same business fields. -
Custom sorting in Web Dynpro ALV columns
Hello Experts,
I want to implement custom sorting on some of columns in Web Dynpro ABAP ALV.I searched in SDN forum,but couldn't find much useful information on this?are there any events through which we can achieve this?
is it technically feasible?
Any information on this will be great help.
Thanks,
NaiduHello Thomas,
Thanks for your quick response.Actually i want to display Price and currency values together in single column ,like 5000 USD.For this i have to use character field as i can't take currency field .If i take char field for price,sorting will based on character type rather than decimal type.Due to this,i want to implement custom sorting on that particular field.
Anyhow thanks for confirmaion.
Thanks,
Naidu -
Error: Find criteria must contain at least one sort field value.
Hi
I am getting the followng error in Sort.as when I click on a column in a DataGrid that is bound to a nested property (e.g. parent.name)
Error: Find criteria must contain at least one sort field value.
I can see why this is failing.
In the findItem function of Sort.as the code tests whether there is data in line (456) hasFieldName = values[fieldName] !== undefined. This fails and so an error is raised later in the function by:
if (fieldsForCompare.length == 0) {
message = resourceManager.getString("collections", "findRestriction");
throw new SortError(message); }
The code needs to traverse down the object hierarchy to get the field so that error is not thrown .
The code needs to traverse down the object hierarchy to get the field so that error is not thrown .
In the case of a non nested property, everything works fine.
There is lots of discussion about nested properties in DataGrid and there is this jira:
http://bugs.adobe.com/jira/browse/SDK-9801
There is talk of using a labelFunction or an itemRenderer and other third party solutions (extensions of DataGridColumn).
Is this a bug? is there a workaround using labelFunction or itemRenderer which can stop the error in Sort.as?
James
Here is the code of findItem in Sort.as of SDK 3..4.0.9271
public
function findItem(items:Array,values:Object,
mode:String,
returnInsertionIndex:Boolean =
false,compareFunction:Function =
null):int{
var compareForFind:Function;
var fieldsForCompare:Array;
var message:String;
if (!items){
message = resourceManager.getString(
"collections", "noItems");
throw new SortError(message);}
else if (items.length == 0){
return returnInsertionIndex ? 1 : -1;}
if (compareFunction == null){
compareForFind =
this.compareFunction;
// configure the search criteria
if (values && fieldList.length > 0){
fieldsForCompare = [];
//build up the fields we can compare, if we skip a field in the
//middle throw an error. it is ok to not have all the fields
//though
var fieldName:String;
var hadPreviousFieldName:Boolean = true;
for (var i:int = 0; i < fieldList.length; i++){
fieldName = fieldList[i];
if (fieldName){
var hasFieldName:Boolean;
try
hasFieldName = values[fieldName] !==
undefined;}
catch(e:Error){
hasFieldName =
false;}
if (hasFieldName){
if (!hadPreviousFieldName){
message = resourceManager.getString(
"collections", "findCondition", [ fieldName ]);
throw new SortError(message);}
else
fieldsForCompare.push(fieldName);
else
hadPreviousFieldName =
false;}
else
//this is ok because sometimes a sortfield might
//have a custom comparator
fieldsForCompare.push(
null);}
if (fieldsForCompare.length == 0){
message = resourceManager.getString(
"collections", "findRestriction");
throw new SortError(message);}
else
try
initSortFields(items[0]);
catch(initSortError:SortError){
//oh well, use the default comparators...
else
compareForFind = compareFunction;I have tried a sortCompareFunction:
var sort:Sort = new Sort();
sort.compareFunction = compareFunction;sort.fields = [sortField];
data.sort = sort;
data.refresh();
this makes no difference.
James -
Copy Planning Plant to Sort field in Maintenance Plan
Hi All,
Is there any User Exit User exit is available to Copy Planning Plant to Sort field in Maintenance Plan.
Regds
VinitI think it is not possibe as the sort field in maintenance plan is a customizing field. you can not enter any value in the sort field but you in SPRO first you have to maintain the values for sort field.
The sort field in order and notification, there you can copy the planning plant or anything else as they are manual input fields
Maybe you are looking for
-
Help please with FaceTime. My built in app seems to have disappeared.
-
Camera no longer working in iOS 5 on my iPod touch 4G. I have a black screen when I tap the camera icon. I still have all my photos, but no camara. Any suggestions before I head to the Apple Genius Bar??
-
Best way of Using Index on a Table.
I am trying to understand the phenomena of using INDEX on a Table need some guidance!!! Let us take this scenario I have a table "MYRECORD" which has 4 attributes(or coulombs) 1. "STATE" (varchar) // this can have 49 different values like newyork, de
-
How can I open a DRM file on my Kobo Aura (authorisez with my ADE account)?
Hi everybody! I am trying desperately to open some DRM books on my Kobo Aura. I have already authorized the ereader with Adobe Digital Editions, but, when I try to open the books from the ereader, it doesn't work...
-
Qosmio G20 VGA in for connecting to XBox 360
How can i connect a Xbox 360 to the qosmio using a VGA HD cable like this? http://www.xbox.com/en-US/hardware/x/xbox360vgahdcable/ Is it possible to use the fantastic monitor of the Qosmio to play? Any help apreciated