Problem after assigning  field-symbol in read statement...

Hello Experts,
I want to use a universal field-symbol in reading my internal tables so
I can avoid declaring multiple work areas. Here is my code:
FIELD-SYMBOLS: <fs_any> type any.
READ TABLE lt_orderadm_h INDEX 1 ASSIGNING <fs_any>.
Now when I try to insert this code:
IF NOT <fs_any>-object_id IS INITIAL.
ENDIF.
It says that <fs_any> has no structure and therefore no component called object_id.
I think that I need to use assign component for this but I don't know the code.
Thank you guys and take care!

Hi
DATA : WA_ITORDERADM_H LIKE LINE OF IT_ORDERADM_H.
**Try to assign the work area rather type any**
FIELD-SYMBOLS: <fs_any> type WA_ITORDERADM_H.
READ TABLE lt_orderadm_h INDEX 1 ASSIGNING <fs_any>.
Now when I try to insert this code:
IF NOT <fs_any>-object_id IS INITIAL.
ENDIF.
Check this program
This works for me
Simple program.
TYPES: BEGIN OF NAME,
NEXTNAME(10),
FIRSTNAME(10),
LASTNAME(10),
END OF NAME.
FIELD-SYMBOLS <F> TYPE NAME.
DATA: LINE(30).
LINE = 'JOHN SMITH SHRI'.
ASSIGN LINE TO <F> CASTING.
WRITE: / 'Lastname:', <F>-LASTNAME,
'Firstname:', <F>-FIRSTNAME,
'Nextname :', <F>-NEXTNAME
Award points if helpful
Thanks
VENKI

