‎2006 Oct 19 11:05 PM
Hi all
Can anybody give me a small example of how to create screens step by step...
Thanks and regards
vijaya
‎2006 Oct 19 11:12 PM
Well, here is steps for simply screen. IN your report program add this statement .
report zrich_0001.
data: ok_code type sy-ucomm.
start-of-selection.
call screen 100.Double click on the "100" in the call screen statement. SYstem will ask if you want to create, say yes, give description of screen on the next screen, there should be a tab for screen elements, add OK_CODE to the ok_code type field, this will handle the FCODES from the screen. Click on the screen flow tab, and uncomment the the module statements for STATUS and USER-COMMAND. Double click on each, system will ask if you want to create them, in the dialog choose your program to add the module to. Once both have been created in the ABAP program, you can continue to the layout, click the layout button the application toolbar.
Screen painter should then fire and here is where you can add your UI elements, Click the UI element for text element and put in the screen, add some text to this UI element. Save and activate all and run your program, you should see the screen. You have not yet created the gui status so there is no function codes for you to handle, exit the program by putting "/N" in the transaction code box at the top of the sapgui. Once you get this far we can continue.
Lite Reading....
http://help.sap.com/saphelp_nw2004s/helpdata/en/e4/2adbef449911d1949c0000e8353423/frameset.htm
Regards,
Rich Heilman
‎2006 Oct 19 11:12 PM
Well, here is steps for simply screen. IN your report program add this statement .
report zrich_0001.
data: ok_code type sy-ucomm.
start-of-selection.
call screen 100.Double click on the "100" in the call screen statement. SYstem will ask if you want to create, say yes, give description of screen on the next screen, there should be a tab for screen elements, add OK_CODE to the ok_code type field, this will handle the FCODES from the screen. Click on the screen flow tab, and uncomment the the module statements for STATUS and USER-COMMAND. Double click on each, system will ask if you want to create them, in the dialog choose your program to add the module to. Once both have been created in the ABAP program, you can continue to the layout, click the layout button the application toolbar.
Screen painter should then fire and here is where you can add your UI elements, Click the UI element for text element and put in the screen, add some text to this UI element. Save and activate all and run your program, you should see the screen. You have not yet created the gui status so there is no function codes for you to handle, exit the program by putting "/N" in the transaction code box at the top of the sapgui. Once you get this far we can continue.
Lite Reading....
http://help.sap.com/saphelp_nw2004s/helpdata/en/e4/2adbef449911d1949c0000e8353423/frameset.htm
Regards,
Rich Heilman
‎2006 Oct 19 11:27 PM
Hi Rich
I finished till that point..can we further..
Thanks
vijaya
‎2006 Oct 23 2:02 PM
Ok, next step is to create the gui status . Your ABAP program should now look like this.
REPORT ZRICH_0001 .
data: ok_code type sy-ucomm.
start-of-selection.
call screen 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
ENDMODULE. " USER_COMMAND_0100 INPUT
Now in the PBO Module.... Uncomment the SET PF-STATUS line. And replace the 'xxxxx' with '0100'.
MODULE STATUS_0100 OUTPUT.
<b> SET PF-STATUS '0100'.</b>
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUTNow double click on the '0100' in that line. System will ask if you want to create the status, say yes. In the dialog enter short text, choose "online status". Click green check. Now on the next screen, drop down the function key section. You must recoginze the icons in the standard toolbar section, for the "Green Arrow, BACK" icon, enter the word BACK, for the yellow, enter EXIT, for the red, enter CANCEL. Save and activate.
Next step is handle these FCodes in the PAI inside the USER_COMMAND MOdule. You can enter the coding like this.
MODULE USER_COMMAND_0100 INPUT.
case ok_code.
when 'BACK' or 'EXIT' or 'CANCEL'.
clear ok_code.
leave program.
endcase.
ENDMODULE. " USER_COMMAND_0100 INPUT
Doing all of this will allow you to leave the program using the standard buttons. This is the most basis screen programming, of course, it gets more exiting as it gets more complex.
Regards,
Rich Heilman
‎2006 Oct 23 2:13 PM
Hi Durga,
YOu can go to ABAPDOCU Transaction if you haven't done that already.
Open the node:
ABAP User Dialogs->Screens->Processing Screens.
YOu would find good sample programs.
Regards,
ravi