ALV doesn't sort as expected.

Hi,
I created sorting rules for two columns, document number and date. Each different date of a certain document constitutes a line in ALV. I used the following code to set the rules. However, the ALV doesn't sort as expected.
LOOP AT LT_FIELDS INTO LS_FIELDS.
     CASE LS_FIELDS-FIELDNAME.
       WHEN 'AUFNR'.
         LO_SORT_RULE ?= LS_FIELDS-R_FIELD->IF_SALV_WD_SORT~CREATE_SORT_RULE( SORT_POSITION = 1 ).
         LS_FIELDS-R_FIELD->IF_SALV_WD_SORT~SET_GROUPING_ALLOWED( ).
       WHEN 'ISSUE_DATE'.
         LO_SORT_RULE ?= LS_FIELDS-R_FIELD->IF_SALV_WD_SORT~CREATE_SORT_RULE( SORT_ORDER    = IF_SALV_WD_C_SORT=>SORT_ORDER_DESCENDING
                                                                              SORT_POSITION = 2 ).
         LS_FIELDS-R_FIELD->IF_SALV_WD_SORT~SET_GROUPING_ALLOWED( ABAP_FALSE ).
       WHEN OTHERS.
     ENDCASE.
   ENDLOOP.
The result is
Header 1
Header 2
001
20140101
003
20140103
006
20140104
002
004
005
But I expect the ALV to be sorted as follows
Header 1
Header 2
001
20140101
002
003
20140103
004
005
006
20140104

Hi ts,
The above code used for sorting should work as you expected.But I suspect that the sort logic of field 'AUFNR'  is not executing / not reaching. Check the column name of HEADER1 column. It might be something else.
To make sure: check in debugging that the logic of AUFNR field gets reached.
Hope this helps you.
Regards,
Rama

