SYNTAX Problem in User-Exit (Perform/Form)

Hi,
i use this User-Exit:
FUNCTION EXIT_SAPLAD15_010.
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(I_DLISRC) LIKE  AD01DLIA-DLISRC
*"     VALUE(I_KOKRS) LIKE  TKA01-KOKRS
*"  TABLES
*"      T_COVP STRUCTURE  COVP OPTIONAL
*"      T_COSPA STRUCTURE  COSPA OPTIONAL
*"      T_COSSA STRUCTURE  COSSA OPTIONAL
*"      T_COVPR STRUCTURE  COVPR OPTIONAL
*"      T_COSRA STRUCTURE  COSRA OPTIONAL
*"      T_V_COFP STRUCTURE  V_COFP OPTIONAL
*"      T_FMSUA STRUCTURE  FMSUA OPTIONAL
*"      T_CKF_DIP_CUSTOMER_EXIT STRUCTURE  CKF_DIP_CUSTOMER_EXIT
*"       OPTIONAL
*"      IT_OBJECTS STRUCTURE  AD01OBJ OPTIONAL
  INCLUDE ZXAD1U10.
ENDFUNCTION.
*   INCLUDE ZXAD1U10                                                   *
CASE I_DLISRC.
  WHEN '0001'. "Istkosten
    PERFORM DP90.
  WHEN '0021'. "Plankosten
    PERFORM DP80.
ENDCASE.
FORM DP80.
BREAK-POINT.
ENDFORM.                                                    "DP90
FORM DP90.
BREAK-POINT.
ENDFORM.                                                    "DP90
I get this syntax-error:
Incorrect nesting: Before the statement "FORM", the structure
introduced by "FUNCTION" must be concluded by "ENDFUNCTION
Isn't it possible to use own Forms in includes of exits?
Thanks, Regards Dieter

when you do this:
function.
  include zx
endfuncion.
include ZXAD1U10
form aaa.
endform.
the abap engine see this:
function.
  form aaa. " this is because the incorrect nesting error apperars
  endform.
endfuncion.
so, you can do two things:
1° put your include sentence in the top of the function group, not inside the exit.
2° try with dinamyc sencentes include (zx...)  perform (routine).

