ABAP Splitter Container to Display 2 SALV Grids [english]

Поділитися
Вставка
  • Опубліковано 13 гру 2024
  • In this video, I show you how to display 2 SALV Grids using a Splitter Container in ABAP. With a Splitter Container, the screen can be divided into several areas.
    In this example, the screen is divided into two containers (top/bottom). In each container, one SALV Grid is displayed.
    Classes:
    cl_gui_splitter_container
    cl_gui_container
    cl_salv_table
    #splittercontainer #salvgrid #salvtable
    ▬▬ Literature 📚 ▬▬▬▬▬▬▬▬▬▬▬▬▬
    ▶ ABAP: An Introduction 2020 amzn.to/45CLTqk
    ▶ Complete ABAP 2023 amzn.to/45D5UNM
    ▶ ABAP to the Future 2022 amzn.to/42cgWGs
    ▶ Clean ABAP 2022 amzn.to/3KAqmow
    ▬▬ My Hardware 💻 ▬▬▬▬▬▬▬▬▬▬▬▬▬
    ▶ Microphone: amzn.to/3zj2UIz
    ▶ Headphone: amzn.to/3GUBRFg
    ▬▬ My Software (free) 💾 ▬▬▬▬▬▬▬▬▬▬▬
    ▶ Video Recorder: bit.ly/678fgh6
    ▶ Video Editor: bit.ly/38Rj9lb
    ▶ Thumbnail: bit.ly/CustAnd...
    ▶ Gamma AI: bit.ly/3nsdvgr
    ▬▬ Further Links 🔗 ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    ⭐Become my subscriber: bit.ly/CustAnd...
    🎬All videos in English: bit.ly/CustAnd...
    ☕Buy me a Coffee 😀: bit.ly/3dih2cl
    *The links are affiliate links. There are no additional costs.

