<?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: Problem about casting in internal tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767746#M906567</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MATNR has type CHAR 18, CUOBJ has type NUMC 18 - how should this work? i.e. How should a letter (let´s say 'Z') be converted to e numeric?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Apr 2008 12:36:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-23T12:36:49Z</dc:date>
    <item>
      <title>Problem about casting in internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767744#M906565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES:
  BEGIN OF ts_matnr,
    matnr TYPE matnr,
    objct TYPE cuobj,
  END   OF ts_matnr.
  tables: mara.
DATA:
  myStatus(20) type c,
  mySTANDARDCLASS(20) type c,
  gt_matnr TYPE STANDARD TABLE OF ts_matnr WITH DEFAULT KEY,
  gs_matnr LIKE LINE OF gt_matnr,
  gs_mara  TYPE mara. 

SELECT-OPTIONS:
  pr_matnr FOR gs_mara-matnr.

START-OF-SELECTION.
SELECT matnr
       matnr AS objct 
       FROM mara
       INTO CORRESPONDING FIELDS OF TABLE gt_matnr WHERE matnr IN pr_matnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I want to write both the normal String and the value as object  into the table. But there is a error at the select saying the fields can't be converted to target field.&lt;/P&gt;&lt;P&gt;I don't know what the problem is. Can you see it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Daniel Gerne on Apr 23, 2008 2:31 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 12:30:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767744#M906565</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T12:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem about casting in internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767745#M906566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can write the Select query as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT matnr
       matnr
       FROM mara
       INTO CORRESPONDING FIELDS OF TABLE gt_matnr WHERE matnr IN pr_matnr.

  LOOP AT gt_matnr INTO gs_matnr.
    gs_matnr-objct = gs_matnr-matnr.
    write:
      / gs_matnr-matnr,
        gs_matnr-objct.
    MODIFY gt_matnr FROM gs_matnr.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards ,&lt;/P&gt;&lt;P&gt;Sunil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 12:35:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767745#M906566</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T12:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem about casting in internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767746#M906567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MATNR has type CHAR 18, CUOBJ has type NUMC 18 - how should this work? i.e. How should a letter (let´s say 'Z') be converted to e numeric?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 12:36:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767746#M906567</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T12:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problem about casting in internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767747#M906568</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;You are calling Matnr twice and your internal table is having only one matnr.&lt;/P&gt;&lt;P&gt;Error is becoz of that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Apr 23, 2008 9:57 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 12:37:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767747#M906568</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T12:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem about casting in internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767748#M906569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Daniel-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of &lt;STRONG&gt;gt_matnr TYPE STANDARD TABLE OF ts_matnr WITH DEFAULT KEY&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try &lt;STRONG&gt;gt_matnr type table of ts_matnr.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;~Srini....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 12:38:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767748#M906569</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T12:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem about casting in internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767749#M906570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Y dont you try using your select statement as follws:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT matnr&lt;/P&gt;&lt;P&gt;       objct &lt;/P&gt;&lt;P&gt;       FROM mara&lt;/P&gt;&lt;P&gt;       INTO CORRESPONDING FIELDS OF TABLE gt_matnr WHERE matnr IN pr_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason for this error is the data type mismatch b/w the source and target.&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;Sourabh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 12:38:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767749#M906570</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T12:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problem about casting in internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767750#M906571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you tell us detailed requirment, maybe we can give you more suggestion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 12:51:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767750#M906571</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T12:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem about casting in internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767751#M906572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;1.The main problem is type conflict in the source to target.&lt;/P&gt;&lt;P&gt;This cuobj is NUM 18,matnr is CHAR 18.&lt;/P&gt;&lt;P&gt; 2.If you do with same type .Then.&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;P&gt;TYPES:&lt;/P&gt;&lt;P&gt;  BEGIN OF ts_matnr,&lt;/P&gt;&lt;P&gt;    matnr TYPE matnr,&lt;/P&gt;&lt;P&gt;    objct TYPE bismt,&lt;/P&gt;&lt;P&gt;  END   OF ts_matnr.&lt;/P&gt;&lt;P&gt;  tables: mara.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  myStatus(20) type c,&lt;/P&gt;&lt;P&gt;  mySTANDARDCLASS(20) type c,&lt;/P&gt;&lt;P&gt;  gt_matnr TYPE STANDARD TABLE OF ts_matnr WITH DEFAULT KEY,&lt;/P&gt;&lt;P&gt;  gs_matnr LIKE LINE OF gt_matnr,&lt;/P&gt;&lt;P&gt;  gs_mara  TYPE mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS:&lt;/P&gt;&lt;P&gt;  pr_matnr FOR gs_mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;SELECT matnr&lt;/P&gt;&lt;P&gt; matnr AS objct&lt;/P&gt;&lt;P&gt;       FROM mara&lt;/P&gt;&lt;P&gt;       INTO CORRESPONDING FIELDS OF TABLE gt_matnr WHERE matnr IN pr_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       loop at gt_matnr into gs_matnr.&lt;/P&gt;&lt;P&gt;       write:/ gs_matnr.&lt;/P&gt;&lt;P&gt;       endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shiva.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 12:54:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767751#M906572</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T12:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem about casting in internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767752#M906573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi shiva,&lt;/P&gt;&lt;P&gt;your code seems to be working. What is this type bismt anyway?&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 13:02:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767752#M906573</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T13:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem about casting in internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767753#M906574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;unfortunately, I just saw that I just walked around my problem instead of solving it. The reason I want to have this MATNR is that I need to use it as Objectkey for a BAPI call:&lt;/P&gt;&lt;P&gt;LOOP AT gt_matnr INTO gs_matnr.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'BAPI_OBJCL_GETDETAIL_KEY'
  EXPORTING
