Skip to Content
0

OOPs ALV in background

Jun 27, 2017 at 05:38 PM

190

avatar image

Hi SDNites,

I have a requirement where I need to have a Header Box and ALV to be displayed in output. I should be able to execute the ALV in background as well.

I have written the program using OOPs ALV. When I use docking container I am able to execute the OOPs ALV in background. But in order to have Header Box, I tried splitter which works fine in foreground but not in background. Then I tried to build 2 containers and in Header box container, I wanted to use CL_GUI_TEXT_EDIT to display only text. Please advise if this can work or also this cannot be executed in background.

Any other approach to make it work using OOPs ALV will be welcomed.

Regards,

Abhi

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Horst Keller
Jun 28, 2017 at 04:55 AM
2

Usage of CFW requires SAP GUI. Programs using CFW cannot be executed in background. You must program it in such a way that CFW is only called if GUI is available which can be checked with FM gui_is_available.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Interesting query though - how come docking containers are ok in background?

0

Maybe, as long as they are empty ...

1
satyapriyanka vana Jun 28, 2017 at 01:52 AM
-2

Hi,

Are you referring Top of Page as header box? What actually the header box contains?

Regards,

Priyanka

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jun 28, 2017 at 10:21 AM
0

CL_GUI_TEXT_EDIT can not run in background, as Horst stated, in background you need Control Framework ( CFW ) this handles the communication(synchronization) between Abap Object and Object @frontend in SAPGUI: That is usually an ActiveX object(if you run Windows). In Back Ground there is no front end!

Best regards, Robin.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

As I have used docking container to execute ALV in background, can't we have an approach where we can use CL_GUI_TEXT_EDIT in background as well. If yes, some reference will be of great help.

0
Bertrand DELVALLEE Jun 28, 2017 at 09:37 AM
0

Hello,

You should try to handle events "print_top_of_page" and "top_of_page" from cl_gui_alv_grid.

Please, have a look at this thread : https://archive.sap.com/discussions/thread/836692

Best regards,

Bertrand

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Will this work in background?

0

Yes.

The trick is to create 2 top-of-page methods : one for foreground (HTML ready) and one for background (text + basic SAP colors only).

You should have a look there for ideas : http://abap-explorer.blogspot.fr/2008/12/demo-program-for-top-of-page-for-alv.html

Best regards,

Bertrand

0