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.
thanks, I from Peru and I'm searching that a lot of time, regards. :)
Wow! from Peru? I find it really surprising where in the world people work with SAP! 😀 Thank you for your feedback! 🤗
Thank you Sir, It was simple and to the point explanation.
Thank you very much for your kind feedback! 😀🤗
muy simple y concreto, gran trabajo.
gracias
¡Muchas gracias! ¡Me alegro! 🤗
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
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 🤗
you can use event double click or hotspot in cl_salv_table and show popup to show more information
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
Thank you very much for your solution! 😀
good explanation. Thanks very useful video
Thank you! 🤗😀
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
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. 🤔
Hi, thank you very much, is very simple and good explanation. I want to applied header , how to actived header here? Thanks
Thanks for your kind feedback! 🤗 What do you mean with header? In this example you see title and columns? Do you expect something else? 🤔
@@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.
Thanks for the video. Can you please suggest on how can i enable the SAVE button? right now it is disabled.
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.
Thanks. It makes sense.
🤗
Thank you very much, how can I display standard toolbar?
As you see has every container his own toolbar. Do you miss some functions? 🤔
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 ???
o_salv_top->set_screen_status or o_salv_bottom->set_screen_status should work? Have you called it in this way? 🤔
@@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.
@@MelissaSautaux Thanks for your solution! 🤗 I have to check this later by myself why the custom PF-Status does not work 🤔
@@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 :(
@@MelissaSautaux I made a note of it. Unfortunately, I have not yet encountered this case myself, so I cannot present a quick solution. 🤔
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?
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? 🤔
Nice..
Thank you! 😃
How did you make this work? I've tried on my end and it did not work. Just no display. Please let me know
Did you add this line(81): WRITE: space.
Thank you so much! It works now
@@brenesportsbobo8753 🤗👏👏👏
como colocariamos dos cuadriculas dentro de una de las principales?
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. 🤗
@@CustAndCode perdona, creo que no me he explicado bien. quiero, dentro de una de esas dos que salen, crear otras dos dentro, es posible?
@@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. 🤗
Hi i want to add a download functionlaity combining both containers values.
Wouldn't it be easier to join the entries before? otherwise you have 2 files 🤔
in my code, field NEW is unknown. can you help me with it ?
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 🤗
@@CustAndCode its showing this "Field "NEW" is unknown. It is neither in one of the specified tables
nor defined by a "DATA" statement."
@@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. 🤗
@@CustAndCode idk which ones wrong, i follow the code thoroughly, difference in settings maybe ?
@@demag.auliansyah4351 which SAP BASIS Release do you have? The NEW Operator is available from version 740 onwards. 🤗
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.
It is quite the same but you have less options with easy splitter container 🤗
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
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. 🤗
Hii. Can we have top of page for each report. Pls reply with sample code
You mean two reports assigned left and right?
Why does WRITE make the screen presentation work?
Without write it does not work because the container is not rendered 🤔
hi compliments for your video. I don't understand the logic for writing space at the end
We need that WRITE command to display the container. 🤗
@@CustAndCode Yes but which is the logic for this behaviuor?
don't exactly know, without it won't work 🙄
Can you pls provide the code also?
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. 😜
not show on fiori
There is no SALV Grid in Fiori. Fiori is completely different! You get the data by ODATA there... 🤗
@@CustAndCode thanks, work for me, just add screen, keep it up man
@@thebudaxcorporate9763 I intend to 🤗 thank's for your feedback!
@@CustAndCode it's okay
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( ).
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
🤗
@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 😉
@@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! 😀
@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 🙏
@@CustAndCode can I ask you if you have an email address ? Then I can send you the ABAP code ? Thank you 🙏