<?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: Issue in ABAP Program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272602#M1530348</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey remove the structure in form just use those ranges.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinayaka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Oct 2010 09:27:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-10-06T09:27:30Z</dc:date>
    <item>
      <title>Issue in ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272599#M1530345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am very new to ABAP. I am facing one issue while changing the exist program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Selection screen:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT-OPTIONS: PT_MATNR FOR MARA-MATNR.
*--------Produkthierarchie
SELECT-OPTIONS: PT_PRDHA FOR MARA-PRDHA.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perform Statment:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;PERFORM get_common_data TABLES pt_prdha
                                 pt_lifnr&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Form:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM get_common_data TABLES   it_prdha STRUCTURE pt_prdha
                              it_lifnr STRUCTURE pt_lifnr&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i try to activate the program it is giving the error &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"field pt_prdha is unknown. It is neither in one of the specified tables nor defined by data statment"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message: please use more descriptive subject lines and code tags from now on.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Thomas Zloch on Oct 6, 2010 12:44 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 09:10:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272599#M1530345</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-06T09:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272600#M1530346</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;First try to understand Flow of program before changing  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check syntax   for perform and form  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e perform getdata .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   form getdata.&lt;/P&gt;&lt;P&gt;   endform "getdata &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Deepak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 09:24:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272600#M1530346</guid>
      <dc:creator>deepak_dhamat</dc:creator>
      <dc:date>2010-10-06T09:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272601#M1530347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sivaparvathy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  The select options name that you declare for a field always creates an internal table. But you can't refer that in the form statement since it's not a standard structure like SFLIGHT or user defined struc say for ex. Thats you it shoots an error. I guess thats the probs. Try with different structure for that table you are using in the form statement rather than the select-options internal table...I dont know for sure...Try and check it out&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;""Just checked your code....no error in the part pt_prdha but it triggers on pt_lifrnr. U gotta declare that before either in a structure format or itab since you are referring that for a formal parameter in the FORM statement."""&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arunmozhi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 09:26:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272601#M1530347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-06T09:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272602#M1530348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey remove the structure in form just use those ranges.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinayaka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 09:27:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272602#M1530348</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-06T09:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272603#M1530349</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;    I suggest you that define PT_PRDHA using DATA statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Else yiou define those by using BEGIN OF statement.i.e., inside structure u give define those fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   The error tells that u need to define those before using it. I hope it will work&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; &lt;/P&gt;&lt;P&gt;Saravanan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 09:28:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272603#M1530349</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-06T09:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272604#M1530350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;PT_PRDHA&lt;/STRONG&gt; - Is it global ???&lt;/P&gt;&lt;P&gt;if its in top include actiavte it first.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 10:00:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272604#M1530350</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-10-06T10:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272605#M1530351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that PT_MATNR &amp;amp; PT_PRDHA are SELECT-OPTIONS. Also remember TABLES params is obsolete in subroutines &amp;amp; FMs, try to avoid them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Recommended way of writing the code will be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: v_matnr TYPE mara-matnr,
      v_prdha TYPE mara-prdha.

* Define Type Ranges for the SELECT-OPTIONs
TYPES: ty_r_matnr TYPE RANGE OF matnr,
       ty_r_prdha TYPE RANGE OF prodh_d.

SELECT-OPTIONS:
s_matnr FOR v_matnr,
s_prdha FOR v_prdha.

PERFORM f_select_data
USING s_matnr[] s_prdha[].
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  F_SELECT_DATA
*&amp;amp;---------------------------------------------------------------------*
FORM f_select_data
USING fp_s_matnr TYPE ty_r_matnr
      fp_s_prdha TYPE ty_r_prdha.

ENDFORM.                    " F_SELECT_DATA&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 10:35:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272605#M1530351</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-10-06T10:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272606#M1530352</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;EM&gt;STRUCTURE pt_prdha&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after keyword STRUCTURE a dictionary structure is expected. You can try with LIKE pt_prdha.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warning: It is always a little bit complicated to pass select-options tables as parameters. Select-options are global data in the program. In this case I would just use the field PT_PRDHA (after renaming to SO_PRDHA) in the subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And: Please avoid meaningless subjects as &lt;STRONG&gt;+Issue in ABAP Program&lt;/STRONG&gt;+&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are new to this forum, first take some time for reading before posting. Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 10:47:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272606#M1530352</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2010-10-06T10:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272607#M1530353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Clemens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Select-options are global data in the program. In this case I would just use the field PT_PRDHA (after renaming to SO_PRDHA) in the subroutine.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm share the same opinion as you do. But the self-proclaimed "omniscient" QA reviewers here have different ideas. Is this documented somewhere or is it just a thumb-rule?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 10:53:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272607#M1530353</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-10-06T10:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272608#M1530354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for the self-proclaimed "omniscient" QA reviewers do as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data:
  l_ref type ref to data.
get reference of so_whatever into  l_ref.

perform select using l_ref.
*...
form select using p_ref type ref to data.
  field-symbols:
    &amp;lt;selopt&amp;gt; type table.
  assign p_ref to &amp;lt;selopt&amp;gt;.
  select ... 
    into ...
    from ....
   where field in &amp;lt;selopt&amp;gt;.
endform.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can argue that this is modern oo oriented best-performance elaborated style. QA reviewers are usually just not qualified for disagreement &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But honestly: With oo the use of references get's used more and more, so why not use them?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 14:50:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272608#M1530354</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2010-10-06T14:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in ABAP Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272609#M1530355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sivaparvathy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, the error is because pt_prdha and pt_lifnr are not in dictionary so, you can't use STRUCTURE, yo must use LIKE (because this tables belong to program).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aditionally:&lt;/P&gt;&lt;P&gt;- TABLES parameter is obsolete, so avoid use it.&lt;/P&gt;&lt;P&gt;- If your program is a REPORT all variables in selection screen are Globals, so you don't need pass it. (just use it)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT-OPTIONS: PT_MATNR FOR MARA-MATNR.
*--------Produkthierarchie
SELECT-OPTIONS: PT_PRDHA FOR MARA-PRDHA.

PERFORM get_common_data.

FORM get_common_data.
...
READ TABLE PT_MATNR INDEX 1.
...
ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope to be clear and usefull,&lt;/P&gt;&lt;P&gt;best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 16:32:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-abap-program/m-p/7272609#M1530355</guid>
      <dc:creator>rxsalomone</dc:creator>
      <dc:date>2010-10-06T16:32:44Z</dc:date>
    </item>
  </channel>
</rss>