*    CLOBJECTKEY           = gt_matnr-objct "nicht Tabelle, sondern Arbeitsbereich
    CLOBJECTKEY           = gs_matnr-objct "hat Typ OBJCT &amp;lt;=&amp;gt; BAPI1003_KEY-OBJECT_GUID
    CLASSNUM              = 'FARBIGE_UNTERLAGEN'
*   KEYDATE               = SY-DATUM
*   LANGUAGE              = SY-LANGU
 IMPORTING
   STATUS                = myStatus
   STANDARDCLASS         = mySTANDARDCLASS.
*  TABLES
*    ALLOCVALUESNUM        =
*    ALLOCVALUESCHAR       =
*    ALLOCVALUESCURR       =
*    RETURN                =.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But with the type from Shiva's code the debugger says that the given parameter has a wrong type.I just can't get this BAPI to work. I want to use it to get the classification information about a material.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 13:15:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767753#M906574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T13:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem about casting in internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767754#M906575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don´t you do it that way?:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA:
  gt_matnr TYPE STANDARD TABLE OF matnr,
  gw_matnr TYPE matnr,
  gv_objkey TYPE cuobj.

SELECT matnr
  FROM mara
  INTO OF TABLE gt_matnr WHERE matnr IN pr_matnr.

LOOP AT gt_matnr INTO gw_matnr.
* type conversion
  MOVE gw_matnr TO gv_objkey.

* call bapi
  CALL FUNCTION 'BAPI_OBJCL_GETDETAIL_KEY'
    EXPORTING
      CLOBJECTKEY           = gv_objkey
      CLASSNUM              = 'FARBIGE_UNTERLAGEN'
*      KEYDATE               = SY-DATUM
*      LANGUAGE              = SY-LANGU
   IMPORTING
     STATUS                = myStatus
     STANDARDCLASS         = mySTANDARDCLASS.
*     TABLES
*       ALLOCVALUESNUM        =
*       ALLOCVALUESCHAR       =
*       ALLOCVALUESCURR       =
*       RETURN                =.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 13:32:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767754#M906575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T13:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem about casting in internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767755#M906576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mike,&lt;/P&gt;&lt;P&gt;thank you for the code. But there are a few syntax errors in it.&lt;/P&gt;&lt;P&gt;About:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INTO OF TABLE gt_matnr WHERE matnr IN pr_matnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It doesn't know pr_matnr. It says it wants to have a table it can walk through, so I thought maybe you meant gt_matnr. But there the debugger says: Table pr_matnr has the wrong Linestructure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 13:42:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767755#M906576</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T13:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem about casting in internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767756#M906577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, than just add the missing statement:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT-OPTIONS:
  pr_matnr FOR gs_mara-matnr.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I posted this coding just to show you how ist should work. My intention was not to do your job!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 13:53:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-about-casting-in-internal-tables/m-p/3767756#M906577</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T13:53:00Z</dc:date>
    </item>
  </channel>
</rss>

