cancel
Showing results for 
Search instead for 
Did you mean: 

The print button I created in the toolbar is not working properly.

yalcin_mete
Participant
0 Kudos
338

Hi Masters,

I created a "print button" in the toolbar. When I click the print button, the output screen appears, but since the program does not leave the ALV screen, the ALV screen appears on top of the output screen and for this reason I cannot see the output screen properly.

yalcin_mete_0-1726154849819.png


First Screen :

yalcin_mete_1-1726155083874.png


After selecting a line in ALV, I click the print button :

yalcin_mete_2-1726155177865.png


I select the output device, then I click the print preview(yazdırma öngörünümü) :

yalcin_mete_3-1726155287987.png


Actually, the output view appears on the screen, but the ALV does not leave the screen.

yalcin_mete_4-1726155468942.png



I tried "ALV refresh" but it did not work. How can I remove the ALV from the screen?



Thanks.

 

 

Sandra_Rossi
Active Contributor

For information, you can obfuscate easily with Greenshot (at getgreenshot.org) e.g.

Sandra_Rossi_0-1726165702940.png

 

Sandra_Rossi
Active Contributor
You display the ALV in CL_GUI_CONTAINER=>SCREEN0 (or equivalent), but you should avoid this in productive programs. Instead, create a Dynpro screen with a Custom control inside (to be instantiated with CL_GUI_CUSTOM_CONTAINER), and you display the ALV grid inside this container.
View Entire Topic
yalcin_mete
Participant
0 Kudos

thank you @Sandra_Rossi 
When I create a container to be instantiated with CL_GUI_CUSTOM_CONTAINER, the problem is solved, but this time I used ALV CL_GUI_CONTAINER=>SCREEN0 because I was getting errors in other places.
Are you saying that I shouldn't use ALV here with CL_GUI_CONTAINER=>SCREEN0?

Doesn't CL_GUI_CONTAINER=>SCREEN0 also work as a container that can be instantiated with CL_GUI_CUSTOM_CONTAINER?

What is the difference between CL_GUI_CONTAINER=>SCREEN0 and CL_GUI_CUSTOM_CONTAINER? container?


Thanks 🙂

Sandra_Rossi
Active Contributor
CL_GUI_CONTAINER=>SCREEN0 is a container in front of the normal Dynpro, so classic Dynpro content is hidden. Two solutions to show the content: free CL_GUI_CONTAINER=>SCREEN0 (will also free what's inside e.g. ALV) or make its content invisible (SET_VISIBLE false). As I said, CL_GUI_CONTAINER=>SCREEN0 is not official, it's something to be used only for quick or short demonstrations.
yalcin_mete
Participant
0 Kudos

Thank you @Sandra_Rossi.
I want to ask one more question 
When I use CL_GUI_CONTAINER=>SCREEN0, a new screen (call screen 0200) does not open. Could this be due to CL_GUI_CONTAINER=>SCREEN0?

Sandra_Rossi
Active Contributor

Yes, screen 0200 is what I called "normal Dynpro" and "classic Dynpro", opposed to CL_GUI_CONTAINER=>SCREEN0 which is not part of official programming (it's a trick, I don't know any SAP standard program using this).

yalcin_mete
Participant
0 Kudos
Thank you very much for the information you have provided @Sandra_Rossi 🙂