‎2005 Mar 21 3:51 PM
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
‎2005 Mar 21 3:55 PM
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
‎2005 Mar 21 3:55 PM
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
‎2005 Mar 21 3:58 PM
hi,
So what should I do if I want to attach a button to a subscreen and and functionality to it?
Thanx
Kelly.
‎2005 Mar 21 4:00 PM
‎2005 Mar 21 4:18 PM
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
‎2005 Mar 21 8:39 PM
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>