Similar Messages

  • Free Goods Problem and User Exit if needed in Sales Order

    Hello All,
    The problem is related to Free Goods in Sales Order which is given with an example -
    We have maintained Free Goods ( T Code - VBN1) in inclusive scenario which is as follows -
    For 210 PAC (Pack) of Material A 18 PAC Free.
    Where 1 PAC = 20 BT (Bottle) and 20 PAC = 1 CV (Case Pack)
    In the material master of Material A the Base Unit Of Measurement (UOM) = PAC and Sales UOM = Blank so that we can use any conversion factor maintained for the material.
    The conversion factors maintained for Material A are as follows -
    1 BT = 1BT
    1 PAC = 20 BT
    1 CV = 20 PAC
    Now when we are raising sales order for 11 CV the free goods are not generated in the Sale Order.
    Again if we maintain the Sales UOM in CV and raise the sales order it is showing :
    10 CV as main item and 1 CV as Free which is wrong because in the conversion factor we have already maintained 1CV = 20 PAC , Whereas in the inclusive scenario it is given 11CV = 210 PAC and 210 PAC = 18 PAC is free.So in any case it is taking into account 2 more PACs.
    Please suggest what need to be done in this case in respect of User Exit or Source Code in ABAP if needed.
    Thanks & Regards
    Priyanka Mitra

    Hello Priyanka Mitra,
    We are facing a problem same as you.
    How did you solve this problem?
    We are very glad if you teach it concretely.
    Please advise your solution to us.
    Thanks.

  • Numeric value variable problem with user exit

    Dear experts,
    I've created a variable (numeric value, user exit) and I want to get the value of variable from an user exit.
    Actually, I want to convert "0calyear" to a number to be albe to calculate (multiplying, dividing etc).
    If there is a possible solution only in FOX, the solution will be the best. However I couldn't find anything.
    So, the next solution I am trying is user-exit. But I am in stuck here.
    The problem is that I have no idea whether the numeric value variable has any sturcture like other variables(char. value) or not. If yes, what structure it has?
    I know, the characterisc value variables have the structure as blow,
        ls_varsel-chanm =
        ls_varsel-seqno =
        ls_varsel-sign  =
        ls_varsel-opt   =
        ls_varsel-low   =
    I've tried several times with the same way like above, but it doesn't work when I call the variable in "BPS0" or "UPSPL".
    How can I solve it? Please let me know.
    I am using SEM_BW 4.00.
    Many Thanks.
    Bruce

    Hi Ravi,
    Sorry, there's a correction. <b>var2 is used for getting the first month of the year selected by the user in var1</b>. If the user doesn't enter a value for var1, then var2 should take first month of current year from var1 which has by default last month of current year (populated in i_step1 from sy-datum). The user can select the value of var1 according to his requirement. Then var 2 should get first month of the year selected. That's why I'm using two exit variables.
    It works fine during the initial run of the query. But when the user clicks on the variable button in the toolbar and executes the query, var1 is not being displayed and an error message <i>No value could be determined for var2</i> is shown. All other variables used in the query are displayed except var1.
    Krzys, Is the option <i>Can be changed in Query Navigation</i>  available for Exit variables. I'll check that and get back to you.
    Boujema, Thanks for the OSS note.
    Thanks
    Hari

  • Problem with User Exit parameter in MD01

    I have done the coding for user exit in MD01. But the exit is not being triggered even when the exit key is specified in the selection screen of the transaction.
    I need to control the material being planned and restrict it to type ROH only.
    Please help me... I need to do this fast

    Hi Sultana,
    The user exit key is stored in table T450U. But the user exit parameter is not stored. Instead, it is entered in the selection screen of MD01.
    Also, You can check the following Transaction codes if they help you to solve yor problem:
    MD20 - Create planning file entry
    MD21 - Display planning file entry
    MDAB - Set up planning file entry in background
    MDRE - Check planning file entry
    Hope it helps.

  • Problem in user - Exit for VF01?

    Hi all,
    I have a requirement where i need to calucate the condition value for my billing document and pass the same value to Net value of the billing header also. Here there is no sales order in the flow.
    I am using the exit   USEREXIT_PRICING_PREPARE_TKOMK in the program RV60AFZZ . The calculation is working fine and the net value of the billing header is changing. But if click on any button on screen or saving the billing document the value is not saving and set back to 0?
    Please help me to resolve the problem?
    Thanks,
    Aravind.

    This may be because there are more than one entry points in exit USEREXIT_PRICING_PREPARE_TKOMK i.e the code written in this will be executed varoius time . SO, you need to code in such a way that desired code get executed only for your senario.
    As per my understanding , when you click your button  user exit USEREXIT_PRICING_PREPARE_TKOMK get executed and may be by initial quantity of some field and hence net quantity becomes zero.
    Check this by puutting a breakpoint in USEREXIT_PRICING_PREPARE_TKOMK and check when all it get executed and then ristrict its execution as per your need.
    Hope you get it.

  • Problem with User-exit

    Hi,
      I implemented userexit 'EXIT_SAPLEINM_001' for IDOC purpose . When i use Tr.code WE15 this userexit will be exectued. This is working fine in development server.
    The problem is with quality server. When WE15 is executed, the control is stopping at CALL CUSTOMER-FUNCTION '001'. But the control is not going into the INCLUDE  program of the exit.
    The user-exit is already in active state (checked in CMOD).
    What could be the problem?
    Points will be rewarded.
    Thank you.
    Ramesh

    Hi Satish,
       i tried doing this and also tried on different systems. Still the same problem.
    actually i implemented 2 use exits.  One is not working (as specified previously) but the other is working fine. Its allowing the control to enter into the include program. what could be the problem for the first one.
    Thank you.
    Ramesh

  • Problem with user exit MBCF0002 EXIT_SAPMM07M_001

    MBCF0002 Customer function exit: Segment text in material doc. item
    EXIT_SAPMM07M_001
    Issue: When the above user exit is activated (even without additions of custom coding), the MB31 item level free text field is not recorded upon saving. Without the user exit activated, the free text can be saved.
    1) Go to MB31.
    Enter movement type 101 and order number. Press enter.
    2) Enter quantity and click on "adopt + Details" button.
    3) Enter free text in the further information text field. Click Save.
    4) Display the material document but the entered free text is missing and not recorded.

    Hi tildveryn,
    Are you from Amtek? I was working on the similar message previously.
    Please refer to the KBA:
    https://css.wdf.sap.corp/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3135313835393226
    Hope it helps.

  • When bapi perform, user exit perform or not

    Hi,
    TCODE VA01,
    i am going to use BAPI(SD_SALESDOCUMENT_CREATE) in order to create or change sales order .
    but  there is user exit on VA01, so i want to know if user-exit execute or not  when i use BAPI on abap code.
    thanks
    venjamin.

    Hi,
    As far as i remember bapi will execute the user exit as once i tried to call the bapi in the user exit and in turn the bapi called back the user exit again. at that i used the same said bapi "SD_SALES_DOCUMENT_CREATE". and hence i changed my code accordingly
    Regards
    Satya

  • Problem with User exit variable

    We're using an user exit variable (var2) for YTD calculation (For getting the first month of current year). It gets value from another exit variable (var1) which has by default value last month of current year(populated in I_step1 from sy-datum). If the user wants he can change the default value of var1. It works fine when the query is executed the first time. But if the user calls the variable screen again, the variable screen does not show var1 in the popup and the user gets an error message that no value could be determined for var2. How can this issue be resolved or is there any other method to satisfy this requirement.
    Your help would be appreciated and rewarded.
    Thanks & Regards
    Hari

    Hi Ravi,
    Sorry, there's a correction. <b>var2 is used for getting the first month of the year selected by the user in var1</b>. If the user doesn't enter a value for var1, then var2 should take first month of current year from var1 which has by default last month of current year (populated in i_step1 from sy-datum). The user can select the value of var1 according to his requirement. Then var 2 should get first month of the year selected. That's why I'm using two exit variables.
    It works fine during the initial run of the query. But when the user clicks on the variable button in the toolbar and executes the query, var1 is not being displayed and an error message <i>No value could be determined for var2</i> is shown. All other variables used in the query are displayed except var1.
    Krzys, Is the option <i>Can be changed in Query Navigation</i>  available for Exit variables. I'll check that and get back to you.
    Boujema, Thanks for the OSS note.
    Thanks
    Hari

  • Problem with User exits when using custom fm

    Hi everybody,
    I am processing an IDoc using fm IDOC_INPUT_INVOIC_MRM. Nos I had to copy this to Z_...
    And this fm has a sun-routine that calls User-exits. When I am using the standard fm, the UEs are being checked for active and executing the logic in the UE. But when I am processing IDoc using Z_...fm, the system is checking if the UEs are active. Its also active and now the cursor is coming to CALL CUSTOMER-FUNCTION '014'. But here when I press F5 in Debug, the cursor moves to the next statement after this function call without executing the user- exits. I dont know why its not executing the UE.
    Is there any setting that I need to make?
    thanks in advance
    kris

    Hi Vamsi,
    User exits are specific to the object they are included in. So when you have a "CALL CUSTOMER-FUNCTION '011'" in IDOC_INPUT_INVOIC_MRM and when you have "CALL CUSTOMER-FUNCTION '011'" in your Z function module, they are two different things.
    The purpose of a user exit is that you can include your logic in there within the limits defined by the object and without repairing the system. If you copied it, then you don't need the user exit anymore, as that copied object is your custom object and you can incorporate anything you want within main source code itself. If you really thing you should have that user exit, then double click on the call function statement, the system will ask if you want to create the function module, say yes and proceed with the creation.
    But I don't see any reason why you will copy a standard IDOC function module(while you could have used a user exit in there) and still want to use the user exit functionality. Once you copied, it is your object and you don't need a user exit to insert code into your own object.
    Hope this is clear.
    Srinivas

  • Problem in user exit for text

    hi all
    m using EXIT_SAPLRSAP_003 to enhance one field in 0material_text  field is LVORM
    INCLUDE ZXRSAU03 .
    CASE I_CHABASNM .
      WHEN '0MATERIAL_TEXT' .
        git_mara_data[] = c_t_texts[].
        SELECT matnr lvorm                                      " table initial check not required
               FROM mara
               INTO TABLE git_mara
               FOR ALL ENTRIES IN git_mara_data
               WHERE matnr = git_mara_data-matnr .
        LOOP AT c_t_texts INTO gs_mara_data .
          READ TABLE git_mara                                   "sy-subrc check not required
                INTO gs_mara
                WITH KEY matnr = gs_mara_data-matnr .
          MOVE gs_mara-lvorm TO gs_mara_data-zzlvorm .
          MODIFY c_t_texts FROM gs_mara .
        ENDLOOP .
    ENDCASE .
    but the problem is wen i m running RSA# in debugg mode this include is not called i put break point still its not stopping dere plz lemme know where m rong

    First :
    is the exit being used:
    put a break point in the include to see if it is being used or not.
    Thenwhat is the value of I_CHABASNM - is it 0material_text or something else.
    Then if both are correct check if your exit is active and even then if it does not go into the include - see if any note exists for the same.
    Arun

  • Problem with user exit EXIT_SAPLIEDI_001 for Inbound Idocs in replacing G/L

    Hello all,
    I am currently facing an issue where my IDOC where exit EXIT_SAPLIEDI_001 is not appearing to work properly.
    Basically I am using the FM that processes the inbound idoc (IDOC_INPUT_INVOIC_FI) to post an accounting document. We needed a solution where we need to substitute one of the G/L Accounts.
    The current process in our SAP system is that we are creating a billing document which automatically generates the output type (running: program rsnasted subroutine edi_processing) to create and process the inbound idoc. 
    So I discovered FM EXIT_SAPLIEDI_001 which exports company code and G/L Account back does this.
    In this exit, Since I needed to get data from the IDOC, I used the logic ASSIGN: ('(SAPLIEDI)IDOC_DATA[]') TO <fs_edidd> to get the DATA Records for further processing.
    During the development and testing phase in the Sandbox system this works.
    However when we moved this to production we encountered a situation where the G/L account was not being substituted so were assuming EXIT_SAPLIEDI_001 is not working properly. However when I reprocess this in production either by running the idoc with errors RBDMANI2 or BD87 the IDOC is properly posted and the G/L Account is substituted as well as if I try to repeat the output type of the billing document. So there are instances when in the actual business scenario it does not work except when I reprocess it.
    I was wondering if there are any ideas why this could have happened?
    Oh ... I  also noticed when we transported the objects of the exit. When I try to double click the subroutine I made inside the exit it said the object does not exist. I had to generate the function group of FM EXIT_SAPLIEDI_001 in SE80 in production for it to reflect. I was wondering if this could have caused the issue.
    Well I hope to hear from you.
    Regards
    Edited by: Rob Burbank on Dec 6, 2011 1:03 PM

    Hi,
    Check in t.code CMOD whether project is active or not (Activate the Project)
    BR,
    Vijay

  • Problem with User exit for Purchase Order creation/change

    Hi Everyone,
    I have a requirement where I have to implement an enhancement for the standard transaction(ME21N/ME22N). I need to modify a particular field of the item table (EKPO) based on a few comparisons from the header values (After save of PO). I am using the enhancement MM06E005 and its corresponding exit  EXIT_SAPMM06E_013. While debugging I notice that the value is getting changed; but as soon as the control comes out of the FM, the change is not being reflected. Hoping to find a solution for this.
    Thanks & Regards,
    Indudhar P.G

    Hi Guys,
    Now I am using the BADI "ME_PROCESS_PO_CUST". But the control is not stopping at the method even though I set a breakpoint. It just saves the PO after I click save. Is this because my document type of PO is Stock Transfer Order. Can I use this BADI for STO's? and moreover how do I process each item line in this method. Does "ls_mepoitem = im_item->get_data( ).
    "  fetch all the item lines?
    Thanks and Regards,
    Indudhar P.G

  • What is difference between User Exits and BAPI

    hello sap gurus
    what is difference between User Exits and BAPIs

    http://www.sap-img.com/abap/what-is-user-exits.htm
    www.****************
    Where as this customer exits are again divided into:
    1. Menu Exits.
    2. Field Exits.
    3. Screen Exits.
    4. Function module exits.
    These all the things comes under Enhancements.
    User exits
    1.A user exit is a three character code that instructs the system to access a program during system processing.SXX: S is for standard exits that are delivered by SAP.
    XX represents the 2-digit exit number.UXX: U is for user exits that are defined by the user. XX represents the 2-digit exit number
    2.USER EXITS are FORMS and are called by SAP standard programs
    using PERFORM.
    3.Inside the form (user exit) you can read and change almost
    any global data from host program.
    4. User exits are more flexible because you have more information to use in your code but on the other hand , it is very easy to manipulate erroneously global data and lead the standard program to a dump or even to make database inconsistent.
    5.While changing User-exit,Access Key is required,
    BAPI is nothing function module but which is remote enabled, means you can access this fm through other SAP or non-SAP system by assingning to business object,which we can crea in SWO1 transaction.
    more details see WWW.****************
    reward if helpful

  • Commit statement in user exit

    Hi All,
    We found that while doing PGI , it takes some time to COMMIT the table VBUK. Due to which we are getting old values of VBUK-KOSTK field while executing select query at later point of time in the flow.
    My question --
    Can I use COMMIT WORK statement in user exit MV50AFZ1 --> FORM USEREXIT_SAVE_DOCUMENT so that all the related tables
    get committed immediately.
    Thanks
    Saurabh

    Hi Saurabh ,
    Normally , you shoud not specify COMMIT stmt in any user exit , badi etc..
    SAP has its own COMMIT statement while execuiting the standard transactions .
    Addition of a COMMIT might lead to problems elsewhere .
    Thanks
    Supriya

Maybe you are looking for

  • How do i connect multiple devices to itunes

    I have multiple apple devices (3 Iphones and 5 ipods) to connect to Itunes.  I can't get Itunes to recognize the independent devices.

  • Update statement not working PL/SQL block

    Hi friends, My code is written the following way: declare var1 number; var2.... Cursor c1 <select something>; Cursor c2 <select something> Begin Insert into table1 <different values>; Commit; /* first update statement */ Update table1 set table1.col3

  • .edl opening error

    hi i've got a problem when importing an .edl file in speedgrade. (when i want to add it on the timeline) here is a screenshot: http://kepfeltoltes.hu/120712/error_www.kepfeltoltes.hu_.png

  • TS3297 Unable to copy music files to iPhone

    I'm getting the msg "itunes could not copy "is this it" to the iPhone because the file could not be read or written. How do I fix this problem. I purchased this album by "the strokes" through itunes.

  • 10.4.4 crash and FileVault - Help!

    Hi there, really hope someone can help with this, I'm desperate! My iBook G4 went down, like many, after the 10.4.4 update. I get stuck on the grey apple booting screen. However I discovered i can still FTP in or SSH into a Darwin prompt from my PC o