<?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 Getting Data from Structure and Store Data into Table using Function Module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662587#M1096873</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;we are created a function module to import 2 structures in the systems and want to read the data from the structure into a customized table when the fucntion module is called. However, whenever the function module is run, we only managed to have one data into the customized table whereas the actual results is that there will be a few records in this customized table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Oct 2008 11:53:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-24T11:53:34Z</dc:date>
    <item>
      <title>Getting Data from Structure and Store Data into Table using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662587#M1096873</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;we are created a function module to import 2 structures in the systems and want to read the data from the structure into a customized table when the fucntion module is called. However, whenever the function module is run, we only managed to have one data into the customized table whereas the actual results is that there will be a few records in this customized table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2008 11:53:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662587#M1096873</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-24T11:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data from Structure and Store Data into Table using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662588#M1096874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;does anyone here know why is this so? thanks alot...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2008 11:54:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662588#M1096874</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-24T11:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data from Structure and Store Data into Table using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662589#M1096875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Give the FM code so that we can troubleshoot your problem....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2008 11:56:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662589#M1096875</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-24T11:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data from Structure and Store Data into Table using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662590#M1096876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello...the code is as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FUNCTION Z_MBB_WRITE_RES_MORT.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(I_CKF_CONTRACT) TYPE  /BA1/R2_STR_CALC_KF
*"     REFERENCE(I_CKF_PROCESS) TYPE  /BA1/R2_STR_CKF_PROCESS
*"----------------------------------------------------------------------
TABLES ZRESMORT.

DATA E_ZRESMORT TYPE STANDARD TABLE OF ZRESMORT WITH HEADER LINE.

SELECT * FROM ZRESMORT.
  DELETE ZRESMORT.
ENDSELECT.


E_ZRESMORT-MORT_FT_ID  = I_CKF_CONTRACT-COMMON-CONTRACT_ID_EXT.
E_ZRESMORT-MORT_KDATE  = I_CKF_PROCESS-TECHNICAL-KEY_DATE.
E_ZRESMORT-MORT_TSTAMP = I_CKF_PROCESS-TECHNICAL-TIMESTAMP.
E_ZRESMORT-MORT_FLAG   = 1.
E_ZRESMORT-MORT_BUPA   = I_CKF_CONTRACT-BUPA-BUSINESS_PARTNER_ID.
E_ZRESMORT-MORT_PORTFO = I_CKF_CONTRACT-BUPA-PORTFOLIO_CAT.
E_ZRESMORT-MORT_FT_ID_DUM  = I_CKF_CONTRACT-COMMON-CONTRACT_ID.

INSERT INTO ZRESMORT VALUES E_ZRESMORT.

IF SY-SUBRC EQ 0.
ENDIF.


ENDFUNCTION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2008 12:15:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662590#M1096876</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-24T12:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data from Structure and Store Data into Table using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662591#M1096877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are deleting all the values in your table first, then inserting one value from the import parameters, so at any point in time you will always have 1 value in the Z table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

FUNCTION Z_MBB_WRITE_RES_MORT.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(I_CKF_CONTRACT) TYPE  /BA1/R2_STR_CALC_KF
*"     REFERENCE(I_CKF_PROCESS) TYPE  /BA1/R2_STR_CKF_PROCESS
*"----------------------------------------------------------------------
TABLES ZRESMORT.
 
DATA E_ZRESMORT TYPE STANDARD TABLE OF ZRESMORT WITH HEADER LINE.
 
SELECT * FROM ZRESMORT.    &amp;lt;=====================
  DELETE ZRESMORT.              &amp;lt;==================  It is deleting all the records in your Z table
ENDSELECT.    &amp;lt;===============================
 
 
E_ZRESMORT-MORT_FT_ID  = I_CKF_CONTRACT-COMMON-CONTRACT_ID_EXT.
E_ZRESMORT-MORT_KDATE  = I_CKF_PROCESS-TECHNICAL-KEY_DATE.
E_ZRESMORT-MORT_TSTAMP = I_CKF_PROCESS-TECHNICAL-TIMESTAMP.
E_ZRESMORT-MORT_FLAG   = 1.
E_ZRESMORT-MORT_BUPA   = I_CKF_CONTRACT-BUPA-BUSINESS_PARTNER_ID.
E_ZRESMORT-MORT_PORTFO = I_CKF_CONTRACT-BUPA-PORTFOLIO_CAT.
E_ZRESMORT-MORT_FT_ID_DUM  = I_CKF_CONTRACT-COMMON-CONTRACT_ID.
 
INSERT INTO ZRESMORT VALUES E_ZRESMORT.
 
