ALV IDA Column Position Change

Hi Folks,
Is it possible to change column position in ALV IDA programmatically if possible then how?
Regards,
Amol

Hello Amol,
you can influence the order of the displayed fields using the SET_AVAILABLE_FIELDS method of the IDA ALVs field catalog instance.
Following you see a little example for the company code table T001. I changed the order of the fields that the company code text is displayed in front of the company code ID. The order in which you pass the fields to the method defines the order for the output.
Best Regards,
Florian
" create IDA ALV
DATA(lo_ida_alv) = cl_salv_gui_table_ida=>create( iv_table_name = 'T001' ).
" set available fields
lo_ida_alv->field_catalog( )->set_available_fields( its_field_names = VALUE if_salv_gui_types_ida=>yts_field_name( ( CONV fieldname('BUKRS') )
                                                                                                                   ( CONV fieldname('BUTXT') ) ) ).
" set display order of fields
lo_ida_alv->default_layout( )->set_visible_fields( it_visible_fields = VALUE if_salv_gui_types_ida=>yt_field_name( ( CONV fieldname('BUTXT') )
                                                                                                                   ( CONV fieldname('BUKRS') ) ) ).
" output
lo_ida_alv->fullscreen( )->display( ).

Similar Messages

  • The Visible attribute on alv grid column is not changed after Change Layout

    Setup:
    I have a program that displays output in an ALV grid (using cl_salv_table).
    The ALV grid is displayed within a custom control on a subscreen.
    I have 4 subscreens being used on a tabstrip control.  So I have 4 ALV grids total (one on each subscreen).
    On each ALV grid, I have set the set_layout_change function to true so that the user can hide and unhide columns etc. on each grid via the button on the alv grid toolbar.
    I also allow the user to dowload the contents of all 4 grids to excel.  To do this I have a custom button that when clicked goes to each ALV grid - gets the column metadata (via cl_salv_columns_table-get() ) and checks the visibility to determine if the column should be downloaded or not (via cl_salv_column-is_visible() ) to excel.
    The Problem:
    As I said I have 4 grids being displayed via a tab control.  Let's say the user is on tab 1 and unhides some columns on the alv grid 1 via the Change Layout... button.  And then the user navigates to tab 2.  If they click the download button at that point - when the download code is run and it checks the visibility of the columns on alv grid 1 - the changes that were made via the Change Layout... button have not synchronized yet.  When I call is_visible() for a column that was unhid it still comes back as false. 
    The only way I have found to remedy this is to make the user click on a button on the alv grid's toolbar before navigating to a different tab to force the synchronization between the changes made and the backend column metadata.  However, this is not the best option and requires training for the user that they have to do this for the download to work correctly. 
    The Question:
    1) why is the Change Layout... button not automatically synchronizing the changes it made to the back end?  Is there a way to make it do this?
    2) OR, is there a way that I can force the synchronization within the code and not force the user to click a button on the alv grid?  If there is a way to force the synchronization - where do I put that code?  As far as I can tell, when I switch between tabs - I am unable to catch that action in my PAI events.
    Thanks in advance for any help.

    I was able to resolve this issue with a satisfactory solution.
    In my program I had a local class definition to handle the grids' events.  When the synchronization wasn't working I only had two events defined: for link_click and added_functions. 
    I created another definition for event after_salv_function:
                   on_after_salv_function for event after_salv_function of cl_salv_events importing e_salv_function
    There is no code in the method implementation - but adding this event handler now causes a synchronization to occur after the Change Layout is done.

  • Changing the column position & width using Screen Variant..

    Hi Experts,
        Iam trying to change the column position and width for the standard transaction (eg. FB60 or VA02) using the transaction code SHD0 (Transaction and Screen Variant).
        Iam able to create and save the transaction and screen variant and i could see the check box options for table control like
        a. Auto Column Position
        b. Auto Column Width
         I tried checking and unchecking both the check boxes but iam unable to modify / maintain the column position and width.
         Please guide me in changing the column position and width.
       Thanks in Advance.

    Hi Mudit,
    Kindly go through this link below:
    http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dbac0b35c111d1829f0000e829fbfe/content.htm
    Hope it helps you
    Regrds
    Mansi

  • Line Item Display Variant MIRO-column position needs to be changed..

    Hi,
    What is the possible way of setting the column position in line item display variant in MIRO screen.
    I need to change the positions of couple of columns so need to have  one layout as per my requirement.
    Does this involve only confiuration or it also needs ABAP changes?
    Request to suggest in detail if any one has done it already.
    Thanks in advance.
    Reagrds,
    BM

    Hi Charlie,
    Thanks for this help.However I have couple of doubts.
    When I save the new variant it asks me for package or local object.
    Cutrrently I have selected n saved as local object but what is the real time scenarion.Do we need to select any package on this screen.I am not aware of these things in detail so nwant to know the difference between a local object and a package and is it functional consultant's task to do this or developers should do this since they can select the package
    Please advise on this.
    Thanks in advance.
    Regards,
    BM

  • Table control change column position or number

    Hi Guys,
    I need to move a column from position 10 to position 5 in the standard program. I did change the table control position in screen painter by doing cut and past of columns at required positions and it does change there but it does not show column positions in the actual screen. Is there config for table control in the standard program?
    In the attributes the position number is disable. Is there some other way that I can move the columns.
    Please advise.
    Thanks,
    FS

    Thanks Manesh,
    I am using travel overview transaction PR05. Can you recommend any config area where the table column positions are maintained. Thanks.
    Regards,
    FS

  • Excel download from ALV OOPS , columns rearranged

    Hi ,
      When I am downloading the data using the Export button - option Spreadsheet few of the columns are getting re-arranged. I am using OOPS ALV using Custom container.I even specified the column position in the field catalogue.
    Can anyone help me to have the columns in the same order as displayed in SAP.
    Many Thanks
    Supriya

    hi,
    for this problem u need to create a varient layout. here u customize the output.
    while seeing the output u can use this layout.
    hence your output will be similar as u seen in the system.
    try and let me know...
    pradeep.

  • Matrix column position problem in screen painter.

    hi.
    i am facing one problem.
    ie.
    i am developing one screen.
    it is having 3 matrix
    each matrix is having some columns
    one matrix ok two matrix ok thrid  matrix ok.
    but
    under third matrix i put some columnes
    1, 2 ,3, 4,
    in screen painter design mode every thing is ok
    it is appearing like 1,2,3,4
    but at preview mode or through the code if i open
    it is  appearing like 1, 4,3,2
    in preview mode screen painter if i click on the form settings it is showing only..
    matrix one columns only  it is not showing either 2 or 3
    and if i open the form through the code..
    i am able to see the columns of matrix 1 n matrix 2 and matrix 3
    i am using some code.
    If (pVal.FormUID = "WIP2PROCESS" And pVal.ItemUID = "1000007") Then
                                oForm = SBO_Application.Forms.Item("WIP2PROCESS")
                                oForm.PaneLevel = 2
                                oForm.Settings.Enabled = False
                                oForm.Settings.MatrixUID = "59"
                            End If
    now through the source code i am able to see the each column under matrix.
    but if  i change the matrix position at form setting it is changing but
    if i click other folder and come back to previous  folder..
    again the column position is   1, 4,3,2
    previously i changed to  1,2,3,4
    how can i do it..
    screen painter can i change it..
    Any information plz update me..

    Hi Srinivas,
    Can you do one thing for me ? Open your form in screen painter, set the columns as you want to display. Now change the unique id for the matrix. Then try to open it through code or see in preview mode.
    Hope it helps.
    Thanks & Regards
    Ankit Chauhan

  • ABAP QUERY Report : column number change

    Hi friends,
    I need to modify the existing ABAP QUERY REPORT.
    I have added a new field in the selection screen.
    When I execute the query, it(our new filed) is displaying at the end of the columns.
    But I want it to be at 8th columns. please help me.
    When I try to change the out position to "8"at "Basic list" -> select check box of our field and double clict it, I am getting the following error.
    Warning: Overlapping fields
    Those fields overlapped by other fields will not be displayed in their entirety.
    So I could not display the new field at 8 th column.
    Guys. Please help me.

    Hi
    You have to change the position of each field after 8th column
    suppose you added your new field at the 8th column position
    then all the subsequent fields positions you have to adjust as per their length
    You have to do like this to adjust the columns
    see the doc on query
    http://help.sap.com/saphelp_46c/helpdata/en/35/26b413afab52b9e10000009b38f974/content.htm
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
    Step-by-step guide for creating ABAP query
    http://www.sappoint.com/abap/ab4query.pdf
    ABAP query is mostly used by functional consultants.
    SAP Query
    Purpose
    The SAP Query application is used to create lists not already contained in the SAP standard system. It has been designed for users with little or no knowledge of the SAP programming language ABAP. SAP Query offers users a broad range of ways to define reporting programs and create different types of reports such as basic lists, statistics, and ranked lists.
    Features
    SAP Query's range of functions corresponds to the classical reporting functions available in the system. Requirements in this area such as list, statistic, or ranked list creation can be met using queries.
    All the data required by users for their lists can be selected from any SAP table created by the customer.
    To define a report, you first have to enter individual texts, such as titles, and select the fields and options which determine the report layout. Then you can edit list display in WYSIWYG mode whenever you want using drag and drop and the other toolbox functions available.
    ABAP Query, as far as I Believe, is the use of select statements in the ABAP Programming. This needs a knowledge of Open SQL commands like Select,UPdtae, Modify etc. This has to be done only by someone who has a little bit of ABAP experience.
    To sum up, SAP queries are readymade programs given by SAP, which the user can use making slight modification like the slection texts, the tables from which the data is to be retrieved and the format in which the data is to be displayed.ABAP queries become imperative when there is no such SAP query existing and also when there is a lot of customizing involved to use a SAP Query directly
    use either SQ02 ans SQ01
    or SQVI tr code
    for more information please go thru this url:
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Create_The_Query.asp
    http://goldenink.com/abap/sap_query.html
    Please check this PDF document (starting page 352) perhaps it will help u.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
    check the below link will be helpful for u
    Tutorial on SQVI
    once you create query system generates a report starting with AQZZ/SAPQUERY/ABAGENCY2======= assing this report to tr code for the same
    Regards
    Anji

  • ALV Table columns reset!

    Hello,
    I have a WD application with ALV Table integrated in a view. When i run this application, and modify the settings of this table and hide some columns, this changes get saved permanently, i.e., if i relaunch the application in a new window these columns are still hidden.
    How can i make sure that every time a user runs this application he gets to see all the columns no matter how he left his column settings in his earlier session. This problem exists with the standard SAP Demo ALV examples as well. And I am sure that some of you must have also faced this problem. How can i resolve this. Thanks.
    Regards,
    Vasu

    I am not sure if there is a method to restore the default settings. But when you initialize your ALV, you can probably make each column visible explicitly. The code for doing that would be:
    data: lt_col type salv_wd_t_column_ref,
            ls_col type salv_wd_s_column_ref.
    lt_col = l_alv_model->if_salv_wd_column_settings~get_columns( ).
    loop at lt_col into ls_col.
    ls_col-r_column->set_visible( abap_true ).
    endloop.
    Regards,
    Nithya

  • When ever employee position changed, an alert should send an email

    we have one requirement...
    when ever any employee position changed, it should send an email ..how to do this one? any idea?
    employee positions are recorded in PER_ALL_ASSIGNMENTS_F table, so if we create event alert on this table ( update ). event alert fires if there is any update to the table...but i want, only alert should send mail, when position column got updated in that table...
    is it possible????

    Oracle provides standard API’s to harness the databases SMTP server capabilities in sending emails. All email services are wrapped under package: UTL_SMTP. The protocol consists of a set of commands for an email client to dispatch emails to a SMTP server. The UTL_SMTP package provides interfaces to the SMTP commands. For many of the commands, the package provides both a procedural and a functional interface. The functional form returns the reply from the server for processing by the client. The procedural form checks the reply and will raise an exception if the reply indicates a transient (400-range reply code) or permanent error (500-range reply code). Otherwise, it discards the reply.
    c := UTL_SMTP.OPEN_CONNECTION('<server>.unix.us.ups.com');
    UTL_SMTP.HELO(c, '<server>.unix.us.ups.com');
    UTL_SMTP.MAIL(c, l_recepient);
    UTL_SMTP.RCPT(c, l_recepient);
    UTL_SMTP.OPEN_DATA(c);
    send_header('From', p_from);
    send_header('To', l_recepient);
    send_header('Subject', p_subject);
    UTL_SMTP.WRITE_DATA(c, UTL_TCP.CRLF || p_message);
    UTL_SMTP.CLOSE_DATA(c);
    UTL_SMTP.QUIT(c);

  • Controle the WD table column position Sequence

    HI All,
    How to  controle the WD table column position  (not ALV) in webdynpro as per custom requirnment.
    Column1, Column2, Column3, Column4…………
    I looked into CL_WD_TABLE to see any possibility.
    Can anyone suggest me the right one?
    Thanks
    Gopal

    Hi,
    Can we rearrange the existing columns of nodes by passing the index and column name.
    Unfortunately, No! you have to remove the column and add it.
    As I have already have a component with table need to rearrange the columns.
    Is it a standard component or custom component?
    If it is a custom component, you can rearrange by right click on column and move up/down.
    If it is a standard component, consider deleting the table( Remove Element) in enhancement mode and then create a new Table UI with specified order.  Or, create a post exit in wddomodifyview and then get the table reference and use remove_column( ) add_column( ) methods
    code snippet:
    DATA: lr_table    TYPE REF TO cl_wd_table,
           lr_abs_col TYPE REF TO cl_wd_abstr_table_column,
           lr_col     TYPE REF TO cl_wd_table_column.
      IF first_time EQ abap_true.
    * get table reference
          lr_table ?= view->get_element( id = 'TABLE ). " ID of Table UI
         CALL METHOD lr_table->remove_grouped_column
           EXPORTING
             id                = 'COL1' " column
             index             = 1      " index
           RECEIVING
            the_grouped_column = lr_abs_col.
          lr_col ?= lr_abs_col.
         CALL METHOD lr_table->add_column
           EXPORTING
             index              = 20  " new index
             the_column     = lr_col.
      ENDIF.
    hope this helps u,
    Regards,
    Kiran

  • Create Table Column position matters?

    Hi All,
    I am just confused the saying that the column positioning in creating tables does not matter for relational database?
    Do you agree or disagree.
    For me I do not agree. Why?
    SQL>  create table a (a char(10),b number);
    Table created.
    SQL> create table b (b number, a char(10));
    Table created.
    SQL> insert into a values ('a',1);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> insert into b select * from a;
    insert into b select * from a
    ERROR at line 1:
    ORA-01722: invalid numberSo it does matter.
    Thanks

    KinsaKaUy? wrote:
    Ok maybe I interpreted it in the wrong way : )
    Can you help me handle this issue.
    I have a table EMP with more than 500 columns, and with 10,000 rows.
    The developer asked to modify a column ATTRIBUTE1 from VARCHAR2(10) to NUMBER;
    It says that the column needs to be empty to change datatype, so I created a backup:
    CREATE TABLE EMP_BAK AS SELECT * FROM EMP;
    TRUNCATE TABLE EMP;
    ALTER TABLE EMP MODIFY(ATTRIBUTE1 NUMBER);
    How can I insert it back using...INSERT INTO EMP SELECT * FROM EMP_BAK;
    To aggraviate the situation the designer wants to move the column position from 100th place to 10th place.
    Assuming that you can not reason them out, how do you make this task easier?
    ThanksInstead of creating a new table and your above mentioned complications you could follow the below method i guess.
    ALTER TABLE EMP ADD DUMMY_ATTRIBUTE1 NUMBER;
    UPDATE EMP
    SET ATTRIBUTE1 = DUMMY_ATTRIBUTE1
    WHERE 1=1;
    COMMIT;
    UPDATE EMP
    SET ATTRIBUTE1 = NULL
    WHERE 1=1;
    COMMIT;
    ALTER TABLE EMP MODIFY ATTRIBUTE1 NUMBER;
    UPDATE EMP
    SET DUMMY_ATTRIBUTE1 = ATTRIBUTE1
    WHERE 1=1;
    COMMIT;
    ALTER TABLE EMP DROP COLUMN DUMMY_ATTRIBUTE1;

  • Set fixed key column position

    Hi together,
    I am using class CL_SALV_TABLE for displaying ALV outputs.
    I´ve defined several key-columns (method 'set_key') and use method 'set_key_fixation' .
    Since 'set_key_fixation' apparently only works when (at least) one key column is beeing display
    as the first column (position 1 of the ALV output table) I want to freeze the postion of the key column
    (...so that you can´t remove the column or move the column to another position)
    Any idea?
    Thanks vor any help

    Hi,
    This is probably another issue with SALV class... You could still grab a cl_gui_alv_grid object from your salv adapter and play with methods from this class (e.g. SET_FIXED_COLS)
    have a look to this blog: Power of ABAP Objects: Overcome the Restrictions of SALV Model
    Here we bypass the restrictions of the SALV model to enable the editable functionnality... guess you could work similarily for your issue...
    Kr,
    Manu.

  • ALV IDA Issues.

    Hi Folks,
    I am creating ALV IDA from external views.
    1. When I am trying to group any column, automatically 1s row  comes with ungrouped manner.
    2.When I am trying to un group each certificate number, I am getting dump, but same code working for Table.
    3. When I am trying to do total for respective column, automatically blank lines getting appended.
    Regards,
    Amol

    Hi Amol,
    it  looks like bugs. Thus I'll recommend to open an appropriate CSS ticket on component BC-SRV-ALV so that the development team can have a look at it and eventually reproduce it in your system.
    Thanks & Kind regards,
    Carine

  • Fix column position

    Hi All,
    I am using a simple Web Dynpro Table UI Element and I am dying trying to fix the column position. The user must not be able to reorder the columns.
    I have seen the other threads about this topic! However, none of the answers actually worked (I have tried "fixedPositon" of the Column and the WD..PERSONALIZATION.. Property in the Application).
    Does anybody have a working solution for this issue??
    THANKS, JOHANNES

    Hello,
    I think end user can control the column position of a table UI element only via user personalization.
    SO If you disable the end user personalization for your application you can stop that.
    How your users changing the column position can you please explain if the above solution is not working.
    Cheers!
    Pradeep

Maybe you are looking for

  • HT5637 How do I download from iTunes Match to an iPad

    I have subscribed to iTunes Match and would like to download the music to an iPad in apple lossless format. I can download but don't know how to select the quality.

  • Email an existing excel file in background !!!urgent please ...

    Hi Gurus…. I wrote an Abap that creates an excel file using the OLE methods for Excel. After that i am trying to send the file that Already I have created as an email Attachment. I am using FM 'SO_DOCUMENT_REPOSITORY_MANAGER' . The problem is that I

  • IPhoto/Aperture 1.5 Integration questions

    Aperture 1.5 allows you to keep iPhoto pictures where they are with a "reference" from Aperture. But since I upgraded to Aperture 1.5, I have the opposite problem -- how do I keep my pictures in Aperture but have iPhoto reference them? With previous

  • How to reference workspace image in static file?

    I have created a .js file and loaded it into shared components as a static file. It works great.....EXCEPT.....my images referenced in the code do not show up. My images are located as #WORKSPACE_IMAGES#. My code for referencing them is: document.get

  • Starting an application within a presentation

    I am doing a presentation in a few days where I would like to do some demos of other software (LaTeX, R, Netlogo). Is it possible to open an application from within a Keynote presentation? That would be neat ...