Skip to Content
author's profile photo Former Member
Former Member

Regarding Include

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2005 at 04:06 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 16, 2005 at 03:49 AM
    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2005 at 10:00 PM

    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?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.