<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Checking table field name in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578450#M261168</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found in linked topic (by L Appana) partial solution which tell that I should to check if table field exist in table DD03L. (thx for that)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Off course my question is an generalization of some problem. Really I have an ready internal table (doesn't matter how it was created) with data (column: table_name and table_field_name). Inside this tables I have information from which table and from which field I should read information. But those names aren't freely selectable (they are limited to some tables and some fields). Because all those field are related in some way with itself I can early select some data to an internal table (let call it it_with_selected_data) with structur which have all fields relevant to allowed fieldname inside itself.&lt;/P&gt;&lt;P&gt;So my task is really to check value of table_name and table_field_name and read relevant information from it_with_selected_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx guys for help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Tomasz Suchanek&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Sep 2006 14:13:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-13T14:13:01Z</dc:date>
    <item>
      <title>Checking table field name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578446#M261164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to get "dynamic" some data from table. What i mean saying 'dynamic'.&lt;/P&gt;&lt;P&gt;I have an ABAP dictonary table TRDIR. I want to allow user to choose some data by typing the name of table column. Than I use want to read only data form this column.&lt;/P&gt;&lt;P&gt;I use field symbols (representing column name) to do this:&lt;/P&gt;&lt;P&gt;local_data_line_from_TRDIR-&amp;lt;FS&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm interesting about FM whichcan check that local_data_line_from have column which name is in &amp;lt;FS&amp;gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 13:39:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578446#M261164</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T13:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Checking table field name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578447#M261165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi tomaz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first fetch all the data from the data base table&lt;/P&gt;&lt;P&gt;to an INTERNAL_TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then allow user to select a column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then U  get the field-name of that column&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using FM  - &amp;gt; GET_COMPONENT_LIST'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*********how to use it *************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : components LIKE rstrucinfo OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----" /&gt; Get component list*************&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GET_COMPONENT_LIST'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;program = sy-repid&lt;/P&gt;&lt;P&gt;fieldname = 'ITAB'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;components = components.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anver&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if helped mark points&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 13:45:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578447#M261165</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-09-13T13:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Checking table field name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578448#M261166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this link for my sample code , once data comes into ALV , you can download it to excel and you can delete the columns which are not required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="2009827"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Appana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 13:52:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578448#M261166</guid>
      <dc:creator>Laxmana_Appana_</dc:creator>
      <dc:date>2006-09-13T13:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Checking table field name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578449#M261167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tomasz,&lt;/P&gt;&lt;P&gt;do you use ALV. if yes, delete all fields which&lt;/P&gt;&lt;P&gt;are not marked from the fieldcat or set it to no_out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 13:53:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578449#M261167</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T13:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Checking table field name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578450#M261168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found in linked topic (by L Appana) partial solution which tell that I should to check if table field exist in table DD03L. (thx for that)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Off course my question is an generalization of some problem. Really I have an ready internal table (doesn't matter how it was created) with data (column: table_name and table_field_name). Inside this tables I have information from which table and from which field I should read information. But those names aren't freely selectable (they are limited to some tables and some fields). Because all those field are related in some way with itself I can early select some data to an internal table (let call it it_with_selected_data) with structur which have all fields relevant to allowed fieldname inside itself.&lt;/P&gt;&lt;P&gt;So my task is really to check value of table_name and table_field_name and read relevant information from it_with_selected_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx guys for help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Tomasz Suchanek&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 14:13:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578450#M261168</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T14:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Checking table field name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578451#M261169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just wish to clarify whether the below states your requirement !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U have an internal table say itab with table name and fieldname...while another isel with selected data for the corresponding fields...Now you wish to loop through itab and get the corresponding data from isel ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that case what is the structure of isel...is it storing the field data as column or in rows ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 14:59:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578451#M261169</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T14:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Checking table field name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578452#M261170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   check Fm nametab_get.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Amole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 15:12:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578452#M261170</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T15:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Checking table field name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578453#M261171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found solution myself, it look like below (the most important think was I was looking for was a DD03l table, thx again L Appana for link) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the way how I find which table name was choosen and which field name (as I said is restricted, limited, in this case to TRDIR and TADIR)&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM explode_parameters
  USING     pse_parameters TYPE ts_parameters
  CHANGING  pv_table_name  TYPE c
            pv_table_field TYPE c
            pv_status      TYPE c.

  DATA:     lv_table_name  TYPE c,
            lv_table_field TYPE c.

  CLEAR pv_table_name.
  CLEAR pv_table_field.

* default: nothing found
  pv_status = space.

  SPLIT  pse_parameters-value AT '-'
    INTO pv_table_name pv_table_field.

  IF sy-subrc EQ 0.
