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

Similar Messages

  • Triggering a smart form from User exit

    Hi Gurus,
    I need to trigger a smart form from a user exit.
    The tcode name is COR1.there is a exit for this tocde.
    This exit should be used to trigger the smart form.
    User exit to be executed upon saving the Process order number.
    Thanks in advance.
    Edited by: vinay raj on Apr 13, 2009 9:38 AM

    Hi,
    You can write a Custom program i.e. the driver program for your smart form.
    And submit that program in the exit. i.e. use the submit statement to run that program.
    I hope this might help you.

  • 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.

  • Form inside user exit

    Is it possible to define a form (subprocedure) inside a user exit?  When I try it complains that I'm trying to define a form inside of a function.  Of course I have no choice because the whole user exit is a function.  What's the best way to work around this?

    i came to know from one of the posts here in SDN, the options are,
    1) create a custom function module and call it
    2) write ur subroutine in a report prog. and call that subroutine of that report prog.
    3) develop a INCLUDE and add it in MAIN prog.
    for more info. pls. search in SDN
    thanq

  • How to make Forms 9i User Exits run on DB server.

    We have a memory resident C programs developed in Oracle EE 7.3.4 and Dev2K (charecter based) on HP OpenVMS. Since the application is character based forms/reports - all the components are configured in one single server. There was no problem for us to write user exits and run C programs on the DB server.
    Now we want to migrate to Oracle 9i and 9iAS.
    My big question is How can we call memory resident C programs running in database server from 9iAS node. 9iAS node is separate Windows 2003 server in the 9i implementation.
    Any suggestions on how we can implement this. We understand that WebUtil runs userexits on the client PC. We need similar functionality to run on the DB server. Any ideas would be appreciated.
    Thanks in advance.

    Whoops, meant to include this:
    OS: All clients on WinXPPro. Forms are hosted in an simple open-access folder on a server running SqlServer 05 (no SharePoint yet). I'm designing the new form in Adobe Acrobat 9.2 Pro based on a Word 2007 document.
    Thanks again!

  • Create new form in user exit ZRGGBR000

    Hi everybody
    I wanted to know if we can add a new form in the user exit ZRGGBR000 or we have to use the existing ones?
    Its the first time im using that user exit and I dont quite know how to proceed
    Thanks

    sorry, may be i wrongly posted this question
    theres a form called get_exit_titles in which all the exits are listed
    I wanted to know if we can add new exits or we have to use the existing ones
    Sorry for the inconvenience

  • Help with Stock Removal User Exit

    Hello All
    To control the storage bin selection, I am using the user exit MWMTO004.  When I use the transaction LT03 to create a transfer order the system selects the storage bin selected by me.  However, when I create a transfer order through L_TO_CREATE_INT it doesnt select the storage bin chosen by me.  After debugging the code in LT03, I found out that SAP locks the bin with lock object ELLQUAX and ELLQUAY and thus prevents it from re-selecting the same bin.  Is there a way in the user exit, through which I can prevent selecting the same bin.  I would be thankful for your inputs in this regard.
    Thanks in Advance.

    Oh God, such a relief I solved it.  SAP provides a FM, L_TO_CREATE_GET_INFO, which updates the quantity that has already been picked.  The following is what I am doing to select a bin in the user exit:
    1) Clear the internal table sent to the user exit (t_qmat).
    2) Call the FM L_TO_CREATE_GET_INFO to check the quantity left in each bin.
    3) Select a bin and insert that bin as the first record of the internal table.
    Thanks
    Sunil Achyut

  • 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

  • Is discoverer  included with forms and reports ?

    Can anyone confirm whether Discoverer is included in the forms and reports server installation (10g) or does it require the full application server.
    Does it need the infrastructure database ?
    Is there a discoverer forum ? ( I can't find it )

    Kevin,
    in 10g R1 in the Forms&Reports-Installation there's only installed, what Forms and Reports need (HTTP, OIC4J, ..). Discoverer can only be installed with the full Enterprise Edition Installation which needs an infrastructure.
    This could change in future, but now there's no way around the infrastructure for Discoverer.
    By the way: Discoverer Forum is Nr. 56:
    Discoverer
    regards
    Rainer

  • Problem with HR module - user exit

    Hi
    My requirement is to have budget order checking before I save expense claims through PA30.
    Here are the step I make :
    - Transaction code PA30
    - Enter personnel no
    - Enter Info type 0015
    - Create
    - Enter wage type
    - Enter amount (BETRG)
    - Cost assignment -> enter cost  center  + oder number
    - My requirement : (Need an exit to check budget of order number)
    - Save
    Please let me know if there's exit I can use.
    Thanks,
    Melissa

    Please post this in HR FORUM.

  • Issue with BOM Exploder User exit

    Hi
    We are facing perfomance issue and for BOM Extract program
    Below are the details:
    I am trying to execute the report for range of items from and to Bom Items (The countof records is 61972).
    API used:BOMPEXPL.EXPLODER_USEREXIT
    Could you please advice us if any if any fix is avaliable Resolve this issue.
    Thanks in Advance
    Kamalakar.G

    Please post the details of the application release, database version and OS.
    We are facing perfomance issue and for BOM Extract program
    Below are the details:What is the concurrent program name?
    I am trying to execute the report for range of items from and to Bom Items (The countof records is 61972).
    API used:BOMPEXPL.EXPLODER_USEREXIT
    Could you please advice us if any if any fix is avaliable Resolve this issue.Was this working before? If yes, any changes have been done recently?
    Do you have the statistics collected up to date?
    Enable trace and submit the concurrent program again and get the TKPROF file to find out why it takes long time to run.
    Thanks,
    Hussein

  • ABEND in Java User Exit with RAW DataType

    I have a Java User Exit Extract running against a trail file that has been pumped to the GoldenGate instance in question.  The extract starts up without any issues, but gives the following error after I update a record that has a RAW datatype as the primary key:
    JAVAWRITER(javawriter.c:269) [ERROR]: Error occurred (Java exception): UEDataSource.createOperation:
    com.goldengate.atg.datasource.InvalidTransactionState: A new operation was received without first receiving a BEGIN transaction. This can happen when processing is resumed in the middle of a transaction, or when there are "before" images in the trail that are not being sent to the user exit (always include "GetUpdateBefores" in the user-exit parameter file).
    I have tried a number of things to try to resolve this, but I can't seem to make this work.  the params for this extract currently looks like this:
    extract uePump
    sourcedefs ./dirdef/my_defgen.def
    setenv (GGS_USEREXIT_CONF = "dirprm/javaue.properties")
    getupdatebefores
    cuserexit ./dirprm/libggjava_ue.so CUSEREXIT passthru includeupdatebefores
    table my_schema.B_PLN_DIR, fetchmodcols (PLN_DIR_ID, *);
    table my_schema.*;
    ... I've tried leaving off the "includeupdatebefores" argument to the cuserexit, leaving out the fetchmodcols handling for the table with the RAW PK field, but I still get the error shown above.
    Any help / pointers is much appreciated.

    includeupdatebefores (lowercase) doesn't work;  you must use the uppercase INCLUDEUPDATEBEFORES !!

  • Include or sub-routine in user-exit

    Hi all,
    i want to put  a sub-routine in my customer user-exit (CMOD).but i can not put the subroutine.
    can i put a subroutine or include statement in a user exit?
    correct answers will be rewarded.
    Thanks
    pabi

    You can make subroutine calls inside a User exit, only if the exit is part of a function pool. All the subroutines can be placed in an include in the function pool & can be called with a Perform Statement from the User Exit.
    ~Suresh

  • User exit in MV45AFZB include

    Hi experts,
    I got a requirement like this .
    To develop user exit to check if the sales order item is within warranty or not,
    And then display a message for user action.
    Background information and requirement:
    When a lift is installed, the Warranty Period is stored in the material master characteristic. If there is a replacement, then the SAP Notification will trigger a Sales Order where the user will create the sale item. During this item creation, a user exit is required to check whether this new replacement should be covered by an existing sales order item warranty (i.e whether the same part has been replaced before and within the warranty period), and the search is by the sales code (ie. The sale order item eg.DEIN material), equipment number ( as represented by the Equipment number in the technical object section in the Sales order header) and subcode (as defined in the characteristic of the item) combination. If an existing item is found and the warranty is still valid (ie.Today -  Sales Order items’s Service Rendered Date(that is manually entered by user)< Warranty Period), Then the system should display a message indicating that the sales order item should be crated in service order instead. Otherwise, prompt a message indicating that the user can continue to create the sales order item.
    Basic Logic:
    User Exit 1:
    USEREXIT_MOVE_FIELD_TO _VBKD
    1. Develop this user exit to get the Equipment Number from the Notification. The Notification number is retrieved from the Sales Order document flow.
    2. Assign the Equipment number to the Sales Order Item’s Technical Information Equipment number field.
    User Exit 2: USEREXIT_CHECK_ABAP
    After user enters Sales Order Item, It triggers the user exit USEREXIT_CHECK_ABAP that the performs the following actions.
    1. Get the current characteristic, Subcode, value, possibly using USEREXIT_GET_FIELD_FROM _SDCOM.
    2. Using the same material number, retrieve the characteristic Warranty Period in the material master classification.
    3. Using current sales order item material number and Equipment Number, get all sales order tiem in VBAP and VERIS02 where VBAP-MATNR = material number (which will retrieve the historical sales with same sales code) and EQUINO = Equipment Number.
    4. Sort list found by Sales order item’s Service Rendered Date in descending order.
    5. Repeat through this list of items until same Sub code is found.
    · Get item characteristic Subcode.
    · If Subcode = current Subcode and Today <(Service Rendered Date + Warranty Period)
    o “part is within warranty. Sales order: NNNNNN. Please create this item in Service Order as non-chargeable.
    I got these USEREXITS in MV45AFZB and MV45AFZZ includes.
    Can any one tell me what is the purpose of USEREXIT_MOVE_FIELD_TO_VBKD in MV45AFZB include
    and USEREXIT_CHECK_VBAP in MV45AFZZ include? . 
    If i write code in above includes is it work out? OR is there any other way to achieve above requirement?
    Can any one tell me Step by step process to achieve this.
    Iam new to USEREXITs.
    Points guaranteed
    cheers
    kaki

    1. You have to get a key from SAP to modify the two includes in which the user exits are present.
    2. You have to enter statement 'INCLUDE z**. ' in both user exits in the MV45* includes. Then save and activate the MV45** includes.
    3. You have to figure out the code that carries out the functionality described in your specifications.
    3. Write the code in includes Z** .
    4. Now the code written by you will be executed when you run the relevant SD transaction
    Message was edited by: Sudhir Bhate

  • How to write include in user exit userexit_save_document

    when i am trying to insert a inlcude in the exit userexit_save_document. i am getting error.
    i ahve written a statement 'include 'Zabcd' inside the user exit.
    doubl clicked on the include->system asked to create a new include-> opted for yes-> an editor came inc hange mode-> i ahve witten the statements form test. endform.
    when i am trying to activate my include 'Zabcd' ,,  ia m getting an error. "the corresponding form should have an edform"
    i cant proceed , it is beyond my imagination
    can some help me out of this situation.
    Best Regards
    Amarender Reddy B

    So you have
    FORM userexit_save_document.
    INCLUDE zabcd.
    ENDFORM.
    And your include contains
    FORM myform.
    ENDFORM.
    Include just inserts source code at the INCLUDE point, so effectively you've written:
    FORM userexit_save_document.
    FORM myform.
    ENDFORM.
    ENDFORM.
    Now do you see the problem?
    matt

Maybe you are looking for

  • TS3297 How can I get My money back for a movie i could not watch?

    I tried  to rent a movie in my Iphone 4, I could not watch it for lack of espace. I erases photos, videos, apps etc and still says NOT Enough space. What can I do? I tried to download it in my old mac and it does not do anything when you download it.

  • Claim Task: User claiming the task gets an email that task was claimed

    When a user claims a task from the group queue an email is sent that the task was claimed to the user that claimed the task... This notification is only nessecary when a task if forwarded by a collegaue. The person that gets the task then knows he pe

  • Issue in Aadobe Forms

    Dear all, As my requirement is an interactive form the fillable field of import parameter /1bcdwb/docparams has to be set to 'X'. When I do the same, it is giving the following information message 'Adobe document services error: Processing Exception

  • Gateway failed error when users are trying to loginto the portal

    Hi, when the users are trying to log into the portal, the following error msg is displaying. most of the users are facing this problem "Connect to SAP gateway failed Connect_PM TYPE=B MSHOST=abcxyz144 GROUP=GP1 R3NAME=GP1 MSSERV=sapmsGP1 PCS=1 LOCATI

  • Display values of Microsoft.IIs.PowerShell.Framework.ConfigurationElement in Powershell

    Hi all As part of my struggle to write a comprehensive script to deploy web applications to the servers of the company that I work for, I have coded a part of the script which displays the properties of the necessary application pools.  This is shown