Similar Messages

  • Problem in using Field Symbols in HIDE statement

    Hi All,
    I am working in an Upgrade project ( from 4.6B to ECC 5.0 ). In a program I found few warnings on HIDE statement because they have used Field Symbols in HIDE statement.
    The warning is " HIDE on a field symbol is dangerous, but the formal parameter "" is not ".
    and the piece of code is
    SET EXTENDED CHECK OFF.
    HIDE: flg_pick_up, <s1>, <s2>, <s3>, <s4>, <s5>, z_feld_ind.
    CLEAR flg_pick_up.
    SET EXTENDED CHECK ON.
    all the field symbols are of type ANY. SO can any one help in removing those warnings.
    Please reply me as soon as possible.
    With Regards,
    Amarnath Singanamala

    Hi amarnath,
    1. Why do u want to remove
       the warning ?
    2. This warning (and not an error)
       is a GENUINE warning,
      which the system wants the user to make aware of.
    3. By doing some xyz,
      even if u may be able to hide the warning,
      the warning may be hidden (for display purpose only),
      but,
      the warning will still be there inside the system.
    4. I think u should ignore the warning,
      (if there are no other repurcussions).
    regards,
    amit m.

  • Problem in assigning field symbol to a nested internal table

    Hi All,
    I have searched the forum but could not find a solution to this problem. I have a requirement where I need to define an internal table within an internal table, so I have used pointer within the outer internal table(itab2) which point to the inner table. However, I am facing problem while assigning the pointer.
    data: begin of struct1 occurs 0,
            fld3(10) type C,
           end of struct1.
    data: begin of itab2 occurs 0,
            fld1(10) type C,
            fld2(10) type C,
            p_inner like ref to struct1,
          end of itab2.
    field-symbols <inner_table> type any.
    I want to assign "itab2->p_inner->* " to "<inner_table>".
    However, the following statement is Not working:
    assign itab2->p_inner->* to <inner_table>.
    I want to fill the values within fields fld1, fld2 and fld3 and append it in itab2.
    The final table should be like:
    ITAB2:
    fld1    fld2    fld3
    aa      bb      cc
                     dd
                     ee
    11      22      33
                     44
                     55
    I have tried many other ways too but could not suceed, please help.
    Thanks,
    Vishal.

    Thanks Matt,
    But how do I append the values within this internal table ??
    When I am using the following code:
    ls_wa-fld3 = 'A'.
    ls_wa-t_in-fld1 = 'B'.
    ls_wa-t_in-fld2 = 'C'.
    ls_wa-t_in-fld1 = 'D'.
    ls_wa-t_in-fld2 = 'E'.
    append ls_wa to lt_tab.
    Its giving an error that:
    The data object "LS_WA" does not have a component called "T_IN-FLD1".
    I wanted the values to be appended in the following way in lt_tab:
    fld3     fld1     fld2
    A     B     C
         D     E
    Please help.

  • Problem with slis_t_specialcol_alv Field Symbol Assignment

    I have created a dynamic internal table (runtime determined number of columns) to contain data to be displayed in an ALV. I’ve also made ensured that the last column of the dynamic itab is of type <b>'slis_t_specialcol_alv'</b> and named <b>‘CINFO’</b> to contain color information for that particular row. In the code below the dynamic itab is pointed to by field symbol <dyn_table> while the work area for it would be <dyn_wa>.
    Somewhere down the line I attempt to assign the ‘CINFO’ component of the current row of the itab to a field symbol called <fs_cinfo> typed as ‘slist_t_specialcol_alv’ (Same as CINFO).
    I used the code:
    ASSIGN COMPONENT 'CINFO' OF STRUCTURE <dyn_wa> TO <fs_cinfo>.
    This gives me the runtime error:
    <i>Type conflict in the ASSIGN statement in the program "ZHRR001_TEMMATRIX".
    You attempted to assign a field to a typed field symbol,
    but the field does not have the required type.    </i>     
    I am unsure why this happens as both the component CINFO and FS <fs_cinfo> are of type slist_t_specialcol_alv.
    For some odd reason though during debugging, I took a look at the <dyn_wa> structure and the component type of CINFO was displayed as “C”???
    Here is the relevant portion of code (creation of dynamic itab and attempting to assign <fs_cinfo>)
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
                   <dyn_wa>.
    FIELD-SYMBOLS: <fs_cinfo> TYPE slist_t_specialcol_alv.
    DATA: lw_cinfo TYPE slis_specialcol_alv.
    DATA:          li_fldcat TYPE lvc_t_fcat,
                   lw_fldcat TYPE lvc_s_fcat.
    *Create internal table fields (they will be called Field1, Field2, etc)
    *Last column will be named 'CINFO' to contain row color information
    DO l_alvcolumncount TIMES.
      index = sy-index.
      IF index <> l_alvcolumncount.
        CLEAR lw_fldcat.
        CONCATENATE 'Field' index INTO lw_fldcat-fieldname .
        CONDENSE lw_fldcat-fieldname NO-GAPS.
        lw_fldcat-datatype = 'STRING'.
    *    lw_fldcat-intlen = 5.
        APPEND lw_fldcat TO li_fldcat .
      ELSE.
        CLEAR lw_fldcat.
        lw_fldcat-fieldname = 'CINFO'.
        CONDENSE lw_fldcat-fieldname NO-GAPS.
        lw_fldcat-datatype = 'slis_t_specialcol_alv'.
        APPEND lw_fldcat TO li_fldcat.
      ENDIF.
    ENDDO.
    * Create dynamic internal table and assign to FS
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog = li_fldcat
      IMPORTING
        ep_table        = new_table.
    ASSIGN new_table->* TO <dyn_table>.
    *Create dynamic work area and assign to FS
    CREATE DATA new_line LIKE LINE OF <dyn_table>.
    ASSIGN new_line->* TO <dyn_wa>.
      ASSIGN COMPONENT 'CINFO' OF STRUCTURE <dyn_wa> TO <fs_cinfo>.
    * Color this cell
      lw_cinfo-fieldname = fieldname.
      lw_cinfo-color-col = 6.
      APPEND lw_cinfo TO <fs_cinfo>.
    Message was edited by: Sow Yong Wong

    Hello Sow
    There is a big problem in the program: you are mixing types used for FM-based ALV (SLIS_...) and ABAP-OO based ALV (LVC_...).
    For ABAP-OO based row colouring you have to define your itab like this:
    TYPES: ty_s_outtab.
      INCLUDE TYPE kna1. " just an example
    TYPES: rowcolor(4)  TYPE c.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab TYPE STANDARD TABLE of ty_s_outtab
                       WITH DEFAULT KEY.
    In the layout (LVC_S_LAYO) you have to set <b>ls_layout-info_fname = 'ROWCOLOR'</b>.
    ROWCOLOR has to be filled according to <b>Cxyz</b> whereas
    - x = color
    - y = inverse on/off
    - z = intensified on/off
    For documentation please refer to <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907">An Easy Reference to ALV Grid Control</a>
    Regards
      Uwe

  • Regarding problem with assigning field to Field symbols

    Hi All,
    We are migrating(recreating) the program which was in 4.7 to ECC 6.0.
    In 4.7 they are using the below code for assigning the field to fieldsymbol from work area as shown below.
    ASSIGN wa_kostl_kstar-wkg001+offset TO <von>
    wa_kostl_kstar is a work area and wkg001 is the fourth field and wkg011 is 13th field and it is taking this filed into field symbol <Von>.
    In Ecc 6.0 th same code is not being accepted and throwing syntax error.
    So they had changed the code in ECC 6.0 to
    ASSIGN wa_kostl_kstar-wkg001+(offset) TO <von>
    And there was no syntax error and while testing it goes to dump.
    I had tested in 4.7 and its working fine taking the value of  13 th field to <von>,and like wise there are some other assign statements after,like this.
    So any one please let me know what to do in this case.
    Regards,
    MADHAVA.

    Hi,
    Hope below example can give you an idea on handling your case:
    TYPES: BEGIN OF t_sal_ord,
             vbeln TYPE vbeln_va,
             posnr TYPE posnr_va,
             auart TYPE auart,
             vkorg TYPE vkorg,
             matnr TYPE matnr,
           END OF t_sal_ord.
    DATA: wa_mara TYPE mara.
    DATA: wa_sal_ord TYPE t_sal_ord.
    FIELD-SYMBOLS: <fs_matkl>,
                   <fs_vkorg>.
    ASSIGN COMPONENT 'MATKL' OF STRUCTURE wa_mara TO <fs_matkl>.
    IF sy-subrc NE 0.
      EXIT.
    ENDIF.
    ASSIGN COMPONENT 'VKORG' OF STRUCTURE wa_sal_ord TO <fs_vkorg>.
    IF sy-subrc NE 0.
      EXIT.
    ENDIF.
    Kind Regards
    Eswar

  • Problem with DESCRIBE field-symbol statement?

    Hi
    I havw written following querry but it's showing error. My doubt is there any resctriction field symbols in DESCRIBE query.
    i wrote
    describe field <a> type typ  length in character mode.
    Is that syntax correct?

    When you use the Describe statement with the field symbols, it will do the describe on the field which was assigned to it.
    Like:
    FIELD-SYMBOLS: <fs> TYPE ANY.
    DATA: l_char TYPE char10.
    l_char = 'TEST'.
    ASSIGN l_char TO <fs>.
    DATA: l_len TYPE i.
    DESCRIBE FIELD <fs> LENGTH l_len IN CHARACTER MODE.
    write: / '<fs>:', <fs>.
    WRITE: / 'Length', l_len.
    Here descirbe gives the property of the L_CHAR because it was assigned to field symbol <FS>.
    Regards,
    Naimesh Patel

  • GETWA_NOT_ ASSIGNED, Field symbol not yet assigned yet.

    Hi,
    I am working in an Upgrade project,, from 4.6 version to ECC version.
    A program is going into a short dump.
    On debugging th program, I identified that there is a problem with a function module which triggers a standard include and this is where i am getting the error. the function module is supposed to populate a internal table is not populating it. the dump shows that the error is there in the assign statement shown below.
    <fm03> type any.
    <field> type any.
    assign <fm03> to <field>.
    can anyone help me out with this?

    if the program is a custom one then after assignment pl. check sy-subrc value
    like:
    assign <fm03> to <field>.
    if sy-subrc = 0.
    Normal processing
    else.
    Error handling here*
    endif.
    And for std. program search for notes if u think it is a bug in the program.
    Regards,
    Joy.

  • Problem related to field-Symbol?

    HI All,
    I am writting the below coding, Please tell me whether the Field Symbol will act as a table or not as I want to append a lot of data to field symbol. Please tell me is there any problem in the code.
    LOOP AT lt_vepoequi_keys into ls_vepoequi_keys.
            READ TABLE lt_vekp ASSIGNING <ls_vekp_str> with key
              matnr = ls_vepoequi_keys-matnr.
            IF sy-subrc = 0.
              <ls_vekp_str>-stoff = ls_vepoequi_keys-stoff.
              <ls_vekp_str>-sonum = ls_vepoequi_keys-sonum.
              <ls_vekp_str>-lagkl = ls_vepoequi_keys-lagkl.
              <ls_vekp_str>-lagkt = ls_vepoequi_keys-lagkt.
    endif.
    endloop.

    Hi Abhinav,
    you have internal table (say it_employee) with fields name,age,senior_category.
    now when you loop this internal table you will need workarea.
    loop at it_employee into wa_employee.
                      if wa_employee-age > 60.
                            wa_employee-senior_category = 'YES'.
                      else.
                              wa_employee-senior_category = 'NO'.
                      endif.
                              modify it_employee from wa_employee. 
                     endloop.
    now one use of Field-symbols is : when internal table is huge and when you loop with workarea and modify internal table each time, it takes time. So if we use Field-symbols performance would increase.
    loop at it_employee assigning into <fs_employee>.
                      if <fs_employee>-age > 60.
                            <fs_employee>-senior_category = 'YES'.
                      else.
                              <fs_employee>-senior_category = 'NO'.
                      endif.
                endloop.
    Now  you see in the above code, i have not used modify statement because when i loop internal table, the field symbol points directly to the memory of internal table.
    So during loop if i assign any value to the field symbol then it directly changes the internal table value, so there wont be any need to use modify statement.
    Hope you are clear with this example....
    Regards
    Sajid

  • Field symbols and READ TABLE with system code 4

    Hi,
    I have a hashed table and I am using field symbols to point to it to retrieve the field content. I then use it in the READ TABLE statement in the following way:
    Loop at x_data assign <fs>.
    ASSIGN COMPONENT 'xxx' OF STRUCTURE <fs> TO <c1>.
    ASSIGN COMPONENT 'xxx' OF STRUCTURE <fs> TO <c2>.
    READ TABLE ZZZZ assign <fs> with table key a1 = <c1>
                                               a2 = <c2>.
    If sy-subrc = 0.
    endif.
    I ran the debugger and I keep getting a 4. I am not able to get the value from a1 and a2 to see what it is and why it is causing a 4 sy-subrc. I know the value from the hashed table and the values c1 and c2 are the same, so the sy-subrc should be 0.
    How would I read a hashed table using field symbols? I know that usig a standard table, I have to sort the table on the key fields() before I actually can do the READ TABLE using the binary search.
    Please advise. Thanks
    RT

    Hai Rob
    Go  through the following Code
    Field-Symbols are place holders for existing fields.
    A Field-Symbol does not physically reserve space for a field but points to a field, which is not known until run time of the program.
    Field-Symbols are like Pointers in Programming language ‘ C ‘.
    Syntax check is not effective.
    Syntax :
    Data : v1(4) value ‘abcd’.
    Field-symbols <fs>.
    Assign v1 to <fs>.
    Write:/ <fs>.
    DATA: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA ITAB LIKE SORTED TABLE OF LINE WITH UNIQUE KEY COL1.
    FIELD-SYMBOLS <FS> LIKE LINE OF ITAB.
    DO 4 TIMES.
    LINE-COL1 = SY-INDEX.
    LINE-COL2 = SY-INDEX ** 2.
    APPEND LINE TO ITAB.
    ENDDO.
    READ TABLE ITAB WITH TABLE KEY COL1 = 2 ASSIGNING <FS>.
    <FS>-COL2 = 100.
    READ TABLE ITAB WITH TABLE KEY COL1 = 3 ASSIGNING <FS>.
    DELETE ITAB INDEX 3.
    IF <FS> IS ASSIGNED.
    WRITE '<FS> is assigned!'.
    ENDIF.
    LOOP AT ITAB ASSIGNING <FS>.
    WRITE: / <FS>-COL1, <FS>-COL2.
    ENDLOOP.
    The output is:
    1 1
    2 100
    4 16
    Thanks & regards
    Sreenivasulu P

  • Using ASSIGN - Field Symbol

    I have used
      import <GT_POS_DATA> from memory id 'lines'.
    and have the same{<GT_POS_DATA>} in my zreport. Now I have to sum
    up one field and move it to a variable to be displayed in my report
    output.
    How shld I proceed.
    Thanks in advance.

    Hi,
    Am facing problem over here :
    ASSIGN COMPONENT wkgbtr OF STRUCTURE <WA> TO <FIELD>.
    This is the part of code I used :
    FIELD-SYMBOLS: <gt_pos_data>  TYPE table,
                     <WA> type any,
                     <field> type any.
    LOOP AT <GT_POS_DATA> ASSIGNING <WA>.
    ASSIGN COMPONENT <wa>-wkgbtr OF STRUCTURE <WA> TO <FIELD>.
    lV_tot = lV_tot + <FIELD>.
    ENDLOOP.

  • Assign field symbols in infotype 0021 BADI implementation (HRPAD00INFTY )

    Hi there,
    In PA30 infotype 0021, i have to change the value of T_VIEW_REPID by implementing BADI HRPAD00INFTY [Program MP002100->screen 2000->MODULE BEFORE_OUTPUT->PERFORM badi_before_output(sapfp50m)]. I'm trying to use field symbols (as below) to change the value of T_VIEW_REPID and getting SY-SUBRC = 4 after the Assign (LV_WA) To <FS_REPID>. Can somebody please help.
    method IF_EX_HRPAD00INFTY~BEFORE_OUTPUT.
      Data: LV_WA(20) Type C Value '(MPPDAT02)VIEW_REPID'.
      Types: T_VIEW_REPID Type T582V-REPID.
      Field-Symbols: <FS_REPID> Type T_VIEW_REPID.
      Assign (LV_WA) To <FS_REPID>.
    endmethod.
    Thanks.

    Try like this
    method IF_EX_HRPAD00INFTY~BEFORE_OUTPUT.
      Data: LV_WA(20) Type C Value '(MP002100)VIEW_REPID'.
    Types: T_VIEW_REPID Type T582V-REPID.
      Field-Symbols: <FS_REPID> Type T_VIEW_REPID.
      Assign (LV_WA) To <FS_REPID>.
    endmethod.

  • Can we write Field Symbols in SELECT statement?

    Hi
    Can we write teh Fiel Symbols in the SELECT Statement ?
    Can you give how to write it, with Example ?
    Regards,
    N.L.Narayana

    Hi,
    Do you ask for that ? :
    field-symbols: <field1> type any ,
                   <field2> type any.
    assign component 'TOTO' of structure 'TATA' to <field1>.
    assign component 'TUTU' of structure 'TATA' to <field2>.
    select single toto
           into <field1>
           from tata
           where tutu = <field2>.
    Rgd
    Frédéric

  • UrGENT-DUMP while querying database table into itab(Assigned field Symbol)

    Hi,
    __I am getting a dump whose description is as follows__-
    "" In an SQL array select, the internal table used to hold the
    selected records must be at least as wide as the database table
    from which the records are being read.
    In this particular case, the database table is 820 bytes wide,
    but the internal table is only 814 bytes wide.""
    The following code had been written:
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_tabl TYPE dd02l-tabname.                                      "Table Name
    SELECTION-SCREEN END OF BLOCK b1.
    FIELD-SYMBOLS: <fs_itab> TYPE STANDARD TABLE,
                   <fs_wa> TYPE ANY,
                   <fs_itab1> TYPE STANDARD TABLE,
                   <fs_wa1> TYPE ANY.
    FORM generate_internal_tab .
      DATA: o_itab TYPE REF TO data,
            o_wa TYPE REF TO data,
            o_itab1 TYPE REF TO data,
            o_wa1 TYPE REF TO data.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = p_tabl
        CHANGING
          ct_fieldcat            = it_fcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
    *Create Dynamic Table for it_fcat
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = it_fcat
        IMPORTING
          ep_table                  = o_itab
        EXCEPTIONS
          generate_subpool_dir_full = 1
          OTHERS                    = 2.
      IF sy-subrc EQ 0 OR o_itab IS NOT INITIAL.
        ASSIGN o_itab->* TO <fs_itab>.
        CREATE DATA o_wa LIKE LINE OF <fs_itab>.
        ASSIGN o_wa->* TO <fs_wa>.
      ENDIF.
    *Download the file to Application server
        SELECT *
          FROM (p_tabl)
          INTO TABLE <fs_itab>.
    So i am geting a dump in placing contents of table(p_tabl) into <fs_itab>.Should the type declarations be changed???
    Please give me an solution to resolve this dump.
    Thanks and regards-
    Sumita

    You are trying to put more fields in the internal table than what is declared presently for itab. Check if one of the fields is selected but not being passed on to a internal table field.

  • Problem with the field-symbols

    Hi all,
            i am unable to delete the  data in the internal table.
            i am sending the code.
          BEGIN OF t_oprtn,
           budat LIKE afru-budat,
           vornr LIKE afru-vornr,
           grund LIKE afru-grund,
           gmein LIKE afru-gmein,
           gmnga LIKE afru-gmnga,
           expfl(1),
           END OF t_oprtn,
    FIELD-SYMBOLS: <fs_collect>         TYPE STANDARD TABLE.
    FIELD-SYMBOLS: <fs_wa_collect>      TYPE ANY.
        CREATE DATA i_collect TYPE STANDARD TABLE OF t_oprtn
                              WITH DEFAULT KEY.
        CREATE DATA wa_collect TYPE t_oprtn.
      ASSIGN i_collect->*       TO <fs_collect>.
      ASSIGN wa_collect->*      TO <fs_wa_collect>.
      SELECT abudat avornr agrund  aarbid astokz darbpl a~aufnr
             bplnbez cmaktx agmnga agmein
             INTO TABLE i_final
             FROM afru AS a INNER JOIN afko AS b
                                       ON aaufnr = baufnr
                            INNER JOIN makt AS c
                                       ON bplnbez = cmatnr
                            INNER JOIN crhd AS d
                                       ON aarbid = dobjid
             WHERE a~budat IN s_budat
    LOOP AT i_final INTO wa_final.
      MOVE-CORRESPONDING wa_final TO <fs_wa_collect>.
        COLLECT <fs_wa_collect> INTO <fs_collect>.
      ENDLOOP
    how to write a delete statement for -  <fs_collect>.
    Plz tell me the delete statement where GMNGA is '0'.   " GMNGA IS A CONFIRM QUANTITY.
    Plz reply its urgent.
    Edited by: hari prasad on May 30, 2008 1:15 PM
    Edited by: hari prasad on May 30, 2008 1:20 PM

    Try:
    field-symbols: <f_temp> type any.
    loop at <fs_collect> assigning <fs_wa_collect>.
       assign component 'GMNGA' of structure <fs_wa_collect> to <f_temp>.
    if <f_temp> is initial.
       delete <fs_collect>.
    endif.
    endloop.
    regards,
    S. Chandramouli.
    Edited by: Chandramouli Subburathinam on May 30, 2008 5:08 PM

  • Assign Field Symbol

    Hi,
    The below code is giving dump.plz let me know wats wrong?
    TABLES : y28m_prot_eina.
    DATA : g_t_mara TYPE TABLE OF mara.
    FIELD-SYMBOLS : <fs> TYPE STANDARD TABLE,
                    <fl> TYPE ANY.
    SELECTION-SCREEN BEGIN OF BLOCK blk1.
    SELECT-OPTIONS s_tabnam FOR y28m_prot_eina-tabname OBLIGATORY.
    SELECT-OPTIONS s_projkt FOR y28m_prot_eina-projekt. "OBLIGATORY.
    SELECT-OPTIONS s_datum FOR sy-datum.
    SELECT-OPTIONS s_time FOR sy-uzeit.
    SELECT-OPTIONS s_status FOR y28m_prot_eina-status.
    SELECTION-SCREEN END OF BLOCK blk1.
    select * from (s_tabnam-low) into table <fs>.
    LOOP AT <fs> INTO <fl>.
      WRITE : <fl>.
    ENDLOOP.

    I think u r getting dump because <fs> is not assigned yet.
    select * from (s_tabnam-low) into table <fs>.
    Try this code:
    REPORT z_demo_alv_jg.
    TYPE-POOLS                                                          *
    TYPE-POOLS: slis.
    INTERNAL TABLES/WORK AREAS/VARIABLES                                *
    DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
          i_index TYPE STANDARD TABLE OF i WITH HEADER LINE,
          w_field TYPE slis_fieldcat_alv,
          p_table LIKE dd02l-tabname,
          dy_table TYPE REF TO data,
          dy_tab TYPE REF TO data,
          dy_line TYPE REF TO data.
    FIELD-SYMBOLS                                                       *
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
                   <dyn_wa> TYPE ANY,
                   <dyn_field> TYPE ANY,
                   <dyn_tab_temp> TYPE STANDARD TABLE.
    SELECTION SCREEN                                                    *
    SELECTION-SCREEN BEGIN OF BLOCK blk1.
    SELECT-OPTIONS s_tabnam FOR y28m_prot_eina-tabname OBLIGATORY.
    SELECT-OPTIONS s_projkt FOR y28m_prot_eina-projekt. "OBLIGATORY.
    SELECT-OPTIONS s_datum FOR sy-datum.
    SELECT-OPTIONS s_time FOR sy-uzeit.
    SELECT-OPTIONS s_status FOR y28m_prot_eina-status.
    SELECTION-SCREEN END OF BLOCK blk1.
    START-OF-SELECTION                                                  *
    START-OF-SELECTION.
    Storing table name
      p_table = s_tabnam-low.
    Create internal table dynamically with the stucture of table name
    entered in the selection screen
      CREATE DATA dy_table TYPE STANDARD TABLE OF (p_table).
      ASSIGN dy_table->* TO <dyn_table>.
      IF sy-subrc <> 0.
        MESSAGE i000(z_zzz_ca_messages) WITH ' No table found'.
        LEAVE TO LIST-PROCESSING.
      ENDIF.
    Create workarea for the table
      CREATE DATA dy_line LIKE LINE OF <dyn_table>.
      ASSIGN dy_line->* TO <dyn_wa>.
    Select data from table
      SELECT * FROM (p_table)
      INTO TABLE <dyn_table>
      UP TO lines ROWS.
    Display report
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
          i_structure_name         = p_table
        TABLES
          t_outtab                 = <dyn_table>
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
      ENDIF.
    Regards,
    Joy.

Maybe you are looking for