Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Command Button in Sub Screen

Former Member
0 Kudos

Hi,

In MPP, I have 3 screens, 1 is main (screen no: 100) and other 2 (screen no’s: 10, 20) are sub screens. In one of the sub screen (20) has List box and Command Button. When I am trying to click the command button I am not able to get the result, I think this is because of there is no OKCODE for sub screens. So can’t we use command buttons in sub screen? If yes can you help me please with sample code?

Thanks & Regards,

Satya

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Satya,

Defining Subscreen Screens

You can create subscreen screens either in the same program or a different program. To create a subscreen screen, enter the screen type Subscreen in the screen attributes. The statically-defined next screen must be the number of the subscreen itself. Choose a size for the screen, making sure that it fits within the subscreen area into which you want to place it. If the subscreen screen is too big for the subscreen area, only the top left-hand corner of it will be displayed.

You create the layout, element list, and flow logic of a subscreen screen in the same way as a normal screen. Subscreens may also include other subscreens. However, the following restrictions apply:

You should arrange the screen elements so that they are not truncated if a subscreen area is too small.

If you want to create several subscreen screens in an ABAP program, you should make sure that the individual screen elements have names unique among the subscreens. If the subscreen screens belong to the same program as the main screen, you should also make sure that names are not used twice there. Otherwise, you must separate data transported from the screen in your ABAP program after each user action (see example).

Subscreens cannot have their own OK_CODE field. Function codes linked to user actions on subscreens are placed in the OK_CODE field of the main screen. This also applies to subscreen screens defined in a different program to the main screen.

The flow logic of a subscreen screen may not contain a MODULE ... AT EXIT-COMMAND statement. Type E functions may only be handled in the main screen.

The flow logic of a subscreen screen may not contain any dialog modules containing the statements SET TITLEBAR, SET PF-STATUS, SET SCREEN, LEAVE SCREEN, or LEAVE TO SCREEN. Any of these statements causes a runtime error. You cannot change the GUI status of a main screen in a subscreen screen.

Don't forget to reward if useful....

4 REPLIES 4

Former Member
0 Kudos

define functional code to the button it will take care.

double click the button, small pop up will come there small FCTCODE box should be there, there you need to define it.

Former Member
0 Kudos

hi,

GUI status can not be set to the sub screen.

OKCODE is not applicable to the sub screen.

It can not contain AT EXIT-COMMAND.

so u can't handle that button,instead place this in the calling screen and use it

Former Member
0 Kudos

Satya,

Defining Subscreen Screens

You can create subscreen screens either in the same program or a different program. To create a subscreen screen, enter the screen type Subscreen in the screen attributes. The statically-defined next screen must be the number of the subscreen itself. Choose a size for the screen, making sure that it fits within the subscreen area into which you want to place it. If the subscreen screen is too big for the subscreen area, only the top left-hand corner of it will be displayed.

You create the layout, element list, and flow logic of a subscreen screen in the same way as a normal screen. Subscreens may also include other subscreens. However, the following restrictions apply:

You should arrange the screen elements so that they are not truncated if a subscreen area is too small.

If you want to create several subscreen screens in an ABAP program, you should make sure that the individual screen elements have names unique among the subscreens. If the subscreen screens belong to the same program as the main screen, you should also make sure that names are not used twice there. Otherwise, you must separate data transported from the screen in your ABAP program after each user action (see example).

Subscreens cannot have their own OK_CODE field. Function codes linked to user actions on subscreens are placed in the OK_CODE field of the main screen. This also applies to subscreen screens defined in a different program to the main screen.

The flow logic of a subscreen screen may not contain a MODULE ... AT EXIT-COMMAND statement. Type E functions may only be handled in the main screen.

The flow logic of a subscreen screen may not contain any dialog modules containing the statements SET TITLEBAR, SET PF-STATUS, SET SCREEN, LEAVE SCREEN, or LEAVE TO SCREEN. Any of these statements causes a runtime error. You cannot change the GUI status of a main screen in a subscreen screen.

Don't forget to reward if useful....

Former Member
0 Kudos

If you add a pushbutton on a subscreen, and assign a function code to it there, you should be able to pick up this in your "module dnnnn_user_command" logic within the PBO of the main screen.