Declaring a field lenght dinamically.

Hi people, I'm from Brazil... and I have a simple problem.
How can I declare a field lenght dinamically.
For example:
In the code below I have the field "Company". This field have 10 characteres of lengh, but in determinated part of the code this value can or not to increase to send it to a TXT file. If will need to increase this value, how can I do this dinamically ?
The code is:
Data: begin of Itab_test occurs 0,
            Company(10)   type C.
Data: End of Itab_test.
Excuse me for my english...
tks,

Define Dynamic Internal table whose fields can be determined dynamically.
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
               <dyn_wa>,
               <dyn_field>.
create dynamic internal table and assign to fs
IFC is your dynamic catalog for fields.
  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>.
Hope this helps...
<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
Kartavya
Edited by: Alvaro Tejada Galindo on Aug 21, 2008 3:22 PM

Similar Messages

  • How to declare a field in a structure and table

    Hi, I have a doubt in declaring a field inside a structure.
    types: BEGIN OF mrm_rbkpv.
            INCLUDE STRUCTURE rbkp_v.
    types: h_rbws LIKE rbws OCCURS 0,
           end of mrm_rbkpv.
    data : e_rbkp_v type mrm_rbkpv.
    Now I want I to refer to field WT_WITHCD inside table H_RBWS.
    eg : if e_ebkp_v-h_rbws-wt_withcd = 'X ' is right or wrong??????
    POints will rewarded
    Thanks in advance

    hi jaysree,
    types: BEGIN OF mrm_rbkpv.
    INCLUDE STRUCTURE rbkp_v.
    types: h_rbws LIKE rbws OCCURS 0,
    end of mrm_rbkpv.
    data : e_rbkp_v type mrm_rbkpv.
    if e_ebkp_v-h_rbws-wt_withcd = 'X '  - > this will work perfectly.
    rgds
    anver
    if hlped mark points

  • How to declare the field if i want the output as 300.12,00

    How to declare the fields if i want the output as 300.12,00
    i have a quantity field so i need to place . in place of , and , inplace of .
    please help me

    hi,
    declare its as
    CURR
    field.
    Regards
    Anver

  • How to declare currency field?

    DATA : V1 TYPE I,
    V2 TYPE I,
    RESULT TYPE P DECIMALS 2.
    how do i declare currency field here?

    In that case,refer to any of the currency fields of any of the database tables and refer to it like this:
    Data : Curr like aufk-waers.
    or from any other database table which contains the currency field.
    In case you have any further clarifications,do let me know.
    Regards,
    Puneet Jhari.

  • Declare a field in an internal table.

    Hi Abap Gurus,
    I want to declare an internal table with a field of datatype numc 2 such that it should values only between 50 and 99.
    kindly suggest how should i go about this.
    Regards.

    hi,
    u can do like this..
    <b>before appending chk and append.</b>
    data : begin of itab occurs 0,
                num(2)   type n,
             end of itab.
    if num BETWEEN '50' AND '99'.
    append itab.
    endif.
    With Rgds,
    S.Barani

  • Declarative Components field binding

    Can we bind a View Object to declarative component? I want to have a declarative component and whenever that declarative component would be used, it would be used with the same view object so i feel it extra work to bind all the attributes to view object's attributes whenever declarative component has to use. I want t create the component (declarative) and get bind it with a view object somehow and use it without every time going through to bind to view object or bind individual fields to view object's attributes. Any suggestions??
    Edited by: Mamoona on Jun 24, 2011 4:56 PM

    Hi,
    this is not what declarative components are for. Think of declarative components as standard JSF components, which you would not build tied to a specific model. If you need to wire a declarative component to a View Object then you expose an attribute on the declarative component that the consumer of the component the uses EL on to bind it e.g. to the ADF binding layer
    Frank

  • Limited field-lenght in ALV ?

    hi,
    i have an field with type string in my alv-output-table. i am calling alv with REUSE_ALV_GRID_DISPLAY.
    in the alv-grid the field gets cutted on position 128.
    how to avoid this ? is 128 the maximum lenght for a field in alv ?
    reg, Martin

    Hi,
    See the notes 857823, 910300 and 959775. All these say there is a limitation of 128 characters but does not explain why.
    857823 - ALV grid: Strings with a maximum of 128 characters
    Symptom
    Entries in cells of the type CHAR or string are truncated after 128
    characters in the SAP GUI.
    More Terms
    ALV Grid Control (cl_gui_alv_grid), function module (Full-screen) Grid
    (Reuse_alv_grid_display, SAPLSLVC_FULLSCREEN), SAPGUI, back end, front end
    Cause and Prerequisites
    The data table that is sent to the front end only allows character values
    with the length 128.
    Solution
    This is the standard system behavior and cannot be changed.
    The note is not release-dependent.
    Regards,
    Raj..

  • Problem Changing a key field lenght

    Friends,
    I've changed the data element of the object field whitch is one of the keys in the Ztable.
    After that, automaticly, all the declarations were changed 'couse all the container variables were pointing to this table field.
    I thought it isn't get problem but it got problems to my woakflow. The first task didn't return an result that I made to an table and after that  others tasks didn't work to.
    I'm sure that the declarations are poitting ti this (workflow key) field I changed the element.
    I think I saw all the things.... What else can I do ?
    Sorry for my bad english. I'm brazilian.

    Hi Ismael,
    Here it's all right. The wheather is cold and rainy here in Rio de Janeiro, but it isn't normal here. Here usually is sunny and hot.
    By the way, Thanks for your help. Now it's working ok. I agree with your answer, because I simply deleted the bindings and made it again and after that it began to work alright again.
    thanks.

  • How to increase the field lenght of file uplaod in BSP application

    Hi All,
       I am facing a problem with u201Cuploadu201D filed length in BSP application.
    When we upload the file in BSP page, the path displayed should be the full path (i.e. from where the file is being upload the file)
    Now this field is appearing 20 char length
    Now I want to increase the length of the upload field (Input field) to be 100 char so that the path is visible.
    In the current application the file upload is being done through a structure (attributes)
    In this structure the fields are like this
    PAGE_NAME
    ID
    FOR
    TAGS
    ROW_INDEX
    COLUMN_INDEX
    OTR_NAME
    REQUIRED_NAME
    MAXLENGTH
    SIZE
    TABLE_NAME
    ON_SELECT
    VALUE
    DISABLED
    ONCLICK
    TEXT
    TYPE
    Using this method:
    CALL METHOD cl_htmlb_fileupload=>factory
              EXPORTING
                Id      = ls_form_save-id
              RECEIVING
                Element = lv_fileup.
            bee_table->add ( level = 2 element = lv_fileup ).
    This cl_htmlb_fileupload is named as class interface.
    Which has the CLG_HTMLB_FILEUPLOAD (it is a class) it is defined in attributes.
    In this class it has the attribute u201CSIZEu201D by default string 20.
    Now I need to change this attribute length from 20 to 100
    For this I copied the standard class CL_HTMLB_FILEUPLOAD into ZCL_HTMLB_FILEUPLOAD.
    This ZCL_HTMLB_FILEUPLOAD contains all attributes of the standard class CL_HTMLB_FILEUPLOAD
    Including the one class (CLG_HTMLB_FILEUPLOAD), this is defined as an attribute (ABOVE MENTIONED?)
    This class is appearing in non editable mode, so   I have copied this class into zclass (ZCLG_HTMLB_FILEUPLOAD).but still I am not able to edit the attribute called u201Csizeu201D
    And also I am not bale to add the zclass in place of the ZCLG_HTMLB_FILEUPLOAD
    Kindly tell me how to modify the length of the field u201Csize u201Cand also how to add the zclass in the attributes of one class (syntax)
    Thanks in advance
    Rambabu.A

    Hi,
    Class CLG_HTMLB_FILEUPLOAD is a class automatically generated when a BSP Element is created. You should not change/create such a class, unless by creating your own BSP Element.
    As per your requirement, you can use the SIZE parameter of method factory:
    ls_form_save-size = '100'.
    CALL METHOD cl_htmlb_fileupload=>factory
    EXPORTING
    Id = ls_form_save-id
    Size = ls_form_save-size
    RECEIVING
    Element = lv_fileup.
    Regards,
    Tanguy

  • Create infotype with PM01+ field lenght in table

    hello my HR friends, a friend of mine create an infotype with tcode PM01 so far everthing is ok but when she finished, i found an error and neither i or she knows how to solve it.
    Picture of infotype: http://img197.imageshack.us/img197/8236/infotype1.jpg
    and problem is, in field that have the rectangle, this field have this possible values:
    http://img529.imageshack.us/img529/1887/infotype2.jpg
    the problem is if a choose the first possible value, field stays like this:
    http://img836.imageshack.us/img836/4494/infotype3.jpg and then when im going to save the system says that content doesn't exist in the table that is feeding that textbox.
    Do anyone knows how to solve this problem or the solution is to put that possible values shorter or put text box bigger.
    regards and thanks in advance for the help.
    Mário

    Instead of INT use DEC or NUMC data types.
    To know why INT cannot be used try searching with Hardware Restriction in terms of general computing.

  • Editable field lenght in ALV - given 254 but only taking 120?

    Hi Friends,
    I have an ALV grid in OO.
    There is a editable field for remarks to be entered, and it has been mapped to a domain with CHAR254.
    Following is the fieldcat set for the column
            LS_FIELDCAT-EDIT             = 'X'.
            LS_FIELDCAT-REPTEXT      = 'Remarks'.
            LS_FIELDCAT-SCRTEXT_L  = 'Remarks'.
            LS_FIELDCAT-SCRTEXT_M = 'Remarks'.
            LS_FIELDCAT-SCRTEXT_S  = 'Remarks'.
            LS_FIELDCAT-OUTPUTLEN = 254.
            LS_FIELDCAT-INTLEN         = 254.
    but still in the report, i am able to input only 120 chars, what could be the reason?
    Appreciate if someone can help me out.
    Thanks,
    Simha

    Hi Vijay,
    Its still the same result.
    i am not able to input more than 120char.
    Same is the case when i try to enter remarks using FM POPUP_GET_VALUES when i pass a field of length 254, i am able to input only upto 124(approx) char
    What could be the prob?
    how to over come this?
    Appreciate your help.
    Regards,
    Simha.
    Edited by: Simha on Nov 17, 2008 9:18 AM

  • Modifying field lenght for an  external table via OWB

    Hi folks,
    After, I would like to thanks everyone that helps to improve the level of quality of this forum with questions and answers!
    I am having a problem with flat files and external tables:
    I can't specify the field length in the ORACLE_LOADER parameters via OWB, so the driver consider that all my fields are CHAR(255). Concerning the online documentation for Oracle Utilities Part. no. A96652-01 on page 12-21, it's write that the lack of specification about the datatype or length of a field, the driver will assume the fields name and order of the fields defined on the external table fields and they will be CHAR(255). My problem is that we need to use a field bigger than CHAR(255), so I made this external table for example about our problem:
    CREATE TABLE "TESTE"
    "NOME" VARCHAR2(300),
    "SOBRENOME" VARCHAR2(300))
    ORGANIZATION EXTERNAL (
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY TARGET_LOC_SRC_FILES_LOC
    ACCESS PARAMETERS (
    RECORDS DELIMITED BY NEWLINE
    CHARACTERSET WE8MSWIN1252
    STRING SIZES ARE IN BYTES
    NOBADFILE
    NODISCARDFILE
    NOLOGFILE
    FIELDS
    TERMINATED BY ';'
    NOTRIM
    "NOME" ,
    "SOBRENOME"
    ) LOCATION (
    TARGET_LOC_SRC_FILES_LOC:'Partners.txt'
    REJECT LIMIT UNLIMITED
    NOPARALLEL
    When we put by hand the field length in this script, it works fine!
    Is there a way to put the length of the fields in the FIELDS clause of the SQL*Loader control file using OWB?

    Carlos,
    Have you tried the following:
    - Update the data types in the sampled flat file (i.e. go into the field definitions and edit the length).
    - Go into the mapping and inbound reconcile the table (right-mouse click the file operator and select inbound reconcile).
    - Regenerate, and review the result.
    Thanks,
    Mark.

  • Declaring a field of an internal table dynamically...

    Hi all,
      I've to use an internal table which contains two field...
    But i want to define its size at run time as per my requirements...
    structure of internal table is very simple...
    <b>types:  begin of ty_tab,
                f1 (size i want dynamically),
                f2(1) type c,
               end of ty_tab.</b>
    in my cases size of field f1 can be between 200 and 1000 approx..
    <b>so how can i define the size of field f1 dynamically...</b>

    Hi Balaji..
    First I had calculated the size of the field to be created... suppose it is <b>w_len1</b>
    data: t_fieldcat TYPE lvc_t_fcat,
    wa_fieldcat TYPE lvc_s_fcat,
    new_table TYPE REF TO data,
    new_line TYPE REF TO data.
    field-symbols: <t_tab> TYPE STANDARD TABLE,
    <wa_str> type any.
    wa_fieldcat-fieldname = 'FLD1'.
    wa_fieldcat-tabname = 'TAB'.
    wa_fieldcat-datatype = 'CHAR'.
    wa_fieldcat-inttype = 'C'.
    wa_fieldcat-intlen = w_len1. " determine during run time
    APPEND wa_fieldcat TO t_fieldcat.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
    it_fieldcatalog = t_fieldcat
    IMPORTING
    ep_table = new_table.
    ASSIGN new_table->* TO <t_tab>.
    CREATE DATA new_line LIKE LINE OF <t_tab>.
    ASSIGN new_line->* TO <wa_str>.
    Earlier I wanted to use type string but I had to use this table further but type string was not supported for that purpose. So I had to do this..
    I think this may be helpful..
    Regards
    Prax

  • How to change the field lenght in stanard structure.

    hai Gurus,
    When I enhanced the standard structure for the 1st time I got warning but I could able to replicate and pull the data from r3 to bw. When I tried to enhance it again it is not allowing me saying i the need to enhance the standard data field length or need to add a custom field for this. Can you tell me how can change the field length for a standard structure?.
    Thanks, VP.

    hi,
    u can add a custom field of the required length to your structure and write the exit to populate it. If its a standard field I dont think you will be able to alter the length of the field.
    Regards.

  • Field lenght

    HI,
    i want to find the number of characters in the field..
    thanks

    Hi Neha,
    You can use string length
    and check below for special characters
    http://help.sap.com/saphelp_40b/helpdata/en/d9/4a9a7151ea11d189570000e829fbbd/content.htm
    Hope it helps.
    Regards,
    Chaithanya.
    Edited by: chaithanya k on Jun 2, 2008 10:02 AM

Maybe you are looking for

  • Fields need to be maintained in Sales order

    Hi gurus,        I wan to maintain two fields in sales order, one is agent(middlemen who facilitate sales) and companies sales representative fields for 3 respresentatives. Anyway these two were defined in Partner functions and assigned to account gr

  • Like statement not working correctly

    I'm having a strange issue. When I run a query to find a chr(255) (value is '¿') value in my party_name field, it is also pulling up other records that do not have it. select party_name from ar.hz_parties hzp where party_name like ('%'||chr(255)||'%'

  • Only audio output is Digital Out

    My MBP has been connected to an external monitor and speakers for about a week (not unusual) and I just disconnected it and am using once again as a laptop. I noticed however, I can't adjust the volume, nothing comes out of the speakers and the only

  • Unable to connect to hardware target in Vivado

    I have Vivado 2015.1 running on Ubuntu Linux 64-bit with a Nexys4 DDR board. I've got the board set up to be programmed using the JTAG (see attached image). Running dmesg on the Linux system I see: [99537.226929] usb 1-1.2: Product: Digilent USB Devi

  • SQL-Tokenizer based on regular-expressions does not work

    I'm on 10gR2 Following SQL-Tokenizer converts string :str to rows using :delim as the delimiter-char (:str and :delim are parameters): select level, regexp_replace(regexp_substr( :in_str || :in_delimiter, '(.*?)' || :in_delimiter, 1, level ), :in_del