<?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 in FM in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-fm/m-p/935284#M61830</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you guys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the problem is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i declare an internal table like structure abaplist in the source code of the FM, right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want to transform the output to the internal table of different line type which i declared it in the TABLES option of FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how should i do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason behind this is i want to use the output in EP.&lt;/P&gt;&lt;P&gt;So the output should be in FM itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Deepak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jul 2005 12:33:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-07-19T12:33:21Z</dc:date>
    <item>
      <title>problem in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-fm/m-p/935281#M61827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have created a Function Module, and from the function module i am calling a report program thru "SUBMIT" command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now in the 'submit' command i add the addition 'exporting list to memory and return'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after that i read the contents of the list using FM&lt;/P&gt;&lt;P&gt;'list_from_memory'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i enter the name of the internal table which i declared in FM. But this is giving me run time error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for detaild view i post the code down below:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;submit zrpt_mm_045 with s_werks-low = s_werks&lt;/P&gt;&lt;P&gt;                   with s_mtart-low = s_mtart_low&lt;/P&gt;&lt;P&gt;                   with s_mtart-high = s_mtart_high&lt;/P&gt;&lt;P&gt;                   with s_matnr-low = s_matnr_low&lt;/P&gt;&lt;P&gt;                   with s_matnr-high = s_matnr_high&lt;/P&gt;&lt;P&gt;                   with s_budat-low = s_budat_low&lt;/P&gt;&lt;P&gt;                   with s_budat-high = s_budat_high&lt;/P&gt;&lt;P&gt;                   with s_lgort-low = s_lgort&lt;/P&gt;&lt;P&gt;                   with rb1 = rb1&lt;/P&gt;&lt;P&gt;                   with rb2 = rb2&lt;/P&gt;&lt;P&gt;                   with rb3 = rb3&lt;/P&gt;&lt;P&gt;                   EXPORTING LIST TO MEMORY AND RETURN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     CALL FUNCTION 'LIST_FROM_MEMORY'&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;         listobject       = itmatgrp1  ---&amp;gt; from FM&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       NOT_FOUND        = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       OTHERS           = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;               .&lt;/P&gt;&lt;P&gt;     IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     ENDIF.&lt;/P&gt;&lt;P&gt;endfunction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 11:42:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-fm/m-p/935281#M61827</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-19T11:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: problem in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-fm/m-p/935282#M61828</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;write the code this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;submit zrpt_mm_045 EXPORTING LIST TO MEMORY&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;with s_werks-low = s_werks&lt;/P&gt;&lt;P&gt;with s_mtart-low = s_mtart_low&lt;/P&gt;&lt;P&gt;with s_mtart-high = s_mtart_high&lt;/P&gt;&lt;P&gt;with s_matnr-low = s_matnr_low&lt;/P&gt;&lt;P&gt;with s_matnr-high = s_matnr_high&lt;/P&gt;&lt;P&gt;with s_budat-low = s_budat_low&lt;/P&gt;&lt;P&gt;with s_budat-high = s_budat_high&lt;/P&gt;&lt;P&gt;with s_lgort-low = s_lgort&lt;/P&gt;&lt;P&gt;with rb1 = rb1&lt;/P&gt;&lt;P&gt;with rb2 = rb2&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;with rb3 = rb3&lt;/P&gt;&lt;P&gt; AND RETURN.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          submit prog name&lt;/P&gt;&lt;P&gt;             exporting list to memory&lt;/P&gt;&lt;P&gt;             with SO_BNAME-LOW = w_upload-bname&lt;/P&gt;&lt;P&gt;             and return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            refresh: i_listobject, i_listkey.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TO READ THE ABOVE LIST FROM MEMORY&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            CALL FUNCTION 'LIST_FROM_MEMORY'&lt;/P&gt;&lt;P&gt;                 TABLES&lt;/P&gt;&lt;P&gt;                      listobject = i_LISTOBJECT&lt;/P&gt;&lt;P&gt;                 EXCEPTIONS&lt;/P&gt;&lt;P&gt;                      NOT_FOUND  = 1&lt;/P&gt;&lt;P&gt;                      OTHERS     = 2.&lt;/P&gt;&lt;P&gt;            IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;              EXIT.&lt;/P&gt;&lt;P&gt;            ENDIF.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where:&lt;/P&gt;&lt;P&gt;*Internal table to hold list output&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF i_LISTOBJECT OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE ABAPLIST.&lt;/P&gt;&lt;P&gt;DATA: END OF i_LISTOBJECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anjali&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Anjali Devi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 11:47:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-fm/m-p/935282#M61828</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-19T11:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: problem in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-fm/m-p/935283#M61829</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've to define &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;listobject = itmatgrp1 ---&amp;gt; from FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like structure ABAPLIST (look in fm LIST_FROM_MEMORY)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 11:47:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-fm/m-p/935283#M61829</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2005-07-19T11:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: problem in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-fm/m-p/935284#M61830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you guys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the problem is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i declare an internal table like structure abaplist in the source code of the FM, right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want to transform the output to the internal table of different line type which i declared it in the TABLES option of FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how should i do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason behind this is i want to use the output in EP.&lt;/P&gt;&lt;P&gt;So the output should be in FM itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Deepak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 12:33:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-fm/m-p/935284#M61830</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-19T12:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: problem in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-fm/m-p/935285#M61831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Deepak,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think you can directly get the information into an internal table of your choice. The functon Module LIST_FROM_MEMORY expects you to give an internal table of a particular structure. You can later on transfer the contents of the internal table to another internal table with a structure that you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 12:40:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-fm/m-p/935285#M61831</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-19T12:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: problem in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-fm/m-p/935286#M61832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Once you have the data back from memory in your internal table, you need to pick apart the data and send it back thru your TABLES interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data coming back from memory must be in table I_LISTOBJECT and be structured like ABAPLIST.  Otherwise the function module will not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


