cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem creating a modal dialog

Former Member
0 Likes
1,528

Hello,

I want to present a 'wizard'-like dialogbox to the user of my system. But I'm having trouble making my popup window modal i.e. to lock the main window of my application as long as the user is interacting with the 'wizard'.

I am in a strictly (ABAP-)object oriented context. Therefore my first attempt was the CL_GUI_DIALOGBOX_CONTAINER which I like quite a lot but it's flaw is that it is amodal which makes it useless.

Then I tried a new dynpro (to which I would attach a docking container) but it seems that dynpros can't be displayed from ABAP-Objects...

Maybe someone has an idea on how to make the CL_GUI_DIALOGBOX_CONTAINER modal <i><b>or</b></i> some other solution to the problem ?

Best regards,

Patrick Baer

Accepted Solutions (1)

Accepted Solutions (1)

christian_wohlfahrt
Active Contributor
0 Likes

Hi Patrick,

IMHO, that's the point: you can't call dynpros inside ABAP-OO.

I'm curious, if there are more elegant ways, but here is my proposal:

Encapsulate your new (modal) screen in a FM or report. This FM (like POPUP*) )can be called inside ABAP-OO.

Inside this FM you can again use OO, but here concept of separate transaction logic (how to book data) and maintenance logic (in which way maintain data in screens) comes into the game.

Regards,

Christian

Former Member
0 Likes

Christian,

I totally agree with you. That's exactly how I see the situation now.

In my opinion the most elegant way would be to add a modal/amodal parameter to the constructor of the CL_GUI_DIALOGBOX_CONTAINER. It probably isn't that easy to implement but it would be quite logical in my eyes. Furthermore it is OO-based and very easy to use.

Best regards,

Patrick Baer

Answers (1)

Answers (1)

sergey_korolev
Active Contributor
0 Likes

Excuse me for off-topic, but there is a Wizard library in SAP (at least in 4.7). You can create your own wizard via transaction SBPT_WB.

Former Member
0 Likes

Sergei,

doesn't seem to be off topic but I have only access to 4.6 release 😐

Former Member
0 Likes

Another off topic post...

I haven't used classes to handle modal dialogs, but I have used CALL FUNCTION .... which works fine.

You can have a look in SE37 at all the standard function modules named POPUP* (there are around 20 or so from memory) for examples.

What controls whether a screen is modal or not is a screen attribute set in the screen painter - Modal.

Cheers,

Brad

Former Member
0 Likes

Brad,

your reply also does not seem to be off topic for me.

I will investigate if it is possible to call a screen from a function module. I interpret your post as suggesting so

I could then wrap the function module call in a method which would be ok.

I am currently using some of the popups that already exist but they are not customizable enough to fit in the current scenario.

Best regards,

Patrick Baer

sergey_korolev
Active Contributor
0 Likes

I've just connected to 4.6c and the transaction is in place.

Former Member
0 Likes

> I will investigate if it is possible to call a screen > from a function module. I interpret your post as

> suggesting so

> I could then wrap the function module call in a method > which would be ok.

Just read through my post, and perhaps it was a bit vague.

For sure you will be able to do as you suggested. What I was trying to say is that the POPUP* functions (for example POPUP_TO_CONFIRM_WITH_STEP) provide an exact technical example of what you want to achieve. If you wrap one of these up in a method you get your result.

Of course, you will probably have to create your own function with call screen (to get your wizard functionality), but the POPUP* functions show you how its done. They also let you test your method approach without having to code a function from scratch.

Cheers,

Brad

Former Member
0 Likes

Sergei,

you are right. I could open the transaction.

I mistakenly tried to find it in the reports...

It might in fact be an option but right now I would prefer to build my wizard from scratch on my own.

If I don't succeed I will get back to the transaction you suggested and try it out again.

Thank you anyway !

Best regards,

Patrick Baer

Former Member
0 Likes

Brad,

thanks for the clarification of your post.

I think I got the message already but what you explained confirmed it

This is the way I will try to design my wizard.

Still I'm a bit disappointed that I could'nt use the CL_GUI_DIALOGBOX_CONTAINER 😐

It's a pretty neat thing, very easy to use and conceptually clean - except a missing option to make it modal...

SAP listen to this !

(probably too late now that web-interfaces are on the table )

Best regards,

Patrick Baer

christian_wohlfahrt
Active Contributor
0 Likes

Hi Patrick,

I don't understand your complain.

Here how I see your necessary steps:

- create a FM

- call screen (and define PBO, PAI,...)

- use CL_GUI_DIALOGBOX_CONTAINER in this screen

- ...make your actions

Regards,

Christian

Former Member
0 Likes

Christian,

just read your reply (somehow didn't get a new post email on this answer...)

I am complaining about a very good technique (cl_gui_dialogbox_container) not thought till the end (option to turn the window modal/amodal).

Of course in the way we discussed it a solution can be achieved. But it is not very elegant in my eyes.

Regards,

Patrick