Please explain what this program doing- I see the results but don't underst

public class Mystery2{
public static void main(String []args){
int count = 1;
while (count <= 10){
System.out.println(count % 2==1? "****":"++++++");
++count;
}//end while
}//end main
}//end class

Hello! First of all - where did you find this code (just for information, so it's easier to answer the question)
Secondly, pls be so kind as to use code tags. Here's the same program, reformatted and in code tags:
public class Mystery2
    public static void main (String [] args)
        int count = 1;
        while (count <= 10)
            System.out.println (count % 2 == 1 ? "****" : "++++++");
            ++count;
        }//end while
    }//end main
}//end class

Similar Messages

  • WRT1900ac: Please explain what uPnP setting does

    Could someone please explain what the following settings (in the Connectivity-Administration page) do?
    UPnP    I_l  Enabled
      I_l Allow users to configure
      I_l Allow users to disable internet access
    Do these en/disable uPnP access to the router from the WAN side? LAN side?
    En/disable uPnP protocol for all devices on the LAN?
    The User Manual is not clear what each of these check-boxes do...
    Thanks.
    Aloke

    I'ts recommended to leave uPnP enabled as it helps various devices obtain reqired port connections to the internet services and internal devices on the LAN side for some gaming and media sharing services and devices as well.
    The additional options are I believe to allow users to configure there own services on than side if needed. At most, if uPnP is enabled, evrything is automatic and little or no coniguration is needed. 
    http://en.wikipedia.org/wiki/Universal_Plug_and_Play

  • Why this query does not show the result?

    Why the query with the schema prefixed does not show the result and the query without schema display the correct results?
    SQL> select data_object_id,object_type from dba_objects where object_name='HR'.'JOBS';
    select data_object_id,object_type from dba_objects where object_name='HR'.'JOBS'
    ERROR at line 1:
    ORA-00933: SQL command not properly ended
    SQL> select data_object_id,object_type from dba_objects where object_name='HR.JOBS';
    no rows selected
    SQL> select data_object_id, OWNER, object_type from dba_objects where object_name='JOBS';
    DATA_OBJECT_ID     OWNER                          OBJECT_TYPE
    69662              HR                                 TABLE
                       OE                                 SYNONYM
    SQL> SELECT USER FROM DUAL;
    USER
    SYS

    Hi,
    the column object_name refers to a object_name which is 'JOBS', the column owner refers to the owner 'HR', the value isn't stored together, so you have to select the two columns. It is the same behaviour as every other table/view. Have a look at the values in the view DBA_OBJECTS.
    Herald ten Dam
    Superconsult.nl

  • Can anyone pls explain what this procedure does?

    i could only figure out that it will be performing a transpose.
    create or replace
    PROCEDURE TEST_TRANSPOSE(o_test OUT SYS_REFCURSOR) AS
    report_exists number(3);
    report_name varchar(30) := 'REPORT_TBL' ;
    query_main varchar(16000) := 'create table ' || report_name || ' as select MAGAZINE ' ;
    query_part varchar(1024) ;
    my_var varchar2(5);
    cursor cur_region is select distinct REGION from MAIN_TBL order by region;
    begin
    select count(*) into report_exists
    from tab
    where tname = report_name;
    if ( report_exists = 1 ) then
    execute immediate 'drop table ' || report_name ;
    end if;
    open cur_region ;
    loop
    fetch cur_region into my_var ;
    exit when cur_region%NOTFOUND;
    query_part := 'select nvl(sum(quantity),0) from MAIN_TBL x where x.magazine = main.magazine and x.region='''||my_var||'''' ;
    query_main := query_main || chr(10) || ',(' || query_part || ')"' || my_var || '"';
    end loop;
    close cur_region ;
    query_main := query_main || ' from (select distinct MAGAZINE from MAIN_TBL ) main' ;
    DBMS_OUTPUT.PUT_LINE(query_main);
    --execute immediate query_main ;
    open o_test for query_main;
    end;
    {code}
    i need to transpose  a table which has dynamic number of rows.This was what i tried.Could you pls bhelp me out to correct this i get "P_TRAN_YEAR" invalid identifier
    [code]
    create or replace
    PROCEDURE         PRM_R_MAT_RPT (p_EmpID     IN  Integer,
    P_TRAN_YEAR IN NUMBER,
    P_TRAN_MONTH IN NUMBER,O_rc OUT sys_refcursor) IS
    v_cnt NUMBER;
    v_sql VARCHAR2(32767);
    v_basic Number(16, 4);
    BEGIN
    select PPH_ORG_AMOUNT into v_basic from prm_p_hop
    where pph_emp_id=p_empid
    and pph_tran_year=p_tran_year
    and pph_tran_month=P_TRAN_MONTH
    and pph_hop_code=5
    and PPH_SALARY_THRU='R';
    -- SELECT  distinct count(*)
    --  INTO v_cnt
    --  FROM PRM_T_VAR_HOP
    --  where PTVH_EMP_ID=p_EMPID
    --  and PTVH_TRAN_YEAR=p_TRAN_YEAR
    --  and PTVH_TRAN_MONTH=P_TRAN_MONTH;
    v_sql := 'select  distinct PCH_SHORT_DESCRIPTION,v_basic,PTVH_AMOUNT Amount ';
    --  FOR i IN 1..v_cnt
    --  LOOP
    v_sql := v_sql || ',max(decode(rn, PCH_SHORT_DESCRIPTION)) as description ';
    --v_sql := v_sql || ',max(decode(rn, '||to_char(i)||', PDSL_INTEREST)) as interest'||to_char(i);
    -- v_sql := v_sql || ',max(decode(rn, '||to_char(i)||', PDSL_PRINCIPAL_SALARY)) as principle'||to_char(i);
    -- v_sql := v_sql || ',max(decode(rn, '||to_char(i)||', PDSL_SOCIETY_CODE)) as SOC_CODE'||to_char(i);
    --  END LOOP;
    v_sql := v_sql || ' from (select  PRM_T_VAR_HOP.*, PRM_C_HOP.*, row_number() over (partition by PTVH_EMP_ID order by PTVH_EMP_ID) as rn
    from  
    PRM_T_VAR_HOP,
    PRM_C_HOP
    WHERE PTVH_EMP_ID         =P_empid
    And   PTVH_TRAN_YEAR      =P_TRAN_YEAR
    And   PTVH_TRAN_MONTH     =P_TRAN_MONTH
    And   PTVH_HOP_CODE       =PCH_HOP_CODE
    AND   PCH_CALCULATION_BASIS=''V''
    AND   PCH_TAG              =''C''
    AND   PTVH_SALARY_THRU     =''R'')';
    OPEN O_rc FOR v_sql;
    END;
    [/code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Your first piece of code does not work, because a create table statement cannot be issued using a ref cursor like that. When executed with the "execute immediate" command, it works. Then, the refcursor is only a "select * from report_tbl".
    What it does, is dynamically dropping and creating a table report_tbl and filling it with the results of a horribly inefficient pivot query. If the report_tbl has no other purpose after running this procedure, then I'd suggest to not drop and create tables dynamically like that. In the second variant of test_transpose, you can see how you can do that.
    SQL> create table main_tbl (magazine,region,quantity)
      2  as
      3  select 'MAGAZINE1','REGION1',1 from dual union all
      4  select 'MAGAZINE1','REGION2',2 from dual union all
      5  select 'MAGAZINE1','REGION3',3 from dual union all
      6  select 'MAGAZINE2','REGION1',4 from dual union all
      7  select 'MAGAZINE2','REGION2',5 from dual union all
      8  select 'MAGAZINE2','REGION3',6 from dual
      9  /
    Tabel is aangemaakt.
    SQL> create or replace PROCEDURE TEST_TRANSPOSE(o_test OUT SYS_REFCURSOR)
      2  AS
      3    report_exists number(3);
      4    report_name varchar(30) := 'REPORT_TBL' ;
      5    query_main varchar(16000) := 'create table ' || report_name || ' as select MAGAZINE ' ;
      6    query_part varchar(1024) ;
      7    my_var varchar2(7);
      8
      9    cursor cur_region is select distinct REGION from MAIN_TBL order by region;
    10  begin
    11    select count(*) into report_exists
    12    from tab
    13    where tname = report_name;
    14    if ( report_exists = 1 ) then
    15    execute immediate 'drop table ' || report_name ;
    16    end if;
    17
    18    open cur_region ;
    19    loop
    20      fetch cur_region into my_var ;
    21      exit when cur_region%NOTFOUND;
    22      query_part := 'select nvl(sum(quantity),0) from MAIN_TBL x where x.magazine = main.magazine and x.region='''||my_var||'''' ;
    23      query_main := query_main || chr(10) || ',(' || query_part || ')"' || my_var || '"';
    24    end loop;
    25    close cur_region ;
    26
    27    query_main := query_main || ' from (select distinct MAGAZINE from MAIN_TBL ) main' ;
    28    execute immediate query_main;
    29    open o_test for 'select * from ' || report_name;
    30  end;
    31  /
    Procedure is aangemaakt.
    SQL> var rc refcursor
    SQL> exec test_transpose(:rc)
    PL/SQL-procedure is geslaagd.
    SQL> print rc
    MAGAZINE     REGION1    REGION2    REGION3
    MAGAZINE1          1          2          3
    MAGAZINE2          4          5          6
    2 rijen zijn geselecteerd.
    SQL> create or replace procedure test_transpose (o_test out sys_refcursor)
      2  as
      3    l_query varchar2(1000) := 'select magazine';
      4  begin
      5    for r in (select distinct region from main_tbl)
      6    loop
      7      l_query := l_query || ', sum(decode(region,''' || r.region || ''',quantity)) ' || r.region;
      8    end loop;
      9    l_query := l_query || ' from main_tbl group by magazine';
    10    open o_test for l_query;
    11  end;
    12  /
    Procedure is aangemaakt.
    SQL> exec test_transpose(:rc)
    PL/SQL-procedure is geslaagd.
    SQL> print rc
    MAGAZINE     REGION1    REGION2    REGION3
    MAGAZINE1          1          2          3
    MAGAZINE2          4          5          6
    2 rijen zijn geselecteerd.Regards,
    Rob.

  • This program doesn't display the results :-(

    this program should output the sum,difference,product and quotient of two numbers.
    i guess the computeQuotient is the wrong part..
    import java.util.*;
    public class MethodExample2
         static Scanner get = new Scanner(System.in);
         public static void main(String[] args)
              double sum,difference,product,quotient;
              double n1,n2;
              System.out.print("Enter the first number: ");
              n1 = get.nextInt();
              System.out.print("Enter the second number: ");
              n2 = get.nextInt();
              sum = computeSum(n1,n2);
              difference = computeDifference(n1,n2);
              product = computeProduct(n1,n2);
              quotient = computeQuotient(n1,n2);
              System.out.print("Sum: " + sum);
              System.out.print("\nDifference: " + difference);
              System.out.print("\nProduct: " + product);
              System.out.print("\nQuotient: " + quotient);
              System.out.println();
         public static double computeSum(double num1,double num2)
              return num1 + num2;
         public static double computeDifference(double num1,double num2)
              return num1 - num2;
         public static double computeProduct(double num1,double num2)
              double res = 0.0;
              for(double ctr = num1;ctr > 0; ctr--)
                        res = num2 + res;
              return res;
         public static double computeQuotient(double num1,double num2)//i guess this is the wrong part
              double res, ctr;
              for(ctr = 1; ctr >= 0; ctr++)
                   res = num1 - num2;
                   num1 = res;
              return ctr;
    }

    Dear Sir:
    The ArithmeticException is RuntimeException, therefore it is unchecked exception.....
    Here is my dumb program for your reference....
    import java.util.*;
    public class ScannerExp{
         static Scanner get = new Scanner(System.in);
         public static void main(String[] args){
         double sum,difference,product,quotient;
         double n1,n2;
         System.out.print("Enter the first number in double format: ");
         n1 = get.nextDouble();
         System.out.print("Enter the second number in double format: ");
         n2 = get.nextDouble();
         sum = computeSum(n1,n2);
    difference = computeDifference(n1,n2);
         product = computeProduct(n1,n2);
         quotient = computeQuotient(n1,n2);
         System.out.print("Sum: " + sum);
         System.out.print("\nDifference: " + difference);
         System.out.print("\nProduct: " + product);
         System.out.print("\nQuotient: " + quotient);
         System.out.println();
         public static double computeSum(double num1,double num2)
              return (num1 + num2);
         public static double computeDifference(double num1,double num2)
              return (num1 - num2);
         public static double computeProduct(double num1,double num2){
              return (num1*num2);
         public static double computeQuotient(double num1,double num2){
    return (num1 / num2);
    use
    jacvac ScannerExp.java
    java ScannerExpthen input the number you want to compute....
    Hope it is half right....

  • How can I identify which albums are associated with a specific picture.  I used to click on the picture and see the albums but don't know how to do it in 13?

    I keep pictures in Albums, specifically by year and then other topic albums. As a result some pictures are in several albums. Sometimes they are assigned in error.  I used to be able to click on a picture and see not only the tags but the albums associated with the picture.  How can I see which albums are assigned to a picture?

    Are you referring to the yellow text box that pops up like this?
    If it is those are called tooltips or anchor titles.  Cyclosaurus has posted script to block them: removing rollover html detail box: Apple Support Communities.
    OT

  • Can anyone explain what this code does.

    <b>Below is the FM for a  SAP Exit Variable ( 0FPER - Fiscal Period Variable ) , I would really appreciate if someone can give some explanation what does the code do.</b>
    FUNCTION RSVAREXIT_0F_FPER.
    ""Lokale Schnittstelle:
    *"       IMPORTING
    *"             VALUE(I_VNAM) LIKE  RSZGLOBV-VNAM
    *"             VALUE(I_VARTYP) LIKE  RSZGLOBV-VARTYP
    *"             VALUE(I_IOBJNM) LIKE  RSZGLOBV-IOBJNM
    *"             VALUE(I_S_COB_PRO) TYPE  RSD_S_COB_PRO
    *"             VALUE(I_S_RKB1D) TYPE  RSR_S_RKB1D
    *"             VALUE(I_S_RKB1F) TYPE  RRO01_S_RKB1F
    *"             VALUE(I_THX_VAR) TYPE  RRO01_THX_VAR
    *"       EXPORTING
    *"             VALUE(E_T_RANGE) TYPE  RSR_T_RANGESID
    *"       EXCEPTIONS
    *"              UNKNOWN_VARIABLE
    *"              UNEXPECTED_VARTYPE
    *"              INVALID_PERIV
    *"              VARIABLE_INITIAL
    *"              NO_REPLACEMENT
      data:
      l_s_range   type rs_s_range,
      ld_periv    type rro01_s_rkb1f-periv,
      ld_curdate  like sy-datum,
      ld_poper    like t009b-poper,
      ld_fiscyear like t009b-bdatj.
      refresh e_t_range.
      clear l_s_range.
      l_s_range-sign = 'I'.
      l_s_range-opt  = 'BT'.
      case i_vartyp.
        when rro04_c_vartyp-formula.
    *--- Determine fiscal year variant
          call function 'BWCO_FISCVARNT_GET'
               exporting
                    i_s_rkb1d        = i_s_rkb1d
                    i_s_rkb1f        = i_s_rkb1f
                    i_thx_var        = i_thx_var
               importing
                    e_periv          = ld_periv
               exceptions
                    no_replacement   = 1
                    unknown_variable = 2
                    others           = 3.
          case sy-subrc.
            when 0.
            when 2.
              raise unknown_variable.
            when others.
              raise no_replacement.
          endcase.
          if ld_periv is initial.
            raise invalid_periv.
          endif.
    *--- Determine current fiscal year
          ld_curdate = sy-datum.
          call function 'DATE_TO_PERIOD_CONVERT'
               exporting
                    i_date         = ld_curdate
                    i_periv        = ld_periv
               importing
                    e_buper        = ld_poper
                    e_gjahr        = ld_fiscyear
               exceptions
                    input_false    = 1
                    t009_notfound  = 2
                    t009b_notfound = 3
                    others         = 4.
          if not sy-subrc is initial.
            raise invalid_periv.
          endif.
    *--- Determine the highest fiscal period in the current fiscal year
          CALL FUNCTION 'GET_ACCOUNT_OF_PERIODS'
               EXPORTING
                    I_GJAHR         = ld_fiscyear
                    I_PERIV         = ld_periv
               IMPORTING
                    E_ANZBUPER      = ld_poper
               EXCEPTIONS
                    INPUT_FALSE     = 1
                    T009B_NOTFOUND  = 2
                    T009_NOTFOUND   = 3
                    OTHERS          = 4
          IF SY-SUBRC <> 0.
                raise invalid_periv.
          ENDIF.
    *--- fill value ranges
          l_s_range-low = ld_poper.
          append l_s_range to e_t_range.
        when others.
          raise unexpected_vartype.
      endcase.
    endfunction.

    1) Fiscal year variant is determined using Function Module - 'BWCO_FISCVARNT_GET'
    2) With Fiscal variant & Current Date as input to Function Module - 'DATE_TO_PERIOD_CONVERT' gets Fiscal Year.
    3) With Fiscal year & variant as input to 'GET_ACCOUNT_OF_PERIODS' gets 
    the highest fiscal period in the current fiscal year

  • Aha! I see the problem but don't know how to fix it. Multiple IDs!

    Over the years, my apple reliance has increased. I have two different email addresses in a bizarre combination on my iMAC, iPhone, and iPad. It prevents me from doing backups completely, getting the latest version of some apps, and using the cloud as it was meant to be.
    IDs, next, are shortened to make this more readble.
    My iMAC uses an itunes ID called TAR. This is where I have bought plenty of iTunes music, but always export to MP3 -- so if I have to trash this ID it'd be ok.
    My iPad shows an iCloud ID of TNT, an iTunes store ID of TAR, and my appleID as TAR.
    My iPhone shows an iCloud ID of TNT, and an apple ID of TAR. I have purchased some apps and I fear not using TAR on it may nulify all of those purchases.
    Should I simply DELETE my iPhone and IPad iCloud accounts and then create new ones on those devices with ID of TAR?
    Please advise! What do I need to set where so that I have one and only one email address for everything.
    If this is NOT the cure to my problems, what else can I check? (Eg. when I do a backup in iTunes on my iMac it says that my iPhone and iPad are not recognized... yet it proceeds with a backup MOSTLY. Authorizing/reauthorizing it from the iMac seems to make no difference.
    The password guesses and resets over the years have been insane, as you might have gathered.
    Thank you!
    Tim

    yeah, remove the icloud accounts, and choose to keep the data on the device when you do so. then, when you sign in with the other id, it'll ask if you want to merge, and you will. then all your information will be in one id

  • When trying to sync my iphone in itunes i keep getting the error message "itunes cannot sync apps because the apps installed on the iphone could not be determined." can anyone explain what this means?

    when trying to sync my iphone in itunes i keep getting the error message "itunes cannot sync apps because the apps installed on the iphone could not be determined." can anyone explain what this means?

    I received the same error message after I had recently updated iTunes to 10.5.1 and I had wirelessly updated 13 apps.  I had to go into iTunes and select Apps, on the bottom right it said I needed to update 13 apps.  I updated the apps via iTunes and then synced again without an issue.
    iPhone 4S / OSX 10.6.8 / iTunes 10.5.1

  • Where do i see the results for dbms_ddl.analyze_object?

    hi All
    I executed the following procedure
    begin
    dbms_ddl.analyze_object('TABLE','OPS$MBPCONT1','IKS_STORAGE_SIGNED_CARDS','COMPUTE');
    end;
    And it executed successfully with result
    PL/SQL procedure successfully completed.
    Could you please let me know whree can i see the results?
    Thank you
    Poonam

    Hi,
    There will be an attribute named last_analyzed in user_tables and user_indexes . You could use this to find out whether the object is analyzed or not.
    Vijay

  • Please tell what to do if I see this error while opening an plan or while saving this plan?

    Error messsge: the enterprise global already contains a table named “Enterprise Entry”.
    Do you want to replace the table with the one from the enterprise global, replace all items with duplicates, rename the table in the project, or cancel opening the project.
    Please tell what to do if I see this error while opening an plan or while saving this plan?

    A-K-J --
    The error message indicates that your Project Server administrator has accidentally polluted the Enterprise Global file with local view and/or tables.  The solution does not lie with the user.  It does not really matter what button the user clicks
    in the dialog, since only the Project Server administrator can solve this problem.  To solve the problem, the Project Server administrator must do the following:
    Open the Enterprise Global file editing.
    Click File > Organizer.
    On the right side of the Organizer dialog (in the Enterprise Global file), delete any non-enterprise views.  There should be NO views named Gantt Chart, Resource Sheet, etc.  The only default enterprise view is named Enterprise Gantt Chart, which
    should not be deleted.
    Click the Tables tab.
    On the right side of the Organizer dialog, delete any non-enterprise tables.  There should be NO tables named Entry, Work, Cost, etc.  The only default enterprise table is named Enterprise Entry, which should not be deleted.
    Click the Close button.
    Save the Enterprise Global file.
    Close the Enterprise Global file.
    Close Microsoft Project, relaunch the software, and log into Project Server again.
    After completing the above steps, every PM should also exit Microsoft Project and relaunch the software again.  Hope this helps.
    Dale A. Howard [MVP]

  • What does this mean "We apologize for the inconvenience, but the ability to order books and prints is no longer supported in iPhoto 5. Please upgrade to a newer version of iPhoto to order these products.

    what does this mean "We apologize for the inconvenience, but the ability to order books and prints is no longer supported in iPhoto 5. Please upgrade to a newer version of iPhoto to order these products." I want to buy a photo book and that message keeps popping up.

    TD, LN - You guys make great points and I will take you at your word. Normally, I would not hesitate to update. I have a lot at stake here with a large vacation coming up with a great many new pictures anticipated. I don't know enough to understand what is meant by "verifying my library." Please give me some insight there and I will start the upgrade process tonight! Seriously, I have wanted to do this for some time, but have been scared away by reading too many situations on these forums.
    TD - you have a good sense of humor. I know all versions eventually need to be left to die away. Support is not eternal. I am sure I missed the announcement that certain versions of iPhoto would no longer offer the ability to conveniently make cards, calendars, books, etc. Like the original poster, I was surprised to learn my version did not offer that functionality only by requesting it and getting denied. Sort of frosted me at the time, as you can tell by my original reply here.
    If anyone can help me with the "verifying" question, I'll get off of here and let the original poster have his thread back! 

  • HT1551 hi i do not see hulu plus programs. I see the shows to select but when i select a show i see the circle spin then it say please try later. That has happened over the 2 days now. This is also now happening with Netflex.

    hi i do not see hulu plus programs. I see the shows to select but when i select a show i see the circle spin then it say please try later. That has happened over the 2 days now. This is also now happening with Netflex.

    its ok i just pulled the plug from the Apple TV waited 3 minutes and plugged back in and now it works.

  • Could someone please explain what "Run Spindump" & "Run System Diagnostics" does in 'Activity Monitor' ?

    Could someone please explain what "Run Spindump" & "Run System Diagnostics" does in 'Activity Monitor' ?

    Good question.  You don't need to worry about running those.  They will run automatically when needed by the system.  The information they generate (some) is sent to apple automatically (unless that setting is disabled).
    If you want to look at the output of these files, most can be found in the console (Utility/Console).  Open the app and look at all the system messages your Mac generates....on the right hand side I would bet you already have a crash log or spindump that was collected without you even knowing it.

  • Please explain what are the various procedures to find user-eixts

    Hi,
    Please explain what are the various procedures to find user-eixts ?
    Ramana

    Hi,
    1. By executing this Program.
    *& Report  ZFIND_EXIT
    REPORT  ZFIND_EXIT.
    *report zbadi_find .
    tables : tstc,
    tadir,
    modsapt,
    modact,
    trdir,
    tfdir,
    enlfdir,
    sxs_attrt ,
    tstct.
    data : jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    parameters : p_tcode like tstc-tcode,
    p_pgmna like tstc-pgmna .
    data wa_tadir type tadir.
    start-of-selection.
    if not p_tcode is initial.
    select single * from tstc where tcode eq p_tcode.
    elseif not p_pgmna is initial.
    tstc-pgmna = p_pgmna.
    endif.
    if sy-subrc eq 0.
    select single * from tadir
    where pgmid = 'R3TR'
    and object = 'PROG'
    and obj_name = tstc-pgmna.
    move : tadir-devclass to v_devclass.
    if sy-subrc ne 0.
    select single * from trdir
    where name = tstc-pgmna.
    if trdir-subc eq 'F'.
    select single * from tfdir
    where pname = tstc-pgmna.
    select single * from enlfdir
    where funcname = tfdir-funcname.
    select single * from tadir
    where pgmid = 'R3TR'
    and object = 'FUGR'
    and obj_name eq enlfdir-area.
    move : tadir-devclass to v_devclass.
    endif.
    endif.
    select * from tadir into table jtab
    where pgmid = 'R3TR'
    and object in ('SMOD', 'SXSD')
    and devclass = v_devclass.
    select single * from tstct
    where sprsl eq sy-langu
    and tcode eq p_tcode.
    format color col_positive intensified off.
    write:/(19) 'Transaction Code - ',
    20(20) p_tcode,
    45(50) tstct-ttext.
    skip.
    if not jtab[] is initial.
    write:/(105) sy-uline.
    format color col_heading intensified on.
    Sorting the internal Table
    sort jtab by object.
    data : wf_txt(60) type c,
    wf_smod type i ,
    wf_badi type i ,
    wf_object2(30) type c.
    clear : wf_smod, wf_badi , wf_object2.
    Get the total SMOD.
    loop at jtab into wa_tadir.
    at first.
    format color col_heading intensified on.
    write:/1 sy-vline,
    2 'Enhancement/ Business Add-in',
    41 sy-vline ,
    42 'Description',
    105 sy-vline.
    write:/(105) sy-uline.
    endat.
    clear wf_txt.
    at new object.
    if wa_tadir-object = 'SMOD'.
    wf_object2 = 'Enhancement' .
    elseif wa_tadir-object = 'SXSD'.
    wf_object2 = ' Business Add-in'.
    endif.
    format color col_group intensified on.
    write:/1 sy-vline,
    2 wf_object2,
    105 sy-vline.
    endat.
    case wa_tadir-object.
    when 'SMOD'.
    wf_smod = wf_smod + 1.
    select single modtext into wf_txt
    from modsapt
    where sprsl = sy-langu
    and name = wa_tadir-obj_name.
    format color col_normal intensified off.
    when 'SXSD'.
    For BADis
    wf_badi = wf_badi + 1 .
    select single text into wf_txt
    from sxs_attrt
    where sprsl = sy-langu
    and exit_name = wa_tadir-obj_name.
    format color col_normal intensified on.
    endcase.
    write:/1 sy-vline,
    2 wa_tadir-obj_name hotspot on,
    41 sy-vline ,
    42 wf_txt,
    105 sy-vline.
    at end of object.
    write : /(105) sy-uline.
    endat.
    endloop.
    write:/(105) sy-uline.
    skip.
    format color col_total intensified on.
    write:/ 'No.of Exits:' , wf_smod.
    write:/ 'No.of BADis:' , wf_badi.
    else.
    format color col_negative intensified on.
    write:/(105) 'No userexits or BADis exist'.
    endif.
    else.
    format color col_negative intensified on.
    write:/(105) 'Transaction does not exist'.
    endif.
    at line-selection.
    data : wf_object type tadir-object.
    clear wf_object.
    get cursor field field1.
    check field1(8) eq 'WA_TADIR'.
    read table jtab with key obj_name = sy-lisel+1(20).
    move jtab-object to wf_object.
    case wf_object.
    when 'SMOD'.
    set parameter id 'MON' field sy-lisel+1(10).
    call transaction 'SMOD' and skip first screen.
    when 'SXSD'.
    set parameter id 'EXN' field sy-lisel+1(20).
    call transaction 'SE18' and skip first screen.
    endcase.
    2. . Go to the screen>System>Status-->Program (Double
    click this program. It will take you to the program.
    2. Now, Goto-->Object Directory Entry.
    3. Make a note the package name.
    4. Now run the transactions SMOD, press F4 and enter the
    above noted package, press enter.
    5. It will display list of Exits.
    6. Now go back to the initial screen SMOD.
    7. Specify the exit name here and select the radio button
    Components.
    8. It will display four group boxes one for FM, second
    for Fcodes, thrid for Screen areas and last for
    includes.
    9. Goto transaction CMOD, create a new project, and
    click the button "Enhancement assignments" and
    specify your enhancements that you got in SMOD.
    10. Now bouble clikc the enhancement, it will take you to editor with some includes starting with Z, double clikc the include you want to edit and proceed.
    3. 1. in se11, goto table MODSAP
    View table contents
    in Type field, enter
    'E' (for user exit / Function Exit)
    OR 'S' (for screen exit)
    4. Calling Customer- fucntion in Main Program
    Thanks,
    Anitha

Maybe you are looking for