Function Module in VL10G containing the Internal Table with All SO & PO

Hi,
    I have a situation where I need to get all the Sales Orders and POs for the given Shipping Point and Planned GI Date from my custom Report without writing SELECT queries. Now, can somebody give me a Function Module and the Internal Table Name where the actual data with Sales Orders and POs is stored?
Thanks,
Venkat.

Hi,
    I have a situation where I need to get all the Sales Orders and POs for the given Shipping Point and Planned GI Date from my custom Report without writing SELECT queries. Now, can somebody give me a Function Module and the Internal Table Name where the actual data with Sales Orders and POs is stored?
Thanks,
Venkat.

Similar Messages

  • Downloading the internal table with header to FTP folder

    Hi All,
    I have one requirement in downloading the internal table details with the fixed header line to FTP folder. The header line having the fixed text of 425 characters length.
    Note: We are not suppose to use WS_DOWNLOAD and GUI_DOWNLOAD function modules.
    Thanks in advance for your reply.
    Regards
    Kamini.

    Hi,
    I can download the internal table details successfully to FTP folder using the FTP function modules like(FTP_CONNECT, FTP_COMMAND , FTP_R/3_TO_SERVER and FTP_DISCONNECT). Here my problem is I am unable to download the internation table with some header text.
    You can see the format (example) of file to be download.
    Here I can successfully download the below details without the header. But I am unable to download with header line. Could you please suggest me.
    seq_no|record_action|trans_date|sku|description|
    1|N|2008-01-03 07:52:31|TTASA5025CBO     
    2|N|2008-01-03 10:28:33|411014        
    3|N|2008-01-03 10:01:03|TTASA6030CBO  
    4|N|2008-01-03 10:01:15|TTASA6630CBO
    5|N|2008-01-03 10:01:25|TTASA7035CBO 
    6|N|2008-01-08 16:57:39|TT6G       
    Regards
    Kamini.

  • Declare the internal table with only one 10 character  field and use

    Hi,
    I want to declare the internal table with only one 10 character  field and use.
    Jaya

    Hi,
    Go ahead. U can declare IT with only one field
    Example:
    data: begin of zcustlist occurs 1000,
                   custmer(10)  type c,
             end of zcustlist.
    Narendra Reddy.
    Edited by: Narendra Reddy C on Aug 8, 2008 11:39 AM

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

  • Function module to get data into internal table from Excel file sheets

    Hi,
    I have to upload customers from excel file.
    we are donloading customer data excel file sheets.
    Customer data in 1 sheet, tax data the other sheet of same excel file, Customer master-Credit data in other sheet of same excel file.
    so i have 3-4 sheet in one excel file.
    now my requirement is to get the data from excel file into internal table.
    is there any function module.
    Thanks & Regards

    I am sending you the idea with an example how you can upload data from an EXCEL file into an internal table. I am not sure if you can take data from different sheet in the same EXCEL file. I think that this is not possible (try it )
    Upload the data into an internal table, like the way that I am describing in the above:
      DATA: L_MAX_COL_NB TYPE I.
      DATA: l_file_name LIKE RLGRAP-FILENAME.
    Just to be sure that is the correct type for the FM.
      l_file_name = P_FILE_NAME.
      L_MAX_COL_NB = 58.  "Maximum nb of colums that the FM can read.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                FILENAME                = l_file_name
                I_BEGIN_COL             = 1
                I_BEGIN_ROW             = 2
                I_END_COL               = L_MAX_COL_NB
                I_END_ROW               = 9999
           TABLES
                INTERN                  = PT_EXCEL
           EXCEPTIONS
                INCONSISTENT_PARAMETERS = 1
                UPLOAD_OLE              = 2
                OTHERS                  = 3.
      IF SY-SUBRC <> 0.
      ENDIF.
    Now you should upload the data into your own itab. The Function Module will return to you all the an itab
    from all fields and columns. Define the structure of the uploading file into SE11 - Data Dictionary. Then read the fieldcatalog of this structure. In the code that I am sending to you, I am insearting an empty line into the internal table and then I am assigning this line into a corresponding field-symbol. Then I am able to change the working area - so and the line of the itab. Propably you could you the statement APPEND INITIAL LINE TO (your_table_name) ASSIGNING <your_field_symbol>, but the example was written in an old SAP version.
      FIELD-SYMBOLS:
                     <F_REC> LIKE WA_UPLOAD_FILE,      "working are of the uploading file
                     <F_FIELD> TYPE ANY.
      DATA: COLUMN_INT TYPE I,
            C_FIELDNAME(30) TYPE C.
      PERFORM GET_FIELDCATOLG TABLES FIELDCAT
                               USING 'ZECO_CHARALAMBOUS_FILE'.
      LOOP AT PT_EXCEL.
        AT NEW ROW.
          ASSIGN WA_UPLOAD_FILE TO <F_REC>.
        ENDAT.
        COLUMN_INT = PT_EXCEL-COL.
        READ TABLE FIELDCAT INTO WA_FIELDCAT INDEX COLUMN_INT.
        CONCATENATE '<F_REC>-' WA_FIELDCAT-FIELDNAME INTO C_FIELDNAME.
        ASSIGN (C_FIELDNAME) TO <F_FIELD>.
        <F_FIELD> = PT_EXCEL-VALUE.
        AT END OF ROW.
          APPEND WA_UPLOAD_FILE TO GT_UPLOAD_FILE.
          CLEAR WA_UPLOAD_FILE.
        ENDAT.
      ENDLOOP.
    With Regards
    George
    Edited by: giorgos michaelaris on Mar 4, 2010 3:44 PM

  • Pass the internal table with different structures to the class module

    Hi ,
    I have created a class method to fill up the data in XML format. the method can be called from various programs with internal table with different structures. I want to pass it as dynamic How can I do that.
    I tried to declare that as type any.
    but not working.
    regards,
    Madhuri

    Hi,
    You could work with data reference.
    Use GET REFERENCE OF itab INTO data_ref for passing the internal table to your method, and dereference it within the method with ASSIGN statement...
    DATA: lr_data TYPE REF TO data.
    GET REFERENCE OF itab INTO lr_data.
    CALL METHOD meth EXPORTING pr_data = lr_data.
    METHOD meth.
      FIELD-SYMBOLS <fs> TYPE ANY TABLE
      ASSIGN pr_data->* TO <fs>.
    ENDMETHOD.
    Kr,
    Manu.

  • Validate the data in the internal table with the date in selection screen

    Hi all,
    I want to validate the data in the internal table and get only the records with the input date in the selection screen.
    The date is in the select options and please let me know how to get the records only if it satisfies the input date in the selection screen.
    Regards,
    Shalem

    For Ex.
    SELECT-OPTIONS: S_DATE FOR VBAK-VDATU
    If you want to read one INTERNAL TABLE record
    READ TABLE it_tab(internal table name) WHERE vdatu(date field name in the internal table) = s_date
    If you want to move more then one
    LOOP AT it_tab WHERE vdatu = s_date.
    Take the field values in another table and append it. then end loop.
    you will get the records which only have the date in select option..
    If you want detail code give me internal table name and select option name i will write you the code.
    regards
    Yuvaram

  • How to fetch the data to the internal table with out using mandt

    Hi all,
    Iam giving my code please observer... and give me the reasonable solution.
      t_mar LIKE STANDARD TABLE OF z_mar.
    SELECT  mandt
             werks                         " Plant
             lifnr                         " Vendor
        FROM z_mar
        INTO TABLE t_mar
    where sal = 2000.
    By removing MANDT from select query, it is going to dump.
    ex:
       SELECT 
              werks                         " Plant
              lifnr                         " Vendor
         FROM z_mar
         INTO TABLE t_mar
    where sal = 2000.
    > Now it is going to dump ( here i removed the mandt field ).
    Please give me a solution to fetch the data by removing mandt in select statement, with out chaning the internal table structure.
    Thanks,
    Ravi

    hi Ravi,
    i also had to avoid move-corresponding and the following is what i did...its extra work and goes around but it will
    do the needed work..............
    t_mar LIKE STANDARD TABLE OF z_mar.
    SELECT *
    FROM z_mar
    INTO TABLE t_mar
    where sal = 2000.
    the above gets you all the fields ...but if you still want to narrow it down to just two fields
    *****Declaring structure with 2 fields
    data:begin of fs_data.
    data:werks type z_mar-werks,
         lifnr type z_mar-lifnr ,
    data:end of fs_data.
    *******internal table of above
    data:int_data like fs_data occurs 0 with headerline.
    *****moving the only 2 required fields
    loop at t_mar.
    t_mar-werks  = int_data-werks.
    t_mar-lifnr  = int_data-lifnr.
    append int_data.
    endloop.
    Hope you found it useful...
    Regards
    Bx

  • Dynamically fill the internal table with new fileds

    Hi Friends,
    I have the internal table like
    Data:begin of i_data occurs 0,
               a(60),
                b(60),
                c(60),
                d(60),
                 e(60),
            end of i_data.
    I need to fill the internal table dynamically like
    Data:begin of i_data occurs 0,
               a(60),
                b(60),
                c(60),
                 c1(60),  "new filed dynamically
                 c2(60),  "new field dynamically
                d(60),
                 e(60),
            end of i_data.
    Please suggest me how to do this.
    Regards,
    Sunny.
    Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 1:55 PM

    You can not add new fields to a statically defined internal table, instead you must create the entrie internal table at runtime.
    Search this forum for Dynamic Internal tables, you will get a lot of example programs.
    Regards,
    Rich Heilman

  • Function module to upload excel to internal table in SAP 7.0 version system

    <<Question has been asked and answered many times - please search before asking for function modules for common tasks>>
    currently i am using SAP Netweaver7.0 version, i need a Funtion Module to upload an Excel sheet data to an internal table.
    please let me know this ASAP.
    thanks,
    Edited by: Matt on Aug 24, 2009 7:25 AM

    hi,
    the FM you have suggested does not exist in the *version 7.0*
    added the FM "ALSM_....",also does not exist
    pls suggest a FM for SAP7.0 version

  • Read the internal table with key

    Hi friends,
    decleration of internal table is :
    TYPES : BEGIN OF ty_qmel,
              qmart TYPE qmel-qmart,
              qmnum TYPE qmel-qmnum,
              qmtxt TYPE qmel-qmtxt,
              strmn TYPE qmel-strmn,
              ltrmn TYPE qmel-ltrmn,
              objnr TYPE qmel-objnr,
              qmdat TYPE qmel-qmdat,
            END OF ty_qmel.
    i have written the query as follows .
    SELECT  qmart qmnum qmtxt strmn ltrmn FROM qmel
       INTO CORRESPONDING FIELDS OF TABLE i_qmel
       FOR ALL ENTRIES IN i_qmel
       WHERE qmart EQ i_qmel-qmart.
    I am getting the data into 1_qmel.
    Let me know how to read this table with key...?
    Thanks in advance...

    Hi,
    Refer this code.
    *&      Form  SUB_COLLECT_DATA
          text
    FORM sub_collect_data.
    *--Local variables
      DATA : lv_count(3) TYPE c.
      IF NOT it_fpltc[] IS INITIAL.
        LOOP AT it_fpltc INTO wa_fpltc.
          lv_count = wa_fpltc-fpltr+3(3).
          wa_final-ccnum = wa_fpltc-ccnum.
          wa_final-rfzei = lv_count.
          CLEAR : wa_vbrk.
          READ TABLE it_vbrk INTO wa_vbrk WITH KEY rplnr = wa_fpltc-fplnr
                                                   BINARY SEARCH.
          IF sy-subrc EQ 0.
            wa_final-vbeln = wa_vbrk-vbeln.
            wa_final-bukrs = wa_vbrk-bukrs.
          ENDIF.
          APPEND wa_final TO it_final.
          CLEAR : wa_vbrk,
                  wa_fpltc,
                  lv_count.
        ENDLOOP.
    Regards,
    PRashant

  • Difference betwen the internal tables

    Hai friends,
               Pls give me the types  of internal tables and their   differences .and its usage by example.
      regrds,
    Prashanth.

    Internal tables
    Definition
    Data structure that exists only at program runtime.
    An internal table is one of two structured data types in ABAP. It can contain any number of identically structured rows, with or without a header line.
    The header line is similar to a structure and serves as the work area of the internal table. The data type of individual rows can be either elementary or structured.
    Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data objects, they save the programmer the task of dynamic memory management in his or her programs. You should use internal tables whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for storing and formatting data from a database table within a program. They are also a good way of including very complicated data structures in an ABAP program.
    Like all elements in the ABAP type concept, internal tables can exist both as data types and as data objects . A data type is the abstract description of an internal table, either in a program or centrally in the ABAP Dictionary, that you use to create a concrete data object. The data type is also an attribute of an existing data object.
    Internal Tables as Data Types
    Internal tables and structures are the two structured data types in ABAP. The data type of an internal table is fully specified by its line type, key, and table type.
    Line type
    The line type of an internal table can be any data type. The data type of an internal table is normally a structure. Each component of the structure is a column in the internal table. However, the line type may also be elementary or another internal table.
    Key
    The key identifies table rows. There are two kinds of key for internal tables - the standard key and a user-defined key. You can specify whether the key should be UNIQUE or NON-UNIQUE. Internal tables with a unique key cannot contain duplicate entries. The uniqueness depends on the table access method.
    If a table has a structured line type, its default key consists of all of its non-numerical columns that are not references or themselves internal tables. If a table has an elementary line type, the default key is the entire line . The default key of an internal table whose line type is an internal table, the default key is empty.
    The user-defined key can contain any columns of the internal table that are not references or themselves internal tables. Internal tables with a user-defined key are called key tables. When you define the key, the sequence of the key fields is significant. You should remember this, for example, if you intend to sort the table according to the key.
    Table type
    The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types:
    Standard tables have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled very quickly, since the system does not have to check whether there are already existing entries.
    Sorted tables are always saved sorted by the key. They also have an internal index. The system can access records either by using the table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique or non-unique. When you define the table, you must specify whether the key is to be unique or not. Standard tables and sorted tables are known generically as index tables.
    Hashed tables have no linear index. You can only access a hashed table using its key. The response time is independent of the number of table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. When you define the table, you must specify the key as UNIQUE.
    Generic Internal Tables
    Unlike other local data types in programs, you do not have to specify the data type of an internal table fully. Instead, you can specify a generic construction, that is, the key or key and line type of an internal table data type may remain unspecified. You can use generic internal tables to specify the types of field symbols and the interface parameters of procedures. You cannot use them to declare data objects.
    Internal Tables as Dynamic Data Objects
    Data objects that are defined either with the data type of an internal table, or directly as an internal table, are always fully defined in respect of their line type, key and access method. However, the number of lines is not fixed. Thus internal tables are dynamic data objects, since they can contain any number of lines of a particular type. The only restriction on the number of lines an internal table may contain are the limits of your system installation. The maximum memory that can be occupied by an internal table (including its internal administration) is 2 gigabytes. A more realistic figure is up to 500 megabytes. An additional restriction for hashed tables is that they may not contain more than 2 million entries. The line types of internal tables can be any ABAP data types - elementary, structured, or internal tables. The individual lines of an internal table are called table lines or table entries. Each component of a structured line is called a column in the internal table.
    Choosing a Table Type
    The table type (and particularly the access method) that you will use depends on how the typical internal table operations will be most frequently executed.
    Standard tables
    This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest possible access. You should fill a standard table by appending lines (ABAP APPEND statement), and read, modify and delete entries by specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship with the number of table entries. If you need key access, standard tables are particularly useful if you can fill and process the table in separate steps. For example, you could fill the table by appending entries, and then sort it. If you use the binary search option with key access, the response time is logarithmically proportional to the number of table entries.
    Sorted tables
    This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERT statement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the table key in the WHERE condition.
    Hashed tables
    This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index. The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data.
    Special Features of Standard Tables
    Unlike sorted tables, hashed tables, and key access to internal tables, which were only introduced in Release 4.0, standard tables already existed several releases previously. Defining a line type, table type, and tables without a header line have only been possible since Release 3.0. For this reason, there are certain features of standard tables that still exist for compatibility reasons.
    Standard Tables Before Release 3.0
    Before Release 3.0, internal tables all had header lines and a flat-structured line type. There were no independent table types. You could only create a table object using the OCCURS addition in the DATA statement, followed by a declaration of a flat structure:
    DATA: BEGIN OF  .
    The effect of the OCCURS addition is to construct a standard table with the data type
    They can also be replaced by the following statements:
    Standard Tables From Release 4.0
    When you create a standard table, you can use the following forms of the TYPES and DATA statements. The addition INITIAL SIZE is also possible in all of the statements. The addition WITH HEADER LINE is possible in the DATA statement.
    Standard Table Types
    Generic Standard Table Type:
    TYPES  TYPE|LIKE TABLE OF  TYPE|LIKE TABLE OF 
                           WITH   TYPE|LIKE TABLE OF  TYPE|LIKE TABLE OF  TYPE|LIKE TABLE OF 
                           WITH   .
    Here, the LIKE addition refers to an existing table object in the same program. The TYPE addition can refer to an internal type in the program declared using the TYPES statement, or a table type in the ABAP Dictionary.
    You must ensure that you only refer to tables that are fully typed. Referring to generic table types (ANY TABLE, INDEX TABLE) or not specifying the key fully is not allowed (for exceptions, refer to Special Features of Standard Tables).
    The optional addition WITH HEADER line declares an extra data object with the same name and line type as the internal table. This data object is known as the header line of the internal table. You use it as a work area when working with the internal table (see Using the Header Line as a Work Area). When you use internal tables with header lines, you must remember that the header line and the body of the table have the same name. If you have an internal table with header line and you want to address the body of the table, you must indicate this by placing brackets after the table name ([]). Otherwise, ABAP interprets the name as the name of the header line and not of the body of the table. You can avoid this potential confusion by using internal tables without header lines. In particular, internal tables nested in structures or other internal tables must not have a header line, since this can lead to ambiguous expressions.
                      TYPES VECTOR TYPE SORTED TABLE OF I WITH UNIQUE KEY TABLE LINE.
    DATA: ITAB TYPE VECTOR,
          JTAB LIKE ITAB WITH HEADER LINE.
    MOVE ITAB TO JTAB.   <-  Syntax error!
    MOVE ITAB TO JTAB[].
    The table object ITAB is created with reference to the table type VECTOR. The table object JTAB has the same data type as ITAB. JTAB also has a header line. In the first MOVE statement, JTAB addresses the header line. Since this has the data type I, and the table type of ITAB cannot be converted into an elementary type, the MOVE statement causes a syntax error. The second MOVE statement is correct, since both operands are table objects.
    Declaring New Internal Tables
    You can use the DATA statement to construct new internal tables as well as using the LIKE or TYPE addition to refer to existing types or objects. The table type that you construct does not exist in its own right; instead, it is only an attribute of the table object. You can refer to it using the LIKE addition, but not using TYPE. The syntax for constructing a table object in the DATA statement is similar to that for defining a table type in the TYPES statement.
    DATA ]
    As when you define a table type, the type constructor
    of an internal table as follows:
    UNIQUE KEY  belong to the key as long as they are not internal tables or references, and do not contain internal tables or references. Key fields can be nested structures. The substructures are expanded component by component when you access the table using the key. The system follows the sequence of the key fields.
    UNIQUE KEY TABLE LINE
    If a table has an elementary line type (C, D, F, I, N, P, T, X), you can define the entire line as the key. If you try this for a table whose line type is itself a table, a syntax error occurs. If a table has a structured line type, it is possible to specify the entire line as the key. However, you should remember that this is often not suitable.
    UNIQUE DEFAULT KEY
    This declares the fields of the default key as the key fields. If the table has a structured line type, the default key contains all non-numeric columns of the internal table that are not and do not contain references or internal tables. If the table has an elementary line type, the default key is the entire line. The default key of an internal table whose line type is an internal table, the default key is empty.
    Specifying a key is optional. If you do not specify a key, the system defines a table type with an arbitrary key. You can only use this to define the types of field symbols and the interface parameters of procedures. For exceptions, refer to Special Features of Standard Tables.
    The optional additions UNIQUE or NON-UNIQUE determine whether the key is to be unique or non-unique, that is, whether the table can accept duplicate entries. If you do not specify UNIQUE or NON-UNIQUE for the key, the table type is generic in this respect. As such, it can only be used for specifying types. When you specify the table type simultaneously, you must note the following restrictions:
    ·     You cannot use the UNIQUE addition for standard tables. The system always generates the NON-UNIQUE addition automatically.
    ·     You must always specify the UNIQUE option when you create a hashed table.
    Initial Memory Requirement
    You can specify the initial amount of main memory assigned to an internal table object when you define the data type using the following addition:
    INITIAL SIZE , the system calculates a new value so that n times the line width is around 12KB.
    Examples
    TYPES: BEGIN OF LINE,
      COLUMN1 TYPE I,
      COLUMN2 TYPE I,
      COLUMN3 TYPE I,
    END OF LINE.
    1. TYPES ITAB TYPE SORTED TABLE OF LINE WITH UNIQUE KEY COLUMN1.
    The program defines a table type ITAB. It is a sorted table, with line type of the structure LINE and a unique key of the component COLUMN1.
    2. TYPES VECTOR TYPE HASHED TABLE OF I WITH UNIQUE KEY                      TABLE LINE.
    TYPES: BEGIN OF LINE,
      COLUMN1 TYPE I,
      COLUMN2 TYPE I,
      COLUMN3 TYPE I,
    END OF LINE.
    TYPES ITAB TYPE SORTED TABLE OF LINE WITH UNIQUE KEY COLUMN1.
    TYPES: BEGIN OF DEEPLINE,
    FIELD TYPE C,
    TABLE1 TYPE VECTOR,
    TABLE2 TYPE ITAB,
    END OF DEEPLINE.
    TYPES DEEPTABLE TYPE STANDARD TABLE OF DEEPLINE
    WITH DEFAULT KEY.
    The program defines a table type VECTOR with type hashed table, the elementary line type I and a unique key of the entire table line. The second table type is the same as in the previous example. The structure DEEPLINE contains the internal table as a component. The table type DEEPTABLE has the line type DEEPLINE. Therefore, the elements of this internal table are themselves internal tables. The key is the default key - in this case the column FIELD. The key is non-unique, since the table is a standard table.
    Specifying the Type of Formal Parameters
    Formal parameters can have any valid ABAP data type. You can specify the type of a formal parameter, either generically or fully, using the TYPE or LIKE addition. If you specify a generic type, the type of the formal parameter is either partially specified or not specified at all. Any attributes that are not specified are inherited from the corresponding actual parameter when the subroutine is called. If you specify the type fully, all of the technical attributes of the formal parameter are defined with the subroutine definition.
    The following remarks about specifying the types of parameters also apply to the parameters of other procedures (function modules and methods).
    If you have specified the type of the formal parameters, the system checks that the corresponding actual parameters are compatible when the subroutine is called. For internal subroutines, the system checks this in the syntax check. For external subroutines, the check cannot occur until runtime.
    By specifying the type, you ensure that a subroutine always works with the correct data type. Generic formal parameters allow a large degree of freedom when you call subroutines, since you can pass data of any type. This restricts accordingly the options for processing data in the subroutine, since the operations must be valid for all data types. For example, assigning one data object to another may not even be possible for all data types. If you specify the types of subroutine parameters, you can perform a much wider range of operations, since only the data appropriate to those operations can be passed in the call. If you want to process structured data objects component by component in a subroutine, you must specify the type of the parameter.
    Specifying Generic Types
    The following types allow you more freedom when using actual parameters. The actual parameter need only have the selection of attributes possessed by the formal parameter. The formal parameter adopts its remaining unnamed attributes from the actual parameter.
         Check for actual parameters
    No type specificationTYPE ANY     The subroutine accepts actual parameters of any type. The formal parameter inherits all of the technical attributes of the actual parameter.
    TYPE C, N, P, or X     The subroutine only accepts actual parameters with the type C, N, P, or X. The formal parameter inherits the field length and DECIMALS specification (for type P) from the actual parameter.
    TYPE TABLE     The system checks whether the actual parameter is a standard internal table. This is a shortened form of TYPE STANDARD TABLE (see below).
    TYPE ANY TABLE     The system checks whether the actual parameter is an internal table. The formal parameter inherits all of the attributes (line type, table type, key) from the actual parameter.
    TYPE INDEX TABLE     The system checks whether the actual parameter is an index table (standard or sorted table). The formal parameter inherits all of the attributes (line type, table type, key) from the actual parameter.
    TYPE STANDARD TABLE     The system checks whether the actual parameter is a standard internal table. The formal parameter inherits all of the attributes (line type, key) from the actual parameter.
    TYPE SORTED TABLE     The system checks whether the actual parameter is a sorted table. The formal parameter inherits all of the attributes (line type, key) from the actual parameter.
    TYPE HASHED TABLE     The system checks whether the actual parameter is a hashed table. The formal parameter inherits all of the attributes (line type, key) from the actual parameter.
    Note that formal parameters inherit the attributes of their corresponding actual parameters dynamically at runtime, and so they cannot be identified in the program code. For example, you cannot address an inherited table key statically in a subroutine, but you probably can dynamically.
    TYPES: BEGIN OF LINE,
            COL1,
            COL2,
          END OF LINE.
    DATA: WA TYPE LINE,
          ITAB TYPE HASHED TABLE OF LINE WITH UNIQUE KEY COL1,
          KEY(4) VALUE 'COL1'.
    WA-COL1 = 'X'. INSERT WA INTO TABLE ITAB.
    WA-COL1 = 'Y'. INSERT WA INTO TABLE ITAB.
    PERFORM DEMO USING ITAB.
    FORM DEMO USING P TYPE ANY TABLE.
      READ TABLE P WITH TABLE KEY (KEY) = 'X' INTO WA.
    ENDFORM.
    The table key is addressed dynamically in the subroutine. However, the static address
    READ TABLE P WITH TABLE KEY COL1 = 'X' INTO WA.
    is syntactically incorrect, since the formal parameter P does not adopt the key of table ITAB until runtime.
    Assigning Internal Tables :
    Like other data objects, you can use internal tables as operands in a MOVE statement
    MOVE , including the data in any nested internal tables. The original contents of the target table are overwritten.
    If you are using internal tables with header lines, remember that the header line and the body of the table have the same name. If you want to address the body of the table in an assignment, you must place two brackets () after the table name.
    DATA: BEGIN OF line,
            col1(1) TYPE c,
            col2(1) TYPE c,
          END OF line.
    DATA: etab LIKE TABLE OF line WITH HEADER LINE,
          ftab LIKE TABLE OF line.
    line-col1 = 'A'. line-col2 = 'B'.
    APPEND line TO etab.
    MOVE etab[] TO ftab.
    LOOP AT ftab INTO line.
      WRITE: / line-col1, line-col2.
    ENDLOOP.
    The output is:
    A B
    The example creates two standard tables ETAB and FTAB with the line type of the structure LINE. ETAB has a header line. After filling ETAB line by line using the APPEND statement, its entire contents are assigned to FTAB. Note the brackets in the statement.
    DATA: ftab TYPE SORTED TABLE OF f
               WITH NON-UNIQUE KEY table_line,
          itab TYPE HASHED TABLE OF i
               WITH UNIQUE KEY table_line,
          fl   TYPE f.
    DO 3 TIMES.
      INSERT sy-index INTO TABLE itab.
    ENDDO.
    ftab = itab.
    LOOP AT ftab INTO fl.
      WRITE: / fl.
    ENDLOOP.
    The output is:
    1.000000000000000E+00
    2.000000000000000E+00
    3.000000000000000E+00
    FTAB is a sorted table with line type F and a non-unique key. ITAB is a hashed table with line type I and a unique key. The line types, and therefore the entire tables, are convertible. It is therefore possible to assign the contents of ITAB to FTAB. When you assign the unsorted table ITAB to the sorted table FTAB, the contents are automatically sorted by the key of FTAB.
    In Unicode systems, the following conversion is not allowed:
    DATA: BEGIN OF iline,
            num TYPE i,
          END OF iline,
          BEGIN OF fline,
            num TYPE f,
          END OF fline,
          itab LIKE TABLE OF iline,
          ftab LIKE TABLE OF fline.
    DO 3 TIMES.
      iline-num = sy-index.
      APPEND iline-num TO itab.
    ENDDO.
    ftab = itab.
    loop AT ftab INTO fline.
      WRITE: / fline-num.
    ENDLOOP.
    In a non-Unicode system, the output may look something like this:
            6.03823403895813E-154
            6.03969074613219E-154
            6.04114745330626E-154
    Here, the line types of the internal tables ITAB and FTAB are structures each with one component of type I or F. The line types are convertible, but not compatible. Therefore, when assigning ITAB to FTAB, the contents of Table ITAB are converted to type C fields and then written to FTAB. The system interprets the transferred data as type F fields, so that the results are meaningless. In Unicode systems, you are not allowed to convert numeric fields to fields of type C.
    Initializing Internal Tables
    Like all data objects, you can initialize internal tables with the
    CLEAR .
    statement. This statement restores an internal table to the state it was in immediately after you declared it. This means that the table contains no lines. However, the memory already occupied by the memory up until you cleared it remains allocated to the table.
    If you are using internal tables with header lines, remember that the header line and the body of the table have the same name. If you want to address the body of the table in a comparison, you must place two brackets () after the table name.
    CLEAR , LT, <).
    If you are using internal tables with header lines, remember that the header line and the body of the table have the same name. If you want to address the body of the table in a comparison, you must place two brackets () after the table name.
    The first criterion for comparing internal tables is the number of lines they contain. The more lines an internal table contains, the larger it is. If two internal tables contain the same number of lines, they are compared line by line, component by component. If components of the table lines are themselves internal tables, they are compared recursively. If you are testing internal tables for anything other than equality, the comparison stops when it reaches the first pair of components that are unequal, and returns the corresponding result.
    DATA: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA: ITAB LIKE TABLE OF LINE,
                 JTAB LIKE TABLE OF LINE.
    DO 3 TIMES.
    LINE-COL1 = SY-INDEX.
    LINE-COL2 = SY-INDEX ** 2.
      APPEND LINE TO ITAB.
    ENDDO.
    MOVE ITAB TO JTAB.
    LINE-COL1 = 10. LINE-COL2 = 20.
    APPEND LINE TO ITAB.
    IF ITAB GT JTAB.
    WRITE / 'ITAB GT JTAB'.
    ENDIF.
    APPEND LINE TO JTAB.
    IF ITAB EQ JTAB.
    WRITE / 'ITAB EQ JTAB'.
    ENDIF.
    LINE-COL1 = 30. LINE-COL2 = 80.
    APPEND LINE TO ITAB.
    IF JTAB LE ITAB.
    WRITE / 'JTAB LE ITAB'.
    ENDIF.
    LINE-COL1 = 50. LINE-COL2 = 60.
    APPEND LINE TO JTAB.
    IF ITAB NE JTAB.
    WRITE / 'ITAB NE JTAB'.
    ENDIF.
    IF ITAB LT JTAB.
    WRITE / 'ITAB LT JTAB'.
    ENDIF.
    The output is:
    ITAB GT JTAB
    ITAB EQ JTAB
    JTAB LE ITAB
    ITAB NE JTAB
    ITAB LT JTAB
    This example creates two standard tables, ITAB and JTAB. ITAB is filled with 3 lines and copied to JTAB. Then, another line is appended to ITAB and the first logical expression tests whether ITAB is greater than JTAB. After appending the same line to JTAB, the second logical expression tests whether both tables are equal. Then, another line is appended to ITAB and the third logical expressions tests whether JTAB is less than or equal to ITAB. Next, another line is appended to JTAB. Its contents are unequal to the contents of the last line of ITAB. The next logical expressions test whether ITAB is not equal to JTAB. The first table field whose contents are different in ITAB and JTAB is COL1 in the last line of the table: 30 in ITAB and 50 in JTAB. Therefore, in the last logical expression, ITAB is less than JTAB.
    Sorting Internal Tables
    You can sort a standard or hashed table in a program. To sort a table by its key, use the statement
    SORT  ASCENDING .
    The statement sorts the internal table  ASCENDING
                 BY  ASCENDING
                     ASCENDING .
    The table is now sorted by the specified components : ‘T’ for standard table, ‘S’ for sorted table, and ‘H’ for hashed table.
    DATA: BEGIN OF LINE,
             COL1 TYPE I,
             COL2 TYPE I,
          END OF LINE.
    DATA ITAB LIKE HASHED TABLE OF LINE WITH UNIQUE KEY COL1
                                        INITIAL SIZE 10.
    DATA: LIN TYPE I,
          INI TYPE I,
          KND TYPE C.
    DESCRIBE TABLE ITAB LINES LIN OCCURS INI KIND KND.
    WRITE: / LIN, INI, KND.
    DO 1000 TIMES.
      LINE-COL1 = SY-INDEX.
      LINE-COL2 = SY-INDEX ** 2.
    INSERT LINE INTO TABLE ITAB.
    ENDDO.
    DESCRIBE TABLE ITAB LINES LIN OCCURS INI KIND KND.
    WRITE: / LIN, INI, KND.
    The output is:
             0         10  H
         1,000         10  H
    Here, a hashed table ITAB is created and filled. The DESCRIBE TABLE statement is processed before and after the table is filled. The current number of lines changes, but the number of initial lines cannot change.
    INSERT LINE INTO TABLE ITAB.
    LINE-TEXT = 'Moller'.
    CONVERT TEXT LINE-TEXT INTO SORTABLE CODE LINE-XTEXT.
    INSERT LINE INTO TABLE ITAB.
    LINE-TEXT = 'Miller'.
    CONVERT TEXT LINE-TEXT INTO SORTABLE CODE LINE-XTEXT.
    INSERT LINE INTO TABLE ITAB.
    SORT ITAB.
    PERFORM LOOP_AT_ITAB.
    SORT ITAB BY XTEXT.
    PERFORM LOOP_AT_ITAB.
    SORT ITAB AS TEXT.
    PERFORM LOOP_AT_ITAB.
    FORM LOOP_AT_ITAB.
      LOOP AT ITAB INTO LINE.
        WRITE / LINE-TEXT.
      ENDLOOP.
      SKIP.
    ENDFORM.
    This example demonstrates alphabetical sorting of character fields. The internal table ITAB contains a column with character fields and a column with corresponding binary codes that are alphabetically sortable. The binary codes are created with the CONVERT statement (see Converting to a Sortable Format). The table is sorted three times. First, it is sorted binarily by the TEXT field. Second, it is sorted binarily by the XTEXT field. Third, it is sorted alphabetically by the TEXT field. Since there is no directly corresponding case in English, we have taken the results from a German text environment:
    Miller
    Moller
    Muller
    Möller
    Miller
    Moller
    Möller
    Muller
    Miller
    Moller
    Möller
    Muller
    After the first sorting, 'Möller' follows behind 'Muller' since the internal code for the letter 'ö' comes after the code for 'u'. The other two sorts are alphabetical
    The binary sort by XTEXT has the same result as the alphabetical sorting by the field TEXT.
    Regards,
    Amit
    Reward all helpful replies.

  • Create an internal table with the rows of another internal table.

    Hi I want to know if posible to create an internal table structure with the  rows of another internal table?
    ex.
    If in i_tab column A has this values: row 1 = first, row 2 = second, row 3 = third.
    Now I want that the structure of my internal table be: first, second, third

    Hi,
    If you do this way then what will be the difference between the two table anyway?? First internal table has the same structure irrespective of which row you select. and you are going to store the data from each row to the rows of the second internal table. In that case, the structure of the internal table is the same as first table. and it would have same rows.
    Am I missing something here? or you want to declare the internal table with each field being the structure of the first table? In this case you'd have to do a dynamic declaration of data as the first table can have any no of rows then the second table would have any no of fields in the structure.
    Now if you know that your first internal table is going to have a fixed no of rows eg 3 rows then it becomes simple. Do the following then
    Data: begin of second_table occurs 0,
    first type <first_table type>,
    second type <first_table type>,
    third type <first_table type>,
    end of second_table.
    Regards
    Prasenjit

  • Getting the last record from the internal table

    When we use a READ statement it always picks up the first record which fulfill its condition but in my case I want to pick up the last record that fulfills it condition
    I have a internal table like
    id     type
    N1      A
    N1      T
    N1      A
    N1      6 ----> LAST RECORD
    my code is
    read table itab wIth key id = netobjid.
    for eg if netobjid = N1 , then I want to read the last record that corresponds to N1 ie ID N1 TYPE - 6...
    How to do that?

    HI
    actually i have done same requirement like this ...
    Take  one count variable into your internal table ..you pass the number of records into cont variable for every time  u enter the loop .
    Sort the internal table with count variable descending . ( AS we cant sort the internal table with sy-tabix)
    Then use read statement with sy-index = 1 .
    USe below logic ,............
    data  :  count  type i value '0'.
    LOOP at int .
    count = count + 1 .
    endloop.
    sort int count descending .
    read int  with  index = 1 .

  • Sorting internal table with line types

    Hi,
    I have internal table juts for an example with four entries as below:
    A[]
    Line.....Line Types
    444001.....P
    New York...C 
    Evershine..B
    Mary.......N
    I want to sort the internal table with line types in order of lin types NBCP.
    How can i do this ?
    Please help.
    Note: Above example is just with four entries, there might be internal table with ten entries and ten defined sorting order for line types.

    Hi Tushar,
    Please note that we can't changes the mandatory sequence of the address format as defined in the country specif address format. We can change the sequence of others fields by line_priority.
    Try to change the address type :
    ADDRESS_TYPE - Address type (from 3.0C)
    There are three types of address:
    Address type '1': addresses of firms or organizations; the address structure which is used in most SAP applications as 'Address'.
    Address type '2': address of a person
    Address type '3': work address, usually the address of a contact person in a company
    Please use T/code "OY01"> Select Country> Example :AU"--> Display --> Select address key and press F1. You will find SAP 's Address format configuration .
    sap help:
    Formatting Routine Key for Printing Addresses
    For printing addresses, there are country-specific routines which in each case copy the correct postal formatting of the address.
    The three-character "Address Layout Key" for the recipient country controls which of the routines available for formatting addresses in the relevant country is used.
    These routines are programmed into the ADDRESS_INTO_PRINTFORM function module.
    They are based on different national and international guidelines and norms, including:
    ISO 11180,
    contracts of the World Postal Union (Seoul 1994),
    international address samples from the World Postal Union
    as well as the available rules of the individual countries.
    Below you will find an overview of the country-specific formats currently implemented.
    Customers can program their own formatting routines using a customer exit. The SZAD0001 SAP enhancement has been defined in the package SZAD for this (-> transaction CMOD).
    General formatting rules
    The following parameters are used depending on the transaction:
    whether the company address (street/house number) or the P.O. Box address is printed if both exist,
    how many lines are available for printing,
    which is the sender country.
    If there are not enough lines, then lines are left out according to a standard sequence.
    The address format depends on whether the sender country is the same as, or different from, the recipient country. The country is always specified from abroad, either as a text name, or as an identification code of up to three characters (license plate code or country key).
    Where the country name is written out in full, it is written in the language of the sender country. If a language is not specified for the sender country, or the sender country itself is not specified, the logon language is used instead.
    Exception: the language for the country code can be explicitly overwritten by a parameter in the print program (e.g. when the country code for customs transit papers is always to be specified in a particular language, such as English). if the "Print country name in recipient language" flag is set in the print program, the recipient language is used.
    Other language-dependent components such as the title and the word 'PO Box' are printed in the recipient language or the recipient country language. If this cannot be determined, the logon language is again used.
    For all formats except Great Britain (006), Japan (013), and South Korea (017), the core of the address is formatted as follows (without empty lines, except for the compulsory empty line:)
    title line (if applicable)
    name block (differs depending on the address type, see below)
    street address or PO Box
                            (compulsory empty line, if applicable)
    city line with postal code
    country code (if applicable)
    The city line and the country name are always printed in upper case for foreign addresses (only for the complete address, not for short forms).
    The name block generally consists of the following:
    "Normal" addresses (address type SPACE and address type 1):
    NAME1
    NAME2
    NAME3
    NAME4
    Personal addresses (address type 2):
    Title of person and name of person
    Business address with department and contact person (address type 3):
    NAME1
    NAME2
    NAME3
    NAME4
    department
    title of person and name of person
    In addresses entered using Business Address Services (central address management) (see Release notes Central Address Management for Release 4.0 and Central Address Management for Release 4.5 ), the street address can comprise several lines (see Print street address), otherwise street and house number are maintained in the Street field.
    Some countries do not have a compulsory empty line (see notes below). The city and district are printed in the city line, connected by a hyphen (exceptions: 004 USA, 006 Great Britain/Ireland, 013 Japan, 015 Germany, 017 South Korea, 019 Denmark), provided that the total length does not exceed 35 characters. If a different city is specified for the PO Box (PFORT), this is used in the PO Box address.
    In all formats which use a country code (currently 001 European standard format 002 Italy, 011 Switzerland and 014 Austria ), the license plate code for that country is used. If this is not maintained, the country key in table T005 is used.
    If the "Print country name in foreign addresses" flag is set for the sender country in table 005, the country code is not used; the country name is printed in the last line of the address.
    Formats 004 (USA), 005 (Canada) and 008 (Singapore) contain a line ('F') for the function of the contact person in the company (if address type = '3'). This line comes immediately after the line 'N' (Name (and title) of the natural person).
    In formats 002 (Italy), 004 (USA), 005 (Canada), 006 (Great Britain), 007 (Brazil) and Australia (009), the REGIO field (Region, State, Province, County) is formatted. For the USA, Canada, Brazil and Australia, the key from table T005S is used; for Great Britain the text name from table T005U.
    In all countries for which no "Address structure key" is maintained, a standard format is used which corresponds to format "010".
    Hope this may help you.
    Lanka

