<?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: Returning table in classes in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861354#M928059</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanx guys&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 May 2008 17:49:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-29T17:49:26Z</dc:date>
    <item>
      <title>Returning table in classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861350#M928055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Guys&lt;/P&gt;&lt;P&gt;I have created a class with two methods.&lt;/P&gt;&lt;P&gt;In of these methods I am trying to return a table of type VBFAVB, this is a type in se38. &lt;/P&gt;&lt;P&gt;Here is my method code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;METHOD get_docflow_vbelv.

  DATA: t_vbfa TYPE TABLE OF vbfavb,
        l_vbfa LIKE LINE  OF t_vbfa .

  CALL FUNCTION 'WB2_VBFA_READ_WITH_VBELV'
    EXPORTING
      i_vbelv          = vbelv
    TABLES
      et_vbfa          = t_vbfa
    EXCEPTIONS
      record_not_found = 1
      OTHERS           = 2.

  IF sy-subrc = 0.
      ret_tab[] = t_vbfa[].
  ENDIF.

  CLEAR: l_vbfa,t_vbfa[].
ENDMETHOD.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I have defined in parametrs the ret_tab like this&lt;/P&gt;&lt;P&gt;RET_TAB Exporting Type VBFAVB &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I compile it says 'RET_TAB' is not an internal table the specification OCCURS N is missing. &lt;/P&gt;&lt;P&gt;Please give me an Idea on how to "pass" an internal table in classes. &lt;/P&gt;&lt;P&gt;A sample code would be great !&lt;/P&gt;&lt;P&gt;Thanks for reading.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;Sameer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2008 20:30:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861350#M928055</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-13T20:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Returning table in classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861351#M928056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So how have you defined REF_TAB? Should be the same type as your itab!!&lt;/P&gt;&lt;P&gt;And it looks to me that you haven't?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Micky Oestreich on May 13, 2008 10:32 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RET_TAB Exporting Type VBFAVB, this is not an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you can do is find out if this type also has a table type defined in data dictionary via where used list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not available create this table type with line type Type VBFAVB .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Micky Oestreich on May 13, 2008 10:33 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative:&lt;/P&gt;&lt;P&gt;create the type in the class itself. Look at the TYPES button at the top of the screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ref_tab type table of VBFAVB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Micky Oestreich on May 13, 2008 10:41 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2008 20:32:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861351#M928056</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2008-05-13T20:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Returning table in classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861352#M928057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;at the interface you can define,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RET_TAB Exporting Type STANDARD TABLE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2008 20:42:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861352#M928057</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-13T20:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Returning table in classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861353#M928058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sameer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On ECC 6.0 you have plenty of &lt;STRONG&gt;table types&lt;/STRONG&gt; available having line type VBFAVB:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LEINT_VBFAVB_T                   Reference structures VBFAVB
LESHP_DELIVERY_DOCUMENT_FLOW_T   Delivery's Document Flow
SA_XVBFA                         Document Flow: Sales
SHP_VL10_VBFA_T                  SD Document Flow
VA_VBFAVB_T                      Table for structure VBFAVB
VBFA_SRT_T                       BAdI Interface Type for Structure VBFAVB&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would recommend to use &lt;STRONG&gt;SA_XVBFA&lt;/STRONG&gt; because it is part of the rather "generic" package VA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your class method should look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS lcl_myclass DEFINITION.

  PUBLIC SECTION.

    METHODS:
      get_docflow_vbelv
        IMPORTING
          VALUE(id_vbelv)    TYPE vbeln
        RETURNING 
          VALUE(rt_data)     TYPE sa_xvbfa.

ENDCLASS.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS lcl_myclass IMPLEMENTATION.

  METHOD get_docflow_vbelv.
  CALL FUNCTION 'WB2_VBFA_READ_WITH_VBELV'
    EXPORTING
      i_vbelv          = id_vbelv
    TABLES
      et_vbfa          = rt_data
    EXCEPTIONS
      record_not_found = 1
      OTHERS           = 2.
 
    IF sy-subrc = 0.
    ENDIF.
  ENDMETHOD.

ENDCLASS.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT zmyreport.


DATA:  gt_vbfa   TYPE  sa_xvbfa.

PARAMETERS:
  p_vbeln            TYPE vbeln.

START-OF-SELECTION.

  CREATE go_myclass.

  gt_vbfa = go_myclass-&amp;gt;get_docflow_vbelv( p_vbeln ).  " function call OR:
  CALL METHOD go_myclass-&amp;gt;get_docflow
    EXPORTING
      id_vbelv = p_vbeln
    RECEIVING
      rt_data = gt_vbfa.
