Receiving warning: implicit function declaration: memset

We have the Sunstudio 11 compiler: Sun C 5.8 2005/10/13 and I created a C program and am receiving the above message:
include <stdio.h>
#include <stdlib.h>
int
main(int argc, char** argv)
char formatString[200];
memset(formatString, 0, sizeof(formatString));
if (argc != 2)
fprintf(stderr, "Usage: %s: argument\n", argv[0]);
return (1);
sprintf(formatString, "Hello %s, from old hello world program", argv[1]);
printf("%s\n", formatString);
return (EXIT_SUCCESS);
When I compile, I receive
"warning: implicit function declaration: memset". I also have code that uses strcpy and strcmp and I receive:
warning: implicit function declaration: strcpy
warning: implicit function declaration: strcmp
When I compile with Workshp 6.2, this warning does not occur. This problem is a prototype issue. In Workshop 6.2, this was resolved if the string.h was not included. The compiler searched until it found the correct header. Is there a way to get the compiler to do what Workshop did?

Thanks, I was just wondering why in 6.1 it was resolved. By including the appropriate header, the problem goes away. With the stub, I wrote, the program compiled on 6.1 with no warnings. But with studio, it compiled with the warning. This was a little bit strange. The developer really should include the appropriate header.

Similar Messages

  • Implicit function declaration warnings

    Hi All,
    Code look likes below,
    #include <stdio.h>
    #include <errno.h>
    #include <signal.h>
    #include <sys/types.h>
    #include <sys/ipc.h>
    int main()
    struct sigvec *svec;
    int sig;
    sigvec(sig, &svec, NULL);
    return 0;
    When i compile this with forte 4.2 compiler its not throwing any warnings. and when compiled with forte 6.2 its throwing warning as:
    "imp.c", line 9: warning: implicit function declaration: sigvec
    How can i resolve this.
    Compile:
    cc -g -o imp imp.c -lnsl -lucb
    And cc location is : /opt/forte62/SUNWspro/bin/cc
    Output of uname -a :
    SunOS server1 5.9 Generic_117171-17 sun4u sparc SUNW,Sun-Fire-V440
    For PATH variable i given /opt/forte62/SUNWspro/bin prior to /usr/ucb.
    Thanks & Regards,
    Sarath.

    In the same way i am facing one more problem:
    Below is the sample c code.
    #include <stdio.h>
    #include <errno.h>
    #include <signal.h>
    #include <sys/types.h>
    #include <sys/ipc.h>
    int main()
    struct sigvec svec;
    int sig;
    svec.sv_flags = 0;
    svec.sv_mask = 0;
    sigvec(sig, &svec, NULL);
    return 0;
    if I compile this getting errors like this.
    cc -g -o imp imp.c -lnsl -lucb
    "imp.c", line 8: incomplete struct/union/enum sigvec: svec
    "imp.c", line 10: undefined struct/union member: sv_flags
    "imp.c", line 11: undefined struct/union member: sv_mask
    cc: acomp failed for imp.c
    my PATH variable is set to : (I tried by putting /opt/SUNWspro/SC4.2/bin before /usr/ccs/bin also)
    /usr/java1.2/bin:/usr/ccs/bin:/usr/atria/bin:/opt/SUNWspro/SC4.2/bin:/usr/local/bin::.:/usr/java1.2/bin:/usr/ccs/bin:/usr/atria/bin:/opt/SUNWspro/SC4.2/bin:/usr/local/bin::.:/usr/bin::/usr/atria/bin:.::/usr/java1.2/bin::/usr/java1.2/bin
    and LD_LIBRARY_PATH is set to :
    /opt/SUNWspro/SC4.2/bin:/usr/ucblib:/usr/lib:/usr/lib:/usr/java1.2/bin:/opt/SUNWspro/SC4.2/bin:/usr/ucblib:/usr/lib:/usr/lib:/usr/java1.2/bin:/opt/SUNWspro/SC4.2/bin:/usr/ucblib:/usr/lib:/usr/lib:/usr/java1.2/bin:/usr/ucblib:/usr/lib:/usr/lib:/usr/java1.2/bin:::
    output of which cc is :
    /opt/SUNWspro/SC4.2/bin/cc
    If I compile the same with /usr/ucb/cc then its going through.
    /usr/ucb/cc imp.c
    Regards,
    Sarath

  • TS3276 An email sent from my iMac has a button linked to a clip hosted on Vimeo. When received, the link functions on iMac and iPad, but opens a window of app icons on iPhone and iPod touch. Any ideas what's wrong?

    An email sent from my iMac has a button linked to a clip hosted on Vimeo. When received, the link functions on iMac and iPad, but opens a window of app icons on iPhone and iPod touch. Any ideas what's wrong?

    For anyone else reading this thread, it is worth knowing that sometimes an email is, or can be, corrupted thereby jamming the works. The solution above is good, but I just wanted to suggest another one.
    If the problem arises, go to an online mail access service, such as Mail2Web.com and login to you mail account there and delete the offending message.
    Problem solved.
    And George, as this is all entirely voluntary, whinging about no takers may not endear people to you. Besides which, a few minutes of searching on Google would have found you a number of solutions.

  • What is the difference between the function declared in the package and pac

    What is the difference between defining a function in the package and package body ?
    Edited by: user10641405 on Nov 19, 2009 1:29 PM

    If you describe a package, you will only see the functions declared in the spec.
    If you only declare them in the body then they are not available to other packages (they are private to the package, not public)

  • Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed.

    Right now I am getting the following error when I try to connect to any of my Oracle databases:
    Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME is set and points to the right directory in /var/apache2/htdocs/test2.php on line 17
    I tried connecting to three separate databases with the same result, 10.2.0.2 [Windows Sever 2003], 9.2.0.7 [Solaris 10], 10.2.0.3 [Redhat].
    On my app server [Sun V20z] which is a x86-64 Bit server has the following installed: Solaris 10, Oracle 10.2 Client [Admin option] and PHP 5.2 using Apache2 that installed with Solaris.
    I done quite a bit of reading and can't quite figure out what I'm doing wrong. So if anyone can help me out I would greatly appreciate it.
    Below is how I setup Apache and PHP and how some of my setting are showing up.
    # uname -a
    SunOS sesapp 5.10 Generic_118855-36 i86pc i386 i86pc
    Install libiconv.
    # gunzip -c libiconv-1.9.2.tar | tar -xvf -
    # cd libiconv-1.9.2
    # ./configure
    # make
    # make install
    Install libxml2.
    # gunzip -c libxml2-2.6.26.tar.gz | tar -xvf -
    # cd libxml2-2.6.26
    # ./configure
    # make
    Copy the sample Apache2 configuration file.
    # cp /etc/apache2/httpd.conf-example /etc/apache2/httpd.conf
    # make install
    Install PHP 5.2
    # gunzip -c cd php-5.2.0.tar.gz | tar -xvf -
    # cd php-5.2.0
    # ./configure with-apxs2=/usr/apache2/bin/apxs with-libxml-dir=/usr/local with-config-file-path=/etc/apache2 with-zlib with-oracle=/apps/oracle/product/10.2.0/client with-oci8=/apps/oracle/product/10.2.0/client
    # make
    # make install
    Setup the PHP configuration file.
    # cp php.ini-dist /etc/apache2/php.ini
    Add the following lines to the PHP /etc/apache2/httpd.conf configuration file.
    AddType application/x-httpd-php .php
    Created file /usr/apache2/bin/oraenv [This is for environment paths when apache starts]
    ORACLE_BASE=/apps/oracle
    export ORACLE_BASE
    ORACLE_HOME=/apps/oracle/product/10.2.0/client
    export ORACLE_HOME
    LD_LIBARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:$ORACLE_HOME
    export LD_LIBARY_PATH
    LD_LIBRARY_PATH=/usr/apache2/lib:$ORACLE_HOME/lib:$ORACLE_HOME
    export LD_LIBRARY_PATH
    TNS_ADMIN=/apps/oracle/product/10.2.0/client/network/admin
    export TNS_ADMIN
    NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252
    export NLS_LANG
    I then modified /usr/apache2/bin/apachectl and in the "CONFIGURATION SECTION" added:
    if [ -f /usr/apache2/bin/oraenv ] ;
    then
    . /usr/apache2/bin/oraenv
    fi
    Enable Apache2 using the Solaris Management Facility (SMF).
    # svcadm enable apache2
    When I do phpinfo() I get the following bits:
    oci8
    OCI8 Support enabled
    Version 1.2.2
    Revision $Revision: 1.269.2.16.2.25 $
    Active Persistent Connections 0
    Active Connections 0
    Oracle Version 10.1
    Compile-time ORACLE_HOME /apps/oracle/product/10.2.0/client
    Libraries Used no value
    Temporary Lob support enabled
    Collections support enabled
    Directive Local Value Master Value
    oci8.default_prefetch 10 10
    oci8.max_persistent -1 -1
    oci8.old_oci_close_semantics 0 0
    oci8.persistent_timeout -1 -1
    oci8.ping_interval 60 60
    oci8.privileged_connect Off Off
    oci8.statement_cache_size 20 20
    Environment
    Variable Value
    LANG C
    LD_LIBARY_PATH /apps/oracle/product/10.2.0/client/lib:/lib:/usr/lib:/apps/oracle/product/10.2.0/client
    LD_LIBRARY_PATH /usr/apache2/lib:/apps/oracle/product/10.2.0/client/lib:/apps/oracle/product/10.2.0/client
    NLS_LANG AMERICAN_AMERICA.WE8MSWIN1252
    ORACLE_BASE /apps/oracle
    ORACLE_HOME /apps/oracle/product/10.2.0/client
    PATH /usr/sbin:/usr/bin
    SMF_FMRI svc:/network/http:apache2
    SMF_METHOD /lib/svc/method/http-apache2 start
    SMF_RESTARTER svc:/system/svc/restarter:default
    TNS_ADMIN /apps/oracle/product/10.2.0/client/network/admin
    TZ Canada/Mountain
    If there is anything that you can think of that I should try or see something that I screwed up in my conf, please let me know as I am stumped.
    Clayton

    I can confirm that this is an Oracle Client permissions problem. I got frustrated and chmod -R 777 /apps/oracle and sure enough I could connect to all the databases. I know that this isn't a solution so I'll undo this and try and figure out which directories PHP is having a hard time accessing. If I am able to narrow it down I'll post it here. And if someone has done this already can you please post your finding's here.
    Cheers,
    Clayton

  • Is there a way to curve fit a nonlinear implicit function?

    Hi
    I would like to fit a least squares curve to a set of data points.  I see I can do this using general LSQ fit.vi or Levenberg-Marquadt, but these VIs seem to only handle implicit functions of the form y=f(x,A). 
    What if I have a data set from a known implicit function, for example a circle:
    (x-x0)^2 + (y-y0)^2 - r^2 = 0
    How can I calculate the x0, y0 and r that minimizes the square error?  Can this be done using the L-M VI or a VI from a different toolkit?
    Thank you.
    Laine

    This can be considered as an optimization problem. For a circle, you could use the fitting on a sphere vi (in the math > optimization sub-palette), giving 0 as z coordinates.  See the attached vi.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Find Circle.vi ‏26 KB

  • Regular exression for matching function declarations or calls

    Hi guys,
    I used a regular expression like \\w + (\\s*) \\( .*\\) (\\s*) [\\{;] to match function
    declarations.This regular expression works fine for all the declarations of the form init_queue(TREE **NODE) {  and even for declarations of the form
    init_queue (TREE **NODE)
    But the problem occurs when i have a declaration of the form
    init_queue(TREE **NODE ,
    int size ) {
    when i have a declaration of this form my regular expression doesnt parse function names.The regular expression . (DOT) means it recognizes anything except for line terminators.So i used the DOTALL option in pattern matching so that .(DOT) matches even line terminators.But using this has a negative effect like i am not able to match declarations of the form
    init_queue(TREE **NODE) { 
    can anyone help me out in solving this
    Thank you,
    Akash

    multipost: http://forum.java.sun.com/thread.jspa?threadID=5168705

  • Cursor problem in PL/SQL function declaration

    Is it possible to declare a cursor in a pipelined function? Because I get errors when I try to do this.
    like this:
    create or replace function myFunctionName(id number) return number pipelined is
    out number;
    cursor myCursor (id number) is select * from mytable;
    begin
    open myCursor;
    end;
    If it is not possible, which other way I should use?
    Thanks,
    Mathieu

    Ok here is an example of a script that doesn't work:
    drop type numset_t;
    drop type num_type2;
    create or replace type num_type2 as object (x number(4), y number(4));
    create or replace type numset_t as table of num_type2;
    create or replace function f1(x number) return numset_t pipelined is
    out number;
    cursor myCursor is select * from cat;
    begin
    for i in 1..x loop
    pipe row(i);
    end loop;
    return;
    end;
    show errors;
    It gives me that output in sqlplus:
    SQL> @test
    Type dropped.
    Type dropped.
    Type created.
    Type created.
    Warning: Function created with compilation errors.
    Errors for FUNCTION F1:
    LINE/COL ERROR
    6/7 PL/SQL: Statement ignored
    6/16 PLS-00382: expression is of wrong type
    And here is what I get when I do:
    SQL> select * from cat;
    TABLE_NAME TABLE_TYPE
    TAXONTMP TABLE
    TMP_CMBSEQID2UPI TABLE
    Any idea?
    Thanks,
    Mathieu

  • Receive warning on Concurrent request

    Hi All,
    I am running the preliminary payment register while creating a payment batch but receive a warning message.
    APP-FND-00500: AFPPRN received a return code of failure from routine FDUPRN. An error occurred while AOL tried to spawn the print process
    Cause: AFPPRN received a return code of failure from the OSD routine FDUPRN. An error occurred while AOL tried to spawn the print process.
    Please give me any suggestions to how to fix this.
    Thanks in advance,

    Hi,
    What is the application release?
    Do you get this warning with all concurrent requests or just with this specific one?
    Please go through the following documents and see if it helps in resolving the issue.
    Note: 1018291.102 - APP-00500 Or APP-FND-00500 Error When Printing A Report
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=1018291.102
    Note: 156570.1 - APP-FND-00500 When Running a Concurrent Request
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=156570.1
    Note: 371350.1 - Some Concurrent Requests Error Out With Fduprn App-Fnd-500
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=371350.1
    Regards,
    Hussein

  • PB in RFC function declaring table as CHANGING

    Hi all,
    I wrote an RFC function to get data between 2 SAP systems. I've to transmit to this function select-options felds. Therefor I've created a changing parameter in the function  I_LFDAT type RSPARAMS_TT which is a table type with structure RSPARAMS.
    I did it by this way as 'Tables are obsolete' in RFC functions.
    My problem is that by calling the function I've a dump saying ' (ungültiger Datentyp 17)'. This means the parameter is not correct.
    I checked anything and the table I'm sending has the same structure as the receiving parameter
    thanks in advance for your help

    Hello Fred
    I am not really a fan of CHANGING parameters in fm's.
    Since you have the table type RSPARAMS_TT I would recommend to use the following approach:
    DATA:
      lt_seloptions   TYPE rsparams_tt.  " itab with select-options
    " fm signature with 2 parameters:
      IMPORTING
        it_selopts = lt_seloptions
      EXPORTING
       et_selopts = lt_seloptions
    The RFC-fm gets IT_SELOPTS as input, can change them, and returns them as EXPORTING parameter ET_SELOPTS.
    Regards
      Uwe

  • [Vim] CTags misses function declarations

    So I'm trying to set up C auto-completion in GVim using Omnicppcomplete, but it seems ctags is lazy on its job.
    For example, when I type
    ctags -R /usr/include/gtk-2.0
    ctags creates an incomplete tags file. Functions such as gtk_window_new() are not detected, and so I only have a partial auto-completion.
    Am I the only one to have this issue?

    darthaxul wrote:If your gonna be programming you must grab a better app such as medit, way easier config with mouse support also.
    Well, I couldn't disagree more with this comment If you want to be productive, try to forget about the mouse and learn to use the keyboard and the powerful editing capabilities of vim efficiently. I tried some IDEs (eclipse, kdevelop, netbeans) which had some nice features, but the editors were always lacking and they are too mouse oriented for my taste. Therefore I always kept coming back to vim.
    W.r.t. plugins, I do not really use many. Omnicompletion and ctags (and I have a background script running wich updates the tag file every minute) which I use regularly. With ctags you can find the declaration and implementation of symbols. And I think omnicomplete has some options for displaying the function prototype, like you want (I know I deactivated it, because for me it was too intrusive most of the time). I also have taglist installed, but I do not use it often.
    From the standard editing capabilities, what you should definitely look at is:
    - Define the indentation as you like it
    - Toggle highlighting of search terms on demand (I have this mapped on \s)
    - Use the "." command
    - Compile and jump to errors from within vim
    - Visual rectangle mode
    There are probably more, but these are the first that come to mind. If you really learn to use the extensive editing capabilities of vim, you probably will be equally efficient (or more) than with en IDE. After all, most of the time you are only editing.
    And to go to the "lacking aspects": what I really miss are refactoring tools, e.g. for changing the name of a class or a method of a class. This would be quite a useful addition and something where (some of) the IDEs have a clear advantage.
    Last edited by davvil (2009-06-05 09:38:52)

  • Newbie Function Declaration Question

    I'm getting a "method undeclared" error in XCode on my method "useOpenFileToGetFSRef".
    INTERFACE:
    @interface MyDocument : NSPersistentDocument {
    IBOutlet NSString *nameOfSourceFile;
    - (IBAction) getSourceFile:(id)sender;
    - (FSRef) useOpenFileToGetFSRef; //THIS IS THE METHOD I'M TRYING TO DECLARE
    @end
    IMPLEMENTATION:
    @implementation MyDocument
    - (FSRef)useOpenFileToGetFSRef //NO COMPILE ERROR FOR THIS LINE
    //function body...
    - (IBAction) getSourceFile:(id)sender{
    FSRef theFileFSRef = useOpenFileToGetFSRef; //COMPILE ERROR: 'useOpenFileToGetFSRef' UNDECLARED
    FSRef a = theFileFSRef;
    //more...
    @end
    How do I correct this? Thanks in advance for any info.

    Write it as a function:
    FSRef useOpenFileToGetFSRef(void)
    of course, you won't have access to any of the data structures in the document.

  • How can I invoke functions declared in my DocumentClass, Please?

    Hello Everyone,
    I have been at it for days now and don't know how to get this going. I have DocumentClass and I have a simple function which returns stage width. I now would like to call this function from othr class which exist within the same package as my DocumentClass. I am able to trace the stage width when I invoke stageWidth() function from the DocumentClass. As I to understand, if the function is public, and it is being accessed by a class that exist within the same package, I should be able to access the function withou any issues. And If I declare the function as STATIC then it is global and can be accessed by classes from other packages. Can anyone help me understand what am I doing wrong, please.
    Function that I have written:
    public function stageWidth()
       return stage.stageWidth;
    I am calling this function from Background class by class reference like this:
    DocumentClass.sWidth();
    I get this error:
    1180: Call to a possibly undefined method sWidth.
    Appreciate all your help. Thank you.

    In addition to my previous replies.
    Why do you need to access stage parameters via calling DocumentClass method? Stage is accessible by all the objects placed on it. So, in your Background class you can read stage.stageWidth directly. Again, this is given that the instance of Background is added to stage.
    Also, your Background class must extend some DisplayObject because, obviously, it will become an object to be displayed. Most often it is Sprite. In the code example below I added listeners for both when Background instance is added to stage and when it is added to display list. Observing the sequence may be very educational.
    So you class Background shoul look like this:
    package com.as3.learning {
        import flash.events.*;
        import flash.display.*;
        import flash.text.*;
        public class Background extends Sprite
            public function Background()
                trace(this + " constructor");
                // listen to when it is added to display list
                addEventListener(Event.ADDED, onAddedToList);
                // listen to when it is added to stage
                if (stage) init();
                else addEventListener(Event.ADDED_TO_STAGE, init);
            // this method can be called in two cases:
            // 1. when the instance is placed on stage and
            // 2. before it is placed.
            public function init(e:Event = null):void
                removeEventListener(Event.ADDED_TO_STAGE, init);
                // only now stage is available
                trace(this + ".init: stage.stageWidth: " + stage.stageWidth);
                trace(this + ".init: DocumentClass.sWidth() = " + DocumentClass.sWidth());
            private function onAddedToList(e:Event):void
                trace(this + ".onAddedToList: stage.stageWidth: " + stage.stageWidth);
                trace(this + ".onAddedToList: DocumentClass.sWidth() = " + DocumentClass.sWidth());

  • Function Declaration Syntax - Best Practices

    Id there any difference between these two declarations?
    If not, is one better that the other?
    sym.myFunction = function(parameter1,parameter2){
          // do stuff here 
         or
    function myFunction(parameter1,parameter2){
          // do stuff here 
    I'm seeing examples of both
    Thanks
    Mathias

    sym.myFunction
    Allows you to access the function anywhere else in your project, using this syntax: sym.getComposition().getStage().myFunction();
    function myFunction
    Is a local function scoped to the current object, and is not accessible by other objects.

  • [Function] Declare a internal table with structure name (entry parameter)

    Hi all,
    I'm explaining my problem :
    I want to create a function with two parameters in entry :
    (IMPORT)  - structure_name with type DD02L-TABNAME
    (TABLES) - t_outtab with empty type
    t_outtab will be in structure_name type.
    Now, in my source function, I want to retrieve all contain of t_outtab in another internal table or field-symbol. I don't know in advance the used structures in my function entries.
    I don't manage to get this contain, cause I can't do :
    DATA : internal_table TYPE structure_name*
    OR
    DATA : internal_table TYPE (structure_name)
    OR used field-symbol
    DATA : internal_table TYPE <fs>*  where <fs> had structure name value.
    To do more later :
    *DATA : line LIKE LINE OF internal_table. *
    *internal_table][ = t_outtab][. *
    And work with this table.
    _ I tried different solutions like : _
    Get the structure of the table.
      ref_table_des ?= cl_abap_typedescr=>describe_by_name( I_STRUCTURE_NAME ).
      idetails[] = ref_table_des->components[].
    Get the first structure table of result table
    LOOP AT idetails INTO xdetails.
        CLEAR: xfc.
        xfc-fieldname = xdetails-name .
        xfc-datatype = xdetails-type_kind.
        xfc-inttype = xdetails-type_kind.
        xfc-intlen = xdetails-length.
        xfc-decimals = xdetails-decimals.
        APPEND xfc TO ifc.
    ENDLOOP.
    Create dynamic internal table and assign to FS
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = ifc
        IMPORTING
          ep_table        = dy_table.
      ASSIGN dy_table->* TO <dyn_table>.
    Create dynamic work area and assign to FS
      CREATE DATA dy_line LIKE LINE OF <dyn_table>.
      ASSIGN dy_line->* TO <dyn_wa>.
    and retrieve to <dyn_table>[] = t_outtab[].
    the but I don't try the solution. If someone have an idea.
    Thanks and regards.
    Romain
    Edited by: Romain L on May 14, 2009 11:35 AM

    Hi,
    We can acheive this using dynamic internal tables.
    Please find sample below.
    *Creating Dynamic internal table 
      PARAMETERS : p_table(10) TYPE C.
      DATA: w_tabname TYPE w_tabname,            
            w_dref TYPE REF TO data,             
            w_grid TYPE REF TO cl_gui_alv_grid. 
      FIELD-SYMBOLS: <t_itab> TYPE ANY TABLE. 
      w_tabname = p_table. 
      CREATE DATA w_dref TYPE TABLE OF (w_tabname).
      ASSIGN w_dref->* TO <t_itab>.
    * Populating Dynamic internal table 
      SELECT *
        FROM (w_tabname) UP TO 20 ROWS
        INTO TABLE <t_itab>.
    * Displaying dynamic internal table using Grid. 
      CREATE OBJECT w_grid
        EXPORTING i_parent = cl_gui_container=>screen0. 
      CALL METHOD w_grid->set_table_for_first_display
        EXPORTING
          i_structure_name = w_tabname
        CHANGING
          it_outtab        = <t_itab>. 
      CALL SCREEN 100.
    * Scenario 2: 
    *Create a dynamic internal table with the specified number of columns. 
    * Creating Dynamic internal table
    TYPE-POOLS: slis.
    FIELD-SYMBOLS: <t_dyntable> TYPE STANDARD TABLE,  u201C Dynamic internal table name
                   <fs_dyntable>,                     u201C Field symbol to create work area
                   <fs_fldval> type any.              u201C Field symbol to assign values 
    PARAMETERS: p_cols(5) TYPE c.                     u201C Input number of columns
    DATA:   t_newtable TYPE REF TO data,
            t_newline  TYPE REF TO data,
            t_fldcat   TYPE slis_t_fldcat_alv,
            t_fldcat   TYPE lvc_t_fcat,
            wa_it_fldcat TYPE lvc_s_fcat,
            wa_colno(2) TYPE n,
            wa_flname(5) TYPE c. 
    * Create fields .
      DO p_cols TIMES.
        CLEAR wa_it_fldcat.
        move sy-index to wa_colno.
        concatenate 'COL'
                    wa_colno
               into wa_flname.
        wa_it_fldcat-fieldname = wa_flname.
        wa_it_fldcat-datatype = 'CHAR'.
        wa_it_fldcat-intlen = 10.
        APPEND wa_it_fldcat TO t_fldcat.
      ENDDO. 
    * Create dynamic internal table and assign to FS
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = t_fldcat
        IMPORTING
          ep_table        = t_newtable. 
      ASSIGN t_newtable->* TO <t_dyntable>. 
    * Create dynamic work area and assign to FS
      CREATE DATA t_newline LIKE LINE OF <t_dyntable>.
      ASSIGN t_newline->* TO <fs_dyntable>.
    *Populating Dynamic internal table 
      DATA: fieldname(20) TYPE c.
      DATA: fieldvalue(10) TYPE c.
      DATA: index(3) TYPE c. 
      DO p_cols TIMES. 
        index = sy-index.
        MOVE sy-index TO wa_colno.
        CONCATENATE 'COL'
                    wa_colno
               INTO wa_flname. 
    * Set up fieldvalue
        CONCATENATE 'VALUE' index INTO
                    fieldvalue.
        CONDENSE    fieldvalue NO-GAPS. 
        ASSIGN COMPONENT  wa_flname
            OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
        <fs_fldval> =  fieldvalue. 
      ENDDO. 
    * Append to the dynamic internal table
      APPEND <fs_dyntable> TO <t_dyntable>.
    * Displaying dynamic internal table using Grid. 
    DATA: wa_cat LIKE LINE OF fs_fldcat. 
      DO p_cols TIMES.
        CLEAR wa_cat.
        MOVE sy-index TO wa_colno.
        CONCATENATE 'COL'
                    wa_colno
               INTO wa_flname. 
        wa_cat-fieldname = wa_flname.
        wa_cat-seltext_s = wa_flname.
        wa_cat-outputlen = '10'.
        APPEND wa_cat TO fs_fldcat.
      ENDDO. 
    * Call ABAP List Viewer (ALV)
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          it_fieldcat = fs_fldcat
        TABLES
          t_outtab    = <t_dyntable>.
    Thanks,
    Jyothi
    Edited by: Jyothi on May 14, 2009 11:42 AM
    Edited by: Jyothi on May 14, 2009 11:43 AM

Maybe you are looking for

  • Domain Controller upgrade windows 2008 r2 to windows 2012

    I currently have 3 windows 2008 r2 domain controllers. 1 physical and 2 virtual. I am looking to see what the best upgrade path would be. the physical is the primary and has dhcp and dns services Stonecold31666

  • Problems with Arrowpoint cookies for clients behind a Proxy

    I have in a WebSite clients being load balanced using Arrowpoint cookies to a virtual Server. The CSS load balance between three Apache real servers. I have some clients that are behind some kind of Proxy Cache and I have seen with a sniffer that the

  • AppleScript resources and examples for Numbers 3

    As Woggledog points out in this thread Numbers 3 now has AppleScript support (as of version 3.1). The linked article in turn has a link to some helpful resources, including working examples, at Mac OS X Automation.  It appears that the AppleScript su

  • Has anyone scanned the latest flash player download for firefox

    I was wondering if anyone else has scanned a copy of the latest file dowloaded from adobe flash player for Firefox. I ran a scan from www.virustotal.com and it picked up a single virus detection called Win32.Corrupt.Ag by eSafe. Here are the results

  • Dead strip

    I have that dead strip problem (unresponsive line in touch) on my ipad2. I updated to ios 5.1.1 nothing happend. There no apple store in my country so i have to pay for the hardware. But do anyone know what i have to replace to solve the problem? Bec