<?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: Cant get a function to return a table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cant-get-a-function-to-return-a-table/m-p/2659386#M613446</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 to change the following and try &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of claseoperacion occurs 0,
       include structure ZCLASE1.
end of claseoperacion.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Aug 2007 00:12:02 GMT</pubDate>
    <dc:creator>former_member194669</dc:creator>
    <dc:date>2007-08-14T00:12:02Z</dc:date>
    <item>
      <title>Cant get a function to return a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cant-get-a-function-to-return-a-table/m-p/2659384#M613444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, im using the new version of sap, in which using the tab TABLES is absolete&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I made a Table Type, and I'm using it on the EXPORT TAB of my function&lt;/P&gt;&lt;P&gt;The code on my Function its very simple, and it works, here it is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION ZGETCLASE.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Interfase local&lt;/P&gt;&lt;P&gt;*"  EXPORTING&lt;/P&gt;&lt;P&gt;*"     REFERENCE(CLASE) TYPE  ZCLASE1&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*DATA : clase type standard table of zclase1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select /BIC/ZRICCLAS /BIC/CLASTXT into table CLASE from /BIC/PZRICCLAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&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'm trying to make it work with a program.&lt;/P&gt;&lt;P&gt;Heres the code i use on my program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------" /&gt;&lt;P&gt;REPORT  ZPRUEBAINDCAPITAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of claseoperacion occurs 0,&lt;/P&gt;&lt;P&gt;    ricclas like zclase-ricclas,&lt;/P&gt;&lt;P&gt;    clastxt like zclase-clastxt,&lt;/P&gt;&lt;P&gt;    end of claseoperacion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ZGETCLASE'&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   CLASE         = claseoperacion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   loop at claseoperacion.&lt;/P&gt;&lt;P&gt;   write: claseoperacion-RICCLAS , 30  claseoperacion-CLASTXT.&lt;/P&gt;&lt;P&gt;   skip 1.&lt;/P&gt;&lt;P&gt;   endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is when i run my programs, it won't work because of this error:&lt;/P&gt;&lt;P&gt;CALL_FUNCTION_CONFLICT_TYPE&lt;/P&gt;&lt;P&gt;Excep. CX_SY_DYN_CALL_ILLEGAL_TYPE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any ideas??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 23:49:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cant-get-a-function-to-return-a-table/m-p/2659384#M613444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-13T23:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cant get a function to return a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cant-get-a-function-to-return-a-table/m-p/2659385#M613445</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;Change this in your code&lt;/P&gt;&lt;P&gt;DATA claseoperacion TYPE TABLE OF ZCLASE1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2007 00:01:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cant-get-a-function-to-return-a-table/m-p/2659385#M613445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-14T00:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cant get a function to return a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cant-get-a-function-to-return-a-table/m-p/2659386#M613446</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 to change the following and try &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of claseoperacion occurs 0,
       include structure ZCLASE1.
end of claseoperacion.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2007 00:12:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cant-get-a-function-to-return-a-table/m-p/2659386#M613446</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-08-14T00:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cant get a function to return a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cant-get-a-function-to-return-a-table/m-p/2659387#M613447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An Extended Syntax change will normally highlight where the problem exists... what confuses me is that you say you have defined "ZCLASE1" as a table type, so why is "clase" a standard table of a table type... i.e. should you have something like (not syntax checked):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FUNCTION ZGETCLASE.
*"----------------------------------------------------------------------
*"*"Interfase local
*" EXPORTING
*" REFERENCE(CLASE) TYPE ZCLASE1
*"----------------------------------------------------------------------

DATA : 
  lt_clase            type zclase1.

  select /BIC/ZRICCLAS /BIC/CLASTXT into table lt_clase 
    from /BIC/PZRICCLAS.

  clase[] = lt_clase[].

ENDFUNCTION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and call it with:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT ZPRUEBAINDCAPITAL.

data:
  gt_clase            type zclase1,
  gs_clase           like line of gt_clase.

start-of-selection.

CALL FUNCTION 'ZGETCLASE'
  IMPORTING
    CLASE = gt_clase.

loop at gt_clase into gs_clase. "into a structure like line of gt_clase.
write: gs_clase-RICCLAS, 30 gs_clase-CLASTXT.
skip 1.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(sorry, I don't have a system in front of me otherwise I'd do a better example).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2007 01:57:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cant-get-a-function-to-return-a-table/m-p/2659387#M613447</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-14T01:57:06Z</dc:date>
    </item>
  </channel>
</rss>

