ABAP Splitter Container to Display 2 SALV Grids [english]

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ม.ค. 2022
  • 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/CustAndCodeThumbnail
    ▶ Gamma AI: bit.ly/3nsdvgr
    ▬▬ Further Links 🔗 ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    ⭐Become my subscriber: bit.ly/CustAndCodeSub
    🎬All videos in English: bit.ly/CustAndCodeENG
    ☕Buy me a Coffee 😀: bit.ly/3dih2cl
    *The links are affiliate links. There are no additional costs.

ความคิดเห็น • 80

  • @icemanirc
    @icemanirc 2 ปีที่แล้ว +1

    muy simple y concreto, gran trabajo.
    gracias

    • @CustAndCode
      @CustAndCode  2 ปีที่แล้ว +1

      ¡Muchas gracias! ¡Me alegro! 🤗

  • @mdsaber6315
    @mdsaber6315 ปีที่แล้ว

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

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Thank you very much for your kind feedback! 😀🤗

  • @dannyquispecasas5238
    @dannyquispecasas5238 ปีที่แล้ว

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

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

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

  • @siriap8460
    @siriap8460 ปีที่แล้ว

    good explanation. Thanks very useful video

  • @rajunaga5247
    @rajunaga5247 2 ปีที่แล้ว

    Nice..

  • @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

    • @user-hk4su6up6e
      @user-hk4su6up6e ปีที่แล้ว

      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! 😀

  • @sebastianschulz7056
    @sebastianschulz7056 ปีที่แล้ว

    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  ปีที่แล้ว

      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
    @nataliaalejandragarciamill7122 11 หลายเดือนก่อน

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

    • @CustAndCode
      @CustAndCode  11 หลายเดือนก่อน

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

  • @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? 🤔

  • @NeerajKumar-du4rm
    @NeerajKumar-du4rm 11 หลายเดือนก่อน

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

    • @CustAndCode
      @CustAndCode  11 หลายเดือนก่อน

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

  • @sreen808
    @sreen808 4 หลายเดือนก่อน

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

    • @CustAndCode
      @CustAndCode  2 หลายเดือนก่อน

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

    • @sreen808
      @sreen808 2 หลายเดือนก่อน

      Thanks. It makes sense.

    • @CustAndCode
      @CustAndCode  หลายเดือนก่อน

      🤗

  • @muthulakshmi7747
    @muthulakshmi7747 8 หลายเดือนก่อน

    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  8 หลายเดือนก่อน

      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. 🤗

  • @user-ck2qi2fh2f
    @user-ck2qi2fh2f 7 หลายเดือนก่อน

    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  7 หลายเดือนก่อน

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

  • @lakshmib9746
    @lakshmib9746 ปีที่แล้ว

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

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

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

  • @user-hk4su6up6e
    @user-hk4su6up6e ปีที่แล้ว

    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? 🤔

    • @user-hk4su6up6e
      @user-hk4su6up6e ปีที่แล้ว +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  ปีที่แล้ว

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

    • @user-hk4su6up6e
      @user-hk4su6up6e ปีที่แล้ว

      @@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  ปีที่แล้ว

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

  • @AndreaPerez-xo5yy
    @AndreaPerez-xo5yy ปีที่แล้ว

    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. 🤗

    • @AndreaPerez-xo5yy
      @AndreaPerez-xo5yy ปีที่แล้ว

      @@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  ปีที่แล้ว

      @@AndreaPerez-xo5yy 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. 🤗

  • @brenesportsbobo8753
    @brenesportsbobo8753 ปีที่แล้ว

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

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Did you add this line(81): WRITE: space.

    • @brenesportsbobo8753
      @brenesportsbobo8753 ปีที่แล้ว

      Thank you so much! It works now

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      @@brenesportsbobo8753 🤗👏👏👏

  • @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?

  • @user-yt5hq6jc4b
    @user-yt5hq6jc4b 3 หลายเดือนก่อน

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

    • @CustAndCode
      @CustAndCode  3 หลายเดือนก่อน

      We need that WRITE command to display the container. 🤗

    • @user-yt5hq6jc4b
      @user-yt5hq6jc4b 3 หลายเดือนก่อน

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

    • @CustAndCode
      @CustAndCode  หลายเดือนก่อน

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

  • @douglasfarcic8486
    @douglasfarcic8486 หลายเดือนก่อน

    Why does WRITE make the screen presentation work?

    • @CustAndCode
      @CustAndCode  หลายเดือนก่อน

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

  • @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. 🤗

  • @user-pt4rp8gy7o
    @user-pt4rp8gy7o ปีที่แล้ว

    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

  • @user-hk4su6up6e
    @user-hk4su6up6e ปีที่แล้ว

    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: th-cam.com/video/ZzXHYDy0UUE/w-d-xo.html
      🤗

    • @user-hk4su6up6e
      @user-hk4su6up6e ปีที่แล้ว

      @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  ปีที่แล้ว

      @@user-hk4su6up6e 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! 😀

    • @user-hk4su6up6e
      @user-hk4su6up6e ปีที่แล้ว

      @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 🙏

    • @user-hk4su6up6e
      @user-hk4su6up6e ปีที่แล้ว

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