Include program gives a syntax error

Hello experts,
I have a code piece as follows:
REPORT  z_obj_emp.
INCLUDE z_class_emp.
z_class_emp is another z report.
When I compile the report z_obj_emp, I get an syntax error:
"Each ABAP program can contain only one "REPORT", "PROGRAM", "FUNCTION-POOL" statement."
Could you please help me out to rectify this issue?
Thanks,
Mohit.

Hello Sachin,
Thanks for the reply. I have done as you have mentioned. Now when I execute the report z_obj_emp,
I get a syntax error at the line:
create object obj_emp.
It says: "Statement is not accessible."
The whole code of z_obj_emp is:
REPORT  Z_OBJ_EMP.
INCLUDE Z_CLASS_EMP.
data: p_name type string,
      p_designation type string,
      obj_emp type ref to c_employee.
create object obj_emp.
p_name = 'EMP1'.
p_designation = 'ACCOUNTANT'.
call method obj_emp->set_attributes exporting
                     im_name = p_name,
                     im_designation = p_designation.
call method obj_emp->display_attributes.
call method c_employee=>display_count.
The code of include z_class_emp is:
*&  Include           Z_CLASS_EMP
class c_employee  definition.
defining the access specifiers.
  public section.
    constants: position type i value 30.
parameterized method
    methods: set_attributes importing im_name type string
                                      im_designation type string.
method
    methods: display_attributes.
static method.
   class-methods: display_count.
  private section.
    data: name           type string,
              designation type string.
static variable.
   class-data: st_count type i.
endclass.
class Implementation
class c_employee  Implementation.
presenting the logic the methods.
   method set_attributes.
     name               = im_name.
     designation     = im_designation.
     st_count          = st_count + 1.
   endmethod.
   method display_attributes.
     write: / 'Name of Employee: '(001), at position name.
            / u2018Designation:'(002), at position designation.
   endmethod.
  method display_count.
   write: / 'Total Number of Employees ',
                         at position st_count left-justified.
  endmethod.
endclass.
Could you please let me know what the problem is now?
Thanks,
Mohit.

