ALV sort column problem
Hi all - I have an ALV with standard sort functionality in each column. Let's say that I have 20 rows with 5 columns, the first column has a record in every row but another column in some rows are empty but in other rows that column has data.
If I click the sort functionality (next to the label of the column) in a column that has empty spaces and values it will show the data sorted but the empty spaces are shown like a whole blank column (it losses the line that divided the rows) and it's kind of confusing, if the column is completely empty and I click sort of course nothing will get sort but the column looks all white (no lines at the row level)
Is there anyway that I can eliminate that white space and if is empty is empty I dont want to lose the line that divide the rows?
thanks!
Jason P-V
hi
it might be dumping as in your mentioned code snippet you are not taking the reference of the field and so it will be intial
Try using the following code instead -
DATA: lo_cmp_usage TYPE ref to if_wd_component_usage.
DATA: lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
DATA: lr_function_settings TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
Data: lr_field_curr TYPE REF TO CL_SALV_WD_FIELD.
*create an instance of ALV component
lo_cmp_usage = wd_this->wd_cpuse_OVERVIEW_PAYMENT_ALV( ). "My ALV Usage Name OVERVIEW_PAYMENT_ALV
* if not initialized, then initialize
if lo_cmp_usage->has_active_component( ) is initial.
lo_cmp_usage->create_component( ).
endif.
* get ALV component
lr_salv_wd_table = wd_this->wd_cpifc_OVERVIEW_PAYMENT_ALV( ).
lr_function_settings ? = lr_salv_wd_table->get_model( ).
CALL METHOD LR_FUNCTION_SETTINGS->IF_SALV_WD_FIELD_SETTINGS~GET_FIELD
EXPORTING
FIELDNAME = 'CON_CURR' " ALV Column Name
RECEIVING
VALUE = lr_field_curr.
CALL METHOD LR_FIELD_CURR->IF_SALV_WD_SORT~SET_GROUPING_ALLOWED ( exporting value = abap_false ).
Hope this helps
Similar Messages
-
Sutotal Problem in ALV for three sorted columns
Hello experts,
i am developing one ALV report for purcj=hase history vendor wise and material group wise.
i am fetching data from rbkp,rseg,mara,makt.
i am also fetching tax code.problem is that that there are 3 columns have group wise and i need sutotal on tax code wise and vendor wise quantity.
please help me for sort problem.
thanksHi Abhishek,
Click on below links:
[http://wiki.sdn.sap.com/wiki/display/Snippets/DisplaysubtotaltextinALV+grid]
[ALV - Sort - Subtotal;
BR
Dep -
ALV - add colour to columns, sorting columns
Hi Experts,
Using ALV oops......I am using field catalog merge FM.
After using that how do I use color & sort options.
How to add colors to columns
How to sort columns
Thanks in advance.
Edited by moderator to more meaningful titleHello Ravindar
Of course you can use the colouring options:
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
* I_BUFFER_ACTIVE =
i_structure_name = 'ZSHHR207'
* I_CLIENT_NEVER_DISPLAY = 'X'
* I_BYPASSING_BUFFER =
* I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = it_fdcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
DATA: ls_fcat TYPE lvc_s_fcat.
LOOP AT it_fdcat INTO ls_fcat.
CASE ls_fcat-fieldname.
WHEN '...'.
ls_fcat-emphasize = 'C410'.
WHEN '...'.
ls_fcat-emphasize = 'C600'.
WHEN OTHERS.
CONTINUE.
ENDCASE.
MODIFY it_fdcat FROM ls_fcat INDEX syst-tabix.
ENDLOOP.
Regards
Uwe -
Problem in specifing the intial sorting column of a report
hi
we have a report based on a table with 6 columns in our home page .we display all the six columns as sortable.
we also need to sort the contents of the report by 4th column by default when ever the user logs in ,but what happens is ,report gets sorted automatically depening upon the previous sorting column selected
is there any way of telling htmldb to sort the report by 4th column ..
many thanks
S.Jawaharhi ,
this infotype has a interesting solution . In my case it was for US country .
We select the veteran status and this is field P0077-VETST which is stored in DB table .
Now based on this value and the molga of that pernr we need to look at the T5UVT table for the combinations avaliable for MOLGA AND VETST .
Based on the config's of this table the screen values are getting populated .
It dosent allow any combinations and the picked values are passed to the screen for fields Q0077-VETS1 VETS2 VETS3 VETS4 .
Br,
Vijay. -
A simple question about wrong sorting with multiple sort columns in Excel 2010
Hi, everyone! I have encountered a problem that I don't know how to explain.
So I post it here because I don't know if there is another more relevant forum...
I have a data sheet with the students' scores for the course.
All the data were generated with the randbetween function,
and pasted with the values.
To rank the students by their performance,
I did the sort with the column "total score" as the first sort-column
and "final term" as the second.
The weird thing to me is that the order of the data seems problematic.
That is, all the rows are sorted correctly with the first sort-column.
But for the rows with the same values of the first sort-column,
there are some rows whose values of the second sort-column are out of order.
(please look at the data file at
www_dot_kuaipan_dot_cn/file/id_67204268108546068_dot_htm
Please change the "_dot_" to the real literal dot.
Especially the rows with 56.7 as the first sort-column value
and some other values near the tail of the list.)
I tried to manually input and sort the same values of both columns
in a near-by region. The result was correct.
When some friend copied all the data to paste in Notepad,
and reload them in excel. The problem disappears.
Some friend also tried to wrap a round function at the values of the 1st sort-column,
the sorting order became correct!
But they could not explain why either.
How confusing! I even tried to swap the first and secod sort-column;
the output was right.
All the data were generated by randbetween function and pasted with values.
Where could all the special characters, if any, come?
Can anyone give me an explanation? I would be very grateful.
Thanks in advance!Re: Sort is not in proper order
Sounds as if the data includes spaces or hidden characters that are affecting the sort.
That is indicated by the fact that manually entering the data resolves the problem.
Note: You can use a public file storage website to hold your file and add the link to it in your post.
Jim Cone
Portland, Oregon USA
Special Sort excel add-in (30+ ways to sort) - 3 week no obligation trial
https://jumpshare.com/b/O5FC6LaBQ6U3UPXjOmX2 -
Hotspot-clicking (Insert function) plus ALV Sorting
Hi,
I have a requirement where the ALV display has to be SORTED based on values entered/changed on a certain column. The sort works ok when used with a custom APPEND button for new records (always inserted at the bottom of the list).
However, it does not work correctly when used with the Hotspot-click (INSERT functionality). It looks like if you CLICK on a particular record onscreen, you are actually addressing the original record in that position before the SORT was effected.
Is the Hotspot-clicking (Insert functionality) possible with ALV sorting? The ideal solution would be to have the ALV sorted at PBO and also at PAI so that the user can change existing records and add new ones with the sorting being updated everytime ON_DATA_CHANGED is triggered.
Will appreciate any help on this.
Thanks!
MichaelHello Michael
Thanks for further specifying your requirements. I have created the sample variant ZUS_SDN_ALVGRID_HOTSPOT_SORT_1 which contains two differences as compared to its template:
Replace table VBAK with VBAP (so we have two levels of sorting: VBELN, POSNR)
Move SET_TABLE_FOR_FIRST_DISPLAY method call into PBO
When I click on the hotspot (VBELN) a new row entry for the order number is created. The sorting (VBELN, POSNR) is kept even though the new row has been appended to the itab.
*& Report ZUS_SDN_ALVGRID_HOTSPOT_SORT
*& Thread: Hotspot-clicking (Insert function) plus ALV Sorting
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1159431"></a>
REPORT zus_sdn_alvgrid_hotspot_sort.
TYPES: BEGIN OF ty_s_outtab.
INCLUDE TYPE vbap.
TYPES: END OF ty_s_outtab.
TYPES: ty_t_outtab TYPE STANDARD TABLE OF ty_s_outtab
WITH DEFAULT KEY.
DATA: gt_outtab TYPE ty_t_outtab.
DATA:
gd_okcode TYPE ui_func,
gd_repid TYPE syrepid,
gt_sort TYPE lvc_t_sort,
gt_fcat TYPE lvc_t_fcat,
gs_layout TYPE lvc_s_layo,
gs_variant TYPE disvariant,
go_docking TYPE REF TO cl_gui_docking_container,
go_grid TYPE REF TO cl_gui_alv_grid.
* CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-DATA:
ms_sel_row TYPE lvc_s_row. " selected row
CLASS-METHODS:
handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING
er_data_changed
e_onf4
e_onf4_before
e_onf4_after
sender,
handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING
e_row_id
e_column_id
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
* CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_data_changed.
FIELD-SYMBOLS: <lt_outtab> TYPE ty_t_outtab.
BREAK-POINT.
ENDMETHOD. "handle_data_changed
METHOD handle_hotspot_click.
" define local data
DATA: ls_outtab TYPE ty_s_outtab,
ld_msg TYPE bapi_msg.
BREAK-POINT.
CLEAR: lcl_eventhandler=>ms_sel_row.
ms_sel_row = e_row_id.
READ TABLE gt_outtab INTO ls_outtab INDEX e_row_id-index.
CONCATENATE 'Selected Sales Order = ' ls_outtab-vbeln ' / '
ls_outtab-posnr
INTO ld_msg.
message i398(00) with ld_msg.
" Trigger PAI
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'INSERT'
* IMPORTING
* rc =
ENDMETHOD. "handle_hotspot_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
PARAMETERS:
p_vkorg TYPE vkorg DEFAULT '0001' OBLIGATORY.
START-OF-SELECTION.
** SELECT * FROM vbak INTO CORRESPONDING FIELDS OF TABLE gt_outtab
** UP TO 200 ROWS
** WHERE vkorg = p_vkorg.
SELECT * FROM vbap INTO CORRESPONDING FIELDS OF TABLE gt_outtab
UP TO 100 ROWS.
PERFORM init_controls.
* Build fieldcatalog and set hotspot for field KUNNR
PERFORM build_fieldcatalog.
PERFORM set_layout_and_variant.
PERFORM set_sorting.
" Register EDIT event
CALL METHOD go_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter
EXCEPTIONS
error = 1
OTHERS = 2.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SET HANDLER:
lcl_eventhandler=>handle_data_changed FOR go_grid,
lcl_eventhandler=>handle_hotspot_click FOR go_grid.
* Link the docking container to the target dynpro
gd_repid = syst-repid.
CALL METHOD go_docking->link
EXPORTING
repid = gd_repid
dynnr = '0100'
* CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* ok-code field = GD_OKCODE
CALL SCREEN '0100'.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'.
* SET TITLEBAR 'xxx'.
* Display data
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
i_bypassing_buffer = abap_true
is_variant = gs_variant
i_save = 'A'
* i_default = 'X'
is_layout = gs_layout
* is_print =
* it_special_groups =
* it_toolbar_excluding =
* it_hyperlink =
* it_alv_graphics =
* it_except_qinfo =
* ir_salv_adapter =
CHANGING
it_outtab = gt_outtab
it_fieldcatalog = gt_fcat
it_sort = gt_sort
* it_filter =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
** CALL METHOD go_grid->refresh_table_display
*** EXPORTING
*** IS_STABLE =
*** I_SOFT_REFRESH =
** EXCEPTIONS
** finished = 1
** OTHERS = 2.
** IF sy-subrc ne 0.
*** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
** ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE gd_okcode.
WHEN 'BACK' OR
'EXIT' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
WHEN 'INSERT'.
PERFORM insert_row.
WHEN OTHERS.
" Check for changed data at the frontend (= grid control)
CALL METHOD go_grid->check_changed_data( ).
ENDCASE.
CALL METHOD go_grid->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR: gd_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form INIT_CONTROLS
* text
* --> p1 text
* <-- p2 text
FORM init_controls .
* Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
ratio = 90
EXCEPTIONS
others = 6.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD go_docking->set_extension
EXPORTING
extension = 99999
EXCEPTIONS
cntl_error = 1
OTHERS = 2.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Create ALV grid
CREATE OBJECT go_grid
EXPORTING
i_parent = go_docking
EXCEPTIONS
others = 5.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " INIT_CONTROLS
*& Form BUILD_FIELDCATALOG
* text
* --> p1 text
* <-- p2 text
FORM build_fieldcatalog.
* define local data
DATA:
ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
* I_BUFFER_ACTIVE =
i_structure_name = 'VBAP' " 'VBAK'
* I_CLIENT_NEVER_DISPLAY = 'X'
* I_BYPASSING_BUFFER =
* I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = gt_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
** LOOP AT gt_fcat INTO ls_fcat.
** CASE ls_fcat-fieldname.
** WHEN 'VBELN' OR
** 'ERDAT' OR
** 'ERZET' OR
** 'ERNAM' OR
** 'AUART' OR
** 'NETWR' OR
** 'WAERK'.
** CONTINUE.
** WHEN OTHERS.
** ls_fcat-no_out = abap_true.
** ENDCASE.
** MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
** ENDLOOP.
* Only non-key fields are editable
** ls_fcat-edit = 'X'.
** MODIFY gt_fcat FROM ls_fcat
** TRANSPORTING edit
** WHERE ( fieldname NE space ).
ls_fcat-hotspot = abap_true.
MODIFY gt_fcat FROM ls_fcat
TRANSPORTING hotspot
WHERE ( fieldname = 'AUART' OR
fieldname = 'VBELN' ).
** DELETE gt_fcat FROM 15 TO 99.
ENDFORM. " BUILD_FIELDCATALOG_KNB1
*& Form SET_LAYOUT_AND_VARIANT
* text
* --> p1 text
* <-- p2 text
FORM set_layout_and_variant .
CLEAR: gs_layout,
gs_variant.
gs_layout-cwidth_opt = abap_true.
gs_variant-report = syst-repid.
gs_variant-handle = 'GRID'.
ENDFORM. " SET_LAYOUT_AND_VARIANT
*& Form SET_SORTING
* text
* --> p1 text
* <-- p2 text
FORM set_sorting .
* define local data
DATA: ls_sort TYPE lvc_s_sort.
REFRESH: gt_sort.
CLEAR: ls_sort.
ls_sort-spos = 1.
ls_sort-fieldname = 'VBELN'.
ls_sort-up = abap_true.
APPEND ls_sort TO gt_sort.
CLEAR: ls_sort.
ls_sort-spos = 1.
ls_sort-fieldname = 'POSNR'.
ls_sort-up = abap_true.
APPEND ls_sort TO gt_sort.
ENDFORM. " SET_SORTING
*& Form INSERT_ROW
* text
* --> p1 text
* <-- p2 text
FORM insert_row .
* define local data
DATA: ls_outtab TYPE ty_s_outtab,
ld_order TYPE vbeln.
READ TABLE gt_outtab INTO ls_outtab
INDEX lcl_eventhandler=>ms_sel_row-index.
ld_order = ls_outtab-vbeln.
" Find last item of sales order
LOOP AT gt_outtab INTO ls_outtab
WHERE ( vbeln = ld_order ).
ENDLOOP.
" Create next item:
add 10 to ls_outtab-posnr.
" NOTE: added at the end of the list
APPEND ls_outtab TO gt_outtab.
" NOTE: insert new row AFTER selected row => works, too
** INSERT ls_outtab INTO gt_outtab
** INDEX lcl_eventhandler=>ms_sel_row-index.
ENDFORM. " INSERT_ROW -
Simple question about ALV sorting
I retrieve data from SFLIGHT table and display it in ALV by using cl_salv_table class. I added a sorting column PRICE as follows:
data r_salv_sort type ref to cl_salv_sorts.
r_salv_sort = r_salv_table->get_sorts( ).
r_salv_sort->add_sort('PRICE').
and got exception message:
Subtotals cannot be calculated on aggregatable columns
it is fine when I change from PRICE column to CONNID column.
What could be the reason for that? I just want to sort the Price column. Thanks!We can do the sorting on the Quantity or Amount column once it ALV is displayed. Because now the control is no more with the SALV model. It is with the ALV framework.
SALV model doesn't allow the sorting on the columns on which you can perform the Agreegation.
You can save the default layout variant and then start the ALV with that variant.
Regards,
Naimesh Patel -
Sorting within sorted columns?
Is it possible to sort columns by say artist & say track names all at one time? If so how is this done?
Thanks in advanceYes, it is.
Use the Songs view, and turn on the Column Browser. Then select the artist you're interested in and finally click on the Name column so the arrow points upwards - as shown below:
<picture>
While the artist is highlighted, the additional (greyed out) selection of "All Genres" and "All Albums" ensures that every song by The Beach Boys is shown, even if they are from different genres.
This doesn't work for artists who only appear on compilation albums though. There is a way to see them, but it's a bit more involved.
To do this, use the Songs view, and turn on the Column Browser. (Oddly, the shortcut for the Column Browser - CTRL+SHIFT+B - isnt working in iTunes 11.1.3.8, so click on the View/Column Browser/Show Column Broswer if you have the same problem. CTRL+B will turn on the menu bar at the top (with View on it). -
00904 error when sorting columns that require double quotes
We have used an ETL tool to import an XML file into Oracle 10g. The column names are mixed case and unfortunately have to remain mixed case because we have a "column" and a "Column" name with different info in them. So when we migrate it in, the field names have be enclosed in double quotes in all SQL operations. The problem in SQL Developer 1.5.1 (Win XP SP2, Oracle 10G) though is that if I try to sort on a column by double clicking the column header, we get an ORA-00904 error COLUMN does not exist. So it looks like it is trying to do an ORDER BY without putting the column name in double quotes. Has anybody else had issues with this and is there a fix for it?
Message was edited by:
coachyIt's a bug.
Logged Bug 7344539 - 00904 error when sorting columns that require double quotes
Workaround: Use the sort button on DataTab's toolbar.
-Raghu -
ALV - force column to be displayed always
Hi Experts,
in runtime I append dynamical columns to a table, which is displayed via ALV.
My problem is, if the user already has saved a layout without this columns, the column is not displayed (it is only available in column-inventory).
Can I force this columns to be displayed also if the are not saved in the layout?
example:
columns in alv structure = C1, C2, C3.
dynamical I append column DC84, and DC39 (always differently)
The user has saved in his layout for example the columns C1, C2, C3, DC84, DC39 as displayed.
Another time I also append column DC31 and so this column is not displayed (user has to select this column in layout-settings).
Biggest problem is, that the user would have to check the layout-setting everytime, because he can't know which columns are covert.
used class = cl_gui_alv_grid
Thx in advanceHi,
we can'd do this by using Alv no other go, if u want show the sub columns go by Classical reporting. -
alv grid column name could not be displayed fully.we manually want to drag the column,to see the column name fully. for ex. if column name is 'COMPANYNAME'.it shows 'COMPA' alone.
how could i solve this problem....?hI,
Check the below code...
*& Report ZALV_PROGRAAM
REPORT ZALV_PROGRAAM.
TYPE-POOLS SLIS.
DATA : BEGIN OF WA_KNA1,
KUNNR TYPE KUNNR,
NAME1 TYPE NAME1,
END OF WA_KNA1,
IT_KNA1 LIKE TABLE OF WA_KNA1.
DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT LIKE LINE OF IT_FCAT.
SELECT KUNNR NAME1 INTO TABLE IT_KNA1 FROM KNA1 UP TO 5 ROWS.
PERFORM FCAT USING '1' 'KUNNR' 'CUSTOMERNUMBER' '40'.
PERFORM FCAT USING '2' 'NAME1' 'CUSTOMERNAME' '40'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-CPROG
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = IT_FCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = IT_KNA1
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*& Form FCAT
text
-->P_0052 text
-->P_0053 text
-->P_0054 text
-->P_0055 text
form FCAT using FP_COL_POS
FP_FIELDNAME
FP_SELTEXT_M
FP_OUTPUTLEN.
WA_FCAT-COL_POS = FP_COL_POS.
WA_FCAT-FIELDNAME = FP_FIELDNAME.
WA_FCAT-SELTEXT_M = FP_SELTEXT_M.
WA_FCAT-OUTPUTLEN = FP_OUTPUTLEN.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
endform. " FCAT
thanks,
Thiru. R -
hi there experts...
I´m doing an alv report and I want to know if it's possible to sort the alv like I'm going to explain:
WA_SORT-SPOS = 1.
WA_SORT-FIELDNAME = 'EKGRP'.
WA_SORT-TABNAME = 'T'.
WA_SORT-UP = 'X'.
APPEND WA_SORT TO IT_SORT.
CLEAR WA_SORT.
WA_SORT-SPOS = 2.
WA_SORT-FIELDNAME = 'EKNAM'.
WA_SORT-TABNAME = 'T'.
WA_SORT-UP = 'X'.
APPEND WA_SORT TO IT_SORT.
CLEAR WA_SORT.
I want to sort this two fields in order that, i just want to group the equal values of EKNAM that correspond to a single value of EKGRP nad not to group all equal values of EKNAM with diferent EKGRP values.
Output Example of what I want:
EKGRP | EKNAM | DESC
-----------|----------|-------------
1 | 001 | blabla1
|----------|-------------
| 002 | blabla2
| |-------------
| | blabla3
-----------|----------|-------------
2 | 002 | blabla4
| |-------------
| | blalba5
|--------- |--------------
| 012 | blabla6
With normal sort, value 002 for EKNAM field is grouped independently from the value of EKGRP field...
Is it possible to do??
Tanks
Edited by: Hermano.Andrade on Apr 8, 2009 5:59 PMHI,
Refer to this link..https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/sortinALV
Opp's sorry it is not possible...if the value is same for the corresponding two values in the different sort column then the values are merged and displayed at first instead of showing once again if any change in the any of the values in other sort column.
Instead you can update the internal table in the same way as required and display as the output. The restriction on this you need to disable the sort buttons on the alv and no other operations to be performed. -
Hi all
I create matrix report( in version 9i)
I want sort columns of report
when i use order by it sort rows but i want sort columns
my query is like this:
SELECT
Code,
name,
DECODE(cons_code, '1', 'A',
'2', 'B',
'3','C',
'4', 'D',
'5', 'E') Activity,
SUM(amnt) amount
From Mytable
Where ....
group by
Code,
DECODE(cons_code, '1', 'A',
'2', 'B',
'3','C',
'4', 'D',
'5', 'E')
my group base on code
my columns base on Activity
and cells are Amount
my report result is:
........ B E D A C
name1 1 1 1 1 2
name2 3 4 8 6 1
I want this :
........ A B C D E
name1 1 1 1 1 2
name2 3 4 8 6 1
....Hello,
How about this?
SELECT Code, name,
DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D','5', 'E') Activity, SUM(amnt) amount
From Mytable
WHERE ....
GROUP BY Code, name, DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D', '5', 'E')
ORDER BY code, DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D', '5', 'E') -
How do I uninstall an application or software from my Macbook Pro? I have been having all sorts of problems updating Adobe Reader and Flash player on my mac that I need to uninstall them so I can re-install them.
Uninstall Flash
http://helpx.adobe.com/flash-player/kb/uninstall-flash-player-mac-os.html
For Reader search "unistall adobe reader mac" for the version you are running
https://forums.adobe.com/message/4793407 XI
http://helpx.adobe.com/acrobat/kb/installing-uninstalling-acrobat-x-mac.html X -
Export TO XXL from ALV Grid - Column order mismatch
Hi All,
The user is trying to download data from Option -> Export -> Spreadsheet which will create XXL.
But while downloading there is mismatch in the order of columns displayed on the alv grid & columns downloaded.
All character fields are displayed on left, then date fields then quantity fields are downloaded to XXL. but in ALV Grid user has chosen a layout in which date fields come first.
Please help me to find solutionGrid display using 'REUSE_ALV_GRID_DISPLAY'. From the alv grid output, user is trying to download data using export -> Excel . so for download there is no custom code.
We have copied standard report and added few more fields to the custom report. strangely Standard report also has this issue.
I searched for SAP notes also..no clue
Maybe you are looking for
-
Inventory Management and WBS?
Hi there, We want to show an inventory management report which contains WBS Hierarchy. It shall look like the following style: Dimension Fact Stock Value FKSTL ->PROJECT ->WBS ->MATNR xxx,xxx,xxx I have activate two InfoCubes, 0IC_C03 and 0
-
Transferring iTunes library from USB drive to new laptop. Many issues.
First off, I usually can only listen to my music if I plug in the USB drive with the original music on it. Now, iTunes is telling me that some of my music "cannot be found." Please help!
-
Bonjour, Après avoir installé un carte PCI 6733,sous Measurement and Automation, je peux faire l'auto test de la carte (résultat OK), je peux accéder au panneau de test et l'utiliser avec succès, je peux créer une tache type génération de tension su
-
Malfunctioning CD drive on PowerBook G4
What should I do if my disc drive will not burn CD's, won't recognize some CD's, and generally needs some repair? Shall I repair it and if so with whom? OR is there in existence an external burner for Macs? Thanks in advance!
-
Deactivation of functional area in FM
Hello I activate functional area as an additional account assignment element for the Funds Management. But I don't use functional area in Funds Management any more. So I want to know how to deactivate account assignment of functional area in my syste