END-OF-SELECTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2008 22:21:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861353#M928058</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-05-13T22:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Returning table in classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861354#M928059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanx guys&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2008 17:49:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861354#M928059</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-29T17:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Returning table in classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861355#M928060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a similar problem regarding to exporting internal table in a method when I create a global class in SE24. The difference is that I have defined the internal table as Standard table of a structure. For example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: t_vbfa TYPE Standard TABLE OF vbfavb,
"assume vbfavb is a structure.                                                                                
"t_vbfa is defined in the class attribute section
METHOD get_docflow_vbelv.
    CALL FUNCTION 'WB2_VBFA_READ_WITH_VBELV'
     EXPORTING
          i_vbelv          = vbelv
     TABLES
        et_vbfa          = t_vbfa.
  
  IF sy-subrc = 0.
      ret_tab[] = t_vbfa[].
  ENDIF.
 
ENDMETHOD.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have defined a table using the fields of vbfavb structure as ZVBFAVB, for example. I then declared an variable as follow:&lt;/P&gt;&lt;P&gt;RET_TAB Exporting Type ZVBFAVB &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I compiled my program, it says 'RET_TAB' is not an internal table the specification OCCURS N is missing.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I avoid the above problem. Where and how should I define this exporting variable RET_TAB so that I can pass this internal table out of the method. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your help is greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 01:50:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861355#M928060</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T01:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Returning table in classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861356#M928061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a similar problem regarding to exporting internal table in a method when I create a global class in SE24. The difference is that I have defined the internal table as Standard table of a structure. For example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: t_vbfa TYPE Standard TABLE OF VBFAVB,
               "assume VBFAVB is a structure here. 
               "t_vbfa is defined in the class attribute section
METHOD get_docflow_vbelv.
    CALL FUNCTION 'WB2_VBFA_READ_WITH_VBELV'
     EXPORTING
          i_vbelv          = vbelv
     TABLES
        et_vbfa          = t_vbfa.
  
  IF sy-subrc = 0.
      ret_tab[] = t_vbfa[].
  ENDIF.
 
ENDMETHOD.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have defined a table using the fields of VBFAVB structure as ZVBFAVB, for example. I then declared the internal table as follow:&lt;/P&gt;&lt;P&gt;RET_TAB Exporting Type ZVBFAVB &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I compiled my program, it says 'RET_TAB' is not an internal table the specification OCCURS N is missing.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How should I define RET_TAB so that I can pass this internal table out of the method. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your help is greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 01:59:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861356#M928061</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T01:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Returning table in classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861357#M928062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anna&lt;/P&gt;&lt;P&gt;This what you need to do&lt;/P&gt;&lt;P&gt;Either look for a table type with line type VBFAVB, or create one. Table types work with classes when you are exporting tables. &lt;/P&gt;&lt;P&gt;I found two which are already existing and could solve your purpose.&lt;/P&gt;&lt;P&gt;VA_VBFAVB_T and&lt;/P&gt;&lt;P&gt;LEINT_VBFAVB_T.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you understand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 13:55:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861357#M928062</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T13:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Returning table in classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861358#M928063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help. I understand now. Anna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Jul 2008 15:28:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/3861358#M928063</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-26T15:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: Returning table in classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/13723589#M2028375</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I have a similar issue working with a method that called a function....I have already put the returning table as you said, but it didn't work &lt;span class="lia-unicode-emoji" title=":sleepy_face:"&gt;😪&lt;/span&gt;, could you help me? Please&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt; method ZGET_DETALLE.
*    TYPES it_detalle TYPE ty_det.
     DATA: t_det TYPE STANDARD TABLE OF zccdetalle,
        l_detalle LIKE LINE  OF t_det .

    CALL FUNCTION 'ZF_DATOS_CLIENTE_LVAA'
      EXPORTING
        pncliente =  PNCLIENTE                " ELEMENTO DE LOS DATOS DEL CLIENTE
      IMPORTING
        pmensaje  = PMENSAJE                 " ELEMENTO DE DATO PARA MENSAJE*S
      TABLES
        ptcte     =  t_det             " ESTRUCTURA DETALLE CLIENTE
      .
    "PTDET[] = it_detalle[].
     IF sy-subrc = 0.
      ptdet[] = t_det[].
     ENDIF.

  CLEAR: l_detalle,t_det[].

  endmethod.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;In the interface&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lizvalpi_mx_0-1717707846732.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/120421i9337B179FFB3DCFA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lizvalpi_mx_0-1717707846732.png" alt="lizvalpi_mx_0-1717707846732.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I run the method appears this window&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lizvalpi_mx_1-1717707992368.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/120422i0BB5C063BE4402D5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lizvalpi_mx_1-1717707992368.png" alt="lizvalpi_mx_1-1717707992368.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 21:21:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/returning-table-in-classes/m-p/13723589#M2028375</guid>
      <dc:creator>lizvalpi_mx</dc:creator>
      <dc:date>2024-06-06T21:21:56Z</dc:date>
    </item>
  </channel>
</rss>

