Skip to Content
0
Former Member
Jul 02, 2007 at 04:38 AM

module pool program error

12 Views

hi expects,

in this program in screen 100, i have provided select-options for material no,maximum qty,no. of kanban,no of unit per kanban in tabstrip and i am having 3 pushbuttons (create (screen110),change(screen 120),display(screen 130).but i am getting error in 100 & 110).in 110 , i should provide again select-options and table control.please help me to solve this problem.

&----


*& Module pool ZSAPMZPGM2 *

*& *

&----


*& *

*& *

&----


PROGRAM ZSAPMZTECHANICALTESTPGM2 .

TABLES : ZTECHANICALTEST2,MAKT.

DATA : BEGIN OF ITAB OCCURS 0,

ZMANDT LIKE ZTECHANICALTEST2-ZMANDT,

ZMATNR LIKE ZTECHANICALTEST2-ZMATNR,

ZMAXQTY LIKE ZTECHANICALTEST2-ZMAXQTY,

ZNUMKB LIKE ZTECHANICALTEST2-ZNUMKB,

ZBUNT LIKE ZTECHANICALTEST2-ZBUNT,

ZCRTBY LIKE ZTECHANICALTEST2-ZCRTBY,

ZCRTDT LIKE ZTECGHANICALTEST2-ZCRTDT,

ZUPDBY LIKE ZTECHANICALTEST2-ZUPDBY,

ZUPDDT LIKE ZTECHANICALTEST2-ZUPDDT,

END OF ITAB.

CONTROLS : VCONTROLS TYPE TABLEVIEW USING 120.

CONTROLS : STRIP TYPE TABSTRIP.

DATA : DYNNR LIKE SY-DYNNR VALUE 110

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


module USER_COMMAND_0100 input.

CASE SY-UCOMM.

WHEN 'DATA SELECTION'.

DYNNR = 110.

STRIP-ACTIVETAB = 'DATA SELECTION'.

ENDCASE.

endmodule. " USER_COMMAND_0100 INPUT

&----


*& Module USER_COMMAND_0110 INPUT

&----


  • text

----


module USER_COMMAND_0110 input.

CASE SY-UCOMM.

WHEN 'CREATE SCREEN'.

INSERT ZTECHANICALTEST2 FROM TABLE itab.

SELECT * FROM ZTECHANICALTEST INTO ITAB.

PROCESS BEFORE OUTPUT.

*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'V_CONTROL'

MODULE V_CONTROL_INIT.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_TC_ATTR.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_COL_ATTR.

LOOP AT G_V_CONTROL_ITAB

INTO G_V_CONTROL_WA

WITH CONTROL V_CONTROL

CURSOR V_CONTROL-CURRENT_LINE.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_FIELD_ATTR

MODULE V_CONTROL_MOVE.

MODULE V_CONTROL_GET_LINES.

ENDLOOP.

  • MODULE STATUS_0100.

*

PROCESS AFTER INPUT.

*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'V_CONTROL'

LOOP AT G_V_CONTROL_ITAB.

CHAIN.

FIELD ZTECHANICALTEST2-ZMANDT.

FIELD ZTECHANICALTEST2-ZMATNR.

FIELD ZTECHANICALTEST2-ZMAXQTY.

FIELD ZTECHANICALTEST2-ZNUMKB.

FIELD ZTECHANICALTEST2-ZKBUNT.

FIELD ZTECHANICALTEST2-ZCRTBY.

FIELD ZTECHANICALTEST2-ZCRTDT.

FIELD ZTECHANICALTEST2-ZUPDBY.

FIELD ZTECHANICALTEST2-ZUPDDT.

MODULE V_CONTROL_MODIFY ON CHAIN-REQUEST.

ENDCHAIN.

ENDLOOP.

MODULE V_CONTROL_USER_COMMAND.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_TC_ATTR.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_COL_ATTR.

MODULE USER_COMMAND_0100.

