Вы находитесь на странице: 1из 3

Steps

1. Create dialog program using se38 transaction and giving type as module pool e.g
ztest_prog
2. Create screen after clicking on display objects and then by right clicking on the module
pool program e.g screen 1000. Remember to do save after every step
3. Create include files ztest_prog_o01(PBO process before include ztest_prog_o01) and
ztest_prog_a01(PAI process after include file)
4. Uncomment the commented part in screen 1000 and double click on STATUS_1000(to
create PBO module remember to associate include file ztest_prog_o01 file). similarly
double click on USER_COMMAND_1000 (to create PAI module remember to associate
include file ztest_prog_a01 file).
5. Uncomment the commented part in STATUS_1000(PBO module)and give some name to
status bar and title bar
SET PF-STATUS 'TESTSTATUS'.
SET TITLEBAR 'TESTTITLE'.
Double click on TESTSTATUS and TESTTITLE to create status bar and title bar
6. Write the code for PBO and PAI module. Sample code for PBO and PAI module is below.
7. Create the layout for screen
Enter text boxes(for display purpose only can give any name) . Then enter input/output
boxes(use the name of the box the same as used in the User_COMMAND_1000(PAI
module)). Then enter push buttons give name like change, create and display but
remember to give FCTCODE as given in the PBO module STATUS_1000.
8. Create transaction using the same name as used in PBO module give program
name(ztest_prog main module program) and screen number (1000)while creating the
transaction and check all three boxes for GUI support (HTML, java and windows).
Create all three transactions
9. Finally activate everything by right clicking on the module and then executing the
program by writing the transaction name in the command box for example(
/oztest_create2)

**********************************************************************
*******************
*PAI Module program
*******************
*&---------------------------------------------------------------------*
*& Include
ZTEST_VIS_MP3_A01
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&
Module USER_COMMAND_1000 INPUT
*&---------------------------------------------------------------------*
MODULE user_command_1000 INPUT.
TABLES: z26empl.
DATA wa_po TYPE z26empl.
CASE sy-ucomm.
WHEN 'V_CREATE'.
wa_po-empid = z26empl-empid.
wa_po-grade = z26empl-grade.
wa_po-location = z26empl-location.
wa_po-pu = z26empl-pu.
MODIFY z26empl FROM wa_po.
MESSAGE 'Saved' TYPE 'I'.
WHEN 'V_CHANGE'.
wa_po-empid = z26empl-empid.
wa_po-grade = z26empl-grade.
wa_po-location = z26empl-location.
wa_po-pu = z26empl-pu.
MODIFY z26empl FROM wa_po.
WHEN 'V_DISPLAY'.
SELECT empid grade location pu
FROM z26empl
INTO CORRESPONDING FIELDS OF wa_po
WHERE empid = z26empl-empid.
z26empl-empid = wa_po-empid.
z26empl-grade = wa_po-grade.
z26empl-location = wa_po-location.
z26empl-pu = wa_po-pu.
CALL SCREEN '1000'.
ENDSELECT.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.
" USER_COMMAND_1000 INPUT
**********************************************************************
*******************
*pbo module program
*******************
MODULE status_1000 OUTPUT.

SET PF-STATUS 'VISHALSTATUS1'.


SET TITLEBAR 'VISHALTITLE1'.
LOOP AT SCREEN.
CASE screen-name.
WHEN 'CHANGE'.
IF sy-tcode NE 'ZTEST_CHANGE2'.
screen-invisible = 1.
MODIFY SCREEN.
ELSE.
screen-invisible = 0.
MODIFY SCREEN.
ENDIF.
WHEN 'CREATE'.
IF sy-tcode NE 'ZTEST_CREATE2'.
screen-invisible = 1.
MODIFY SCREEN.
ELSE.
screen-invisible = 0.
MODIFY SCREEN.
ENDIF.
WHEN 'DISPLAY'.
IF sy-tcode NE 'ZTEST_DISPLAY2'.
screen-invisible = 1.
MODIFY SCREEN.
ELSE.
screen-invisible = 0.
MODIFY SCREEN.
ENDIF.
ENDCASE.
ENDLOOP.
ENDMODULE.
" STATUS_1000

OUTPUT

Вам также может понравиться