<?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 Issue while returing values from Function Module/BAPI in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-returing-values-from-function-module-bapi/m-p/3645414#M877869</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings all, I'm trying to get the values after returing from BAPI. Before come out of the FM, I can see the data in gt_gr_out table, but not after coming out. I want to display the data from table gt_gr_out, but nothing to display after come out from BAPI/FM.&lt;/P&gt;&lt;P&gt;Could anyone please advice me how do get the output data.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;=====================================================
*********************************************
TYPES:  ty_header TYPE zapo_gr_header.
DATA:   ty_item  TYPE zapo_gr_item.
DATA:  ty_gr_out  TYPE zapo_gr_status.
*********************************************
DATA: gt_gr_out  LIKE ty_gr_out OCCURS 0 WITH HEADER LINE,
      t_header             TYPE STANDARD TABLE OF ty_header,
      t_item               LIKE STANDARD TABLE OF ty_item.
*********************************************
 PERFORM goodsmvt_post TABLES  t_header
                                t_item
                                gt_gr_out.
*********************************************
FORM goodsmvt_post  TABLES   P_T_HEADER  STRUCTURE zapo_gr_header
                             P_T_ITEM    STRUCTURE zapo_gr_item
                             P_gt_gr_out STRUCTURE zapo_gr_status.


  CALL FUNCTION 'Z_APO_BAPI_GR_POST'
    TABLES
      I_GR_HEADER = P_T_HEADER
      I_GR_ITEM   = P_T_ITEM
      RETURN      = p_gt_gr_out.

ENDFORM.  
*********************************************
FUNCTION Z_APO_BAPI_GR_POST.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  TABLES
*"      I_GR_HEADER STRUCTURE  ZAPO_GR_HEADER
*"      I_GR_ITEM STRUCTURE  ZAPO_GR_ITEM
*"      RETURN STRUCTURE  ZAPO_GR_STATUS
*"----------------------------------------------------------------------

      MOVE c_p TO gt_gr_out-feed_status.
      MOVE text-002 TO gt_gr_out-message1.
    ENDIF.
    CONCATENATE sy-datum
                sy-uzeit
              INTO gt_gr_out-proc_time.
    APPEND gt_gr_out.
=====================================================&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 Apr 2008 08:45:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-12T08:45:09Z</dc:date>
    <item>
      <title>Issue while returing values from Function Module/BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-returing-values-from-function-module-bapi/m-p/3645414#M877869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings all, I'm trying to get the values after returing from BAPI. Before come out of the FM, I can see the data in gt_gr_out table, but not after coming out. I want to display the data from table gt_gr_out, but nothing to display after come out from BAPI/FM.&lt;/P&gt;&lt;P&gt;Could anyone please advice me how do get the output data.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;=====================================================
*********************************************
TYPES:  ty_header TYPE zapo_gr_header.
DATA:   ty_item  TYPE zapo_gr_item.
DATA:  ty_gr_out  TYPE zapo_gr_status.
*********************************************
DATA: gt_gr_out  LIKE ty_gr_out OCCURS 0 WITH HEADER LINE,
      t_header             TYPE STANDARD TABLE OF ty_header,
      t_item               LIKE STANDARD TABLE OF ty_item.
*********************************************
 PERFORM goodsmvt_post TABLES  t_header
                                t_item
                                gt_gr_out.
*********************************************
FORM goodsmvt_post  TABLES   P_T_HEADER  STRUCTURE zapo_gr_header
                             P_T_ITEM    STRUCTURE zapo_gr_item
                             P_gt_gr_out STRUCTURE zapo_gr_status.


  CALL FUNCTION 'Z_APO_BAPI_GR_POST'
    TABLES
      I_GR_HEADER = P_T_HEADER
      I_GR_ITEM   = P_T_ITEM
      RETURN      = p_gt_gr_out.

ENDFORM.  
*********************************************
FUNCTION Z_APO_BAPI_GR_POST.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  TABLES
*"      I_GR_HEADER STRUCTURE  ZAPO_GR_HEADER
*"      I_GR_ITEM STRUCTURE  ZAPO_GR_ITEM
*"      RETURN STRUCTURE  ZAPO_GR_STATUS
*"----------------------------------------------------------------------

      MOVE c_p TO gt_gr_out-feed_status.
      MOVE text-002 TO gt_gr_out-message1.
    ENDIF.
    CONCATENATE sy-datum
                sy-uzeit
              INTO gt_gr_out-proc_time.
    APPEND gt_gr_out.
