<?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 passing select option as method parameter in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952645#M1601979</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;Try with below code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;s_var1 for im_sel_scr_field,&lt;/P&gt;&lt;P&gt;s_var2 for im_sel_scr_field,&lt;/P&gt;&lt;P&gt;s_var3 for im_sel_scr_field,&lt;/P&gt;&lt;P&gt;s_var4 for im_sel_scr_field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because you are maintining all select opt fields are characters. so according to that based on 'im_sel_scr_field' attribute data type we can follow to assign type to select options.&lt;/P&gt;&lt;P&gt;Now you can pass select option values to the respective method as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 May 2011 09:45:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-05-30T09:45:03Z</dc:date>
    <item>
      <title>Issue in passing select option as method parameter</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952638#M1601972</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 have written one common validation method for all select-options in selection-screen.&lt;/P&gt;&lt;P&gt;Which will be called for every select option validation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will pass s_vkorg, s_vtweg, s_abgru etc.. for each of the validations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the method i have created structrure &amp;amp; table type for the im_sel_scr_field.&lt;/P&gt;&lt;P&gt;This zsel_field structure is created with sign(char1), option(char2), low(45), high(45) field values.&lt;/P&gt;&lt;P&gt;zsel_field_tt (Table type for zsel_field structure).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when i am calling validation method as below, i am getting 'type compatible' error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i can create i.table of above structure: zsel_field i can pass the sel-opt value to i.table to avoid this error.&lt;/P&gt;&lt;P&gt;But i need to do this for each select option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Z_Meth&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Method&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EXPORTING&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;im_sel_scr_field = s_vkorg[]/s_abgru[] etc...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: I don't want to create structure/table type for each select option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to make s_vkorg[], s_abgru[] etc... passed without type-compatibale error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone provide input for resolving this issue!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kumar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 08:01:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952638#M1601972</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-30T08:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in passing select option as method parameter</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952639#M1601973</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;The structure of Sel option is as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                   	SIGN	                                   			C(1)&lt;/P&gt;&lt;P&gt;                                   	OPTION	                                   			C(2)&lt;/P&gt;&lt;P&gt;                                   	LOW	                                   			C(10)&lt;/P&gt;&lt;P&gt;                                   	HIGH	                                   			C(10)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the same in your method.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 08:08:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952639#M1601973</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-30T08:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in passing select option as method parameter</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952640#M1601974</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;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will get same error message 'Not Type compatible' as LOW/HIGH are Char(10) but s_vkorg will have Char4 &amp;amp; s_abgru will have char2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to make it work for all different lengths of select options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kumar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 08:13:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952640#M1601974</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-30T08:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in passing select option as method parameter</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952641#M1601975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As each of your select options are of different type (LOW and HIGH fields) you will keep raising this error. I don't think you can statically address parameter type which would be common to all your select options. Try then working with it dynamically by passing only reference to it&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
"definition
METHOD z_meth IMPORTING ref_sel_opt TYPE REF TO DATA.

"implementation
METHOD z_meth.
   field-symbols: &amp;lt;sel&amp;gt; type any table, &amp;lt;field&amp;gt; type any.

   assign ref_sel_opt-&amp;gt;* to &amp;lt;sel&amp;gt;.
   if sy-subrc = 0.
   "validate the structure
     ASSIGN COMPONENT 'SIGN' of structure &amp;lt;sel&amp;gt; to &amp;lt;field&amp;gt;.
     if sy-subrc ne 0.
         "wrong structure raise some error
     endif.
 
    ASSIGN COMPONENT 'OPTION' of structure &amp;lt;sel&amp;gt; to &amp;lt;field&amp;gt;.
     if sy-subrc ne 0.
         "wrong structure raise some error
     endif.
 
    ASSIGN COMPONENT 'LOW' of structure &amp;lt;sel&amp;gt; to &amp;lt;field&amp;gt;.
     if sy-subrc ne 0.
         "wrong structure raise some error
     endif.
 
    ASSIGN COMPONENT 'HIGH' of structure &amp;lt;sel&amp;gt; to &amp;lt;field&amp;gt;.
     if sy-subrc ne 0.
         "wrong structure raise some error
     endif. 
   endif.

   "now work with &amp;lt;sel&amp;gt; as the structure is correct
ENDMETHOD.

"client
data ref_sel type ref to data.
get reference of s_opt1[] into ref_sel.
CALL METHOD ...z_meth EXPORTING ref_sel.

get reference of s_opt2[] into ref_sel.
CALL METHOD ...z_meth EXPORTING ref_sel.

get reference of s_opt3[] into ref_sel.
CALL METHOD ...z_meth EXPORTING ref_sel.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 08:17:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952641#M1601975</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2011-05-30T08:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in passing select option as method parameter</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952642#M1601976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;All of them are select options at database level.It shouldnt be a problem.Please paste teh code where you are calling the method and passing the same.Also please show the method definition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 08:18:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952642#M1601976</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-30T08:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in passing select option as method parameter</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952643#M1601977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sap_Wiz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be you didn't notice Marcin's &lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;"&lt;STRONG&gt;wiz&lt;/STRONG&gt;"adry&lt;/SPAN&gt; &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 08:25:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952643#M1601977</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-05-30T08:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in passing select option as method parameter</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952644#M1601978</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;Thanks for your replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am calling my validation code in below way currently:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: gt_sel_field TYPE TABLE OF z_sel_field,

  gt_sel_field[] = s_vkorg[].

  CALL METHOD zcl_validation=&amp;gt;z_sel_scr_validation
    EXPORTING
*      im_param         = ''
      im_sel_field = gt_sel_field[]
*      im_sel_field = s_vkorg[].

z_sel_field is a structure with fields: sign(char1), option(char2), low(char45), high(char45).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My method (z_sel_scr_validation) in class created with below parameters:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IM_PARAM TYPE string. (optional)
IM_sel_field TYPE z_sel_field_tt, (optional)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;z_sel_field_tt refers to z_sel_field structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In method i will validate select option (or) parameter based on user input (Have all the logic to validate against check table etc..).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In above method call i am using gt_sel_field[] but i want to use s_vkorg[], s_abgru[] etc... but they are not type compatiable&lt;/P&gt;&lt;P&gt;with table type (or) structure of z_sel_field. If i use gt_sel_field[] i need to declare it every time validation happens for each field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i acheive this!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kumar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 09:17:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952644#M1601978</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-30T09:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in passing select option as method parameter</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952645#M1601979</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;Try with below code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;s_var1 for im_sel_scr_field,&lt;/P&gt;&lt;P&gt;s_var2 for im_sel_scr_field,&lt;/P&gt;&lt;P&gt;s_var3 for im_sel_scr_field,&lt;/P&gt;&lt;P&gt;s_var4 for im_sel_scr_field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because you are maintining all select opt fields are characters. so according to that based on 'im_sel_scr_field' attribute data type we can follow to assign type to select options.&lt;/P&gt;&lt;P&gt;Now you can pass select option values to the respective method as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 09:45:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-in-passing-select-option-as-method-parameter/m-p/7952645#M1601979</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-30T09:45:03Z</dc:date>
    </item>
  </channel>
</rss>

