<?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: Type compatible error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-compatible-error/m-p/6639881#M1443326</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;*----------------------------------------------------------------------*
*       CLASS cl_details DEFINITION
*----------------------------------------------------------------------*
CLASS cl_details DEFINITION.
  PUBLIC SECTION.
    CLASS-DATA :
      BEGIN OF wa_details, " types
        bname TYPE xubname, " user ID
        name_textc TYPE user_addr-name_textc, " user name
        agr_name TYPE agr_users-agr_name, " Role's
      END OF wa_details.

    TYPES : tr_bname TYPE RANGE OF bname ,
            t_bname  TYPE LINE OF tr_bname.

*   internal table declarations
    DATA : itab_details LIKE TABLE OF wa_details,
           itab_roles LIKE TABLE OF wa_details,
           itab_actygrps TYPE TABLE OF bapiagr,
           itab_return TYPE TABLE OF bapiret2.

*   work area declartions
    DATA : wa_detls LIKE wa_details,
           wa_roles LIKE wa_details,
           wa_actygrps LIKE wa_details,
           wa_return LIKE wa_details,
           bname TYPE xubname.

    METHODS get_details IMPORTING wa_usrnm TYPE tr_bname." string.

ENDCLASS. "details DEFINITION

*----------------------------------------------------------------------*
*       CLASS cl_details IMPLEMENTATION
*----------------------------------------------------------------------*
CLASS cl_details IMPLEMENTATION.
  METHOD get_details.

    SELECT bname name_textc FROM user_addr INTO TABLE itab_details
    WHERE bname IN wa_usrnm .
  ENDMETHOD.                    "get_details
ENDCLASS.                    "cl_details IMPLEMENTATION

SELECTION-SCREEN BEGIN OF BLOCK b1.
SELECT-OPTIONS : usr_nm FOR cl_details=&amp;gt;wa_details-bname MATCHCODE OBJECT user_comp.
SELECTION-SCREEN END OF BLOCK b1.

DATA : obj_ref TYPE REF TO cl_details ,
       usrtmp  TYPE cl_details=&amp;gt;tr_bname ,
       usrwa   TYPE cl_details=&amp;gt;t_bname  .

