Statement not accessible in include called in a user-exit

I am working on an upgrade project, and we receive an error 'Statement not accessible.
In the following user exit:
FUNCTION EXIT_SAPLZLWB_002.
INCLUDE ZZLWBU02 .
ENDFUNCTION.
If I go to the include, I get an the error 'statement not accessible'.
I tried to put all the code in the include between a form...endform statement,
but then I get an incorrect nesting error because the form...endform is between a function...endfunction.
How can I solve this?
Thx!
Edited by: christophe latinne on Jan 9, 2009 4:31 PM

this seems to be a clone of a standard SAP function group, and thats why you can;t access the exits here.
EXIT_SAPLZLWB_002
you can create the exits starting with Z* in order to access those at runtime.

Similar Messages

  • Statement not accessible - Syntax error

    Hi all,
    There is a form within a standard include. The form has an include within it. Its a custom include. So its an exit i suppose. Now i have a problem in the custom include. There is "statement not accessible" error. Find below the code in the custom include.
    *&  Include           ZZIMOVEKVGR4                                     *
    DATA: r_vkorg TYPE RANGE OF vkorg.
    CONSTANTS: c_z_salesorg_zzkvgr4 TYPE rvari_vnam VALUE
                                                    'Z_SALESORG_ZZKVGR4'.
    * Get the values from variant Z_SALESORG_ZZKVGR4 of TVARVC tavle
    CALL FUNCTION 'Z_FILL_RANGE_TABLE_FROM_TVARV'
    EXPORTING
    name                 = c_z_salesorg_zzkvgr4
    *   INITLINE             = ' '
    *   LINE_SEPARATOR       = ','
    TABLES
    rngtab               = r_vkorg.
    * Check for the sales orgranisation in TVARVC table
    IF vbrk-vkorg IN r_vkorg.
    * Move field Customer group 4 to KOMPCV structure
      MOVE vbrp
    ENDIF.
    Please help me understand how to overcome the same. The function module called has a select query. Does it have something to do.
    Pasting here the form that calls this include.
    FORM USEREXIT_ACCOUNT_PREP_KOMPCV.
    *  KOMPCV-zzfield = xxxx-zzfield2.
    *{   INSERT         TSTK9B000H                                        1
    * TSTK9A05ZS-Begin of changes For scr 7060
    * Only for the sale organisation S096
        INCLUDE ZZIMOVEKVGR4.                                "TSTK9A05ZS
    * TSTK9A05ZS-End of changes
    *}   INSERT
    ENDFORM.
    Thanks & Regards,
    Selvakumar M.

    Hi,
    this form in RV60AFZZ is to modify KOMPCV fields.
    I can't see any attempts to change those fields in your include.
    You can either move your code directly into form routine USEREXIT_ACCOUNT_PREP_KOMPCV, or correct your code in your include to make it work (as Sudhi told before).
    Regards.
    Klaus

  • "Statement not accessible" error in Implicit enhancement - SAPMF05A

    Hi,
      I am trying to implement Implicit Enhancement in program SAPMF05A, in module transaktions_init. When I click on Edit -> Enhancement Option -> Show implicit enhancement, it displays implicit enhancement at end of module ( after ENDMODULE) statement. When I click " Enhancement" icon, write code and it gives error statement not accessible.
    Please suggest.
    Regards,
    Priya

    You will have to put the code in a module and then call that module.
    Rob

  • Statement not accessible error in Implicit Enhancement of  SAPMPE03

    ENDMODULE.
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1 ) Include MPMKMO00, End                                                                                S
    *$*$-Start: (1)---------------------------------------------------------------------------------$*$*
    ENHANCEMENT 1 ZENH_PE03.
    MESSAGE 'hi' TYPE 'I'.
    ENDENHANCEMENT.
    *$*$-End:   (1)
    As shown above i added a line MESSAGE 'Hi' Type 'I' in the implicit enhancement portion. But it gives me error "Statement not accessible"
    Thanks

    Hi Amber,
    just in case you have to do something similar again: ABAP Code must always be between MODULE ... ENDMODULE or FORM ... ENDFORM. In the example in this post the statement
    MESSAGE 'hi' TYPE 'I'.
    is just after an ENDMODULE. statement and so this code can never be reached (or is not accessible ). The implicit enhancement option outside the existing modularization units is used to define completely new MODULEs or FORMs.
    Hope this helps!
    Regards
    Oliver

  • Statement Not Accessible for a FM

    Hi i am getting Statement not accessible syntax error at the Call Function Statement,(bold line) for the following code. Can somebody clarify me why this is happening. Thanks in advance.
    PROGRAM ZHR_FEATURE_RLPGR .
    TABLES : PERNR.
    TABLES : T74HG,  PSKEY, T5UB3, T5UB9, T5UBT, T5UBA .
    infotypes:0001,0021.
    CALL FUNCTION 'EXIT_SAPLHRBEN00FEATURE_029'    
      EXPORTING
        _PERNR                 = PSKEY-PERNR
        _BEGDA                 = PSKEY-BEGDA
        _ENDDA                 = PSKEY-ENDDA
        _BAREA                 = T5UB3-BAREA
        _BENGR                 = T5UBT-BENGR
        _BSTAT                 = T5UB9-BSTAT
        _BPLAN                 = T5UBA-BPLAN
        _SUBTY                 = PSKEY-SUBTY
        _OBJPS                 = PSKEY-OBJPS
    IMPORTING
       _RLPGR                  = T74HG-RLPGR
       EXCEPTIONS
       EVALUATE_FEATURE       = 1
       CUSTOMER_ERROR         = 2
       OTHERS                 = 3

    Hi,
    Try with as below.
    CALL FUNCTION 'EXIT_SAPLHRBEN00FEATURE_029'
      EXPORTING
        _pernr                 =
        _begda                 =
        _endda                 =
        _barea                 =
        _bengr                 =
        _bstat                 =
        _bplan                 =
        _subty                 =
        _objps                 =
        iscobra              =
        _nontx                 =
    IMPORTING
      _RLPGR                 =
    EXCEPTIONS
      EVALUATE_FEATURE       = 1
      CUSTOMER_ERROR         = 2
      OTHERS                 = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Ram.

  • Statement not accessible error - Any ideas please.

    Hello all:
              We were using macro from TRMAC table in 4.6C version and it used to give a warning but after upgrading to ECC6.0 it is syntax error! Please look at the code below:
    *SELECTION SCREN / PARAMETERS                                          *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-s01.
    PARAMETERS: p_mode(1) TYPE c DEFAULT 'N' OBLIGATORY,
                p_grp     LIKE apqi-groupid DEFAULT 'SKF_POST' OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN SKIP 1.
    unix_pc_path text-001 text-002 text-003.
    *Intialization                                                         *
    *INITIALIZATION.
    *At selection screen                                                   *
    AT SELECTION-SCREEN OUTPUT.
      PERFORM format_unixpath(yunixctrl) USING 'YHOME_UX' yhome_ux.
    AT SELECTION-SCREEN.
      IF ( rdb_pc = 'X' AND yhome_pc IS INITIAL ) OR
         ( rdb_ux = 'X' AND yname_ux IS INITIAL ).
        MESSAGE e000 WITH 'A filename is required'.
      ENDIF.
    AT USER-COMMAND                                                      *
    AT USER-COMMAND.
    *Start-of-selection                                                    *
    START-OF-SELECTION.
      IF NOT rdb_ux IS INITIAL.
        unix_getname yhome_ux yname_ux v_file_in.
        PERFORM upload_parse_unix_file.
      ELSEIF NOT rdb_pc IS INITIAL.
        v_file_in = yhome_pc.
        PERFORM upload_parse_pc_file.
      ENDIF.
      PERFORM skf_posting.
    *End-of-selection                                                      *
    END-OF-SELECTION.
    The program does not like the line "unix_pc_path text-001 text-002 text-003." and gives an error "Statement not accessible". I went through some discussion forums on this here but nothing related to macro. Could anyone please give me an idea how I could resolve this? All the answers will be rewarded.
    Thanks.
    Mithun

    You cannot put it in START-OF-SELECTION a you need the unix path in the
    AT SELECTION-SCREEN FOR OUTPUT event.. move the statement from the selection-screen block to the INITIALIZATION event.
    ~Suresh

  • " Statement not accessible"

    Hi all
    there is an error  for the below statemnt
    APPEND 'Techn.Platz' TO it_fieldnames.
    " Statement not accessible"
    Thanks
    Protyusha

    Hi Protyusha,
    It seems that you are trying to append the complete line of a tabel with this 'Techn.Platz' . Instead you provide the field name that you are trying to append
    For ex:   it_fieldnames-fieldname.
    If still you are not clear then send me the complete code I will explain you in detail.
    Regards,
    Md Ziauddin

  • IPC Pricing with AP 7.00 Database Access/Call function module user-exit

    Hi experts,
    we are running SAP ECO on SAP ECC 6.0 with IPC Pricing AP 7.00 running in the VMC.
    I'm facing a new requirement. In an user-exit for requirements the access to the ABAP database is needed.
    (I know that the SAP recommendation is, don't have access to database. But we need this functionality)
    In ABAP it looks like:
    select single * from  a590
          into     LH_674_a590
          where    kappl  = 'V'
          and      kschl  = 'ZSPR'
          and      kunnr  = komk-kunnr
          and      matnr  = komp-matnr
          and      datbi  >= komk-prsdt
          and      datab  =< komk-prsdt.
    Is there a possibility to implement the same SELECT in the Java-User-Exit?
    Is there maybe the alternative to call a function module instead?
    The database exits on the same application server on which the VMC runs.
    If there is a possiblity can anyone provide me with sample coding or give an advice where to find samle coding?
    I would prefer to call a functions module.
    Thanks in adcance
    Karl-Wilhelm

    Hi Shanto & Sumit,
    Thanks for the inputs.
    as per my understanding of the log
    java.lang.IncompatibleClassChangeError: com.sap.leasing.pricing.tools.LeasingPricingTools: method getPricingConditionByConditionTypeName(Lcom/sap/spe/pricing/transactiondata/userexit/IPricingItemUserExit;Ljava/lang/String;)Lcom/sap/spe/pricing/transa ctiondata/IPricingCondition; used to be stati
    error is thrown by the SAP standard user exit and because of which execution is failing in customer user exits and surprisingly we have not made any changes in both of them.
    this was working earlier before upload.could this be because of the jar packaging.
    how i can download the standard user exit com.sap.leasing.pricing.tools.LeasingPricingTools from crm
    for further investigation.
    Thanks,
    Siddharth

  • Call BDC in User Exit?

    Hi,
    Is it possible to call BDC in User Exits? Requirement is to update cusotmer master using by CALL TRANSACTION that called from a user exit.
    How to know the user exit name, If I already know the function module name and include name?
    Ex: Include - ZXVSVU02.
    Function Module - EXIT_SAPLVV02_001.
    <removed by moderator>
    Edited by: Thomas Zloch on Jun 8, 2010 12:44 PM

    Hi,
    Have you tried calling BDC through module pool program? if its going to wotk there, sure u will get it done from user exist......
    I have worked it through module pool.......all the best for ur try.....
    Kalyan

  • Call an applications 'user exit' from a PL/SQL procedure

    My question is a technical PL/SQL question related to Oracle Applications. I need to call a standard applications 'user exit' from a stored PL/SQL procedure. Can anyone tell me if this is possible and how to do it?
    (i.e. I am attempting to call the AR user exit SALESTAX)
    Thanks,
    Michelle Dodge

    Hi,
    Read this thread, perhaps is there your response :
    Host...
    Nicolas.

  • Statement not accessible error

    Hi, we have upgraded the project from 46c to ecc version.
    In one standard include MV45AFZZ , one statement is added  IMPORT itab1chk FROM MEMORY.
    In MV45AFZB , the value for itab1chk is getting exported.
    In 46c , we r not getting any error when we run the VA01 transaction.
    But in ECC, this transaction going for Dump giving error 'The statement is not accessible ' referring to the statement IMPORT itab1chk FROM MEMORY which is in MV45AFZZ include.
    I tried by adding ID <KEY> to the IMPORT AND EXPORT statement. But still getting same error.
    Can any one please suggest the solution.
    Thanks,
    laks.

    Hi,
    You get this Error normally when you are doing a syntax check on the Includes in which the code lines are not between FORM and ENDFORM.
    I dont think this is a serious error atleast till 4.7 as the system will allow you to activate the Include. May be the ECC is a bit more stringent on this issue.
    I think your problem will be solved if you try to include all the code lines only in the FORM and ENDFORM.
    regards,
    Mahesh

  • Include with form in user-exit

    Hello everyone,
    I am trying to put an include which contains a form routine into a user-exit include . My include source activates normally by itself but when i try to activate the user-exit include which contains my custom include i am getting the error " Incorrect nesting: Before the statement "FORM", the structure introduced by "FUNCTION' must be concluded by "ENDFUNCTION"  "
    Any ideas on how i can fix that?
    Regards,
    Huseyin

    Hi Huseyin,
    userexits are done by filling an include which itself is source code of the function module. If you want to do some structurized programming, you should copy the EXIT function to customer name space and to your own function group. Then, in  the include, you call your own function passing exactly the parameters of the EXIT function.
    Then you are free to create includes, forms, data, objects,... whatever you want to achieve structured functionality.
    Sample code:
    *& Include.: ZXTRKU12                                                  *
    * new functionality sourced out to new function module
      call function 'Z_EXIT_SAPLV55K_004'
        importing
          processing_protocol = processing_protocol
        tables
          idoc_data           = idoc_data
        changing
          idoc_control        = idoc_control
        exceptions
          idoc_error          = 1
          do_not_process_idoc = 2
          others              = 3.
      case sy-subrc .
        when 0.
          exit.
        when 1.
          raise idoc_error.
        when others.
    * Can't raise OTHERS -> 2 AND Others handled in common
          raise do_not_process_idoc.
      endcase.
    Here we created a new function group ZXTRK for the exit function group XTRK. We copied function EXIT_SAPLV55K_004 to function z_exit_saplv55k_004. In our case, we created 22 form includes and one top include because our programming guidelines require an include for each form.
    The rest shoud be crystal-clear. If not, feel fre to ask for details.
    Regards,
    Clemens

  • Calling a std user exit from a user defined user exit

    hi
    I have a standard User Exit. I want to call it from a User Exit created by me something like zaaabbbb.
    Can you please tell me the procedure how to do it ?

    Hi,
    If the user exit is a Z include in a function module then you can call the function module like any other function module passing the required parameters. For example CALL CUSTOMER-FUNCTION '002' in transaction VA01 corresponds to function module EXIT_SAPMV45A_002. You can call this function module like you do any other function module.
    CALL FUNCTION 'EXIT_SAPMV45A_002'
      EXPORTING
        i_tvak        =
        i_tvta        =
        i_vkgrp       =
        i_vkbur       =
    * IMPORTING
    *   E_KUNNR       =
    If the user exit is a subroutine in an include in SAP name space (For example subroutine userexit_delete_document in include mv45afzz), then find out the main program in which the include is included (for example mv45afzz is included in program sapmv45a). Once you have done that you can using the following statement to call the subroutine.
    PERFORM <subroutine name> IN PROGRAM <program name>.
    For Examaple
    PERFORM userexit_delete_document IN PROGRAM sapmv45a.
    Please make sure that you use the main program name (In our example sapmv45a) and not the include name (in our example mv45afzz).

  • Syntax error on include of Function Module (user exit)  EXIT_SAPLRSAP_002

    When I do a syntax check in the a routine within inlude ZXRSAU02 of FM EXIT_SAPLRSAP_002, I get an error.  This object has been in production so I must be doing the syntax check incorrectly. The error is 'Field i_t_data is unknown. It is neither in one of the specified tatble nor defined by a 'DATA' statement.  This is strange because this field is defined in main body of this user exit.   Please advise the correct way to do syntax check.  
    Thank you.

    Hi,
    The reason for this might be, though it is used in main body- check the main body is not in the routine. Check the field is declared globally, if not try to check the field assigned to what type, & try to re-assign to same one(like your target place where to update the values, continue to Declare& add accordingly.)
    - Dileep .C

  • Hr_infotype_operation errors when called within a user exit

    Hi there.
    I am doing an enhancement in userexit PBAS0001 for CE using the enhancement framework.Whenever I am trying to change the payroll area in IT0001 by PA30 it has to give a message saying that 'all the assignments will change to new payroll areas do you want to continue?'if i say yes then the payroll areas for all the assignments should be chnaged to the current payroll area which I am trying to change.So after the pop up I am looping at all the assignments and calling the function module hr_infotype_operation.It gives an error Complex Application error.I debugged and saw that when it calls the function module the user exit gets triggered again and goes to the starting within the function call and hits the function module again and keep going like this.I checked the structure and all the parameters.looks fine below is the code where I am using the function module.I am trying to update IT0001 when somebody tries to change the IT0001(is that an issue??) i tried by submitting a program by calling the function module in the program.Didnt work too.Is there any way we can do it by BDC??
    Check if the payroll areas are equal
        IF ls_i0001-abkrs NE new_p0001-abkrs.
    If the payroll areas are not equal then generate a message pop-up with 'YES' and 'NO' buttons
          CALL FUNCTION 'POPUP_TO_CONFIRM'
            EXPORTING
              titlebar       = 'Warning'
              text_question  = 'Payroll Area specified is different with other assignments.Do you want to move all the other assignments to the same payroll area?'
              text_button_1  = 'Yes'
              icon_button_1  = ' '
              text_button_2  = 'No'
              icon_button_2  = ' '
              default_button = '1'
              start_column   = 25
              start_row      = 6
            IMPORTING
              answer         = lv_case
            EXCEPTIONS
              text_not_found = 1
              OTHERS         = 2.
          CASE lv_case.
            WHEN '2'.                                 "For 'NO' button
              LEAVE TO SCREEN '2010'.
            WHEN 'A'.                                 "For 'CANCEL' button
              LEAVE TO SCREEN '2010'.
            WHEN '1'.                                 "For 'YES' button
    Second Pop-up confirm
              CALL FUNCTION 'POPUP_TO_CONFIRM'
                EXPORTING
                  titlebar              = 'Warning'
                  text_question         = 'System will update all other assignments to the new payroll area'
                  text_button_1         = 'Yes'
                  icon_button_1         = ' '
                  text_button_2         = 'No'
                  icon_button_2         = ' '
                  default_button        = '1'
                  display_cancel_button = 'X'
                  start_column          = 25
                  start_row             = 6
                IMPORTING
                  answer                = lv_case1
                EXCEPTIONS
                  text_not_found        = 1
                  OTHERS                = 2.
              CASE  lv_case1.
                WHEN '2'.                             "For 'NO' button
                  LEAVE TO SCREEN '2010'.
                WHEN 'A'.                             "For 'CANCEL' button
                  LEAVE TO SCREEN '2010'.
                WHEN '1'.                             "For 'YES' button
    For all the assignments read the infotype 0001 and update the payroll area
                  LOOP AT lt_pernr INTO ls_pernr.
                    CLEAR:lt_i0001,ls_i0001.
                    REFRESH lt_i0001.
                    CALL FUNCTION 'HR_READ_INFOTYPE'
                      EXPORTING
                        tclas           = 'A'
                        pernr           = ls_pernr
                        infty           = '0001'
                        begda           = new_p0001-begda
                        endda           = new_p0001-endda
                        bypass_buffer   = 'X'
                      IMPORTING
                        subrc           = lv_subrc
                      TABLES
                        infty_tab       = lt_i0001
                      EXCEPTIONS
                        infty_not_found = 1
                        OTHERS          = 2.
                    SORT lt_i0001 BY endda DESCENDING.
                    READ TABLE lt_i0001 INTO ls_i0001 INDEX 1.
                    ls_i0001-abkrs = new_p0001-abkrs.
                   lv_record = ls_i0001.
    Lock the employee
                      CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
                        EXPORTING
                          number = ls_i0001-pernr
                        IMPORTING
                          return = lv_return.
                      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
                        EXPORTING
                          infty         = '0001'
                          number        = ls_i0001-pernr
                          validityend   = '12302006'
                          validitybegin = '12012006'
                          record        = ls_i0001
                          operation     = 'INS'
                         IMPORTING
                          return        = return.
    *unlock the employee
                      CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
                        EXPORTING
                          number = ls_i0001-pernr
                        IMPORTING
                          return = lv_return.
                   SUBMIT zhr_infotype_operation_py_area USING SELECTION-SCREEN '1000'
                   WITH p_infty  = '0001'
                   WITH p_pernr  = ls_i0001-pernr
                   WITH p_endda  = new_p0001-endda
                   WITH p_begda  = new_p0001-begda
                   WITH p_record = lv_record
                   WITH p_opera  = 'INS'
                   WITH p_tclas  = 'A'
                   AND RETURN.
                  ENDLOOP.
              ENDCASE.
          ENDCASE.
    ENDIF.

    maybe a little late, but I had found this message today (searching for different problem) but maybe the date for HR_infotype_operation might do a little problem, cause you are filling it with: DDMMYYYY but it should be YYYYMMDD so it just translate it that this is really far in the past so that might be a problem. Try sy-datum instead and for the end of validity try '99991231' dont worry, when you will update the same infotype again, the FM will end the previous infotype to previous day and the new one will get validity from sy-datum till the end ....

Maybe you are looking for

  • Photo Stream (via iCloud) is no longer working on PC -- w/o system changes

    Photo Stream (via iCloud) worked great on my Windows PC a week ago.  Suddenly it's stopped entirely.  When I attempt to open it, I get an error message that says that "Photo Stream is not enabled" and that I should go to the iCloud Control Panel.  Wh

  • Regarding parallel queries in ABAP same as in oracle 10g

    Hi,    Is there any way we can write parallel queries in ABAP, in the same way we do in oracle 10g.Kindly see below; alter table emp parallel (degree 4); select degree from user_tables where table_name = 'EMP'; select count(*) from emp; alter table e

  • I want to update SAP standard tables

    Hi, I want to update SAP tables using BAPI. can you please suggest me how can i do this and which BAPI i should use for that purpose. I want to update KNVV , FKKMAKO , FKKVKP table.

  • Why is this happening? pixellated screen, not rebooting

    This all it is seem to do. Day and Night. Doesnt reboot, doesnt do anything else. Doesnt charge. Randomly this happened. Explain someone please?

  • License fees for commercial use

    Hello everyone, We are developping a software that uses JDK. I would like to know if there will be any fees to give to SUN when we sell the software or if it's a just a contract. I would appreciate the advise of someone who sold a software using JDK