IF SY-SUBRC EQ 0.
ENDIF.
 
 
ENDFUNCTION.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2008 12:58:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662591#M1096877</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-24T12:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data from Structure and Store Data into Table using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662592#M1096878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mxg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So how can we modify the code so that the functiona module will add in more than one records into the table when the function module is being called?? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanksss...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2008 15:31:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662592#M1096878</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-25T15:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data from Structure and Store Data into Table using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662593#M1096879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fluffy,&lt;/P&gt;&lt;P&gt;You need to use the LOOP Statement to insert the data into the database table.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chidanand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2008 16:12:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662593#M1096879</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-25T16:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data from Structure and Store Data into Table using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662594#M1096880</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;It should be something like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES ZRESMORT.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA E_ZRESMORT TYPE STANDARD TABLE OF ZRESMORT WITH HEADER LINE.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;SELECT * FROM ZRESMORT.    &amp;lt;=====================&lt;/P&gt;&lt;P&gt;  DELETE ZRESMORT.              &amp;lt;==================  It is deleting all the records in your Z table&lt;/P&gt;&lt;P&gt;ENDSELECT.    &amp;lt;===============================&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at I_CKF_CONTRACT.  " Assuming this is the Main Table&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Read table I_CKF_PROCESS with key ." Here you will read this table to get the corresponding records of Table I_CKF_CONTRACT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E_ZRESMORT-MORT_FT_ID  = I_CKF_CONTRACT-COMMON-CONTRACT_ID_EXT.&lt;/P&gt;&lt;P&gt;E_ZRESMORT-MORT_KDATE  = I_CKF_PROCESS-TECHNICAL-KEY_DATE.&lt;/P&gt;&lt;P&gt;E_ZRESMORT-MORT_TSTAMP = I_CKF_PROCESS-TECHNICAL-TIMESTAMP.&lt;/P&gt;&lt;P&gt;E_ZRESMORT-MORT_FLAG   = 1.&lt;/P&gt;&lt;P&gt;E_ZRESMORT-MORT_BUPA   = I_CKF_CONTRACT-BUPA-BUSINESS_PARTNER_ID.&lt;/P&gt;&lt;P&gt;E_ZRESMORT-MORT_PORTFO = I_CKF_CONTRACT-BUPA-PORTFOLIO_CAT.&lt;/P&gt;&lt;P&gt;E_ZRESMORT-MORT_FT_ID_DUM  = I_CKF_CONTRACT-COMMON-CONTRACT_ID.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;INSERT INTO ZRESMORT VALUES E_ZRESMORT.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2008 16:17:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662594#M1096880</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-25T16:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data from Structure and Store Data into Table using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662595#M1096881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cant say anything unless I know the complete picture of what you are trying to do. Fro now I can say that your FM is importing one value and you wan tot insert that value, while retaining the other value in there. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way would be to put a where condition ib the code below to delete just the entries you want to get rid of not all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM ZRESMORT.&lt;/P&gt;&lt;P&gt;  DELETE ZRESMORT.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2008 16:43:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662595#M1096881</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-25T16:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data from Structure and Store Data into Table using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662596#M1096882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey...actually when the function module is being called, this functional module will delete all the data in the existing table "zresmort", load in the new sets of data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently when the function module is being called, the existing data in the table cannot be deleted and insert another new sets of data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2008 01:31:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662596#M1096882</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-28T01:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data from Structure and Store Data into Table using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662597#M1096883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you have all the records available when calling this FM? if yes, then instead of using structur ein import parameters use table types as the import and then use the rows to update the Z table for all the rows at the same time&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2008 01:37:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662597#M1096883</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-28T01:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data from Structure and Store Data into Table using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662598#M1096884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the function module is to called the structure, there are no table for this to store the data, we get the data from the structure...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2008 01:47:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662598#M1096884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-28T01:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data from Structure and Store Data into Table using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662599#M1096885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to think of logic on what you are trying here. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;basically you want to call it several times in one process, and during that you would want to delete all previous entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One option would be to define a global variable V_flag , and set that during the 1st run, and check that flag in subsequent one before deleting the entries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

if  v_flag = space.

SELECT * FROM ZRESMORT.
  DELETE ZRESMORT.
ENDSELECT.

v_flag = 'X'

endif. 

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2008 01:57:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662599#M1096885</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-28T01:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data from Structure and Store Data into Table using Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662600#M1096886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi MxG..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your information. For the global variable that you mentioned in the previous post, what's the purpose of the global variable? thanksss...can elaborate more on this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2008 03:19:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-data-from-structure-and-store-data-into-table-using-function-module/m-p/4662600#M1096886</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-28T03:19:18Z</dc:date>
    </item>
  </channel>
</rss>