Similar Messages

  • ALV doesn't go back

    Hi Experts,
    based on the SAP ALV example for "cl_salv_table" I wrote an ALV report. The first screen is for data selection. After this the ALV grid is displayed.
    The problem is that the standard back button doesn't work as expected. So after clicking on "direct processing (F8)" in SE80 the selection screen is being opened. Here the back button works fine and it switches back to SE80.
    When having selected some values and processed the report so the ALV grid is being displayed the click on back button results in an empty screen just with the title headline of the report. There I would expect the selection screen to be.
    When clicking on the back button at this empty screen the report is being processed again and the ALV grid pops up. From there on its something like a endless loop: back to empty screen - back to ALV grid; back to empty screen - back to ALV grid; ...
    The PF Status is defined. The OK-Code is defined. After clicking on the back button the standard PAI-Module is being loaded.
    The following is the part where I declare the ALV grid:
    TRY.
      cl_salv_table=>factory(
          EXPORTING
            list_display = IF_SALV_C_BOOL_SAP=>FALSE
          IMPORTING r_salv_table = alv
          CHANGING t_table = lt_report_tab ).
      alv->set_screen_status(
        pfstatus = 'MAIN'
        report = sy-repid
        set_functions = alv->c_functions_all ).
      alv_events = alv->get_event( ).
      create object event_handler.
      set handler event_handler->on_double_click for alv_events.
    *  Set up selections.
      g_selections = alv->get_selections( ).
      g_selections->set_selection_mode( 1 ). "Single
      alv->display( ).
    CATCH cx_salv_msg.
      MESSAGE 'ALV display was not possible' TYPE 'I' DISPLAY LIKE 'E'.
    ENDTRY.
    Any Ideas what could be wrong with my coding?
    Many thanks in advance!
    Best regards
    Tobias

    The function code is: &F03
    alternativley I already tried BACK with the same result.
    Where shall I put the LEAVE TO SCREEN 0 when it's using the standard PAI Module which is NOT included within my Report?

  • Print or download ALV report with sort options

    Dear friends,
    How i can download into excel or print ALV report with sort options, like customer name column with similar values should not repeat in the print out or download file.
    Regards,
    Praveen Lobo

    Hi Praveen,
    Use this code, its working:-
    *FOR SORTING DATA
    DATA : it_sort TYPE slis_t_sortinfo_alv,
           wa_sort TYPE slis_sortinfo_alv.
    *          SORT W.R.T. CUSTOMER NAME
      wa_sort-spos = 1.
      wa_sort-fieldname = 'NAME1'. "field customer name
      wa_sort-tabname = 'IT_KNA1'. "internal table with records
      wa_sort-up = 'X'.
      APPEND wa_sort TO it_sort.
      CLEAR wa_sort.
    "this will sort the ALV o/p for customer with same name
    "now the name will not be repeated
    "records with same name will be grouped
    *          DISPLAY RECORDS IN ALV GRID
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program                = sy-repid "report id
        it_fieldcat                       = it_field "field catalog
        it_sort                           = it_sort "sort info
      TABLES
        t_outtab                          = it_kna1 "internal table
      EXCEPTIONS
        program_error                     = 1
        OTHERS                            = 2.
      IF sy-subrc <> 0.
      ENDIF.
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir
    Edited by: Tarun Gambhir on Dec 31, 2008 1:13 PM

  • Mapping Problem with 2 ALV Tables after sorting

    Hi,
    I have a context node INCIDENTS with a sub-node SUB_INCIDENTS.
    The sub-node is filled via a Supply Function.
    Both nodes are displayed in separate ALV Grids on the same view, which works pretty well.
    The only problem I face is when I try to sort one of the ALVs, then I get an error "The node specified in mapping ( SUB_INCIDENTS) could not be found ".
    I have no clue how to solve that, already tried to fill the sub-node with the ALV standard function "ON_STD_FUNCTION_AFTE", no effect.
    Does anybody can imagine what might be the reason?
    Best regards, Steffen
    Edited by: Steffen Weber on Aug 27, 2008 2:55 PM

    In general, having two ALVs for parent and then a sub node is not supported.  Here is a section from the online help that describes what happens when a sort occurs on the parent node in ALV:
    Important Exception: Sorting
    Here ALV has to use the entire dataset so that the data records can be arranged in the new order. For this purpose, the ALV component temporarily takes control of the internal data table and invalidates the corresponding context node of your application during this time. This ensures that the application cannot access the context node while the ALV component is editing the internal data table.
    Once the internal data table has been resorted, ALV rebuilds the context node, releases it again for the application, and displays the data accordingly.
    This ensures that the internal data table is never copied. This is important because large volumes of data would considerably impact performance and memory space.
    When you are planning your application, note the following side-effects of this mechanism:
    ●      When the context node is invalidated, information about current selections, and in particular the lead selection, is lost.
    ●      If your application has created subnodes for the context node, (master-detail scenario), these subnodes are lost as soon as the ALV component invalidates the context node. If the application then tries to access the subnodes, a runtime error occurs.
    Because of the invalidation that is described here, the subnode leadselection is lost and is invalidated as well. This leads to the error you are encountering.

  • Webpart Connection Doesn't Sort After Edit

    Hello,
    I have two SP task lists, 1st list for project details and 2nd list for project costs (1:Many). When viewing a single item from the project details task list in the Default Display Form, the project costs task list is
    also displayed as a webpart. The project costs webpart is connected to the project details item, and filters only project costs that have the same "Project Name". This works great, but my problem is the project costs list I've turned on inline editing.
    In the same Default Display From, when the user clicks to edit a line item in the project costs list, edits the item, and then clicks save, the page reloads, and all project costs are displayed instead of the filtered project costs list. The changes do not
    save, and the user has to scroll down the list to find the project cost line item still in edit mode. If the edits are repeated and save is once again clicked on the project costs list, the project cost line item is updated, and the project costs list is filtered
    correctly as intended.
    Can anyone help me correct or understand the issue: When making edits to a task list item using inline editing on a connected and filtered webpart, the list doesn't save edits to the webpart list and maintain its connected filter? Thank you for any guidance
    you can provide.

    Hi,
    According to your post, my understanding is that webpart connection doesn't sort after you edit the related list.
    Per my knowledge, it will send the value to connected web part when page loads in the display form.
    If you edit the item inlien, it will not refresh the page, so it cannot send the value again.
    I recommend that you can use the “Insert Related List” option in the display form.
    For more information, you can refer to:
    SharePoint 2010 - Insert Related Lists
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • ITunes sometimes doesn't sort my mp3 folder

    hey everyone - i triesd searching the forum for an answer to this but unfortunately didn't seem to find anything. i might be searching with the wrong keywords. but basically my question is this:
    ihave iTunes set up so that it sorts my mp3 folder. i think this is pretty straight forward. i move all my songs and downloads (mainly from beatport.com) into my mp3 folder and then import them to iTunes (usually by dragging into iTunes) most of the time iTunes takes the raw file that has some kind of weird id3 tag like 0192deep_space_carl_craigremix and sorts it appropriately into a folder with Artist, Title, Album, etc... that way when i go to look for it, its under the artist, not just a single file like the one above
    but SOMETIMES it doesn't do this. sometimes the file stays with that funky tag. which means when i go to search for it it's NOT under the artist's name. mainly th issue i run into is when using something like Ableton, i can't search my folder by artists, i have to search this mess of random songs starting with numbers like 839093_Deep... etc...
    anyone have any idea why iTunes doesn't sort these song files? it seems pretty random, but it WILL do it as one big chunk. meaning if i buy 10 songs from Beatport, it either sorts ALL 10 appropriately, or it DOESN'T sort all 10... never anything in between
    any insight would be fantastic!!!

    unfortunately thats the problem. usually either iTunes manages the folders immediately OR - all i have to do is manually change the iTunes tags and it will automatically reconfigure the folder and place these songs that have the iD3 tags of 8948204_xxxxxx into the right format. So for example if the song is mark alexandre - itunes help. the file with 43289294ituneshelp will automatically be put into a folder for Mark Alexandre...
    it just hasn't been doing it lately....

  • ITunes doesn't sort albums properly.

    So like my iTunes doesn't sort my albums properly. I have the track numbers listed in Get Info, but when I click Sort by Album, it sorts the albums, then it sorts the songs inside the albums by the artist.
    Any help appreciated-
    I want the albums sorted by the track number in the get info

    I noticed this problem too - but only on albums with "Album artist" info.
    Once I removed that, everything sorted correctly by track number.
    However, I'd love to find a way to actually make it sort correctly.

  • ArrayDeque as a stack doesn't work as expected with complex objects

    Trying to use ArrayDeque as a strorage for complex values <PSList<PSol>> (i.e. Arraylists of structured Values PSol), this doesn't work as expected. The code below should produce different values of pSLWk, being stored on bkStack, which are then to be retrieved by pop() to the variables pSL1, pSL2, pSL3.
    However, retrieval only ends up with three identical data sets (variables) pS1,pS2, pS3.
            public PSList<PSol> pSL;
            private ArrayDeque<PSList<PSol>> bkStack=new ArrayDeque<PSList<PSol>>();
            pSLWk=new PSList<PSol>();       // Constructor copies some Array (static field) to the PSLists
            pSL=new PSList<PSol>();
            pSLAux=new PSList<PSol>(pSLWk);   // Constructor copies from existing PSList
            pSLWk.checkResult("pSLWk prior to setDefaults - modifies pSLWk !");
            setDefaults();                                                            // Modifies pSLWk only
            pSLWk.checkResult(" pSLWk after setDefaults");              // .. got changes (o.k.)
            pSL.checkResult(" pSL after setDefaults");                  // .. unchanged  (o.k.)
            pSL.checkResult(" pSLAux after setDefaults");               // .. unchanged  (o.k.)
            bkStack.push(new PSList<PSol>(pSLWk));                      // store changes in bkStack
            pSLWk.getEl(77).setVal(new StringBuffer("4"));              // change pSLWk again (value 4 @ 77)
            pSLWk.checkResult("pSLWk, after PUSH, THEN modify 4@77");   // .. got change (o.k.)
            pSL.checkResult("pSL after setVal 77");
            bkStack.push(pSLWk);                      // store changes in bkStack
            pSLWk.getEl(80).setVal(new StringBuffer("8"));              // change pSLWk again (value 8 @ 80)
            pSLWk.checkResult("pSLWk after setVal 8@80");               // .. got change (o.k.)
            pSL.checkResult("pSL after setVal 80");
            bkStack.push(new PSList<PSol>(pSLWk));                      // store changes in bkStack
            pSL1=new PSList<PSol>(bkStack.pop());
            pSL1.checkResult("pSL1 after 1st pop");
    //      pSL1=bkStack.pop()                                          // Straightforward way doesn't work either...
            pSL2=new PSList<PSol>(bkStack.pop());
            pSL2.checkResult("pSL2 after 2nd pop");
            pSL3=new PSList<PSol>(bkStack.pop());
            pSL3.checkResult("pSL3 after 3rd pSLWk=..pop()");Here the result from the code above:
    debug:
    1 8 9   4  5 42 9 7  5  2 6 4 923     1  7   3         86   7 5  3 69     2   63 <C.R.>pSLWk prior to setDefaults - modifies pSLWk !
    128 96  4635 42 9 7945  2 6 47923     1  7   3 9       86   7 5  3 69     2   63 <C.R.> pSLWk after setDefaults
    1 8 9   4  5 42 9 7  5  2 6 4 923     1  7   3         86   7 5  3 69     2   63 <C.R.> pSL after setDefaults
    1 8 9   4  5 42 9 7  5  2 6 4 923     1  7   3         86   7 5  3 69     2   63 <C.R.> pSLAux after setDefaults
    128 96  4635 42 9 7945  2 6 47923     1  7   3 9       86   7 5  3 69     2  463 <C.R.>pSLWk, after PUSH, THEN modify 4@77
    1 8 9   4  5 42 9 7  5  2 6 4 923     1  7   3         86   7 5  3 69     2   63 <C.R.>pSL after setVal 77
    128 96  4635 42 9 7945  2 6 47923     1  7   3 9       86   7 5  3 69     2  4638<C.R.>pSLWk after setVal 8@80
    1 8 9   4  5 42 9 7  5  2 6 4 923     1  7   3         86   7 5  3 69     2   63 <C.R.>pSL after setVal 80
    128 96  4635 42 9 7945  2 6 47923     1  7   3 9       86   7 5  3 69     2  4638<C.R.>pSL1 after 1st pop
    128 96  4635 42 9 7945  2 6 47923     1  7   3 9       86   7 5  3 69     2  4638<C.R.>pSL2 after 2nd pop
    128 96  4635 42 9 7945  2 6 47923     1  7   3 9       86   7 5  3 69     2  4638<C.R.>pSL3 after 3rd pSLWk=..pop()
    1 8 9   4  5 42 9 7  5  2 6 4 923     1  7   3         86   7 5  3 69     2   63 <C.R.>pSLWk prior to setDefaults - modifies pSLWk !
    128 96  4635 42 9 7945  2 6 47923     1  7   3 9       86   7 5  3 69     2   63 <C.R.> pSLWk after setDefaults
    1 8 9   4  5 42 9 7  5  2 6 4 923     1  7   3         86   7 5  3 69     2   63 <C.R.> pSL after setDefaults
    1 8 9   4  5 42 9 7  5  2 6 4 923     1  7   3         86   7 5  3 69     2   63 <C.R.> pSLAux after setDefaults
    128 96  4635 42 9 7945  2 6 47923     1  7   3 9       86   7 5  3 69     2  463 <C.R.>pSLWk, after PUSH, THEN modify 4@77
    1 8 9   4  5 42 9 7  5  2 6 4 923     1  7   3         86   7 5  3 69     2   63 <C.R.>pSL after setVal 77
    128 96  4635 42 9 7945  2 6 47923     1  7   3 9       86   7 5  3 69     2  4638<C.R.>pSLWk after setVal 8@80
    1 8 9   4  5 42 9 7  5  2 6 4 923     1  7   3         86   7 5  3 69     2   63 <C.R.>pSL after setVal 80
    128 96  4635 42 9 7945  2 6 47923     1  7   3 9       86   7 5  3 69     2  4638<C.R.>pSL1 after 1st pop
    128 96  4635 42 9 7945  2 6 47923     1  7   3 9       86   7 5  3 69     2  4638<C.R.>pSL2 after 2nd pop
    128 96  4635 42 9 7945  2 6 47923     1  7   3 9       86   7 5  3 69     2  4638<C.R.>pSL3 after 3rd pSLWk=..pop()What's the problem with this ?
    Rem: I tried the simple approach as well:
    bkstack.push(pSLWk);
    ...

    Thank you for your comments, although I see we still don't have a common understanding of the problem.
    Firstly, I add the code for the PSList and the PSol classes, so you might find some problem with that:
         public class PSol     {
              private StringBuffer val;
              private int zI;
              private int sI;
              private int bI;
                        // == Konstruktor
              public PSol( StringBuffer v, int z, int s, int b )     {
                   this.val=v;
                   this.zI=z;
                   this.sI=s;
                   this.bI=b;
                        // == Getter,Setter
              public StringBuffer getVal()     {return val;}
              public int getZ()     {return zI;}
              public int getS()     {return sI;}
              public int getB()     {return bI;}
              public int getVSize()     {return val.length();}
              public void setVal(StringBuffer v)     {val=v;}
              public boolean hasVChar( StringBuffer ch, boolean delCh )     {
                   boolean bT=false;
                   StringBuffer fSt=getVal();
                   if (!(fSt.indexOf( ch.toString() )     == -1))     {
                        bT=true;
                        if (delCh)     {
                             setVal(fSt.deleteCharAt(fSt.indexOf( ch.toString() )));
                   return bT;
         }     // PSol
         public class PSList<E> extends ArrayList<PSol>     {
                   /**     Construktor 1: PSList(v,z,s,b) - makes list from single arrays
              private static final long serialVersionUID =  4711L;                         // ### JAVAC Warning! ###
            public PSList (String[] vS, int[] z, int[] s, int[] b) {
                   StringBuffer[] v=new StringBuffer[valDim];
                for (int i=0;i<valDim;i++)  {
                    v=new StringBuffer(vS[i]);
    //ArrayList<PSol> pSL=new ArrayList<PSol>;
                   for (int i=0; i<valDim; i++) {
                        this.add( new PSol( v[i], z[i], s[i], b[i] ) );
    /** Konstruktor2 : makes list from matrix array
    public PSList () {
    for (int j=0; j<nDim; j++) {
    for (int i=0; i<nDim; i++) {
    this.add( new PSol( new StringBuffer(sGuiArr[i][j]), i, j , i/locDim + (j/locDim)*locDim) );
                        /**     ------- Construktor 3 : PSList(PSList pS) - makes list as a copy of an existing one
    public PSList ( PSList<PSol> pX )     {
                   super (pX); // ArrayList-Constructor (Collection)
    // get Element <PSol>
    public PSol getEl ( int i )     {return get(i);}
         public int getCount()     {return size();}
         public int getTValLg()     {
                   int lg=0;
                   for (int i=0; i<getCount(); i++)     {
                        lg=lg + getEl(i).getVal().length();
                   return lg;
                        /**     ------- checkResult()     -     Check if alll elements are single char +dump
         public boolean checkResult(String messg)     {
                   boolean allOne=true;
                   for (int i=0; i<size(); i++)     {
                        if ( getEl(i).getVal().length() > 1 )     {
                             allOne=false;
                             System.out.print(" ");
                   else     {
                        System.out.print(getEl(i).getVal());
                   System.out.println("<C.R.>"+messg);
                   return allOne;
         }     // Class PSList
    Secondly, I don't really see what you mean by pointing out to 'only one "pSLWk" instance of PSList'. The variable pSLWk is the variable to be worked upon; after some change of the contents, I want to save this state of contents to the stack. When I pop that variable from the stack, I wouldn't want to restore it to pSLWK, but to some other variable, e.g. by public PSList<PSol> pSL1;
    pSL1=new PSList<PSol>(bkStack.pop());Again - to my understanding (which comes from old days of microprocessor coding... - there shouldn't be a need to know how the data came there, or what was the name of the variable who stored it there. And  : the implementation of ArrayDeque returns 'elements' of class E, not references !
    Thirdly, you're right, that the method of using a copy constructor for retrieval looks 'weird'. However - I had some other versions that didn't work either, e.g. the straightforward one, as I pointed out.
    And fourthly: yes, I'm almost sure that I'm messing up something somewhere. I went to this forum hoping to clarify that ... :)
    If you don't mind, could you please sketch a few lines of code, how to 'push' a complex variable to a ArrayDeque stack, and retrieve it - by 'pop()' - to some to other variable of the same class later ?
    Might make our discussion much easier, to see how things REALLY work.
    Thank you !                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • VoiceOver navigation buttons doesn't work as expected on latest version of Firefox

    VoiceOver navigation buttons doesn't work as expected on latest version of Firefox. VO+Left/Right not jump from element to element
    Version of OS: OS X Yosemite 10.10.1
    Version of Chrome: 42.0.2311.90 (64-bit)
    Version of Firefox: 37.0.2

    Did this work in a previous version of Firefox?
    There is an open bug to improve accessibility on OS X. (Bug 336306) I'll update that bug with any relevant information you provide here.

  • Hierarchical alv doesn't expand

    Hello  experts
    i written a hierarchical alv it run fines at output it doesn't expand please help me to find out the problem.
    REPORT  ZCR_HERARCHIAL_LIST_DISPLAY.
    TABLES :VBAK,VBAP.
    TYPE-POOLS:SLIS.
    DATA : BEGIN OF IT_VBAK OCCURS 0,
           VBELN LIKE VBAK-VBELN,
           ERDAT LIKE VBAK-ERDAT,
           ERZET LIKE VBAK-ERZET,
           ERNAM LIKE VBAK-ERNAM,
           ANGDT LIKE VBAK-ANGDT,
           EXPAND TYPE XFELD,
           END OF IT_VBAK.
    DATA : BEGIN OF IT_VBAP OCCURS 0,
           VBELN LIKE VBAP-VBELN,
           POSNR LIKE VBAP-POSNR,
           MATNR LIKE VBAP-MATNR,
           MATWA LIKE VBAP-MATWA,
           END OF it_vbap.
    DATA : IT_FILELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA : IT_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA : WA_KEYINFO TYPE SLIS_KEYINFO_ALV.
    DATA : I_PROGRAM TYPE sy-repid.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS S_VBELN FOR VBAK-VBELN NO INTERVALS.
    SELECTION-SCREEN SKIP.
    PARAMETERS:P_EXPAND AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK B1.
    start-of-selection.
    PERFORM SELECT_DATA.
    PERFORM BULID_FIELDCATALOG.
    PERFORM SET_LAYOUT.
    FORM SELECT_DATA .
    SELECT VBELN
           ERDAT
           ERZET
           ERNAM
           ANGDT
           FROM VBAK
           INTO CORRESPONDING FIELDS OF TABLE IT_VBAK UP TO 10 ROWS.
          IF NOT IT_VBAK[] IS INITIAL.
          SELECT VBELN
                 POSNR
                 MATNR
                 MATWA
                 FROM VBAP
                 INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
                 FOR ALL ENTRIES IN IT_VBAK WHERE VBELN = IT_VBAK-VBELN.
          ENDIF.
       SORT IT_VBAP BY VBELN.
    ENDFORM.                    " SELECT_DATA

    FORM BULID_FIELDCATALOG .
    WA_FIELDCAT-col_pos = 1.
    WA_FIELDCAT-fieldname = 'VBELN'.
    WA_FIELDCAT-tabname = 'VBAK'.
    WA_FIELDCAT-seltext_m = 'SALES DOCUMENT'.
    APPEND WA_FIELDCAT TO it_fileldcat.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-col_pos = 2.
    WA_FIELDCAT-fieldname = 'ERDAT'.
    WA_FIELDCAT-tabname = 'VBAK'.
    WA_FIELDCAT-seltext_m = 'RECORD CREATION DATE'.
    APPEND WA_FIELDCAT TO it_fileldcat.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-col_pos = 3.
    WA_FIELDCAT-fieldname = 'ERZET'.
    WA_FIELDCAT-tabname = 'VBAK'.
    WA_FIELDCAT-seltext_m = 'ENTRY TIME'.
    APPEND WA_FIELDCAT TO it_fileldcat.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-col_pos = 4.
    WA_FIELDCAT-fieldname = 'ERNAM'.
    WA_FIELDCAT-tabname = 'VBAK'.
    WA_FIELDCAT-seltext_m = 'NAME OF THE PERSON WHO CREATED THE OBLECT'.
    APPEND WA_FIELDCAT TO it_fileldcat.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-col_pos = 5.
    WA_FIELDCAT-fieldname = 'ANGDT'.
    WA_FIELDCAT-tabname = 'VBAK'.
    WA_FIELDCAT-seltext_m = 'QUOTATION'.
    APPEND WA_FIELDCAT TO it_fileldcat.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-col_pos = 6.
    WA_FIELDCAT-fieldname = 'VBELN'.
    WA_FIELDCAT-tabname = 'VBAP'.
    WA_FIELDCAT-seltext_m = 'SALES DOCUMENT'.
    APPEND WA_FIELDCAT TO it_fileldcat.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-col_pos = 7.
    WA_FIELDCAT-fieldname = 'POSNR'.
    WA_FIELDCAT-tabname = 'VBAP'.
    WA_FIELDCAT-seltext_m = 'SALES DOCUMENTB ITEM'.
    APPEND WA_FIELDCAT TO it_fileldcat.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-col_pos = 8.
    WA_FIELDCAT-fieldname = 'MATNR'.
    WA_FIELDCAT-tabname = 'VBAP'.
    WA_FIELDCAT-seltext_m = 'MATERIAL NO'.
    APPEND WA_FIELDCAT TO it_fileldcat.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-col_pos = 9.
    WA_FIELDCAT-fieldname = 'MATWA'.
    WA_FIELDCAT-tabname = 'VBAP'.
    WA_FIELDCAT-seltext_m = 'MATERIAL ENTERED'.
    APPEND WA_FIELDCAT TO it_fileldcat.
    CLEAR WA_FIELDCAT.
    ENDFORM.                    " BULID_FIELDCATALOG
    FORM SET_LAYOUT .
    IT_LAYOUT-group_change_edit = 'X'..
    IT_LAYOUT-colwidth_optimize = 'X'.
    IT_LAYOUT-zebra = 'X'.
    IT_LAYOUT-detail_popup = 'X'.
    IT_LAYOUT-get_selinfos = 'X'.
    IF P_EXPAND = 'X'.
    IT_LAYOUT-expand_fieldname = 'EXPAND'.
    ENDIF.
    WA_KEYINFO-ITEM01 = 'VBELN'.
    WA_KEYINFO-ITEM01 = 'VBELN'.
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
      EXPORTING
    *   I_INTERFACE_CHECK              = ' '
       I_CALLBACK_PROGRAM             = I_PROGRAM
    *   I_CALLBACK_PF_STATUS_SET       = ' '
    *   I_CALLBACK_USER_COMMAND        = ' '
       IS_LAYOUT                      = IT_LAYOUT
       IT_FIELDCAT                    = IT_FILELDCAT
    *   IT_EXCLUDING                   =
    *   IT_SPECIAL_GROUPS              =
    *   IT_SORT                        =
    *   IT_FILTER                      =
    *   IS_SEL_HIDE                    =
    *   I_SCREEN_START_COLUMN          = 0
    *   I_SCREEN_START_LINE            = 0
    *   I_SCREEN_END_COLUMN            = 0
    *   I_SCREEN_END_LINE              = 0
    *   I_DEFAULT                      = 'X'
    *   I_SAVE                         = ' '
    *   IS_VARIANT                     =
    *   IT_EVENTS                      =
    *   IT_EVENT_EXIT                  =
        I_TABNAME_HEADER               = 'VBAK'
        I_TABNAME_ITEM                 = 'VBAP'
    *   I_STRUCTURE_NAME_HEADER        =
    *   I_STRUCTURE_NAME_ITEM          =
        IS_KEYINFO                     = WA_KEYINFO
    *   IS_PRINT                       =
    *   IS_REPREP_ID                   =
    *   I_BYPASSING_BUFFER             =
    *   I_BUFFER_ACTIVE                =
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER        =
    *   ES_EXIT_CAUSED_BY_USER         =
      TABLES
        T_OUTTAB_HEADER                = IT_VBAK
        T_OUTTAB_ITEM                  = IT_VBAP
    * 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.

  • Field should not display in the subtotal row in ALV report after sorting .

    we have a requirement, after sorting and subtotaling, the output in ALV is -
    vbeln        amount1  amount2  amount3
    123           11              12            13
    123           12             13             14
    123           23             25             27 
    133           11              12            13
    133           12             13             14
    133           23             25             27
    Now the customer wants the ALV outpput in this fashion -
    123           11              12            13
    123           12             13             14
                     23             25             27    --->123 (vbeln) should not come in subtotaling row
    133           11              12            13
    133           12             13             14
                      23             25             27--->133(vbeln) should not come in subtotaling row

    Hi,
    if it helps you could create a hierachy. In this way you can define the field catalog for the lines and for the subtotal columns. The only thing is that you would always show the subtotal rows.
    You have references of hierachy alvs in
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c060fcb4-2c62-2b10-d2b2-f32407a5cc6f
    ALV Hierarchy
    alv hierarchy
    In this case it also sorts
    Sorting for ALV hierarchy
    I hope it helps.
    Edited by: Oscar Pecharroman on Aug 2, 2010 1:13 PM

  • Smart Album "Managed" doesn't behave as expected

    Hello,
    I have a smart album in my library that I use to track managed files ("file status = managed"). My expectation is to click on this, it shows me the files under library management, I select them all and then Relocate Masters to a folder in the file system.
    This works well with one exception. Lets say I have a relocated image and I edit this in the external (PS) editor. When I come back to Aperture, I have 2 files in a single stack - the master which is relocated and the new version which is not.
    When I select my Smart Album, I would expect to see the new version that was just created. However, it doesn't appear. If I go back to the 2 images and split them out of the stack then go back to the smart album, the version IS shown.
    I clearly don't want to split all my stacks or micro-manage every new version I create. Is this standard behavior? Is there another way for me to achieve this?
    Thanks

    This might work. Click the magnifying glass to the right of your smart album name. This will bring up the dialog box to set the parameters of the smart album. At the bottom left corner, check the box for "Ignore Stack Groupings". This should allow the smart album to search through all of the stacked photos and not just the images on top of the stacks.

  • Connecting to other computers on network doesn't work as expected.

    This is kind of interesting.
    I do this: From Menu Go > Network
    Then I choose either my iMac or MacBook Pro and double click the user name for my home folders on the other computers.
    A window opens up and the bottom right of the window the little twirling busy thing just goes and goes and goes.
    I notice the server icon on the Desktop and double click it and everything is there an access is fast, just like I expected from the first window that popped up. But it's still there, blank, with a little twirly thing (very technical).
    I get what I'm after, but it doesn't work the way it should.

    Try keeping your shares from sleeping during the expected period of use--assuming they are. If this procedure works, then you'll need to decide between the "lesser of the two evils."

  • How to solve the problem: ipod doesn't  sort tracks by track number

    After lots of attempts, I think I've found the solution that solves this problem (is it a BUG of the ipod software last update?).
    PROBLEM DESCRIPTION
    ===================
    For some albums, ipod seams to be not able to sort songs by track number, no matter how you order the tracks through itunes.
    This problem normally appears in albums that are NOT of the same artist (ex: soundtracks).
    Once you upload on ipod (for ex.) your soundtrack, it can happen, when you browse the ipod in the following way:
    (from the main menu): music -> albums -> <name of the album> -> <tracks list>
    that the tracks list IN THE ipod appears NOT sorted by track number.
    SOLUTION
    ========
    This problem is due to a particular tag, "album artist": try to DELETE what is written in this tag for each song that doesn't appear in the correct order.
    For those that are not aware about itunes:
    1) open itunes when your ipod is connected to the pc
    2) select a song ON THE IPOD that you notice is not in the right position
    3) right click the mouse on it and the select "get info": a popup appears
    4) select the "info" tag on this popup
    5) delete what is written in the text area named "album artist"
    6) click "ok"
    TEST AND REMARK
    ================
    Another suggestion, useful to test the result of this action through itunes.
    It seams that ipod software makes a specific sequence of queries: when you select a specific album on your ipod, first it groups songs by album name (it seams a nonsense, because the songs that belong to the same album have, of course, the same album name), then by "album artist" and only at the end by track number.
    So, if you delete the content of the tag "album artist", automatically ipod should sort all songs by track number.
    Therefore, try to make this test: in itunes, in the ipod section, click on the colum "album" in order to sort your album by album name.
    If the songs appear in the right order (that is, sorted by tracks), your should have solved the problem.
    Hope that this will help the ones who have this problem.

    Hi, welcome to Apple Discusions.
    Is the album marked up as an audiobook by any chance?
    See http://samsoft.org.uk/iTunes/grouping.asp and http://samsoft.org.uk/iTunes/audiobooks.asp for more info.
    tt2

  • 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.
    thanks

    Hi Abhishek,
    Click on below links:
    [http://wiki.sdn.sap.com/wiki/display/Snippets/DisplaysubtotaltextinALV+grid]
    [ALV - Sort - Subtotal;
    BR
    Dep

Maybe you are looking for

  • How can I get my data out of a crashed drive?

    I need help. Crashed hard drive. How can I get the data out?

  • How to create new project in SPRO Transaction

    How to create new project in SPRO Transaction I need to attach my program Transaction code under the created project. Please help me how to do? Regards, Purshoth

  • Payment was refunded

    I did not want my payment refunded and the payment was not fraudulent I want my subscription back this is the 3rd time its tried to refund me cuz of fraudulent charge its my credit card I used to pay for it..

  • Reimport or extract edb-File

    Hello everyone, I have had a total server crash. Everything is not correctly working and the full windows system is damaged (empty popups, strange errors, no desktop icons etc.). BUT fortunately my Exchange-Folder seems to be untouched and completely

  • IPhoto sort events by photo count

    Hi, I need to track down events with 1 photo or more How can I sort events with photo count included? iPhoto'08 7.1.5 MacOSX 10.7.5 or iPhoto 9.6(910.29) MacOSX 10.10 Yosemite