2008 Apr 07 8:47 AM
please help me to write the following codecode
(1) Create a work area of the folowing fields of the 'Z' table(employee/department)-
MANDT(03) type CLNT ,
EMPID (05) type CHAR ,
EMPNM(15) type CHAR ,
EMPDJ (08) type CHAR ,
EMPAD (30) type CHAR ,
EMPPH (15) type CHAR ,
DEPID (05) type CHAR .
Create a selection-screen equivalent of the above work area
(2) Also put 'INSERT' 'DELETE' and 'UPDATE' buttons on
the selection-screen
(3) Using INSERT statement insert selection-screen record
into DATABASE TABLE, when the user presses 'INSERT'
button on selection-screen
(4) Using UPDATE statement modify record of the DATABASE
TABLE, when the user presses 'UPDATE' button on
selection-screen
(5) Using DELETE statement delete the corresponding
DATABASE TABLE record, when the user
presses 'DELETE' button on selection-screen
(6) Use messages appropriately.
please help me to write the following codecode
(1) Create a work area of the folowing fields of the 'Z' table(employee/department)-
MANDT(03) type CLNT ,
EMPID (05) type CHAR ,
EMPNM(15) type CHAR ,
EMPDJ (08) type CHAR ,
EMPAD (30) type CHAR ,
EMPPH (15) type CHAR ,
DEPID (05) type CHAR .
Create a selection-screen equivalent of the above work area
(2) Also put 'INSERT' 'DELETE' and 'UPDATE' buttons on
the selection-screen
(3) Using INSERT statement insert selection-screen record
into DATABASE TABLE, when the user presses 'INSERT'
button on selection-screen
(4) Using UPDATE statement modify record of the DATABASE
TABLE, when the user presses 'UPDATE' button on
selection-screen
(5) Using DELETE statement delete the corresponding
DATABASE TABLE record, when the user
presses 'DELETE' button on selection-screen
(6) Use messages appropriately.
2008 Apr 07 8:59 AM
Hi ravinder,
To get Buttons ofn Selection-screen.
tables: sscrfields.
SELECTION-SCREEN:
PUSHBUTTON 2(10) but1 USER-COMMAND cli1,
PUSHBUTTON 12(10) but2 USER-COMMAND cli2,
PUSHBUTTON 2(10) but3 USER-COMMAND cli3.
INITIALIZATION.
but1 = 'INSERT'.
but2 = 'DELETE'.
but3 = 'UPDATE'.
AT SELECTION-SCREEN.
CASE sscrfields.
WHEN 'CLI1'.
.........
WHEN 'CLI2'.
................
WHEN 'CLI3'.
..........................
ENDCASE.
Also check ythe following link
http://help.sap.com/saphelp_nw70/helpdata/EN/9f/dba81635c111d1829f0000e829fbfe/frameset.htm
Regards,
Ruthra
2008 Apr 07 9:26 AM
Check this sample program.
I hope that it gives u some idea.
Regards,
Venkat.O
REPORT zvenkat_test1.
TYPES:
BEGIN OF t_empdet,
mandt TYPE mandt ,
empid(05) TYPE c ,
empnm(15) TYPE c ,
empdj(08) TYPE c ,
empad(30) TYPE c ,
empph(15) TYPE c ,
depid(05) TYPE c ,
END OF t_empdet.
DATA:
w_empdet TYPE t_empdet.
DATA:
i_empdet TYPE STANDARD TABLE OF t_empdet.
PARAMETERS:
mandt TYPE mandt ,
empid(05) TYPE c ,
empnm(15) TYPE c ,
empdj(08) TYPE c ,
empad(30) TYPE c ,
empph(15) TYPE c ,
depid(05) TYPE c .
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE title1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 10(8) text_001 USER-COMMAND com1.
SELECTION-SCREEN PUSHBUTTON 20(8) text_002 USER-COMMAND com2.
SELECTION-SCREEN PUSHBUTTON 30(8) text_003 USER-COMMAND com3.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1 .
INITIALIZATION.
text_001 = 'INSERT'.
text_002 = 'DELETE'.
text_003 = 'MODIFY'.
AT SELECTION-SCREEN.
w_empdet-mandt = mandt.
w_empdet-empid = empid.
w_empdet-empnm = empnm.
w_empdet-empdj = empdj.
w_empdet-empad = empad.
w_empdet-empph = empph.
w_empdet-depid = depid.
CASE sy-ucomm .
WHEN 'COM1'."Insert
INSERT zempdet FROM w_empdet.
WHEN 'COM2'."Delete
DELETE zempdet FROM w_empdet.
WHEN 'COM3'."Modify
UPDATE zempdet SET mandt = w_empdet-mandt
empid = w_empdet-empid.
ENDCASE.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |