Application Development and Automation 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: 
Read only

Dialog programming- subscreen

Former Member
0 Likes
675

Hi,

I would like to know if we can attach OK code to a subscreen. If can't how do we do it? Can we use any userexit or something for that?

Help pls

Thank you,

Kelly

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
649

Hi,

there is no way to have a ok-code for a subscreen itself. The ok-code is always passed to the basic dynpro.

regards

Siggi

5 REPLIES 5
Read only

Former Member
0 Likes
650

Hi,

there is no way to have a ok-code for a subscreen itself. The ok-code is always passed to the basic dynpro.

regards

Siggi

Read only

0 Likes
649

hi,

So what should I do if I want to attach a button to a subscreen and and functionality to it?

Thanx

Kelly.

Read only

0 Likes
649

I would assume that the button which is added onto a subscreen would be handled by the parent screen.

Regards,

Rich Heilman

Read only

0 Likes
649

Yes, i've just tested it. If you put a button on a subscreen and include the subscreen in another screen, the fcode is triggered and sent back to the USER_COMMAND of the parent screen.

here is my test program. I created screen 100 as the parent with a subscreen are called sub1, and subscreen 101 with a pushbutton which triggers fcode 'PUSH'.



report zrich_0002 .

data: ok_code type sy-ucomm.

call screen 100.
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
module status_0100 output.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.

endmodule.                
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
module user_command_0100 input.

  case ok_code .
    when 'PUSH'.
      check sy-subrc  = 0.
  endcase.

endmodule.               


* This is the flow logic

*PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
*
* call subscreen sub1 including sy-repid '101'.
*
*PROCESS AFTER INPUT.
*
* call subscreen sub1 .
*
* MODULE USER_COMMAND_0100.

Regards,

Rich Heilman

Read only

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Likes
649

Hi

Subscreens are used always as a <b>sub</b> screen of a normal screen. So, they cannot have their own user command field. The user-command field of the main screen gets the function code of the button (or triggered function) pressed at the subscreen.

Regards

*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>