How to handle field symbols internal table values?

HI all,
          I declared field string as below.The below code is working fine.
Data : ITAB TYPE STANDARD TABLE OF YAPOPLN, (Custom table).
          wa_itab like line of ITAB.
field-symbol : <fs> type ITAB.
ASSIGN PARAM TO <FS>
LOOP AT <FS> INTO WA_ITAB.
WRITE:/ 'ABC'.
ENDLOOP.
But my requirement is that I dont want all the fields of the table YAPOPLN.My output contains only 2 fields of the table YAPOPLN,which contains total 4 fields.According to my requirement only 2 fields will be getting into one parameter PARAM(this is function module parameter,which is from ALV classes) from the user entered output,which contains only 2 fields.So the above code is not working properly because wa_itab contains 4 fields and giving short dump.
If I am declaring the internal table with the required fields(only 2 fields) and referring that internal table to field symbol <FS>
Data : BEGIN OF ITAB1 OCCURS 0,
         FIELD1 LIKE YAPOPLN-FIELD1,
         FIELD2 LIKE YAPOPLN-FIELD2,
         END OF ITAB1.
field-symbol : <fs> LIKE ITAB1 OR  <FS> TYPE ANY.
DATA :WA_ITAB1 LIKE LINE OF ITAB1.
ASSIGN PARAM TO <FS>
LOOP AT <FS> INTO WA_ITAB.
WRITE:/ 'ABC'.
ENDLOOP.
But when I am compiling this code i am getting the below error.I am gettting the same below error when even <FS> is also declared as <FS> TYPE ANY.
.'FS' is not an internal table or defined in TABLES.
Can anyone help me in this regard?
Thanks,
Balaji

Hello,
Try this way:
If both the type of internal tables are same then you can directly assign dynamic internal table to static internal table.
itab = <itab>.
Suppose you have field symbol internal table <itab> which is different in structure from ITAB.
Now, you can create <wa> as follow:
FIELD-SYMBOLS <wa>.
DATA wa TYPE REF TO DATA.
CREATE DATA wa TYPE LINE OF <itab>.
ASSIGN wa->* to <wa>.
This way your work area is read.
Using [ASSIGN COMPONENT|http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb3923358411d1829f0000e829fbfe/content.htm] syntax you can read required component of <wa>.
Finally you can use that value to load static internal table.
You can also refer to my thread on [Dynamic table|Re: Creating Dynamic table].
Hope this helps!
Thanks,
Augustin.
Edited by: Augustarian on Aug 20, 2009 10:06 AM

