Custom table sort
There is a custom table in that table can i display the table contents sorted by one particular field.
hi,
if plant and date together make the primary key, then at present it must be sorted by by the primary key for example -
plant date
5610 12.10.2006
5610 18.12.2006
8510 10.12.2006
8510 17.12.2006
is it not Ok with you ?
Similar Messages
-
Custom table model, table sorter, and cell renderer to use hidden columns
Hello,
I'm having a hard time figuring out the best way to go about this. I currently have a JTable with an custom table model to make the cells immutable. Furthermore, I have a "hidden" column in the table model so that I can access the items selected from a database by their recid, and then another hidden column that keeps track of the appropriate color for a custom cell renderer.
Subject -- Sender -- Date hidden rec id color
Hello Pete Jan 15, 2003 2900 blue
Basically, when a row is selected, it grabs the record id from the hidden column. This essentially allows me to have a data[][] object independent of the one that is used to display the JTable. Instinctively, this does not seem right, but I don't know how else to do it. I know that the DefaultTableModel uses a Vector even when it's constructed with an array and I've read elsewhere that it's not a good idea to do what I'm trying to do.
The other complication is that I have a table sorter as well. So, when it sorts the objects in the table, I have it recreate the data array and then set the data array of the ImmutableTableModel when it has rearranged all of the items in the array.
On top of this, I have a custom cell renderer as well. This checks yet another hidden field and displays the row accordingly. So, not only does the table sort need to inform the table model of a change in the data structure, but also the cell renderer.
Is there a better way to keep the data in sync between all of these?To the OP, having hidden columns is just fine, I do that all the time.. Nothing says you have to display ALL the info you have..
Now, the column appears to be sorting properly
whenever a new row is added. However, when I attempt
to remove the selected row, it now removes a seemingly
random row and I am left with an unselectable blank
line in my JTable.I have a class that uses an int[] to index the data.. The table model displays rows in order of the index, not the actual order of the data (in my case a Vector of Object[]'s).. Saves a lotta work when sorting..
If you're using a similar indexing scheme: If you're deleting a row, you have to delete the data in the vector at the INDEX table.getSelectedRow(), not the actual data contained at
vector.elementAt(table.getSelectedRow()). This would account for a seemingly 'random' row getting deleted, instead of the row you intend.
Because the row is unselectable, it sounds like you have a null in your model where you should have a row of data.. When you do
vector.removeElementAt(int), the Vector class packs itself. An array does not. If you have an array, when you delete the row you must make sure you dont have that gap.. Make a new array of
(old array length-1), populate it, and give it back to your model.. Using Vectors makes this automatic.
Also, you must make sure your model knows the data changed:
model.fireTableDataChanged(); otherwise it has no idea anything happened..
IDK if that's how you're doing it, but it sounds remarkably similar to what I went thru when I put all this together.. -
FBL5N Customer Namewise Sorting Needed
Dear Friends,
In FBL5n , now Customer Codewise Sorting is coming. My Requirment is Customer Namewise Sorting.
both Customer Number and Name are in Header Level.HEllo!
Please, read my explanation below:
The field NAME1 is not included in the tables BSEG and BSID/BSAD or in
the structures RFPOS and RFPOSX. Therefore, you will not be able to add
NAME1 to the line item display in FBL5N as a standard field or as a
special field (note 215798).
But, there is a workaround for this.
If you need NAME1 to be shown in the Line Item Display then you need to
add the field to the structures RFPOS and RFPOSX.
When the structure has been extended with the field then you need to
run the reports RFPOSXEXTEND and BALVBUFDEL (in the same way as seen in
the solution part in note 215798).
After that you need to use the Open FI Exit 1650 to fill the fields. You
will find a function group FI_ITEMS from transaction SE80. In this func-
tion group you will find a function module FI_ITEMS_DISPLAY where the
form ITEMS_DISPLAY_INIT includes the exits 1610 to 1650. The important
one for your problem is 1650 (OPEN_FI_PERFORM_00001650_E).
This exit is used if you want to display fields in e.g. FBL5N which
does not exist in the tables BSID/BSAD and also not in the customer
line item in BSEG.
Through this user exit it should be possible to get the value from the
relevant tables e.g. from other customer tables into structure RFPOSXEXT
if there is a relation between the relevant tables e.g. KNA1 to RFPOSX/
BSID.
Please also have a look at notes 112312 and 217189.
I hope this information clarifies your query ;D !
Regards,
REnan -
"CX_SY_OPEN_SQL_DB" ERROR when modifying a custom table
Dear friends,
I get this runtime error "DBIF_RSQL_SQL_ERROR"
"CX_SY_OPEN_SQL_DB" excpetion raised while am trying to modify a custome table . says deadlock detected while waiting for resourcebelow is the code snippet please suggest solution on how to avoid the error. thanks for the help in advance.
kathy
*Get all packspec levels
lt_levels = iv_packspec_content-levels.
loop at lt_levels into ls_levels.
if ls_levels-hutyp is not initial.
ls_zpackspec-guid = ls_levels-guid.
ls_zpackspec-aennr = ls_levels-aennr.
ls_zpackspec-total_quan = ls_levels-total_quan.
ls_zpackspec-level_type = ls_levels-level_type.
ls_zpackspec-/cfscmx/nest_fc = ls_levels-/cfscmx/nest_fc.
ls_zpackspec-maxstack = ls_levels-maxstack.
ls_zpackspec-unit_tw = ls_levels-unit_tw.
ls_zpackspec-g_weight = ls_levels-g_weight.
ls_zpackspec-unit_tv = ls_levels-unit_tv.
ls_zpackspec-g_volume = ls_levels-g_volume.
ls_zpackspec-trgqty = ls_levels-trgqty.
ls_zpackspec-flg_minimum_ps = ls_levels-flg_minimum_ps.
ls_zpackspec-creadat = sy-datum.
ls_zpackspec-matid = iv_packspec_content-content-matid.
ls_zpackspec-hu_create = ls_levels-hu_create.
ls_zpackspec-unit_gw = ls_levels-unit_gw.
ls_zpackspec-g_capa = ls_levels-g_capa.
ls_zpackspec-unit_gv = ls_levels-unit_gv.
ls_zpackspec-hutyp = ls_levels-hutyp.
ls_zpackspec-block = ls_levels-block.
ls_zpackspec-length = ls_levels-length.
ls_zpackspec-width = ls_levels-width.
ls_zpackspec-height = ls_levels-height.
ls_zpackspec-unit_lwh = ls_levels-unit_lwh.
ls_zpackspec-nest_ftr = ls_levels-nest_ftr.
if not ls_elementgroup is initial.
sort ls_elementgroup by guid.
read table ls_elementgroup assigning <ps_el_group>
with key guid = ls_levels-elementgroup
binary search.
if <ps_el_group> is assigned.
ls_elemgroup = <ps_el_group>-elements.
endif.
sort ls_elemgroup by hurelevant.
read table ls_elemgroup assigning <ps_elem>
with key hurelevant = 1
binary search.
if sy-subrc eq 0.
ls_zpackspec-hurelevant = <ps_elem>-hurelevant.
endif.
endif.
append ls_zpackspec to lt_zpackspec.
clear ls_zpackspec.
endif.
endloop.
**Update Packspec data for each level in the table ZPACKSPEC.*
*if not lt_zpackspec is initial.*
*modify zpackspec from table lt_zpackspec.*
*ev_zpackspec = lt_zpackspec.*
*endif.*Kathy - do you have duplicate entries for the same key fields in the internal table you are using for the update?
Rob -
How to delete the records from custom table???
My requirement is,
I have a custom table, assume as ZABC, I have updated this by my custom program, This data having table can be extracted by BI etract program(Assume ZZZ). Here I am not writing any code for extracting data from table to BI extract program, That they will do by BI extract program. But I want to write the code for
<b>Cleanup of Z tabledelete records 30 days after the BI data extractor has run.</b>
How this is possible suggest me any method having for these???
Thanks SanjuHell Sanjana,
Ask your basis people to do the clean up after 30 days. If you want the clean up only to be done 30 days after BI extract has been done, then u need some sort of indicator to say that BI Extract has been done , like flag and date in a custom table which will be set as soon as extract is done. Then based on that info u need to delete a the records.
Regards -
FM for F4 help on a custom table
Hi ,
Is there any FM which can show the values of a particular field of a custom table.
e.g. I have a custom table in which one of the fields in user id.
Now I wanna show it as a pop up in which the field would be user id. Now if the user clicks on f4 help of this field , I wanna show him all the values of this field from the custom table.
Please suggest how this can be done.
Regards,
DivyanshuThere are a number of ways to do this. Here is one. This example program gets values from T001 for F4 help. You can use your custom table instead.
report zrich_0001 .
tables: t001.
data: begin of it001 occurs 0,
bukrs type t001-bukrs,
butxt type t001-butxt,
ort01 type t001-ort01,
land1 type t001-land1,
end of it001.
select-options s_bukrs for t001-bukrs.
initialization.
select bukrs butxt ort01 land1 into table it001 from t001.
sort it001 ascending by bukrs.
delete adjacent duplicates from it001 comparing bukrs.
at selection-screen on value-request for s_bukrs-low.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BUKRS'
dynprofield = 'S_BUKRS'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = it001.
start-of-selection.
Regards,
Rich Heilman -
Adding new field in customized table ZPM_QMEL_EXT
Hi all,
My requirement is to add a new field in ZPM_QMEL_EXT table numeric field no of months due (ZZ_CO_MON_DUE) .
Its value will be calculated as the # of invoices that were paid vs. what has not been paid and then from there, value of this field will be fetched.It has to be populated during the time of notifcation screen entry (iw51). The logic will be similar to this
SELECT FAEDN FROM DFKKOP INTO TABLE IT_DU_DT
WHERE GPART EQ WA_QMEL-KUNUM AND
VKONT EQ WA_QMEL-ZZ_VKONT.
SORT IT_DU_DT BY FAEDN ASCENDING.
READ TABLE IT_DU_DT INTO WA_DU_DT INDEX 1.
MOVE WA_DU_DT-FAEDN TO DUE_DT.
CALL FUNCTION 'HR_MONTHS_BETWEEN_TWO_DATES'
EXPORTING
I_DATUM_BIS = SY-DATUM
I_DATUM_VON = DUE_DT
IMPORTING
E_MONATE = NO_MT.
IF NO_MT IN P_DU_MT.
WA_QMEL-DUE_MONTHS = NO_MT.
Awaiting your kind help .
Thanks
hariom.Hi,
There is only one option to include extra field for standard tables that is Append Structure other than we don't have any option.
For Customizing tables we can use Append structure as well as Include Structure.
Rules: Append Structure should be in last in Field column but include structure you can insert in any where it means between the fields.
Delivery class option and data class will take care automatically while upgrading the sap system one version to Another version.(upgrading).
For that you should maintain the those properties when data base table creation.
i hope the above information may helpful to you.
Best Regards
Sreenivas Pachva -
HR ABAP for employee groups with possible custom table...
Hi Members
I have a internal table where employee name and employee group are maintained.
Next, i have other tables where employee name is there and his salary. now I want to add all the salaries of the employees with same groups, how can I do this.
for Example, I have employee group as ENG, DOC, NUR Etc. (Also I wanted to use some kind of dynamic conditions as emplyee groups might added latter in custom table.
Thank you.
Edited by: Julius Bussche on Sep 23, 2008 10:18 PMCheck out this code:
*& Report ZTEST3
REPORT ztest3.
TYPES:
BEGIN OF x_employee,
id TYPE n LENGTH 10,
name TYPE c LENGTH 20,
group TYPE c LENGTH 4,
END OF x_employee,
BEGIN OF x_emp_sal,
id TYPE n LENGTH 10,
salary TYPE p LENGTH 16 DECIMALS 2,
END OF x_emp_sal,
BEGIN OF x_final,
group TYPE c LENGTH 4,
id TYPE n LENGTH 10,
name TYPE c LENGTH 20,
salary TYPE p LENGTH 16 DECIMALS 2,
END OF x_final.
DATA:
i_employee TYPE STANDARD TABLE OF x_employee INITIAL SIZE 0,
i_final TYPE STANDARD TABLE OF x_final INITIAL SIZE 0,
i_salary TYPE STANDARD TABLE OF x_emp_sal INITIAL SIZE 0,
wa_employee TYPE x_employee,
wa_salary TYPE x_emp_sal,
wa_final TYPE x_final,
wa_final_temp TYPE x_final.
DEFINE append_employee.
wa_employee-id = &1.
wa_employee-name = &2.
wa_employee-group = &3.
append wa_employee to i_employee.
END-OF-DEFINITION.
DEFINE append_salary.
wa_salary-id = &1.
wa_salary-salary = &2.
append wa_salary to i_salary.
END-OF-DEFINITION.
append_employee:
1 'John' 'ENG',
2 'Mary' 'ENG',
3 'Pooja' 'IT',
4 'Payal' 'IT',
5 'Sourav' 'IT'.
append_salary:
1 '111.00',
2 '1111.00',
3 '11111.00',
4 '111111.00',
5 '1111111.00'.
LOOP AT i_employee INTO wa_employee.
READ TABLE i_salary INTO wa_salary
WITH KEY id = wa_employee-id.
IF sy-subrc = 0.
wa_final-id = wa_employee-id.
wa_final-name = wa_employee-name.
wa_final-group = wa_employee-group.
wa_final-salary = wa_salary-salary.
APPEND wa_final TO i_final.
ENDIF.
ENDLOOP.
SORT i_final BY group.
LOOP AT i_final INTO wa_final_temp.
wa_final = wa_final_temp.
AT END OF group.
SUM.
WRITE: /1 wa_final_temp-group, 5 wa_final_temp-salary.
ENDAT.
ENDLOOP.
output will be:
ENG 1.222,00
IT 1.233.333,00
Edited by: Sourav Bhaduri on Sep 24, 2008 1:44 AM -
Hi all,
I have successfully personalized the EIT SSHR screen to display one of the configured EIT on a custom responsibility using a custom function(so that I can do personalization on function level without affecting other EIT screens).
Now my challenge is that, when I click on the menu function, it takes me to the people search page, I do a search and select a employee, then it shows me the list of existing EIT records with an option of add, update and delete. Here, I need to show the existing records in a sorted order. I need the latest entry entered to appear in the top. If this is not possible, it would be great if I can have the table sorted as per one of the segment value.
Is there a way to do this. Can someone help me in doing this and let me know the steps to do the same.
Cheers
ArunI think Tomahawk is the way to go here.
Tomahawk allows sorting of data in the data table.
For action based on row selection, you need to invoke java script function
using rowOnClick attribute of t:dataTable and then make a hidden command button "click" from
the java script.
Regards,
Joshua -
Synonym required to query custom tables from Oracle Apps database
When creating an Answers report that queries from a table owned by a custom schema (not APPS), I cannot query the table and get error. Once I add a Synonym for APPS on this table, then OBIEE works normally.
Since OBIEE is logging in as the APPS user, are Synonyms required for all non-APPS tables/views or is there another feature of the Administrator where it can store the table alias (our typical owner of custom tables is XXFI)?OK, well "compare" can mean one of two things: Compare structure or compare contents. Here is a quick script to compare column structures of two tables on one database:
(select COLUMN_NAME,
DATA_TYPE,
DATA_LENGTH,
DATA_PRECISION,
DATA_SCALE,
NULLABLE
from dba_Tab_columns
where owner=:OWNR1
and table_name = :tablename
minus
select COLUMN_NAME,
DATA_TYPE,
DATA_LENGTH,
DATA_PRECISION,
DATA_SCALE,
NULLABLE
from dba_Tab_columns
where owner=:ownr2
and table_name = :tablename)
union all
(select COLUMN_NAME,
DATA_TYPE,
DATA_LENGTH,
DATA_PRECISION,
DATA_SCALE,
NULLABLE
from dba_Tab_columns
where owner=:ownr2
and table_name = :tablename
minus
select COLUMN_NAME,
DATA_TYPE,
DATA_LENGTH,
DATA_PRECISION,
DATA_SCALE,
NULLABLE
from dba_Tab_columns
where owner=:ownr1
and table_name = :tablename)
If this query returns any rows, then these indicate that there are structural differences between the tables. We do a minus in both directions to ensure that an additional column in either schema will be returned in the query.
If you are going across dblinks to remote tables then you have to amend the "dba_tab_columns" to "sys.dba_tab_columns@yourdblink"
If you also want to compare indexes, triggers, etc then do the same sort of thing for the associated dba_ views for those objects.
And if you want to compare table contents, then often the fastest way is also to check minuses in both directions, if the tables are not too big:
e.g.
(select * from schema1.table@dblink1
minus
select * from schema2.table@dblink2)
union all
(select * from schema2.table@dblink2
minus
select * from schema1.table@dblink1)
local tables, of course, simply omit the "@dblink" issues.
There are tools to help in such things. TOAD, for example, has a pretty good schema comparison tool, and there are plenty of other options out there. But if you need to script this yourself then the logic I've shown is a good starting point.
Cheers,
Mike -
Error while deleting a customer table
When I try to delete a customer table which is saved as a local object I get an error stating that the table is still used in ABAP Dictionary. It seems that the customer table is still used in a customer program, but the program is already deleted! I deleted the program earlier and thus no longer exist in our system. I cannot find any trace of the program, but am unable to delete the customer table now. Any suggestions?
Program name would have been of the table maintenance generator and you deleted it manually.
It should have been deleted from TMG .
Your problem will be resolved if you will create Table maintenance of the database table and then delete it again. -
How to find out the user who has created a new field in the custom table.
How to find out the user details who has created a new field in the custom table.
Thanks,
JoanHi Jesudasan ,
You can know the user details with version management.Please find the
below procedure to know.
Go to table->Utilities tab->version->Version management->Compare the previous one .
Hope this solves the issue,Let me know if you have any issues.
Thanks,
Rajani -
How to find the Table from which a Custom table is created.
Hi Gurus,
I have a custom table in SAP and want to figure how that has been created. How can I do that?
Regards
PrashantHello Prashant,
what do you mean by "how"?
When you say custom table do you mean "Customization table" or a "Customer table" (in namespace Z... or Y...)
Anyway, you can access SE11 transaction, view the table and then check its attributes. -
Converting garbled characters for JAPANESE characters in a custom table
Hi all,
I have a custom table that store Japanese characters.
After my company has upgraded to ECC6.0, this data in the custom table has become garbled and its alot of it garbled.
Is there any SAP tool that can I use to make the correction on those garbled Japanese characters?
Thanks,
William WilstrothHi Nils,
I really really really had a field day reading and testing around UC... To my dissappointment, I do not have the authorization to use SUMG and SCP too as well as a few of the TCODES...
I finally told my higher level technical mgnt. that this table might need some changes...
Has this problem of mine got anything to do with MDMP since its no longer supported in ECC6 and I found one coding that search for MDMP in RSVTPROT...
My colleagues suggest that the data be corrected from table DBTABLOG... which i find, in my opinion, is not the right way...
Thanks,
William -
Custom report sorting
I need to display the report column header in vertical format, hence I’ve to use to use some css code along with column name for that. Also, I want this column to be sorted by clicking the column name. So, I’m embedding the following url along with css and column name to enable sorting on this column when user clicks the column header. I got the following url by looking at the standard report with sorting enabled on a column.
http://test.com:7777/pls/htmldb/f?p=100:22:&APP_SESSION:fsp_sort_1::RP&fsp_region_id=1870116795285540
My questions are …
How can I toggle the url to append “_desc” to the fsp_sort_1 parameter dynamically when the user clicks the column name, as it is done when standard column sorting is selected.?
How can pass region id dynamically in the above url (last number in the url)?
Any ideas are appreciated
Thanks,
Suryahi pavan
i can just tell you that i had no issues with custom column sorting in webi with Enterprise XI 3.0 and Xcelsius 2008.
Best Regards
Ulrich
Maybe you are looking for
-
Downloaded MSN4Mac, says it's external hard drive, can't delete it
I downloaded Messenger for Mac from the Microsoft website, version 7 i think it was. It was saved to the download folder as a .dmg file. I opened it and installed it into one of my files, but instead of showing up there, it showed up on my desktop as
-
My iPhone 4 has become unresponsive during the latest update I have a progress bar about half way through the update and it hasn't moved for about an hour can anyone help???
-
JDBC Receiver doesn't work (and doesn't show any error msg)
Hi all, I'm now trying to test a file to JDBC scenario. After many msgs sent, I'm checking at sxmb_moni and the file sender is ok, the msg mapping is ok, and the JDBC receiver is ok - the status is "processed successfully". But... in my database (Ora
-
E-Mail processing error every 60 seconds, but still mails are handled?
Hi Guys, My "Operations Mnager" Event log file on the SCSM 2012 R2 Server is filling with the one error: Log Name: Operations Manager Source: SvcMgr Inbound Email Event ID: 27017 Task Category: None Level: Error Keywords:
-
WebCenter PS3 VM AviTrustSamplePortal(V2.0) does not startup.
Hello Experts - I am trying to configure the new PS3 VM but running into one final problem. I cannot start the AviTrustSamplePortal(V2.0) applicaiton. When I try and start the appliation i recieve the following error. Substituted for the exception or