Maybe you are looking for

  • How to disable check box (row selector) in a tabular APEX report

    I have a tabular report with check boxes that gets populated by a SQL query.  For certain rows, I want to disable (or not render) the check box, depending on the value of one of the columns for that particular row (if the value of a column defined as

  • Process exited with exit code 1.

    Hi all, I am trying to run the XML Page .can you please help me how to resolve this type of issue? D:\OAF\jdevhome\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\config> D:\OAF\jdevbin\jdk\bin\javaw.exe -hotspot -classpath D:\OAF\jdevbin\j2ee\hom

  • Reg Adapter Module in SAP PI 7.11

    Hi, I am trying to develop an Adapter Module using SAP NWDS and I am referring http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e6747fa?quicklink=index&overridelayout=true for the same. Now I am stuck on

  • WDS unattend.xml shutdown the system after installing the image instead of reboot.

    I have a large number of machines that I want to install Windows 7 by using WDS unattend.xml.  unattend.xml works absolutely fine but I want WINPE to shutdown the system at the end of image installation and before OOBE.  Could you please let me know,

  • In California - no download previous purchases option in 10.3

    I'm in California, but not getting an option to download previous purchases in iTunes 10.3 on my i7 MBPro. (Works fine on my i5 iMac.) Both run OS 10.6.7. I've uninstalled/reinstalled iTunes 10.3, including .pkgs, .plists, iTunes helper, etc, and I'v