Declaration of table

Hi Experts these are the table entries , Please let me know how to create table and call it in program.When calling this in program plese give me one example.
country     customer           
Kosovo     35271322     Labochem     Gjakova
Kosovo     35261190     NTSH "Koslabor"     Prishtina
Kosovo     35285432     Agani     Prishtina
Kosovo     35273167     Tri-Med     Prishtina
Kosovo     35227569     Eramed     Prishtina
Kosovo     35288017     Universität      Prishtina
Kosovo     35260594     SAIC     Prishtina
Montenegro     35036855     BUSINESSMONTENEGRO D.D.     Podgorica
  we have to insert those
8 customers and their countries into the program.
Perhaps here a solution with a Z-table containing the given 8 customers is
feasible as well – but this table should only be called when required (performance!).
Thanks & Regards
Ahammad.shaik

Hi,
Create a table with the fields as below.
Country - char(15)
customer -char(40) - make this as a primary key
Once you create the table create all the entries you have mentioned into this table.
Now write a program to get all these details.
select * from <table created> into table <internal table>.
loop at <internal table>
write:/ .......
endloop.
Regards,
Ram

Similar Messages

  • Issue in WS based on FM with data declared as TABLES

    Dear all,
    I created enterprise WS with endpoint as function module. The FM has a date declared as TABLES. I see the table data under Output section of External and Internal view in SE80. Also the data is being exposed (check box set). However if I consume the WS either via ABAP consumer proxy or externally outside the SAP system (from JAVA app) the data which is declared as TABLES is not visible in RESPONSE from the WS.
    Is this behavior feature? Shall I always declare (in case of custom FM) all the data as EXPORTING?
    If so what about the SAP standard FMs? In this case do I need to always create custom Z* FM as wrapper?
    thanks
    m./

    Please re-post if this is still an issue to the Business Objects Forum or purchase a case and have a dedicated support engineer work with you directly

  • How to use FIELD-SYMBOLS to declare a table

    How to use FIELD-SYMBOLS to declare a table?

    hi yong,
    this will be very general:
    FIELD-SYMBOLS : <gf_table> TYPE ANY TABLE.
    or
    to do like a specific table from your program
    FIELD-SYMBOLS : <gf_table> TYPE itab.
    itab is of course your internal table from your program.
    ec

  • Query in SQL 2008R2 error Msg 1087, Level 15, State 2, Line 31 Must declare the table variable

    Hello Experts, 
    Can You help me; I get the follwing error in my query
    Msg 1087, Level 15, State 2, Line 31
    Must declare the table variable "@ASE_SUBART_GROEP".
    the @ASE_SUBART_GROEP is a self-defined table in this SQL environment.
    Maybe you know the error or the missing part
    Thanks in advance, Jos Dielemans

    I'm not familiar with SAP Business One unfortunately, so can only be of limited help here. But I'm going to guess that @ASE_SUBART_GROEP is a table variable passed to a stored procedure and is defined and passed down by the application, so you won't
    be able to copy-paste this code directly into management studio and get it to work.
    You could remove the join to return *all* records. Although the dataset might be very big
    SELECT T0.CardCode AS 'Klantnr'
    ,T0.CardName AS 'Klantnaam'
    ,T4.GroupName AS 'Klantgroep'
    ,T9.Descr AS 'Merknaam'
    ,T5.SlpName AS 'Verkoper'
    ,T3.MailCity AS 'Leverplaats'
    ,T7.NAME AS 'Leverland'
    ,T3.City AS 'Factuurplaats'
    ,T7.NAME AS 'Factuurland'
    ,T0.DocNum AS 'Documentnr'
    ,T0.DocDate AS 'Datum'
    ,Cast((Datepart(Year, T0.DocDate)) AS VARCHAR) AS 'Jaar'
    ,RIGHT('00' + CAST(DATEPART(MONTH, T0.DocDate) AS VARCHAR(2)), 2) AS 'Maand'
    ,(Cast((Datepart(Year, T0.DocDate)) AS VARCHAR) + '-' + RIGHT('00' + CAST(DATEPART(MONTH, T0.DocDate) AS VARCHAR(2)), 2)) AS 'Periode'
    ,T1.ItemCode AS 'Artikelnr'
    ,T2.ItemName AS 'Artikelnaam'
    ,T1.Quantity AS 'Aantal VEH'
    ,T2.SVolume AS 'Aantal EH per VEH'
    ,(T1.Quantity * T2.SVolume) AS 'Aantal EH'
    ,T8.UnitName AS 'EH-Naam'
    ,T6.ItmsGrpNam AS 'Artikelgroep'
    ,T2.U_ItemGrp AS 'Hoofdgroep'
    ,T10.NAME AS 'Subgroep'
    ,T1.CogsAcct AS 'Kostpr.rek.'
    ,T1.AcctCode AS 'Opbrengstrek.'
    ,T1.LineTotal AS 'BrutoOmzet'
    ,T0.DiscPrcnt AS 'Korting'
    ,(+ T1.LineTotal * (100 - T0.DiscPrcnt) / 100) AS 'NettoOmzet'
    FROM dbo.OINV T0
    INNER JOIN dbo.INV1 T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
    INNER JOIN OCRD T3 ON T0.CardCode = T3.CardCode
    INNER JOIN OCRG T4 ON T3.GroupCode = T4.Groupcode
    INNER JOIN OSLP T5 ON T3.SlpCode = T5.SlpCode
    INNER JOIN OITB T6 ON T2.ItmsGrpCod = T6.ItmsGrpCod
    INNER JOIN OCRY T7 ON T3.Country = T7.Code
    LEFT OUTER JOIN OLGT T8 ON T2.SVolUnit = T8.UnitCode
    LEFT OUTER JOIN UFD1 T9 ON T3.U_ZPgroep = T9.FldValue
    AND TableID = 'OCRD'
    AND FieldID = 2
    --LEFT OUTER JOIN @ASE_SUBART_GROEP T10 ON T2.U_ASE_SUB_ARTGROEP = T10.Code
    WHERE T0.DocDate >= '20120101'
    AND T0.Canceled = 'N'
    UNION ALL
    SELECT T0.CardCode AS 'Klantnr'
    ,T0.CardName AS 'Klantnaam'
    ,T4.GroupName AS 'Klantgroep'
    ,T9.Descr AS 'Merknaam'
    ,T5.SlpName AS 'Verkoper'
    ,T3.MailCity AS 'Leverplaats'
    ,T7.NAME AS 'Leverland'
    ,T3.City AS 'Factuurplaats'
    ,T7.NAME AS 'Factuurland'
    ,T0.DocNum AS 'Documentnr'
    ,T0.DocDate AS 'Datum'
    ,Cast((Datepart(Year, T0.DocDate)) AS VARCHAR) AS 'Jaar'
    ,RIGHT('00' + CAST(DATEPART(MONTH, T0.DocDate) AS VARCHAR(2)), 2) AS 'Maand'
    ,(Cast((Datepart(Year, T0.DocDate)) AS VARCHAR) + '-' + RIGHT('00' + CAST(DATEPART(MONTH, T0.DocDate) AS VARCHAR(2)), 2)) AS 'Periode'
    ,T1.ItemCode AS 'Artikelnr'
    ,T2.ItemName AS 'Artikelnaam'
    ,- T1.Quantity AS 'Aantal VEH'
    ,T2.SVolume AS 'Aantal EH per VEH'
    ,(- T1.Quantity * T2.SVolume) AS 'aantal EH'
    ,T8.UnitName AS 'EH-Naam'
    ,T6.ItmsGrpNam AS 'Artikelgroep'
    ,T2.U_ItemGrp AS 'Hoofdgroep'
    ,T10.NAME AS 'Subgroep'
    ,T1.CogsAcct AS 'Kostpr.rek.'
    ,T1.AcctCode AS 'Opbrengstrek.'
    ,- T1.LineTotal AS 'BrutoOmzet'
    ,T0.DiscPrcnt AS 'Korting'
    ,(+ T1.LineTotal * (100 - T0.DiscPrcnt) / 100) AS 'NettoOmzet'
    FROM dbo.ORIN T0
    INNER JOIN dbo.RIN1 T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
    INNER JOIN OCRD T3 ON T0.CardCode = T3.CardCode
    INNER JOIN OCRG T4 ON T3.GroupCode = T4.Groupcode
    INNER JOIN OSLP T5 ON T3.SlpCode = T5.SlpCode
    INNER JOIN OITB T6 ON T2.ItmsGrpCod = T6.ItmsGrpCod
    INNER JOIN OCRY T7 ON T3.Country = T7.Code
    LEFT OUTER JOIN OLGT T8 ON T2.SVolUnit = T8.UnitCode
    LEFT OUTER JOIN UFD1 T9 ON T3.U_ZPgroep = T9.FldValue
    AND TableID = 'OCRD'
    AND FieldID = 2
    --LEFT OUTER JOIN @ASE_SUBART_GROEP T10 ON T2.U_ASE_SUB_ARTGROEP = T10.Code
    WHERE T0.DocDate >= '20120101'
    AND T0.Canceled = 'N'
    ORDER BY T0.CardCode
    The join to the table variable has been commented out above, so the code should run. After that you might want to update the WHERE clause to include only particular sub-groups

  • Problem in declaring internal table

    hai experts ,
    i am new to web dynpro abap .. my problem is i want to declare a internal table for a table using the web dynpro code wizard .. i found many threads regarding that .. but for mee its not working .. many of them posted that get_static_attributes_table method will solve the problem .. but i used the method in the wizard but it saying that method does not  exist ..pls solve the problem ..
    say where to enter the method in the wizard ..
    thanks & kind regards
    chinnaiya

    Hi Chinnaiya,
    Your post isnt that clear as to what you intend to do. Do you intend to just create an internal table declaration which would be able to hold your context nodes data or do you wish to use the get_static_attributes method to fetch all your tables data into this internal table?
    If you want to just declare an internal table which can hold the data then you would have to do it manually. You can't generate your internal table declaration using the code wizard. Suppose your context nodes name is SFLIGHT then you can use the below syntax to declare a table & work area respectively.
    DATA: lt_sflight TYPE wd_this->elements_sflight,  " Internal table
                wa_sflight TYPE wd_this->element_sflight.  " Work area
    For each node <node> of a controller context, a structure type element_<node> is implicitly generated in the interface IF_<ctrl>. The structure fields correspond to the attributes a node element consists of. Similarly for each node <node> of a controller context, a standard table type elements_<node> is implicitly generated in the interface IF_<ctrl>. The line type of this table is element_<node>. This constant can be used to
    type an internal table that can hold the attributes of multiple node elements. So as how said here you can even declare the work area and internal table like shown below in your MAIN view:
    DATA: lt_sflight TYPE if_main=>elements_sflight,  " internal table
               wa_sflight TYPE if_main=>element_sflight.  " work area
    But the disadvantage of this approach as how pointed out by Thomas in 1 of this earlier threads is that this coding works fine only for this particular view. If you copy the same code and try to use it in another view say VIEW1 then it wouldn't work as the interface name would have changed from if_main to if_view1. So its suggested to use the earlier approach.
    Regards,
    Uday

  • Declaring a table in Smart Forms

    Hi Guyz,
    Im having a hard time in using smartforms...actually..i have a structure table ZHPayroll
    Which consists of basic,fix allow ,company etc.
    My main problem is i cant declare or call my structure table in Smartforms under Forms->Tables..My command is <b> IT_GL type ZHPayroll</b>
    It has an error message
    "ONLY TABLE TYPES MAY BE USED AS REFERENCE TYPE FOR A TABLE PARAMETER".So i declare it under Form Interface->Import
    Then I declare a GS_DATA under Global Definitions ->Global Data
    Command is like this GS_DATA type TS_Data (which is my structure under TYPES tab same structure like ZHPayroll)
    .Once I call it  under Main Window->Table->Data
    IT_GL is neither specified under tables nor it is defined as an internal table.
    Please give some advice what to do about this.
    I used this FM see below.
    DATA: ly_formname TYPE rs38l_fnam.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = 'ZSF_PAYROLL'
        IMPORTING
          fm_name            = ly_formname
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc <> 0.
       MESSAGE e001 WITH 'ZSF_PAYROLL'.
      ENDIF.
      CALL FUNCTION ly_formname
        EXPORTING
    <b>      it_gl            = gs_outtab</b>
          exp_total_at_top = 'X'
         prepared_by      = p_prepb
         approved_by      = p_apprb
        EXCEPTIONS
          formatting_error = 1
          internal_error   = 2
          send_error       = 3
          user_canceled    = 4
          OTHERS           = 5.
    Thanks in advance
    aVaDuDz

    Hi Naren,
    I appreciate your reply...Im ok in creating a structure...but the main error is in smartforms.
    this is what i did..
    1.Declare IT_GL type ZHPayroll (created structure) from Form Interface->Tables
    2.Declare GS_Data type TS_DATA (types  declare under Types Tab. This structre is the same with ZHPayroll)
    3. Create a Table from Main Window->Table
    4.Declare internal Table under Data Tab the IT_GL into GS_Data
    5.I called FM in my program
      DATA: ly_formname TYPE rs38l_fnam.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = 'ZSF_PAYROLL'
        IMPORTING
          fm_name            = ly_formname
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      CALL FUNCTION ly_formname
        EXPORTING
          IT_GL           = gs_outtab
          exp_total_at_top = 'X'
        EXCEPTIONS
          formatting_error = 1
          internal_error   = 2
          send_error       = 3
          user_canceled    = 4
          OTHERS           = 5.
    But after activating my Smartforms this is the error
    Only table types may be used  as the reference type for  a table parameter
    but transfer the IT_GL to Import tab from Form Interface
    Same error occur.
    Please HELP.
    Thanks
    aVaDuDz

  • Simple command to refresh data of all declared internal tables & variables!

    Hi All,
    I have declared many internal tables & variables in my program in declaration include.
    Is there any Simple command which can refresh data of all declared internal tables & variables!
    Instead of clearing & refreshing each i.table & variable i want to use single command to refresh data.
    Is this possible!
    Thanks in advance.
    Thanks,
    Deep.

    CLEAR: lv_field1,
                 lv_field2,
                 lt_itab1[],
                 lt_itab2[].
    ONE simple command (CLEAR), can initialize fields, workareas, field-symbols,.... and internal tables.

  • Declaring custom table under parameters  tab in BADI

    Hello Friends,
    I need to declare custom table under parameters tab in BADI. When iam trying to change the screen from display to change mode, iam getting followoing message.
    Exit classes/interfaces can only be edited using the BADI Builder
    Replies regarding this highly appreciated.Thanks in advance.
    Regards
    Sri

    Hi,
    Badi and respective method as follows.
    ZBBP_CATALOG_TRANSFR --> Badi
    ENRICH_ITEM_DATA --> method
    I need to  declare custom table under the above method
    Thanks.

  • Declaring internal tables

    why do we declare internal tables in this way
    TYPES: BEGIN OF ty_t501t,
           END OF ty_t501t.
    DATA: gt_list1 TYPE STANDARD TABLE OF ty_list1,
    why not this
    DATA: BEGIN OF ITAB OCCURS 0,
          END OF ITAB.

    Hi,
    Declaring internal table with a header line decreases performance.
    Its better to have internal table without header line and a work area to work with it.
    Its improves performance.
    Also wen u work with internal table with header line it creates confusion that whether ur working with the header line or body of the internal table.
    Also declaring internal table with header line is obsolete one.
    LOOP AT ITAB----
    >Working with header line.(Confusion whether ur referring header or body of internal table)
    LOOP AT ITAB INTO WA------>Working with internal table widout header line and an work area
    Regards,
    Lakshman.
    Edited by: Lakshman N on Aug 14, 2009 7:25 AM

  • How to declare internal table in SMARTFORM

    Hi experts,
    I have an Internal table in my program and I want to declare in the smartform as well. How and where can I declare? Should I use global definitions and tpyes tab? How can I pass the content of the internal table to the smartform?

    Click Global Defiitions
    In TYPES :
    TYPES : BEGIN OF gty_add,
             name1      TYPE ad_name1,                          " name1
             city1      TYPE ad_city1,  " City
             country    TYPE adrc-country, "Coutnry
             post_code1 TYPE ad_pstcd1, " post code
             street     TYPE ad_street, " street
             house_num1 TYPE ad_hsnm1,  " house number
             tel_number TYPE ad_tlnmbr1," tele number
            END OF gty_add.
    In Global DATA
    GT_ADD     TYPE TABLE OF     GTY_ADD ( Internal table)
    WA_ADD     TYPE     GTY_ADD ( work area)

  • How to use %Type declaration with table residing in a different database

    How can I use the %TYPE declaration if the table is from a different database.
    E.g
    v_business_unit ps_jrnl.header.business_unit%TYPE;
    In the above declaration statement,the table 'ps_jrnl_header' resides in a different database(Database A) from the one I am currently in( Database B).(This is because data needs to be extracted from Database A into Database B).

    1. Create a database link to the other database (this probably already exists since your proc is interacting with that database)
    2. Create a synonym for the table in the other database
    create synonym foo for ps_jrnl.header@database_a;3. Reference the synonym in your variable declaration:
    v_business_unit  foo.business_unit%TYPE;

  • How to declare Dynamic table in Tables Parameters of a Function Module...

    Hi Gurus,
    I would like to Know how to declare a Dynamic table in Tables parameters of a Function Module.
    so that it should be able to hold any table data ....
    I have tried all possible ways of trying to assign fields-symbol like declarations which doesnt allow here ...
    plz Dont reply with the basics of creating dynamic internal tables, coz my case is not an Internal table it is FM table parameter declaration.....

    Hi,
    If you are requirement is to create a function module with tables parameter having a generic line type i.e. no specific line type
    just declare it with a name under Parameter name with out specifying the type.
    A reference function module with such parameter, i would quote is the standard GUI_UPLOAD/ GUI_DOWNLOAD where the parameters specified under TABLES are generic.
    If you want to process the values passed to these parameters in the source code of function module, field symbols would be a preferable option.
    Regards,
    Sharath Panuganti

  • HR abap :  how to declare internal table to fetch data from 0585 infotype

    Hi all ,
    I am able to fetch the data from pa0585 infotype for set of employee no , but the problem is as the fields in pa0585 (like Contr to ULIP , NSC , Medical Treatment,Contribution to Certain Pension Funds so on ..) will be changed dynamically and will be displayed based on the amount value in descending order iam not able to store the values of the fileds into internal table . I dont understand how to declare the internal table ..Please help in if u have solved this kind of problem.
    I shld get the output in this way ...
    Emp No     Name    Medical treatment       Contr to ULIP             ....... so on
    101          abc           10000                        150000                      .......so on
    102          xyz           12000                        150000                      .......so on
    My header shld be fixed and I shld display values in this way .... I can use write statement to display directly .
    Thanks ....

    Hi
    Decalre INFOTYPE
    Goto SE37 - Find FM -
    READINFOTYPE*

  • How to declare internal table in BADI with variable name beginning with 0..

    Gurus,
    How to declare an internal table within a BADI. I have to implement a BADI UC_TASK_CUSTOM for BCS to BW load and there i have to  declare an internal table like:
    TYPES:          BEGIN OF t_cube_data,
                    0cs_version       TYPE /bi0/oics_version,
                    0sem_cgcomp       TYPE /bi0/oisem_cgcomp,
                    bcs_vers          TYPE /bic/oibcs_vers,
                    bcs_lcus          TYPE /bic/oibcs_lcus,
                    bcs_ldch          TYPE /bic/oibcs_ldch,
                    bcs_invcom       TYPE /bi0/oibcs_invcom,
                    bcs_litem         TYPE /bic/oibcs_litem,
                    bcs_llob          TYPE /bic/oibcs_llob,
                    bcs_lmay          TYPE /bic/oibcs_lmay,
                    0move_type        TYPE /bi0/oimove_type,
                    pcompany         TYPE /bi0/oipcompany,
                    bcs_lprg          TYPE /bic/oibcs_lprg,
                    figlxref3         TYPE /bic/oifiglxref3,
                    fiscyear         TYPE /bi0/oifiscyear,
                    fiscper3         TYPE /bi0/oifiscper3,
                    fiscvarnt        TYPE /bi0/oifiscvarnt,
                    curkey_gc        TYPE /bi0/oicurkey_gc,
                    unit             TYPE /bi0/oiunit,
                    cs_trn_gc        TYPE /bi0/oics_trn_gc,
                    cs_trn_qty       TYPE /bi0/oics_trn_qty,
              END OF t_cube_data
    But with this declaration it gives a error saying that u cannot have a variable beginning with 0...like 0cs_version....
    but i have to do it for my functionality to wrk...
    Please help me do it....
    how can i declare a internal table that allows me to have variable names that start with 0....
    Please help....Its URGENT....
    Thanks
    Sam

    Murali,
    I need to have 0 before the variable name in the declaration of the internal table....how can i attain that....
    Please suggest...
    Thanks
    Sam

  • Declare Internal Table in Code or in Data Dictionary...Opinions needed?

    Is it better to define your internal table and all of its fields in a begin of/end of declaration stmt in your code's data definitions. Or, is it better to create a structure in the Data Dictionary, which means one line of code in your program? Why does one choose the method they prefer?
    I am thinking it is best to declare in Data Dictionary, especially since ABAP is now leaning towrds objects. However, I am seeing a lot of field by field definitions in programs. I am very interested in how most programmers accomplish this and why.    
                     Thank-You

    I would say that if the internal table is to be used in more than one program, then I would create a structure and/or table type in the ABAP dictionary.  If it is to be used in just one program, then I would define it locally.
    Regards,
    Rich Heilman

  • Declaration of table in adobe form

    hi,
    for the internal table declaration in adobe forms, have to use table type instead of structure.
    how to find out the table type for every structure

    how to find out the table type for every structure
    If it is there you can find it from SE11.
    where used list in that check Table types.
    and also if it is not there you can create it in SE11.
    please close ur earlier post.

Maybe you are looking for