Similar Messages

  • Program ZRFI_RFFOBR_U contains syntax errors

    Hi Gurus,
    While maintaing varaint for program ZRFI_RffoBR_U in App - we got the error "Program ZRFI_RFFOBR_U contains syntax errors" can anyone help us waht could be the reasons. Actually our client is doing regression testing

    Hi,
    It's a 'Z-program' (self-developed). If you are not familiar with ABAP, ask your ABAP team to check it.
    Regards,
    Eli

  • Tween/Transition import code gives a syntax error

    Basicly, I'm using Tweens and transitions, and am having
    trouble making them appear in some parts.
    On a multipage website, pasting in the code:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    Gives me a syntax error for where the two lines appear. -
    This will make any transitions and tweens not appear (the two lines
    above need to be commented out for it to compile). However, when a
    page is loaded that contains the code (and gives no syntax error),
    the transitions and tweens in the first movie as well as the loaded
    clip all work fine.
    What would cause a synax error when trying to use the import
    code?
    The actual site itself you can see in progress at
    http://cressaid.brettjamesonline.com/us
    . The drop down menus just appear, until you load either the logos,
    corporate id or brochures section in folio. Then they smoothly roll
    down

    SuperRoach,
    > I think I found the solution - which was to use
    Actionscript 2.0
    > in the publish settings. This got rid of the error, and
    made it
    > work fine.
    Yes, that makes sense, then. You can look up these classes
    and
    keywords, by the way, in the ActionScript 2.0 Language
    Reference and
    Components Language Reference. Both sets of documentation
    indicate the
    availability of everything you look up. For example, the
    "import statement"
    entry says:
    Availability: ActionScript 2.0; Flash Player 6
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • ICR: program FBICRC_GENERATE_CUST with syntax error

    Hi,
    in our Development system, the auto config program for ICR "FBICRC_GENERATE_CUST" is not working due to syntax error. It works in testsystem and productive system but not in development.
    Anyone experienced the same issue i.e. short dump when running FBICRC_GENERATE_CUST ?
    The following syntax error occurred in program "FBICRC_GENERATE_CUST " in
    include "FBICRC_GENERATE_CUST_F03 " in
    line 51:
    "The data object "LS_FBICRC01000" does not have a component called "HID"
    "E_DCURR"."
    Error analysis
        The following syntax error was found in the program FBICRC_GENERATE_CUST :
        "The data object "LS_FBICRC01000" does not have a component called "HID"
        "E_DCURR"."
    Thanks
    Stephane
    TRIUMPH ASIA

    HI  Eli,
    actually the problem only occurs after we implemented OSS note 1172591 with the SAP delievered transport P3EK049760
    So before having this transport: FBICRC_GENERATE_CUST  works fine
    AFTER the transport P3EK049760 contained in OSS note 1172591  -> syntax error.
    The field "hide_dcurr" is missing in table FBICRC01000
    Cheers
    Stephane

  • IOS developer program gives "An unknown error occurred. Please try again." on registration.

    Hi,
    I am trying to register in iOS developer program but it gives "An unknown error occurred. Please try again.".
    I tried different browsers (Google Crome, firefox, IE, safari), I also tried registering from iPad but the same error occured, I am trying this from 1st April, but it still not resolved.
    Also the country is showing blank, hence I am not able to select the state. (I am from India).
    Please help, thanks in advance.

    I had the same issue (from United Kingdom), fixed this by inspecting the page and changing the country input type from 'hidden' to 'text' and manually entering 'United Kingdom' in the text field.
    Country still displays as blank on the next page, but I'm able to proceed past that without the error.

  • Jdbc program gives unsupported classVersion error at runtime

    Hello Dear Friends, I have writter a simple java application which fetches some rows from a simple table. I can compile the code without any erros, but while at runtime it gives some error saying that UnsupportedClassVersionError. Please help me. I'm using Access database, here is the code. Please help me, I'm totally stuck and your help is appreciated, regards, Raasi
    import java.sql.*;
    public class TestJdbc {
    public static void main(String[] arg) {
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:mmall", "","");
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("select name, age from details;");
    while(rs.next()) {
    String s = rs.getString("name");
    int n = rs.getInt("age");
    System.out.println( s + "'s age is :" + n);
    } catch(Exception e){
    System.out.println(e.getMessage());
    }and the error I get on the console is like this....
    C:\Miraclejava>java TestJdbc
    Exception in thread "main" java.lang.UnsupportedClassVersionError: TestJdbc (Uns
    upported major.minor version 49.0)
            at java.lang.ClassLoader.defineClass0(Native Method)
            at java.lang.ClassLoader.defineClass(Unknown Source)
            at java.security.SecureClassLoader.defineClass(Unknown Source)
            at java.net.URLClassLoader.defineClass(Unknown Source)
            at java.net.URLClassLoader.access$100(Unknown Source)
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    C:\Miraclejava>

    It has nothing to do with JDBC.
    As a guess you are running the MS VM instead of the sun one.
    When you type the following it MUST give you a version number. If it gives you nothing then you are running the MS VM.
    java -version

  • Include program for script dump error in data type

    Hi i  have written following subroutine for script.
    FORM WITHHOLD TABLES in_tab STRUCTURE itcsy
                         out_tab STRUCTURE itcsy.
    data:     a_SKFBT  TYPE REGUP-SKFBT,
         A_DMBTR  TYPE REGUP-DMBTR,
        W_TAX1(18) TYPE REGUP-SKFBT.
    read table in_tab WITH KEY NAME = 'REGUP-SKFBT'.
    read table in_tab INDEX 1.
    check sy-subrc = 0.
    a_SKFBT = in_tab-value.
    read table in_tab WITH KEY NAME = 'REGUP-DMBTR'.
    read table in_tab INDEX 2.
    check sy-subrc = 0.
    a_DMBTR = in_tab-value.
    W_TAX = ( a_SKFBT - a_DMBTR ).
    read table out_tab with key name = 'W_TAX1'.
    IF SY-SUBRC = 0.
    out_tab-value = W_TAX1.
    modify out_tab INDEX 1.
    ENDIF.
    ENDIF.
    endform.
    above program is giving dump .
    while deduction values in w_tax .
    what type of variables i shold take here..

    Hi Venkat,
    Your declaration for the tax variable is wrong. When you have specified a table field there is not any need to mention the number of characters for that variable.
    Simply declare as W_TAX type REGUP-SKFBT and
    W_TAX1(16) type c.
    After computing W_TAX, Move W_TAX to W_TAX1.
    Regards,
    Anil

  • Program giving syntax error in Production client

    Hi Experts,
                I have moved an object into testing client its working fine there,but when it was moved from testing to production client.
                they are getting the error as "program ZSIOPCN contains syntax errors", when they are trying to create a variant in SE80 for this program from menu goto-->variants.
                Can anyone give any idea why this error comes, when the program is working fine in Quality client. Please give me suggestions,why it may happen.
    all answers will be rewarded, Thanks in advance.
    Thanks & Regards,
    Poorna.

    hi Rodrigo Paisante,
               i didn't understand the point "one or more objects wold be moved too", means moving the same object many times.
               we generally move the workbench requests in a sequence, in which they released. This transport sequence is follwed in the same sequence when moving from one client to another client.
               can you eloborate the solution and possible cause for this problem. i am getting message error DB: 242.
    Thanks,
    Poorna

  • Syntax Error when generate print program in HRFORMS

    Dear All,
    I created form for payslip using HRFORMS, the name form is ZPS_TPI_01. When I activate the form, the error raised: Generated print program contains a syntax error
    Diagnosis
      Generated print program /PYXXFO/ZPS_TPI_01_PRNT conains a syntax error in line 9 of include /PYXXFO?ZPS_TPI_01_PAYR.
    I have already apply note 878168 but it is not work.
    Please advise me.
    Thank you,

    hi,
    can you let me know for which country  are you trying to generate the HR form for payslip?
    There are certain countries for which payslip isnt supported.
    For such countries you get a similar error.
    Thank you,
    Jose

  • Merged dimension gives #syntax error

    Hi everybody,
    i have a simple report that contains 2 query.
    i merged two dimensions and everything looks like fine.
    but when i just refresh the query it gives me syntax error;
    bo system : 4.1 sp3 and both of queries are bex queries.any suggestion please.

    Hi Veer,
    1) same behaviour with Applet as well as web mode
    2) No
    3) I created a webi report, added two bex queries, Country Code is the common dimension which I'm trying to merge. Once both BEx queries are freshed and the objects from both queries are available in in the report to choose from, I try to merge them Country Code, however the merge option isn't even available (i.e. it does not allow merging by selecting objects or choosing the merge from the menu). As a work around I pull the Country code in the report pane from each query as a seprarate objects, ( i notice Country code object from Query one has the values while the Country Code from the second query has the #TOREFRESH, although both query were refreshed at start).
    Since both Country Code objects are on the report cavas, I refresh both queries again. Now I see the values in both objects. Now if I select the Country code from the left hand panel it allows merging. After merging, I drag the new merage counry code on the report Cavas i see the combined values (so far so good). Next I refresh the report again and magically the merged objects is disappeared from the report canvas and the #SYNTAX erro is it remains there.
    As I said, I am using 4.1 with Sup Pak 3, build 1257.
    Any help would be appreciated.
    Regards
    WAK

  • Syntax error in programs-list

    Hi experts,
    I wanted to know the number of programs which had syntax error in production during certain period.
    is there any program/transaction/table to track this apart from ST22?

    ST22 or SM21 are your only options.  If they're cleared down regularly, then the data has gone. If they're archived, check the archive.
    You could write a program that monitors for syntax errors.  But it couldn't work before the time it was written.
    Now, the big question. Why are you getting syntax errors in your productive system?!  This should be a very rare event - or do simply mean programs that dump?
    matt

  • Syntax error in program - update failed in MIRO

    Hi All,
    I was trying to post invoice in MIRO in sandbox. When I tried posting the document i get an update failure message.
    There  is a corresponding dump - syntax error. the error is as follows:
    The following syntax was found in the program SAPLZGFI_MRM_ENTRY_RAP. " The field "GT_RSEG" is unknown, but there is  a field  with the similar name "T_RSEG".
    I am a Basis admin and I am not much aware of ABAP Development. So please let me know what I could do to remove this. I can try the solution as htis is sandbox.
    Thanks and REgards,
    Raghavan

    Hello Raghavan,
    "GT_RSEG" and "T_RSEG" will be treated as two different internal tables. If "GT_RSEG" is not declared but still used in the program then program will throw syntax error as given by you.
    Please check if "GT_RSEG" is declared as an internal table in the program SAPLZGFI_MRM_ENTRY_RAP (Use find to check whether it is declared or not). If not then someone might be trying to use this internal table in some customer exit (i.e. Z function module). You can either declare it in data declaration just like "T_RSEG" or change it to "T_RSEG" (maybe the ABAPer who is doing some changes in Z function module might have written the internal table name as "GT_RSEG" by mistake instead of "T_RSEG").
    Safe side declare another internal table as "GT_RSEG" in the program as below:
    Data: gt_rseg type standard table of <table_name>.
    Or-Maybe you can contact that ABAPer by checking the version management of the program where error is coming (you can come to know the place of error through short dump ST22 transaction code) and inform him/her about the error. In this way, he/she will change the code accordingly.
    Hope this is helfpul!
    Regards,
    Saba
    Edited by: Saba Sayed on Feb 13, 2011 12:56 AM

  • Syntax Error after creating enhancements for subroutine

    Problem:
    Creating enhancement sections gives a syntax error when creating enhancement options and implementations for a subroutine and then ceating enhancement options and implementations for the call to that same subroutine.
    <p>
    Syntax Error:
    "Different number of parameters in FORM and PERFORM (routine: SET_LAYOUT, number of formal parameters: 2, number of actual parameters: 1)
    </p>
    <p>
    Here's the following scenario:
    </p>
    <p>
    A subroutine is defined in a program.
    The subroutine is called within the same program.
    </p>
    <p>
    I then executed these steps:
    <br>     1. Defined an enhancement section around the subroutine definition
    <br>     2. Defined an enhancement section around the subroutine call.
    <br>     3. Implemented the enhancement section around the subroutine definition and add an additional parameter.
    </p>
    <p>
         Currently, this gives a syntax error as expected, since the call to the subroutine needs 1 more parameter.
    </p>
    <p>
         4. Implemented the enhancement section for the subroutine call.  I change the call in the implementation so it passes the new parameter.
    </p>
    <p>
    A syntax check to this gives an error.  The syntax checker is not only checking the new implementation, but also the original subroutine that should have been overwritten.
    </p>
    <p>
    The enhancement sections use the same enhancement spot, and the enhancement implementations use the same implementation.
    </p>
    <p>
    I tried various combinations of using different enhancement spots and/or implementations, but all give the same syntax error.  I tried separating the subroutine in a different include and  retried my testing, but it still gave the same syntax error.
    </p>
    <p>
    Here's the sample code I first created to try troubleshooting the problem:
    </p>
    <p>
    <pre>
    ENHANCEMENT-SECTION ZEP_Z_MICHAEL_02 SPOTS ZES_Z_MICHAEL .
         PERFORM set_layout
              CHANGING
              wa_layout.
    END-ENHANCEMENT-SECTION.
    $$-Start: ZEP_Z_MICHAEL_02----
    $$
    ENHANCEMENT 2  ZEI_TEST_SECTIONS.
         "inactive version
         PERFORM set_layout
         using 'X'
              CHANGING
              wa_layout.
    ENDENHANCEMENT.
    $$-End:   ZEP_Z_MICHAEL_02----
    $$
    ENHANCEMENT-SECTION ZEP_Z_MICHAEL_01 SPOTS ZES_Z_MICHAEL STATIC .
    FORM set_layout
    CHANGING p_wa_layout TYPE slis_layout_alv.
    p_wa_layout-zebra = 'X'.
    wa_layout-no_colhead = 'X'..
    p_wa_layout-colwidth_optimize ='X'.
    wa_layout-window_titlebar = 'Woot'.
    ENDFORM. "set_layout
    END-ENHANCEMENT-SECTION.
    $$-Start: ZEP_Z_MICHAEL_01----
    $$
    ENHANCEMENT 1  ZEI_TEST_SECTIONS.
         "inactive version
    FORM set_layout
    using p_test type boolean
    CHANGING p_wa_layout TYPE slis_layout_alv.
    p_wa_layout-zebra = 'X'.
    wa_layout-no_colhead = 'X'..
    p_wa_layout-colwidth_optimize ='X'.
    wa_layout-window_titlebar = 'Woot'.
    ENDFORM. "set_layout
    ENDENHANCEMENT.
    $$-End:   ZEP_Z_MICHAEL_01----
    $$
    </pre>
    </p>
    <p>
    Please let me know if you think I am doing something wrong. 
    </p>
    <p>
    Thanks, <br>
    Mike
    </p>
    Edited by: Michael Herman on Mar 8, 2010 8:11 PM

    Yes, Sandra.  That is what did and it worked with no syntax errors!
    I'm not sure if this is getting off topic or not, but the SAP documentation(taken from the SAP help after pressing F1 on the keyword static in ERP6) seems misleading:
    "The STATIC addition is intended for the enhancement of data declarations, while the statement ENHANCEMENT-POINT without the STATIC addition is designed for the enhancement of executable coding."
    I would think the enhancement section ZEP_Z_MICHAEL_02 would fall under the category of executable code, while the enhancement section ZEP_Z_MICHAEL_01 would fall under the category of declarative code.
    Unfortunately, all the SAP enhancement sections I come accross are dynamic.  The SAP help explains the reasoning for this:
    "In contrast to the statement ENHANCEMENT-POINT, the addition STATIC of the statement ENHANCEMENT-SECTION can only be used with maximum caution for changes of data declarations, because a replacement and no completion is carried out. Especially application development within SAP should not use the addition STATIC at all with ENHANCEMENT-SECTION as the change will be active in the entire customer system. "
    I do not know what the word "completion" means in the previous quote, so I can't determine why it would matter.  Regardless, if a developer wanted to change a standard subroutine declaration, they would also have to mod an enhancement section to change it to static.  This seems to defeat the purpose of using enhancements, but maybe this scenario is not what enhancements were intended for.

  • Syntax errors possible at runtime?

    Hello,
    i need to know something about those, i didn't really find any good explinations at google..
    so a syntax error is an error because we write something wrong: it's not written like it should
    so a syntax error is a compile time error, but now im a bit unsure if it is possible to have a syntax error which doesnt give an error at compile time, but does at run time
    i think like having
    public void main(String[] args) // we forgot the static declaration
    //do stuff
    it won't give an syntax error because it is fine, but when we run it it gives an error... is this then a syntax error hidden at compile time but a detected syntax error at runtime?
    anyone can confirm and if possible with my/an example?
    thanks in advance

    796870 wrote:
    public void main(String[] args) // we forgot the static declaration
    //do stuff
    it won't give an syntax error because it is fine, but when we run it it gives an error... is this then a syntax error hidden at compile time but a detected syntax error at runtime?Not really, since there's nothing wrong with the syntax. It's just not the right syntax for a class intended to run as a program.

  • How to fix Syntax Error: Expected end of line, etc. but found end of script. in applescript?

    I am making an applescript for my modding tool for Minecraft. It used to use multiple apps and I am now trying to make one app for all the tasks.
    Here is the code:
    say "You are running iCraft version one point one for minecraft version 1.2.5"
    display dialog "Which tool do you want to use?" buttons {"Mod Installer", "Backup", "Restore"} default button 3
    set the button_pressed to the button returned of the result
    if the button_pressed is "Mod Installer" then
    do shell script "~/desktop/iCraft/iCraft.app/contents/re…
    display dialog "Insert all mod files into the Mods folder."
    display dialog "Have you inserted all Mod files into the Mods folder?" buttons {"Yes", "No"} default button 2
    if the button_pressed is "Yes" then
    do shell script "~/desktop/iCraft/iCraft.app/contents/re…
    display dialog "Finished"
    else
    display dialog "Insert mod files into the Mods folder and restart iCraft.app."
    end if
    if the button_pressed is "Backup" then
    display dialog "Are you sure you want to backup your Minecraft.jar in it's current state?" buttons {"Yes", "No"} default button 2
    if the button_pressed is "Yes" then
    do shell script "~/desktop/iCraft/iCraft.app/contents/re…
    display dialog "Finished, find it in your Backups directory in the iCraft folder"
    else
    display dialog "Backup aborted"
    end if
    if the button_pressed is "Restore" then
    display dialog "Are you sure you want to restore your Minecraft.jar with your backup?" buttons {"Yes", "No"} default button 2
    if the button_pressed is "Yes" then
    do shell script "~/desktop/iCraft/iCraft.app/resources/s…
    else
    display dialog "Restore aborted"
    end if
    end
    When I try to compile/run it gives me Syntax Error: Expected end of line, etc. but found end of script.

    Your script got mangled when pasting it into your message, but the main problem looks like you are missing a bunch of end if statements.  Unless your if statements are contained on one line, you need to terminate them with a matching end if statement - for example, the following are equivalent:
    if someString is "whatever" then display dialog "foo"
    if someString is "whatever" then
      display dialog "foo"
    end if

Maybe you are looking for