DATA: BEGIN OF i_LISTOBJECT OCCURS 0.
INCLUDE STRUCTURE ABAPLIST.
DATA: END OF i_LISTOBJECT.

CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = i_LISTOBJECT
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC &amp;lt;&amp;gt; 0.
EXIT.
ENDIF.
endif.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next you next to pick apart the data.  Here is where it gets tricky and dangerous.  We do this kind of thing when bringing data from reports to the portal.  It keeps all the report code in one place but also you must be careful when changing the report program.  Here's how we do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this example, listout is the table I got back from memory.  xzepphlsm is the internal table which is passing thru the interface.   Notice that each line of the report is being broken up into the output structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


  loop at listout.
    check sy-tabix &amp;gt; 8.
    clear xzepphlsm.


    perform convert_date_internal using listout-line+0(10)
                                        xzepphlsm-datum .

    perform convert_list_number_to_integar
                    changing listout-line+20(10).
    xzepphlsm-nopak = listout-line+20(10).

    perform convert_list_number_to_integar
                    changing listout-line+40(10).
    xzepphlsm-nopik = listout-line+40(10).

    perform convert_list_number_to_integar
                    changing listout-line+60(10).
    xzepphlsm-inpip = listout-line+60(10).

    append xzepphlsm.

  endloop.

&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 12:49:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-fm/m-p/935286#M61832</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-07-19T12:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: problem in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-fm/m-p/935287#M61833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Deepak,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even my requirement was the same. I dint paste that code as i was not sure whether u needed it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyways, here it goes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF I_LISTKEY OCCURS 0,&lt;/P&gt;&lt;P&gt;        ZEILE(256) TYPE C.&lt;/P&gt;&lt;P&gt;DATA: END OF I_LISTKEY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : i_DUMMY_OUTPUT1 type standard table of DUMMY_OUTPUT1,&lt;/P&gt;&lt;P&gt;       w_DUMMY_OUTPUT1 LIKE LINE OF I_DUMMY_OUTPUT1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where:&lt;/P&gt;&lt;P&gt;TYPES : BEGIN OF DUMMY_OUTPUT1,&lt;/P&gt;&lt;P&gt;            ur internal table fields.&lt;/P&gt;&lt;P&gt;        END OF DUMMY_OUTPUT1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now:&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;*To Convert the list into an internal table&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;          CALL FUNCTION 'LIST_TO_ASCI'&lt;/P&gt;&lt;P&gt;               TABLES&lt;/P&gt;&lt;P&gt;                    LISTASCI           = I_LISTKEY&lt;/P&gt;&lt;P&gt;                    LISTOBJECT         = i_LISTOBJECT&lt;/P&gt;&lt;P&gt;               EXCEPTIONS&lt;/P&gt;&lt;P&gt;                    EMPTY_LIST         = 1&lt;/P&gt;&lt;P&gt;                    LIST_INDEX_INVALID = 2&lt;/P&gt;&lt;P&gt;                    OTHERS             = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          CLEAR I_DUMMY_OUTPUT1. REFRESH I_DUMMY_OUTPUT1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          delete i_listkey from 1 to 3.&lt;/P&gt;&lt;P&gt;          DESCRIBE TABLE I_LISTKEY LINES LV_LIN.&lt;/P&gt;&lt;P&gt;          delete i_listkey index lv_lin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          LOOP AT I_LISTKEY.&lt;/P&gt;&lt;P&gt;            SPLIT I_LISTKEY-ZEILE AT '|'&lt;/P&gt;&lt;P&gt;                   INTO W_DUMMY_OUTPUT1-field1&lt;/P&gt;&lt;P&gt;                        W_DUMMY_OUTPUT1-field2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            CONDENSE W_DUMMY_OUTPUT1-field1 NO-GAPS.&lt;/P&gt;&lt;P&gt;            CONDENSE W_DUMMY_OUTPUT1-field2 NO-GAPS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;append w_dummy_output to i_dummy_output.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    MOVE w_dummy_output_field1 TO &lt;/P&gt;&lt;P&gt;                   w_ur_warea_of_table -field1.&lt;/P&gt;&lt;P&gt;    MOVE w_dummy_foutput_field2 TO&lt;/P&gt;&lt;P&gt;                   w_ur_warea_of_table-field2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND lw_ur_warea_of_table TO li_ur_itab_of_table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          ENDLOOP.&lt;/P&gt;&lt;P&gt;          CALL FUNCTION 'LIST_FREE_MEMORY'&lt;/P&gt;&lt;P&gt;               TABLES&lt;/P&gt;&lt;P&gt;                    LISTOBJECT = i_LISTOBJECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          CLEAR I_DUMMY_OUTPUT1. &lt;/P&gt;&lt;P&gt;          REFRESH I_DUMMY_OUTPUT1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once u go into debugg mode u wil understand why we are using the split and condense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is how u want it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anjali.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2005 05:37:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-fm/m-p/935287#M61833</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-20T05:37:31Z</dc:date>
    </item>
  </channel>
</rss>