КОМЕНТАРІ • 81

  • @dannyquispecasas5238
    @dannyquispecasas5238 2 роки тому

    thanks, I from Peru and I'm searching that a lot of time, regards. :)

    • @CustAndCode
      @CustAndCode  2 роки тому

      Wow! from Peru? I find it really surprising where in the world people work with SAP! 😀 Thank you for your feedback! 🤗

  • @mdsaber6315
    @mdsaber6315 Рік тому

    Thank you Sir, It was simple and to the point explanation.

    • @CustAndCode
      @CustAndCode  Рік тому

      Thank you very much for your kind feedback! 😀🤗

  • @icemanirc
    @icemanirc 2 роки тому +1

    muy simple y concreto, gran trabajo.
    gracias

    • @CustAndCode
      @CustAndCode  2 роки тому +1

      ¡Muchas gracias! ¡Me alegro! 🤗

  • @BahriErtunc
    @BahriErtunc 2 роки тому

    Very simple and good explanation. I just applied it and it worked. Thanks.
    It would be very useful if you could connect the two tables and show detail records in the bottom table when a record is clicked on the upper table

    • @CustAndCode
      @CustAndCode  2 роки тому

      Thank you! Should be possible. You have to catch the click event in SALV table 1, read some data and display ist in SALV table 2. Maybe i will find time to make a video about it 🤗

    • @thebudaxcorporate9763
      @thebudaxcorporate9763 2 роки тому

      you can use event double click or hotspot in cl_salv_table and show popup to show more information

    • @MelissaSautaux
      @MelissaSautaux Рік тому

      I Just did it by this way:
      DATA: lr_events TYPE REF TO cl_salv_events_table.
      lr_events = o_salv_top->get_event( ).
      SET HANDLER gr_events->on_double_click FOR lr_events.
      METHOD on_double_click.
      PERFORM double_click USING row column.
      ENDMETHOD.
      FORM double_click USING i_row TYPE i
      i_column TYPE lvc_fname.
      READ TABLE your_table INTO DATA(your_structure) INDEX i_row.
      IF sy-subrc EQ 0.
      SELECT from table INTO TABLE (Table from your 2nd container) where condition EQ your_structure
      ENDIF.
      o_salv_bottom->refresh( refresh_mode = if_salv_c_refresh=>full ).
      ENDFORM. " show_function_info

    • @CustAndCode
      @CustAndCode  Рік тому

      Thank you very much for your solution! 😀

  • @siriap8460
    @siriap8460 2 роки тому

    good explanation. Thanks very useful video

  • @sebastianschulz7056
    @sebastianschulz7056 2 роки тому

    How can I refresh internal tables in the bottom container. In my case i use my second container to get more data from another databank. I have a handler double click. So, if i click on a column in my top container, i select data and the second container shows me the info. But if i click on a other column, the bottom container doesnt refresh. Thank you for helping me.
    PS: your video is very good and helps me a lot yet

    • @CustAndCode
      @CustAndCode  2 роки тому

      So it works only on the first try? mhm have you debugged the code? Have the values of the internal table in the bottom container changed after the second click? You have to check if the error is in the select or is it a refreshing problem. 🤔

  • @nataliaalejandragarciamill7122

    Hi, thank you very much, is very simple and good explanation. I want to applied header , how to actived header here? Thanks

    • @CustAndCode
      @CustAndCode  Рік тому

      Thanks for your kind feedback! 🤗 What do you mean with header? In this example you see title and columns? Do you expect something else? 🤔

    • @PawanKumar-yz6yk
      @PawanKumar-yz6yk 3 місяці тому

      @@CustAndCode Same query for me: splitting the main container into four sub-containers using the split container and showing text data in the first container as a header, while displaying ALV tables in the other three containers. How can we display header data in 1st container.

  • @sreen808
    @sreen808 9 місяців тому

    Thanks for the video. Can you please suggest on how can i enable the SAVE button? right now it is disabled.

    • @CustAndCode
      @CustAndCode  8 місяців тому

      You have to add a custom GUI STATUS and then set a handler like in this video: ua-cam.com/video/82nZy4o4Rek/v-deo.html
      🤗 Hope that helps.

    • @sreen808
      @sreen808 8 місяців тому

      Thanks. It makes sense.

    • @CustAndCode
      @CustAndCode  6 місяців тому

      🤗

  • @NeerajKumar-du4rm
    @NeerajKumar-du4rm Рік тому

    Thank you very much, how can I display standard toolbar?

    • @CustAndCode
      @CustAndCode  Рік тому

      As you see has every container his own toolbar. Do you miss some functions? 🤔

  • @MelissaSautaux
    @MelissaSautaux Рік тому

    Hi ! thank you for this nice tutorial ! I'm trying to add set screen status but I have a dump cx_salv_method_not_supported. Do you know how to fix this please ???

    • @CustAndCode
      @CustAndCode  Рік тому

      o_salv_top->set_screen_status or o_salv_bottom->set_screen_status should work? Have you called it in this way? 🤔

    • @MelissaSautaux
      @MelissaSautaux Рік тому +1

      @@CustAndCode HI !! thank you for your reply ! No this way doesn't work with full screen but I found a solution for that here you are:
      We need to add functions. My needed was to add additional buttons to the toolbar. In this way it works perfectly but we cannot use a custom PF-Status.
      TRY.
      l_text = 'Action Header'.
      l_icon = icon_complete.
      lr_functions->add_function(
      name = 'HEADER'
      icon = l_icon
      text = l_text
      tooltip = l_text
      position = if_salv_c_function_position=>right_of_salv_functions ).
      CATCH cx_salv_wrong_call cx_salv_existing.
      ENDTRY.

    • @CustAndCode
      @CustAndCode  Рік тому

      @@MelissaSautaux Thanks for your solution! 🤗 I have to check this later by myself why the custom PF-Status does not work 🤔

    • @MelissaSautaux
      @MelissaSautaux Рік тому

      @@CustAndCode
      CX_SALV_METHOD_NOT_SUPPORTED
      An exception has occurred which is explained in more detail below. The
      exception, which is assigned to class 'CX_SALV_METHOD_NOT_SUPPORTED' was not
      caught and
      therefore caused a runtime error. The reason for the exception is:
      Classe CL_SALV_TABLE méthode SET_SCREEN_STATUS n'est pas supportée pour
      CL_SALV_TABLE Plein écran et liste uniquement.
      I tried some suggestions from blogs without success :(

    • @CustAndCode
      @CustAndCode  Рік тому

      @@MelissaSautaux I made a note of it. Unfortunately, I have not yet encountered this case myself, so I cannot present a quick solution. 🤔

  • @Apunado14
    @Apunado14 Рік тому

    Hi there, this code works as expected. But I've a big problem: it does not work on SAP Gui for Java (to be used in a Mac). When the sentence "write space" is executed, a blank screen appears avobe the ALV report. Do you know how to fix it?

    • @CustAndCode
      @CustAndCode  Рік тому

      That's funny. Which version of the SAP GUI do you have? I don't have a Mac here to test this. Did you try to comment out the line? 🤔

  • @rajunaga5247
    @rajunaga5247 2 роки тому

    Nice..

  • @brenesportsbobo8753
    @brenesportsbobo8753 2 роки тому

    How did you make this work? I've tried on my end and it did not work. Just no display. Please let me know

  • @APRZ16
    @APRZ16 Рік тому

    como colocariamos dos cuadriculas dentro de una de las principales?

    • @CustAndCode
      @CustAndCode  Рік тому

      Esto es exactamente lo que muestra este vídeo.
      o_splitter_main = contenedor principal
      o_container_top = mesa 1
      o_container_bottom = mesa 2
      Las mesas pueden disponerse de cualquier manera, por ejemplo, también una al lado de la otra. 🤗

    • @APRZ16
      @APRZ16 Рік тому

      @@CustAndCode perdona, creo que no me he explicado bien. quiero, dentro de una de esas dos que salen, crear otras dos dentro, es posible?

    • @CustAndCode
      @CustAndCode  Рік тому

      @@APRZ16 Por desgracia, no estoy seguro de que esto sea posible. Pero puede definir en la línea 24 cuántas filas y columnas debe tener su contenedor. A continuación, puede colocar contenedores en cada una de estas filas y columnas. Así que es muy flexible. 🤗

  • @lakshmib9746
    @lakshmib9746 2 роки тому

    Hi i want to add a download functionlaity combining both containers values.

    • @CustAndCode
      @CustAndCode  2 роки тому

      Wouldn't it be easier to join the entries before? otherwise you have 2 files 🤔

  • @demag.auliansyah4351
    @demag.auliansyah4351 Рік тому

    in my code, field NEW is unknown. can you help me with it ?

    • @CustAndCode
      @CustAndCode  Рік тому

      This form of declaration is possible with release 7.40 I am sure you have that. 🤔
      Pay attention to the spelling and syntax if this does not help post me the error message 🤗

    • @demag.auliansyah4351
      @demag.auliansyah4351 Рік тому

      @@CustAndCode its showing this "Field "NEW" is unknown. It is neither in one of the specified tables
      nor defined by a "DATA" statement."

    • @CustAndCode
      @CustAndCode  Рік тому

      @@demag.auliansyah4351 "NEW" is not a field it is an operator. With the new operator we create the container objects. Please compare your code with they code in the video I think you have forgotten some lines. 🤗

    • @demag.auliansyah4351
      @demag.auliansyah4351 Рік тому

      @@CustAndCode idk which ones wrong, i follow the code thoroughly, difference in settings maybe ?

    • @CustAndCode
      @CustAndCode  Рік тому

      @@demag.auliansyah4351 which SAP BASIS Release do you have? The NEW Operator is available from version 740 onwards. 🤗

  • @RamyaKatrapalli
    @RamyaKatrapalli Рік тому

    Hi sir. I want a topic explanation on easy splitter container . And difference between splitter container and easy splitter container. Can u please make a video on it or any document u have can please share it sir.

    • @CustAndCode
      @CustAndCode  Рік тому

      It is quite the same but you have less options with easy splitter container 🤗

  • @muthulakshmi7747
    @muthulakshmi7747 Рік тому

    Hi this is madhu, thanks for your valuable time and input, i have tried your concept this working fine, but when schedule a background job , it's getting some error related to splitter container, how to solve this ..thanks once more time

    • @CustAndCode
      @CustAndCode  Рік тому

      Thank you very much for your feedback! Not every application can be executed in the background (job). I have never called Splitter Container as a job myself. You would have to analyze the error for that. 🤗

  • @jerlinthomas8025
    @jerlinthomas8025 2 роки тому

    Hii. Can we have top of page for each report. Pls reply with sample code

    • @CustAndCode
      @CustAndCode  2 роки тому

      You mean two reports assigned left and right?

  • @douglasfarcic8486
    @douglasfarcic8486 6 місяців тому

    Why does WRITE make the screen presentation work?

    • @CustAndCode
      @CustAndCode  6 місяців тому

      Without write it does not work because the container is not rendered 🤔

  • @lucapastura
    @lucapastura 8 місяців тому

    hi compliments for your video. I don't understand the logic for writing space at the end

    • @CustAndCode
      @CustAndCode  8 місяців тому

      We need that WRITE command to display the container. 🤗

    • @lucapastura
      @lucapastura 8 місяців тому

      @@CustAndCode Yes but which is the logic for this behaviuor?

    • @CustAndCode
      @CustAndCode  6 місяців тому

      don't exactly know, without it won't work 🙄

  • @SushmaSenthilSenthilkumar
    @SushmaSenthilSenthilkumar Рік тому

    Can you pls provide the code also?

    • @CustAndCode
      @CustAndCode  Рік тому

      Unfortunately I don't own a website to publish and explain the code. But you will learn most if you type it by your own. This is not that much code. 😜

  • @thebudaxcorporate9763
    @thebudaxcorporate9763 2 роки тому

    not show on fiori

    • @CustAndCode
      @CustAndCode  2 роки тому +1

      There is no SALV Grid in Fiori. Fiori is completely different! You get the data by ODATA there... 🤗

    • @thebudaxcorporate9763
      @thebudaxcorporate9763 2 роки тому +1

      @@CustAndCode thanks, work for me, just add screen, keep it up man

    • @CustAndCode
      @CustAndCode  2 роки тому +1

      @@thebudaxcorporate9763 I intend to 🤗 thank's for your feedback!

    • @thebudaxcorporate9763
      @thebudaxcorporate9763 2 роки тому +1

      @@CustAndCode it's okay

  • @MelissaSautaux
    @MelissaSautaux Рік тому

    Hi, working again on this and trying to edit one cell. I found a solution with this piece of code but it seems that there is a limit on columns I mean if there is too much columns the edit doesn't work if I change the layout with only some of columns it works. Do you have an idea?
    TRY.
    ls_edit->set_attributes_for_columnname(
    EXPORTING
    columnname = 'PURCH_REQ'
    all_cells_input_enabled = abap_true
    ).
    CATCH cx_salv_not_found.
    ENDTRY.
    ls_edit->validate_changed_data( ).
    o_salv_top->refresh( ).

    • @CustAndCode
      @CustAndCode  Рік тому

      I don't use the SALV Table Framework if I have to edit cells of a table. This will not work. For this I have a special solution posted a few month ago: ua-cam.com/video/ZzXHYDy0UUE/v-deo.html
      🤗

    • @MelissaSautaux
      @MelissaSautaux Рік тому

      @Cust&Code in SAP ABAP hi ! Yes it works! I found a solution by using a working around to inherited a class that gives the possibility to edit. I will give you the code on monday 😉

    • @CustAndCode
      @CustAndCode  Рік тому

      @@MelissaSautaux Really? Sounds cool! If it works I will make a video with credits to you 😉 I have tested some code from github but I don't want to use it in production enviroment 🤔 That is a bit too uncertain for me 😜 Looking forward to Monday! 😀

    • @MelissaSautaux
      @MelissaSautaux Рік тому

      @Cust&Code in SAP ABAP yes really ! I was testing and checking during hours because I didn't want to use reuse functions or to create dynpros. Then I found some blog about inheritance of class cl_gui_alv_grid to use the edit property and it works. I'm happy because I don't need to change all my program 😌 for sure I will send you my code on monday then you can try and if you can do a demo could be nice because I think with this solution you can create all you code with oo classes and methods and don't need to waist time creating dynpros and maintaining you pbo and pai 🙏

    • @MelissaSautaux
      @MelissaSautaux Рік тому

      @@CustAndCode can I ask you if you have an email address ? Then I can send you the ABAP code ? Thank you 🙏