IF SY-SUBRC = 0.

MESSAGE I000(0) WITH 'CREATED'.

ELSE.

MESSAGE E001(0) WITH 'NOT CREATED'.

ENDIF.

WHEN OTHERS.

CLEAR OK_CODE.

SET SCREEN 120.

LEAVE SCREEN.

ENDCASE.

ENDCASE.

endmodule. " USER_COMMAND_0110 INPUT

&----


*& Module USER_COMMAND_0120 INPUT

&----


  • text

----


module USER_COMMAND_0120 input.

CASE SY-UCOMM.

WHEN 'DISPLAY SCREEN'.

INSERT ZTECHANICALTEST2 FROM TABLE itab.

SELECT * FROM ZTECHANICALTEST2 INTO ITAB.

IF SY-SUBRC = 0.

MESSAGE I000(0) WITH 'DISPLAY'.

ELSE.

MESSAGE E001(0) WITH 'NOT DISPLAY'.

ENDIF.

WHEN 'DISPLAY SCREEN'.

CLEAR OK_CODE.

SET SCREEN 130.

LEAVE SCREEN.

ENDCASE.

ENDCASE.

endmodule. " USER_COMMAND_0120 INPUT

&----


*& Module USER_COMMAND_0130 INPUT

&----


  • text

----


module USER_COMMAND_0130 input.

CASE SY-UCOMM.

WHEN 'CHANGE SCREEN'.

CASE SY-UCOMM.

MODIFY ZTECHANICALTEST2 FROM TABLE itab.

PROCESS BEFORE OUTPUT.

*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'V_CONTROL'

MODULE V_CONTROL_INIT.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_TC_ATTR.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_COL_ATTR.

LOOP AT G_V_CONTROL_ITAB

INTO G_V_CONTROL_WA

WITH CONTROL V_CONTROL

CURSOR V_CONTROL-CURRENT_LINE.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_FIELD_ATTR

MODULE V_CONTROL_MOVE.

MODULE V_CONTROL_GET_LINES.

ENDLOOP.

  • MODULE STATUS_0100.

*

PROCESS AFTER INPUT.

*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'V_CONTROL'

LOOP AT G_V_CONTROL_ITAB.

CHAIN.

FIELD ZTECHANICALTEST2-ZMANDT.

FIELD ZTECHANICALTEST2-ZMATNR.

FIELD ZTECHANICALTEST2-ZMAXQTY.

FIELD ZTECHANICALTEST2-ZNUMKB.

FIELD ZTECHANICALTEST2-ZKBUNT.

FIELD ZTECHANICALTEST2-ZCRTBY.

FIELD ZTECHANICALTEST2-ZCRTDT.

FIELD ZTECHANICALTEST2-ZUPDBY.

FIELD ZTECHANICALTEST2-ZUPDDT.

MODULE V_CONTROL_MODIFY ON CHAIN-REQUEST.

ENDCHAIN.

ENDLOOP.

MODULE V_CONTROL_USER_COMMAND.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_TC_ATTR.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_COL_ATTR.

MODULE USER_COMMAND_0100.

IF SY-SUBRC = 0.

MESSAGE I000(0) WITH 'DISPLAY'.

ELSE.

MESSAGE E001(0) WITH 'NOT DIPLAY'.

ENDIF.

WHEN CHANGE SCREEN.

LEAVE PROGRAM.

ENDCASE.

endmodule. " USER_COMMAND_0130 INPUT

&----


*& Module STATUS_0130 OUTPUT

&----


  • text

----


module STATUS_0130 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

LOOP AT CONTROL VCONTROL.

MODIFY ZTECHANICALTEST2 FROM TABLE ITAB.

PROCESS BEFORE OUTPUT.

*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'V_CONTROL'

MODULE V_CONTROL_INIT.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_TC_ATTR.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_COL_ATTR.

LOOP AT G_V_CONTROL_ITAB

INTO G_V_CONTROL_WA