=====================================================&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Apr 2008 08:45:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-returing-values-from-function-module-bapi/m-p/3645414#M877869</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-12T08:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: Issue while returing values from Function Module/BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-returing-values-from-function-module-bapi/m-p/3645415#M877870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Most likely the problem is due to the usage of outdated ABAP statements (e.g. itab with header lines &amp;amp; TABLES parameters).&lt;/P&gt;&lt;P&gt;I would recommend to make the following improvements:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
=====================================================
*********************************************
TYPES:  ty_header TYPE zapo_gr_header,
             ty_t_header TYPE STANDARD TABLE OF ty_header
                               WITH DEFAULT KEY.
DATA:   ty_item  TYPE zapo_gr_item,
            ty_t_item  TYPE STANDARD TABLE OF ty_item
                            WITH DEFAULT KEY.
DATA:  ty_gr_out  TYPE zapo_gr_status,
           ty_t_gr_out  TYPE STANDARD TABLE OF ty_gr_out
                             WITH DEFAULT KEY.
*********************************************
"DATA: gt_gr_out  LIKE ty_gr_out OCCURS 0 WITH HEADER LINE,
"      t_header             TYPE STANDARD TABLE OF ty_header,
"      t_item               LIKE STANDARD TABLE OF ty_item.

DATA: gt_gr_out      TYPE ty_t_gr_out,
           t_header       TYPE ty_t_header,
           t_item           TYPE ty_t_item.


*********************************************
 "PERFORM goodsmvt_post TABLES  t_header
 "                               t_item
 "                               gt_gr_out.

PERFORM goodsmvt_post
                                 USING
                                       t_header
                                       t_item
                              CHANGING
                                      gt_gr_out.
*********************************************
"FORM goodsmvt_post  TABLES   P_T_HEADER  STRUCTURE zapo_gr_header
"                             P_T_ITEM    STRUCTURE zapo_gr_item
"                             P_gt_gr_out STRUCTURE zapo_gr_status.

FORM goodsmvt_post
                          USING VALUE(p_t_header)    TYPE ty_t_header
                                     VALUE(p_t_item)        TYPE ty_t_item
                      CHANGING
                                p_gt_gr_out                     TYPE ty_t_gr_out.
 
 
  CALL FUNCTION 'Z_APO_BAPI_GR_POST'
    TABLES
      I_GR_HEADER = P_T_HEADER
      I_GR_ITEM   = P_T_ITEM
      RETURN      = p_gt_gr_out.
 
ENDFORM.  
*********************************************
FUNCTION Z_APO_BAPI_GR_POST.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  TABLES
*"      I_GR_HEADER STRUCTURE  ZAPO_GR_HEADER
*"      I_GR_ITEM STRUCTURE  ZAPO_GR_ITEM
*"      RETURN STRUCTURE  ZAPO_GR_STATUS
*"----------------------------------------------------------------------
 
" NOTE TABLES parameters are obsolete and should be replaced
"           by corresponding IMPORTING and EXPORTING parameters.

      MOVE c_p TO gt_gr_out-feed_status.
      MOVE text-002 TO gt_gr_out-message1.
    ENDIF.
    CONCATENATE sy-datum
                sy-uzeit
              INTO gt_gr_out-proc_time.
    APPEND gt_gr_out.
=====================================================
&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>Sat, 12 Apr 2008 09:11:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-returing-values-from-function-module-bapi/m-p/3645415#M877870</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-04-12T09:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Issue while returing values from Function Module/BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-returing-values-from-function-module-bapi/m-p/3645416#M877871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uwe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the advice. my prob has been resolved. points rewarded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your advice is appreciated, thanks. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Apr 2008 11:15:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-returing-values-from-function-module-bapi/m-p/3645416#M877871</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-12T11:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Issue while returing values from Function Module/BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-returing-values-from-function-module-bapi/m-p/3645417#M877872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually there was another problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FUNCTION Z_APO_BAPI_GR_POST.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  TABLES
*"      I_GR_HEADER STRUCTURE  ZAPO_GR_HEADER
*"      I_GR_ITEM STRUCTURE  ZAPO_GR_ITEM
*"      RETURN STRUCTURE  ZAPO_GR_STATUS
*"----------------------------------------------------------------------
 
      MOVE c_p TO gt_gr_out-feed_status.
      MOVE text-002 TO gt_gr_out-message1.
    ENDIF.
    CONCATENATE sy-datum
                sy-uzeit
              INTO gt_gr_out-proc_time.
    APPEND gt_gr_out.  " Does not fill RETURN parameter !!!
   
    APPEND gt_gr_out TO return.  " or:
    RETURN[] = gt_gr_out[].
    
&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>Mon, 14 Apr 2008 03:50:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-returing-values-from-function-module-bapi/m-p/3645417#M877872</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-04-14T03:50:18Z</dc:date>
    </item>
  </channel>
</rss>