START-OF-SELECTION .

  CREATE OBJECT obj_ref.

  LOOP AT usr_nm INTO usrwa .
    APPEND usrwa TO usrtmp .
  ENDLOOP.

  obj_ref-&amp;gt;get_details( EXPORTING wa_usrnm = usrtmp ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Feb 2010 14:07:23 GMT</pubDate>
    <dc:creator>Pawan_Kesari</dc:creator>
    <dc:date>2010-02-22T14:07:23Z</dc:date>
    <item>
      <title>Type compatible error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-compatible-error/m-p/6639879#M1443324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i am trying to assign an exprorting parameter via an instance method i am getting the error "USR_NM IS NOT TYPE COMPATIBLE WITH FORMAL PARAMETER WA_USRNM".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*selection screen&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN BEGIN OF BLOCK b1.&lt;/P&gt;&lt;P&gt;  SELECT-OPTIONS : usr_nm FOR cl_details=&amp;gt;wa_details-bname MATCHCODE OBJECT user_comp.&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN END OF BLOCK b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : obj_ref TYPE REF TO cl_details.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; FIELD-SYMBOLS : &amp;lt;fs&amp;gt; TYPE LINE OF wa_details.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT obj_ref.&lt;/P&gt;&lt;P&gt;  obj_ref-&amp;gt;get_details( usr_nm ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS cl_details DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    CLASS-DATA : BEGIN OF wa_details, " types&lt;/P&gt;&lt;P&gt;                    bname        TYPE xubname,                 " user ID&lt;/P&gt;&lt;P&gt;                    name_textc   TYPE user_addr-name_textc,    " user name&lt;/P&gt;&lt;P&gt;                    agr_name     TYPE agr_users-agr_name,      " Role's&lt;/P&gt;&lt;P&gt;                 END OF wa_details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*internal table declarations&lt;/P&gt;&lt;P&gt;    DATA : itab_details  LIKE TABLE OF wa_details,&lt;/P&gt;&lt;P&gt;         : itab_roles    LIKE TABLE OF wa_details,&lt;/P&gt;&lt;P&gt;         : itab_actygrps TYPE TABLE OF bapiagr,&lt;/P&gt;&lt;P&gt;         : itab_return   TYPE TABLE OF bapiret2.&lt;/P&gt;&lt;P&gt;*work area declartions&lt;/P&gt;&lt;P&gt;    DATA : wa_detls     LIKE wa_details,&lt;/P&gt;&lt;P&gt;         : wa_roles     LIKE wa_details,&lt;/P&gt;&lt;P&gt;         : wa_actygrps  LIKE wa_details,&lt;/P&gt;&lt;P&gt;         : wa_return    LIKE wa_details,&lt;/P&gt;&lt;P&gt;         : bname TYPE xubname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS get_details IMPORTING wa_usrnm LIKE bname." string.&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "details DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS cl_details IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD get_details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT bname name_textc FROM user_addr INTO TABLE itab_details&lt;/P&gt;&lt;P&gt;                                           WHERE bname IN ('LB'). "(usr_nm).&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i am using the USR_NM in the select statement it is giving an error. So, please advice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2010 08:30:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-compatible-error/m-p/6639879#M1443324</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-22T08:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Type compatible error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-compatible-error/m-p/6639880#M1443325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;SELECT bname name_textc FROM user_addr INTO TABLE itab_details&lt;/P&gt;&lt;P&gt;WHERE bname IN ('LB'). "(usr_nm).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your select statement you are using &lt;STRONG&gt;IN&lt;/STRONG&gt;  (WHERE bname IN ('LB'). "(usr_nm).).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using IN then usr_nm should be a range or select option. Instead you change your statment as :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT bname name_textc FROM user_addr INTO TABLE itab_details&lt;/P&gt;&lt;P&gt;WHERE bname  = usr_nm.&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;Regards,&lt;/P&gt;&lt;P&gt;Ramesh Kashigari.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ramesh Kashigari on Feb 22, 2010 2:50 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2010 13:49:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-compatible-error/m-p/6639880#M1443325</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-22T13:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Type compatible error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-compatible-error/m-p/6639881#M1443326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;*----------------------------------------------------------------------*
*       CLASS cl_details DEFINITION
*----------------------------------------------------------------------*
CLASS cl_details DEFINITION.
  PUBLIC SECTION.
    CLASS-DATA :
      BEGIN OF wa_details, " types
        bname TYPE xubname, " user ID
        name_textc TYPE user_addr-name_textc, " user name
        agr_name TYPE agr_users-agr_name, " Role's
      END OF wa_details.

    TYPES : tr_bname TYPE RANGE OF bname ,
            t_bname  TYPE LINE OF tr_bname.

*   internal table declarations
    DATA : itab_details LIKE TABLE OF wa_details,
           itab_roles LIKE TABLE OF wa_details,
           itab_actygrps TYPE TABLE OF bapiagr,
           itab_return TYPE TABLE OF bapiret2.

*   work area declartions
    DATA : wa_detls LIKE wa_details,
           wa_roles LIKE wa_details,
           wa_actygrps LIKE wa_details,
           wa_return LIKE wa_details,
           bname TYPE xubname.

    METHODS get_details IMPORTING wa_usrnm TYPE tr_bname." string.

ENDCLASS. "details DEFINITION

*----------------------------------------------------------------------*
*       CLASS cl_details IMPLEMENTATION
*----------------------------------------------------------------------*
CLASS cl_details IMPLEMENTATION.
  METHOD get_details.

    SELECT bname name_textc FROM user_addr INTO TABLE itab_details
    WHERE bname IN wa_usrnm .
  ENDMETHOD.                    "get_details
ENDCLASS.                    "cl_details IMPLEMENTATION

SELECTION-SCREEN BEGIN OF BLOCK b1.
SELECT-OPTIONS : usr_nm FOR cl_details=&amp;gt;wa_details-bname MATCHCODE OBJECT user_comp.
SELECTION-SCREEN END OF BLOCK b1.

DATA : obj_ref TYPE REF TO cl_details ,
       usrtmp  TYPE cl_details=&amp;gt;tr_bname ,
       usrwa   TYPE cl_details=&amp;gt;t_bname  .

START-OF-SELECTION .

  CREATE OBJECT obj_ref.

  LOOP AT usr_nm INTO usrwa .
    APPEND usrwa TO usrtmp .
  ENDLOOP.

  obj_ref-&amp;gt;get_details( EXPORTING wa_usrnm = usrtmp ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2010 14:07:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-compatible-error/m-p/6639881#M1443326</guid>
      <dc:creator>Pawan_Kesari</dc:creator>
      <dc:date>2010-02-22T14:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Type compatible error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-compatible-error/m-p/6639882#M1443327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lokesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first error that you are getting is because of the wrong data type declaration. If you look at your data declaration section, you will see that the &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; usr_nm FOR cl_details=&amp;gt;wa_details-bname MATCHCODE OBJECT user_comp.usr_nm FOR cl_details=&amp;gt;wa_details-bname MATCHCODE OBJECT user_comp.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in the method interface data declaration, the data type is different. So, have a look at the data declarations and check for the correct data type. This will resolve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the second error, have a look again at the data declaration. As the Select statement expects an IN Statement for a Ranges or Select Options. The Data declaration seemed to be alright, but the data types may be different.&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;Samantak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Feb 2010 05:30:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-compatible-error/m-p/6639882#M1443327</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-23T05:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Type compatible error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type-compatible-error/m-p/6639883#M1443328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lokesh,&lt;/P&gt;&lt;P&gt;Can you please update whether your problem is solved. If solved please mark the question as answered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ramesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Feb 2010 09:56:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type-compatible-error/m-p/6639883#M1443328</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-23T09:56:54Z</dc:date>
    </item>
  </channel>
</rss>