*   work on local data
    lv_table_name   =  pv_table_name.
    lv_table_field  =  pv_table_field.
    "uppercase
    TRANSLATE lv_table_name TO UPPER CASE.
    TRANSLATE lv_table_field TO UPPER CASE.
    CASE lv_table_name.
      WHEN 'TRDIR'.
        IF NOT lv_table_field IS INITIAL.
          pv_status = '1'.
          "restore parameters as upper case
          pv_table_name  = lv_table_name.
          pv_table_field = lv_table_field.
        ENDIF.
      WHEN 'TADIR'.
        IF NOT lv_table_field IS INITIAL.
          pv_status = '2'.
          "restore parameters as upper case
          pv_table_name  = lv_table_name.
          pv_table_field = lv_table_field.
        ENDIF.
      WHEN OTHERS.
        pv_status = 'S'.
    ENDCASE.
  ENDIF.

ENDFORM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  check_table_params_exists
*&amp;amp;---------------------------------------------------------------------*
*       2006.09.11 by Tsy
*       PV_OCCURRENCE is:
*         '1'   when TRDIR need to be read
*         '2'   when TADIR need to be read
*         '3'   when both table need to be read
*         SPACE when no table found
*
*       Function finish searching when both table need to be read
*       than later checking is not neccessary
*       or when it finish looping
*----------------------------------------------------------------------*
*      --&amp;gt;VALUE(PTE_PARAMETERS)  text
*      --&amp;gt;PV_OCCURRENCE          text
*----------------------------------------------------------------------*
form check_table_params_exists
    using    value(pte_parameters)  type  tt_parameters
    changing pv_occurrence          type  c.

  data:  ls_parameters  type ts_parameters,
         lv_table_name(40)    type c,
         lv_table_field(40)   type c,
         ls_table_def         type dd03l.

* default: no relevant table name found
  pv_occurrence = space.

  loop at pte_parameters into ls_parameters.

    clear ls_table_def.

*   extract table name and table field
    split ls_parameters-value at '-'
          into lv_table_name lv_table_field.

    if sy-subrc = 0.
*     to uppercase
      translate lv_table_name to upper case.
      translate lv_table_field to upper case.
*     is tablename TRDIR or TADIR?
      if  ( lv_table_name eq 'TRDIR' )       "if table name is correct
      and ( not lv_table_field is initial ). "and fieldname is choosen
        "found
        select single tabname fieldname
          into corresponding fields of ls_table_def
          from dd03l
          where tabname   = lv_table_name
            and fieldname = lv_table_field.
        "if this field exist
        if not ls_table_def is initial.
          if pv_occurrence eq '2'.
            pv_occurrence = '3'.
            exit.
          else.
            pv_occurrence = '1'.
          endif.
        endif.
      elseif  ( lv_table_name eq 'TADIR' )    "if table name is correct
      and ( not lv_table_field is initial ).  "and fieldname is choosen
        select single tabname fieldname
            into corresponding fields of ls_table_def
            from dd03l
            where tabname   = lv_table_name
              and fieldname = lv_table_field.
        if not ls_table_def is initial.
          if pv_occurrence eq '1'.
            pv_occurrence = '3'.
            exit.
          else.
            pv_occurrence = '2'.
          endif.
        endif.
      endif.
    endif.
    clear ls_parameters.
  endloop.
endform.                    "check_table_params_exists
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is how I assing correct values &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM fill_param_val_from_table_line
    USING     pv_table_name   TYPE c
              pv_field_name   TYPE c
              pv_occurrence   TYPE c
              pse_prog_data   TYPE /imgdt/head_prog
    CHANGING  pv_param_value  TYPE c.

  FIELD-SYMBOLS &amp;lt;tn&amp;gt; TYPE /imgdt/head_prog.
  FIELD-SYMBOLS &amp;lt;fv&amp;gt; TYPE c.

  ASSIGN pse_prog_data TO &amp;lt;tn&amp;gt;.

  CASE pv_occurrence.
    WHEN '1'. "TRDIR
      ASSIGN COMPONENT pv_field_name OF STRUCTURE &amp;lt;tn&amp;gt; TO &amp;lt;fv&amp;gt;.
      pv_param_value = &amp;lt;fv&amp;gt;.
    WHEN '2'. "TADIR
      ASSIGN COMPONENT pv_field_name OF STRUCTURE &amp;lt;tn&amp;gt; TO &amp;lt;fv&amp;gt;.
      pv_param_value = &amp;lt;fv&amp;gt;.
    WHEN OTHERS. "when 'S' ad in other cases don't change anything
  ENDCASE.

ENDFORM. "fill_param_val_from_table_line
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Tomasz Suchanek&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Tomasz Suchanek&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Tomasz Suchanek&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 15:13:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578453#M261171</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T15:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Checking table field name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578454#M261172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check FM RFC_READ_TABLE.Pass the table name and the field names which you require to fetch data in FIELDS parameter or you can use the same logic used in the FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Lakshman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 15:16:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-table-field-name/m-p/1578454#M261172</guid>
      <dc:creator>Lakshmant1</dc:creator>
      <dc:date>2006-09-13T15:16:40Z</dc:date>
    </item>
  </channel>
</rss>

