Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Include

Former Member
0 Kudos

hai

I cannot write "Form" module in INCLUDE program and access inside the Module program.why

could you pls help.

PROGRAM ZMW00M0010.

INCLUDE ZMW0010010.

inside include prg i wrote small FORM ..ENDFORM and

tried to call from Main Module pool program ZMW00M0010.

Chandra kumar

4 REPLIES 4

Former Member
0 Kudos

Chandra, it's important that inside your main program you call your include.

for example:

PROGRAM ZMYPROGRAM.

INCLUDE ZMW0010010.

  • now, you must call your rutine that's inside your include,

PERFORM MY_RUTINE.

The my_rutine it's inside the include with a

form my_rutine.

endform.

Former Member
0 Kudos

Could you post additional details for us to look at?

What kind of error did you get?

Has everything been activated?

If you move the FORM to the main program can you call it?

Former Member
0 Kudos

HAI
PROGRAM ZMW00M0010. * Main module program type M
INCLUDE ZMW0010010. * data declaration type I
*INCLUDE ZMW0010020. * PBO module program type I
INCLUDE ZMW0010040. * Subrouting program type I


In ZMW0010010, data declaration.

DATA: FIELDS_LINE TYPE SVAL,
      FIELDS_ITAB LIKE TABLE OF FIELDS_LINE.

In ZMW0010040,Inside Subrouting program i wrote

FORM TP_GETDATE.
FIELDS_LINE-TABNAME = 'ZMW0001'.
  FIELDS_LINE-FIELDNAME = 'IMPORTDAY'.
  FIELDS_LINE-VALUE = SY-DATUM.
*  FIELDS_LINE-FIELD_ATTR =
  FIELDS_LINE-FIELD_OBL = 'X'.
*  FIELDS_LINE-COMP_CODE =
  FIELDS_LINE-FIELDTEXT = '移送反映日'.
*  FIELDS_LINE-COMP_TAB =
*  FIELDS_LINE-COMP_FIELD =
*  FIELDS_LINE-NOVALUEHLP =
  APPEND FIELDS_LINE TO FIELDS_ITAB.
  CALL FUNCTION 'POPUP_GET_VALUES'
    EXPORTING
*     NO_VALUE_CHECK        = ' '
      POPUP_TITLE           = 'testpopup'
*     START_COLUMN          = '5'
*     START_ROW             = '5'
*   IMPORTING
*     RETURNCODE            =
    TABLES
      FIELDS                = FIELDS_ITAB
   EXCEPTIONS
     ERROR_IN_FIELDS       = 1
*     OTHERS                = 2
            .
  IF SY-SUBRC <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.

In Main PROGRAM ZMW00M0010,
PROGRAM ZMW00M0010. * Main module program type M
INCLUDE ZMW0010010. * data declaration type I
INCLUDE ZMW0010040. * Subrouting program type I

Inside user command
MODULE MAINUSER_COMMAND_0100 INPUT.
SAVE_OK = OK_CODE.
  CLEAR OK_CODE.
  CASE SAVE_OK.
  WHEN 'BACK'.                 "&#21069;&#30011;&#38754;
    SET SCREEN 0.
  WHEN 'CANCEL'.               "&#20013;&#27490;
    LEAVE PROGRAM.
  WHEN 'EXIT'.                 "&#32066;&#20102;
    LEAVE PROGRAM.
  ENDCASE.
  CASE SY-UCOMM.
    WHEN 'FU01'.
    PERFORM TP_GETDATE.
    CALL SCREEN '200'.

ENDMODULE.

I tried compiling individual programs it gives below error

"STATEMENT is INACCESSIBLE"

Could you pls tell why this error occurs.

Chandra kumar

0 Kudos

You need an ENDCASE statement:

CASE SY-UCOMM.

WHEN 'FU01'.

PERFORM TP_GETDATE.

CALL SCREEN '200'.

<=== need ENDCASE here

ENDMODULE.

Try adding that and let us know what happens.

Message was edited by: Charles Folwell

You will also need to define OK_CODE and SAVE_OK.