Similar Messages

  • How to move field symbol internal table to internal table with header line?

    Dear all,
    hi...hereby i would like to ask how i can move field symbol internal table to a internal table?
    as i know field symbol internal table is without header line..
    so, may i know how to do this....to move field symbol internal table to internal table which consist of header line and field and record will same as field symbol internal table...in additional, my field symbol internal table is dynamic table mean everytime will have flexible columns..?
    Please advise...
    Thanks
    Regard,
    ToToRo.
    Edited by: @ToToRo@ on Aug 20, 2009 6:16 AM

    Hello,
    Try this way:
    If both the type of internal tables are same then you can directly assign dynamic internal table to static internal table.
    itab = <itab>.
    Suppose you have field symbol internal table <itab> which is different in structure from ITAB.
    Now, you can create <wa> as follow:
    FIELD-SYMBOLS <wa>.
    DATA wa TYPE REF TO DATA.
    CREATE DATA wa TYPE LINE OF <itab>.
    ASSIGN wa->* to <wa>.
    This way your work area is read.
    Using [ASSIGN COMPONENT|http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb3923358411d1829f0000e829fbfe/content.htm] syntax you can read required component of <wa>.
    Finally you can use that value to load static internal table.
    You can also refer to my thread on [Dynamic table|Re: Creating Dynamic table].
    Hope this helps!
    Thanks,
    Augustin.
    Edited by: Augustarian on Aug 20, 2009 10:06 AM

  • How can i know the number of lines in field-symbol internal table

    how can i know the number of lines in field-symbol internal table

    Hi,
    If your field symbol has been defined as an internal table :
    Use std describe as
    Data: l type i.
    describe <fs> lines l.
    'l' will contain the number of lines as needed.
    FYI
    The size of this storage area in a field symbols depends on the number of table lines which is not fixed, but determined dynamically at runtime.
    Regards,
    Amit

  • How to pass field symbol or table from one view to another view in abap web dynpro?

    I am creating an Inbound Outbound ALV report in ABAP Web Dynpro. However at selection-screen I have select options and fetching is done at view2. Problem is we can pass parameter using inbound outbound parameters but how to pass internal table or field-symbols from one view to another view? I made use of Assistance Class too but its not very clear to me. Please give me some example or code to sort this problem out.

    I am creating an Inbound Outbound ALV report in ABAP Web Dynpro. However at selection-screen I have select options and fetching is done at view2. Problem is we can pass parameter using inbound outbound parameters but how to pass internal table or field-symbols from one view to another view? I made use of Assistance Class too but its not very clear to me. Please give me some example or code to sort this problem out.

  • Field-symbols : internal table

    Dear experts,
    I am trying to put contents of internal table from a standard transaction in this way but i am not getting.
    Further i get last record successfully if i try to follow the code of this link
    http://www.sapdevelopment.co.uk/enhance/enhance_fsymbol.htm
    The code that i use is :
    types: begin of t_type,
    tabix type i,
    color type c,
    selfl type c,
    vbeln like lips-vbeln,
    posnr like lips-posnr,
    kschl like nast-kschl,
    nacha like nast-nacha,
    parvw like nast-parvw,
    pname like kna1-name1,
    pcity like lfa1-ort01,
    vstel type c,
    lfdat like mkpf-budat,
    wadat like mkpf-budat,
    end of t_type.
    data :   pgm(40) value '(SAPLKKBL)T_OUTTAB[]'.
             field-symbols: <fs> type standard table.
    data: i_get type t_type occurs 0 with header line.
    assign (pgm) to <fs>.
    append lines of <fs> to i_get[].
    But not getting,the datatype i have created is only by looking at fields in memory map.Its not exactly of T_OUTPUT[] as it can't be referred

    Hi aditya,
    Please try defining field symbol as of generic type ( TYPE ANY).
    or try this way.
    data :
    pgm(40)
    t_pgm like standard table of pgm.
    field-symbols: <fs> type ANY
    data: i_get type t_type occurs 0 with header line.
    t_pgm =  (SAPLKKBL)T_OUTTAB[].
    Loop at t_pgm into pgm.
    assign pgm to <fs>.
    append <fs> to i_get[].
    ENDLOOP.
    Hope this would help you.
    Good luck
    Narin

  • Reading the data from field symbol internal table //

    Hi,
    There are 2 internal tables defined as Fieldsymbols (type any) and I need to retrive data from second internal table based on a field value in first internal table.
    Let's assue the name internal table 1 is <it_itab1>, 2nd internal table name is <it_itab2> and the work areas are <wa_itab1> and <wa_itab2>.
    The existing logic :
    LOOP at <it_itab1> ASSIGNING <wa_itab1>.
      ASSIGN COMPONENT 'XYZ' OF STRUCTURE <wa_itab1> TO l_field6.
      LOOP AT <it_itab2> ASSIGNING <wa_itab2>.
        ASSIGN COMPONENT 'XYZ' OF STRUCTURE <wa_itab2> TO <p_field7>.
        IF <p_field7> = l_field6.
    do the required business.
        ELSE.
          *     do the required business.
        ENDIF.
      ENDLOOP.
    ENDLOOP.
    The requirement of reading second internal table was achieved by putting loop on the internal table but its giving considerable effect on performance !!
    Is there any way to use READ statement in my case OR any way of putting WHERE condition on loop statement of second internal table ??
    Thank you !!

    Use the below Logic.
    Loop at Itab1 into wa_itab1.
        Loop at itab2 into wa_itab2 where p_field7 = wa_itab1-xyz or I_field6.
    do the required business.
        endloop.
        Loop at itab2 into wa_itab2 where p_field7 <> wa_itab1-xyz or I_field6.
    do the required business.
        endloop.
    endloop.
    Hope it is useful...

  • How To select maximum Value in a specifieid field in internal table.

    How To select maximum Value in a specifieid field in internal table?

    Step : 1
    Sort itab by <Field1> descending.
    Just sort the internal table by the field.
    STEP: 2
    Then read the table at index 1.
    Read table itab index 1.               
    ITAB-FIELD = MAX .                  " Max field will come in the first row of the internal table.
    Regards,
    Gurpreet

  • How to bind internal table values with RootUIElement(Table) from select Que

    Hello Friends,
           In my view Layout,there r two Input fields ,Submit button and Table... My concept is when user posting values in two input fields and clicking submit button means the result(more than one values) should be displayed in Table...
         I written coding also but i dont know to bind internal table values with Table... My code as follows,
    method onactionsearch .
       data:
         Node_Node_Flight                    type ref to If_Wd_Context_Node,
         Elem_Node_Flight                    type ref to If_Wd_Context_Element,
         Stru_Node_Flight                    type If_View1=>Element_Node_Flight ,
         itab TYPE STANDARD TABLE OF sflight.
    navigate from <CONTEXT> to <NODE_FLIGHT> via lead selection
       Node_Node_Flight = wd_Context->get_Child_Node( Name = IF_VIEW1=>wdctx_Node_Flight ).
    @TODO handle not set lead selection
       if ( Node_Node_Flight is initial ).
       endif.
    get element via lead selection
       Elem_Node_Flight = Node_Node_Flight->get_Element(  ).
    @TODO handle not set lead selection
       if ( Elem_Node_Flight is initial ).
       endif.
    alternative access  via index
    Elem_Node_Flight = Node_Node_Flight->get_Element( Index = 1 ).
    @TODO handle non existant child
    if ( Elem_Node_Flight is initial ).
    endif.
    get all declared attributes
       Elem_Node_Flight->get_Static_Attributes(
         importing
           Static_Attributes = Stru_Node_Flight ).
    select * from sflight into CORRESPONDING FIELDS OF TABLE itab
      WHERE carrid = Stru_Node_Flight-carrid and connid = Stru_Node_Flight-connid.
    Node_Node_Flight->bind_table( new_items = itab ).
    endmethod.
    Plz reply me asap...!

    Hi,
    What I understood from your coding is...
    * navigate from <CONTEXT> to <NODE_FLIGHT> via lead selection
    Node_Node_Flight = wd_Context->get_Child_Node( Name = IF_VIEW1=>wdctx_Node_Flight ).
    You are reading values from the above node and binding the values to the same node.Am i right?
    Did you take seperate context node for your input fields or binded the above context to the fields.If not then read the context attribute values which are binded to the carrid and connid then pass these values to select query.
    One more thing is select cardinality 1..n for node NODE_FLIGHT since you are displaying more than one record.
    Go through the some basic tutorials.Search in sdn you will it get.Already there is a tutorial in sdn which explains exactly what do you require.
    Go throgh this link
    Web Dynpro for ABAP: Tutorials for Beginners
    Web Dynpro for ABAP: Tutorials for Beginners [original link is broken]
    Edited by: suman kumar chinnam on Mar 26, 2009 10:50 AM

  • How to Refresh "Internal table values" in User EXIT.

    Dear All,
    My requirement is to place some checks in exit ZXQQMU20 in different tabs from the TCODE IW21 . IW22 etc.
    Now after placeing the checks towards the different tabs while doing "NOCO" from IW21 the conditions are fullfilled but
    when i go ahead to modify the created  "NOCO " from the TCODE IW22 by deleting the created values and saving in IW22 , the conditions written in the exit are still satisfied eventhough i have deleted the values in IW22.
    The reason for this is that the tables which are there in the exit ZXQQMU20 T_VIQMFE , T_VIQMUR , T_VIQMMA
    still contains the old values which were there at the time of creation of "NOCO"  in IW21 .
    How to refresh my " internal tables values" used in such that even at the time of modification of the NOCO through IW22 my table values should pick the current screen values and not the values which were there at the time of creation.
    Please help.
    The code i have written in the exit is as below:-
    ********************* Changed vide ******START
    *****IW21  IW22 also added in filter criteria of notification *************
    ******The purpose of this modification is that in the execution of IW21 or IW22 or IW24 or IW25 we have to give a check that if the
    ******notification type is M2 than inside the Transaction screen , if the Breakdown duration comes less than 15 min than there are
    ******no issues but if the breakdown duration is more than 15 min than the mandatory fields needs to be entered in the analysis tab.
    **    The user has to fill up either following mandatory fields in Analysis Data tab.
    **    A. Object Parts & Damages sub tab
    **    Code Group - Object Parts (OTGRP, VIQMFE)
    **                          AND
    **    Code Group - Problem / Damage (FEGRP, VIQMFE)
    **    Or
    **    Notification Item Short Text (FETXT, VIQMFE)
    **   B. Cause sub tab
    **    Code Group # Causes (URGRP, VIQMUR)
    **    Or
    **    Cause Text (URTXT, VIQMUR)
    **   C. Action Taken sub tab
    **    Code Group # Activities (MNGRP, VIQMMA)
    **    Or
    **    Activity Text (MATXT, VIQMMA)
    **            Then, allow user to complete notification (NOCO).
    CLEAR : L_VAR , L_COMP_TIME.
    IF ( SY-TCODE EQ 'IW21' OR SY-TCODE EQ 'IW22' OR SY-TCODE EQ 'IW24' OR
          SY-TCODE EQ 'IW25' ).
       IF ( E_VIQMEL-IWERK = '061' ) OR ( E_VIQMEL-IWERK = '062' ).
         IF E_VIQMEL-QMART = 'M2'.
           L_VAR = E_VIQMEL-AUSZT.
           L_COMP_TIME = L_VAR / 60.
           IF L_COMP_TIME < 15.
             EXIT.
           ELSEIF L_COMP_TIME > 15..
    *         IF ( T_VIQMFE-OTGRP IS INITIAL AND T_VIQMFE-FEGRP IS INITIAL )  OR  ( T_VIQMFE-FETXT IS INITIAL ) .
    *           MESSAGE 'Please fill the mandatory analysis data in Object Parts' TYPE 'E'.
    *         ENDIF.
             IF T_VIQMFE-OTGRP EQ '' OR T_VIQMFE-FEGRP EQ ''.
               IF T_VIQMFE-FETXT EQ ''.
                 MESSAGE 'Please fill the mandatory analysis data in Object Parts' TYPE 'E'.
               ENDIF.
             ENDIF.
             CLEAR L_TAG.
             IF T_VIQMUR[] IS INITIAL.
               MESSAGE 'Please fill the mandatory analysis data in Cause tab' TYPE 'E'.
             ELSE.
               LOOP AT T_VIQMUR.
                 IF  T_VIQMUR-URGRP IS INITIAL .
                   IF T_VIQMUR-URTXT IS INITIAL.
                     L_TAG = 'X'.
                   ENDIF.
                 ENDIF.
               ENDLOOP.
               IF L_TAG = 'X'.
                 MESSAGE 'Please fill the mandatory analysis data in Cause tab' TYPE 'E'.
               ENDIF.
             ENDIF.
             CLEAR L_TAG.
             IF T_VIQMMA[] IS INITIAL.
               MESSAGE 'Please fill the mandatory analysis data in Action' TYPE 'E'.
             ELSE.
               LOOP AT T_VIQMMA.
                 IF  T_VIQMMA-MNGRP IS INITIAL .
                   IF T_VIQMMA-MATXT IS INITIAL.
                     L_TAG = 'X'.
                   ENDIF.
                 ENDIF.
               ENDLOOP.
               IF L_TAG = 'X'.
                 MESSAGE 'Please fill the mandatory analysis data in Action' TYPE 'E'.
               ENDIF.
             ENDIF.
           ENDIF.
         ENDIF.
       ENDIF.
    ENDIF.
    <Added code tags>
    Thank you so much in advance..
    -Sudhish
    Please use the code tags when you're posting any code snippet
    Edited by: Suhas Saha on Jul 13, 2011 12:39 PM

    Hi, I was thinking just like XVBAP and YVBAP values in the USEREXIT_SAVE_DOCUMENT.
    Plz check u have x /y versions or tables like _old/ _new suffixes and then move the value accordingly.
    otherwise there may be inconsistency.
    Edited by: Prasenjit S. Bist on Jul 13, 2011 3:03 PM

  • 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

  • How to add the contents of a field of internal table.

    Hello Everybody,
    How to sum up the individual field from a internal table. Like i have a internal table that has menge field , I need to sum up the menge field for each matnr..
    exm : for each matnr there are 5 menge entries, I need to add all the menge fields and shud be put against the matnr .
    Thanks,

    Hi Khaleel,
    One more option is using the "collect" statement.....
    imagine in the internal table itab..we have 2 fields only..
    MATNR,MENGE,
    we have 2 internal tables itab1 and itab2...
    loop at itab1.
    collect itab1 to itab2.
    endloop.
    Action performed is ...for the same MATNR...menge gets added and saved as a single record...When matnr changes...new record is Appended
    another case is we have 3 fields in internal table
    MATNR,UNIT,MENGE
    imagine we hane the records
    Material1 KG  100
    Material1 LT   20
    Material1 LT   200
    MAterial2 KG 100
    in this case...the output will be
    Material1 KG 100
    Material1 LT  220
    MAterial2 KG 100
    Reason is that the fields before the addable value is checked for similarity..
    here field UNIT is also checked and also MATNR before adding up....
    Hope it gave you some alternative idea to proceed with....
    Reward if helpful
    Regards
    Byju

  • How to pass  internal table values to parameter

    hi,
             how to pass  internal table values to parameter in selection screen.if is it possible means please sent codeings.
    thanks.
      stalin.

    hi,
    tables : mara.
    data :  begin of itab_mara occurs 0,
              matnr like mara-matnr,
              ernam like mara-ernam,
              end of itab_mara.
    selection-screen : begin of block blk1 with frame title text-001.
    parameters : p_matnr like mara-matnr.
    selection-screen : end of block blk1.
    select matnr ernam from mara into corresponding fields of itab_mara
                                                                    where matnr = p_matnr.
    loop at itab_mara.
    write :/ itab_mara-matnr,
               itab_mara-ernam.
    endloop.
    <b><REMOVED BY MODERATOR></b>
    Message was edited by:
            Alvaro Tejada Galindo

  • Passing '**********' to screen field value instead of internal table value

    Hi All,
    I have written BDC, in which when i pass value for second screen "Description type field"  it's passing '*************************' instead of internal table value.
    It's picking correct value for first internal table value. Could anyone please give an idea why it's happening?
    Please find the code:
    LOOP AT it_record.
    header data for BDC
       AT NEW CLASS.
        IF sy-tabix <> 1.
            perform bdc_dynpro      using 'SAPLCLMO' '7777'.
            perform bdc_field       using 'BDC_OKCODE'
                                    '=SAVE'.
            CALL TRANSACTION 'CLWM' USING bdcdata
                          MODE p_mode
                          UPDATE 'S'
                          MESSAGES INTO messtab.
            clear : bdcdata[],bdcdata.
        ENDIF.
        perform bdc_dynpro      using 'SAPLCLMO' '0200'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'RMCLM-CLASS'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
        perform bdc_field       using 'RMCLM-CLASS'
                                      it_record-class.
        perform bdc_dynpro      using 'SAPLCLMO' '7777'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'RMCLM-KLBEZ'.
        perform bdc_field       using 'RMCLM-KLBEZ'
                                      it_record-klbez.
        perform bdc_field       using 'RMCLM-STATU'
                                      '1'.
        perform bdc_dynpro      using 'SAPLCLMO' '7777'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=MERK'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'RMCLM-KLBEZ'.
        perform bdc_field       using 'RMCLM-KLBEZ'
                                      it_record-klbez.
        perform bdc_field       using 'RMCLM-STATU'
                                      '1'.
        MOVE 1 TO IDX.
        ENDAT.
    line item data for BDC
            perform bdc_dynpro      using 'SAPLCLMO' '7777'.
            perform bdc_field       using 'BDC_OKCODE'
                                       '/00'.
            perform bdc_field       using 'BDC_CURSOR'
                                        'RMCLM-RELEV(02)'.
            CONCATENATE 'RMCLM-MERKMA(' IDX ')' INTO FNAM.
            perform bdc_field       using FNAM
                                        it_record-merkma.
            CONCATENATE 'RMCLM-RELEV(' IDX ')' INTO FNAM.
            perform bdc_field       using   FNAM
                                       it_record-relev.
            IDX = IDX + 1.
      ENDLOOP.
    Thanks,
    Ujjwal

    Hi Ujjwal
    The reason behind this is that you are using AT NEW.... ENDAT block in your coding.
    When you use AT NEW field statements, the fields in the work area after the field get converted into ********.
    Check values in your work area I_RECORD in debugging inside AT NEW statement and you will understand what I am saying.
    In your case all the fields from header line of I_RECORDS which come after field CLASS are getting converted into *******,
    hence the error.
    Try using a temporary work area, say w_record. Pass value of I_record to w_record before AT NEW statement.
    And use w_record-fields instead of I_record-fields. And your program should work.

  • How would you order an internal table e.g. itab according a specific field

    Hello
    How would you order an internal table e.g. itab according a specific field?
    Would you be so kind and let me see an mini example
    Thank you in advance

    Hi Tina,
    You can sort the table as already mentioned, or if you want it always kept in a key sequence you could define it as a sorted table something like this:
    types:
    begin of itabline,
    field1  type c,
    field2  type n,
    field3  ....
    end of itabline.
    DATA itab TYPE sorted table of itabline WITH UNIQUE key field1.
    You can then insert and read entries by the key fields.
    Hope that helps as an option!
    Robin

  • How to convert Internal table values to excel file

    Hi Experts!!!
    I have requirement to generate a Excel(.xls) file for a requirement. For this the final internal table values has to be moved to excel file. I have used function module "SAP_CONVERT_TO_XLS_FORMAT" to generate it to my local machine. But when i tried to generate the file in "AL11" folder its giving a dump. Ex(/sapia/iface/out/comm/saphr/test.xls). Can anyone please tell me is there anyother function modules or program to generate in sapia folder. 
    Thanks.
    Ganesh R K

    try to save as a tab delimited.