WITH CONTROL V_CONTROL

CURSOR V_CONTROL-CURRENT_LINE.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_FIELD_ATTR

MODULE V_CONTROL_MOVE.

MODULE V_CONTROL_GET_LINES.

ENDLOOP.

  • MODULE STATUS_0100.

*

PROCESS AFTER INPUT.

*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'V_CONTROL'

LOOP AT G_V_CONTROL_ITAB.

CHAIN.

FIELD ZTECHANICALTEST2-ZMANDT.

FIELD ZTECHANICALTEST2-ZMATNR.

FIELD ZTECHANICALTEST2-ZMAXQTY.

FIELD ZTECHANICALTEST2-ZNUMKB.

FIELD ZTECHANICALTEST2-ZKBUNT.

FIELD ZTECHANICALTEST2-ZCRTBY.

FIELD ZTECHANICALTEST2-ZCRTDT.

FIELD ZTECHANICALTEST2-ZUPDBY.

FIELD ZTECHANICALTEST2-ZUPDDT.

MODULE V_CONTROL_MODIFY ON CHAIN-REQUEST.

ENDCHAIN.

ENDLOOP.

MODULE V_CONTROL_USER_COMMAND.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_TC_ATTR.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_COL_ATTR.

MODULE USER_COMMAND_0100.

ENDLOOP.

ENDLOOP.

endmodule. " STATUS_0130 OUTPUT

&----


*& Module STATUS_0120 OUTPUT

&----


  • text

----


module STATUS_0120 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

LOOP AT CONNTROL VCONTROL..

PROCESS BEFORE OUTPUT.

*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'V_CONTROL'

MODULE V_CONTROL_INIT.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_TC_ATTR.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_COL_ATTR.

LOOP AT G_V_CONTROL_ITAB

INTO G_V_CONTROL_WA

WITH CONTROL V_CONTROL

CURSOR V_CONTROL-CURRENT_LINE.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_FIELD_ATTR

MODULE V_CONTROL_MOVE.

MODULE V_CONTROL_GET_LINES.

ENDLOOP.

  • MODULE STATUS_0100.

*

PROCESS AFTER INPUT.

*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'V_CONTROL'

LOOP AT G_V_CONTROL_ITAB.

CHAIN.

FIELD ZTECHANICALTEST2-ZMANDT.

FIELD ZTECHANICALTEST2-ZMATNR.

FIELD ZTECHANICALTEST2-ZMAXQTY.

FIELD ZTECHANICALTEST2-ZNUMKB.

FIELD ZTECHANICALTEST2-ZKBUNT.

FIELD ZTECHANICALTEST2-ZCRTBY.

FIELD ZTECHANICALTEST2-ZCRTDT.

FIELD ZTECHANICALTEST2-ZUPDBY.

FIELD ZTECHANICALTEST2-ZUPDDT.

MODULE V_CONTROL_MODIFY ON CHAIN-REQUEST.

ENDCHAIN.

ENDLOOP.

MODULE V_CONTROL_USER_COMMAND.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_TC_ATTR.

*&SPWIZARD: MODULE V_CONTROL_CHANGE_COL_ATTR.

MODULE USER_COMMAND_0100.

endmodule. " STATUS_0120 OUTPUT

&----


*& Module STATUS_0110 OUTPUT

&----


  • text

----


module STATUS_0110 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

WHEN 'DELETE ROWS'.

CASE SY-UCOMM.

DELETE FROM ZTECHANICALTEST2

WHERE MATERIAL = 'NY'.

WHEN 'UNDELETE ROWS'.

LEAVE SCREEN.

WHEN 'SELECT ALL'.

CASE SY-UCOMM.

SELECT * FROM ZTECHANICALTEST2 INTO ITAB.

WRITE :/ ITAB.

ENDSELECT.

ENDCASE.

WHEN 'DESELECT ALL'.

endmodule. " STATUS_0110 OUTPUT