Maybe you are looking for

  • Browser not showing scrollbar in text layout component

    hi my text layout works great as SWF, however when i publish i dont see the scroll bar in the html page. saying that i can use the mouse scroll to scroll the text. my XML: <?xml version="1.0" encoding="utf-8"?> <flow:TextFlow paddingTop="5" paddingRi

  • Elements 5 won't open, error message "attempt to access invalid address" any solutions please.

    I have been using this for years with other problems, however now it refuses to open. I have uninstalled and re-installed after restarting the computer twice. I also deleted every folder I could find with elements in the name to no avail. If I read a

  • MacBook Pro (13-inch Early 2011) not staring up at all

    Hi Everyone, I have MacBook Pro (13-inch Early 2011). Since couple of weeks my Mac suddenly shuts down, when I try to restart it again I am not getting any response, no fan voice, no screen start up, no lights nothing. I read couple of blogs and foun

  • Rhythmbox 0.8.8 problem

    hi, Since last upgrade I haven't been able to add new music or internet radio stations to Rhythmbox. Also my entire music library is lost. The files are still there but Rhythmbox can't find them.. Any ideas how to correct it? .murkus EDIT: I suspect

  • ADF Telnet with JDev 10.1.3.5

    I've tried so may days but ended up with no answer even from googling about ADF Telnet. I saw that oracle has a hidden treasure and that is Oracle ITS (Industrial telnet Server). I tried to find some samples, but it seems that no one using it and I o