<?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: Dynamic table declaration in FM in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238752#M772885</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raymond,&lt;/P&gt;&lt;P&gt;Tried this as well..But still giving me a short dump..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Jan 2008 14:30:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-18T14:30:47Z</dc:date>
    <item>
      <title>Dynamic table declaration in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238747#M772880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Geeks,&lt;/P&gt;&lt;P&gt;I am calling a FM from a program where the FM should get the structure data and set that data into a single line with delimiters and send it out. The table structure can be anything. So how can I declare that table structure data (in tables tab in FM). Could somebody help me with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 14:11:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238747#M772880</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T14:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table declaration in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238748#M772881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran, try this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this piece of code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT YDEMO .&lt;/P&gt;&lt;P&gt;PARAMETERS: TBLNAME(50). "DEFAULT 'SPFLI'.&lt;/P&gt;&lt;P&gt;DATA: TOTAL_ROWS TYPE P.&lt;/P&gt;&lt;P&gt;SELECT COUNT(*) FROM (TBLNAME) INTO TOTAL_ROWS. &lt;/P&gt;&lt;P&gt;WRITE: / TBLNAME, TOTAL_ROWS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Hema.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 14:22:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238748#M772881</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T14:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table declaration in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238749#M772882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the function module interface, do not assign a TYPE for the table if you are using a TABLES parameter.  If you are passing the table in the IMPORTING and EXPORTING parameters, then you will want to type it as STANDARD TABLE.  This allows you to pass a table with any structure.  Once inside the function module you will then need to read this table using field symbols.&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>Fri, 18 Jan 2008 14:25:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238749#M772882</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2008-01-18T14:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table declaration in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238750#M772883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just give the name of the internal table, don't give any type to this parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in the source you will have to use dynamic assignment to access records and fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 14:27:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238750#M772883</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2008-01-18T14:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table declaration in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238751#M772884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;I tried this but when calling this FM from a program its giving me a short dump.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 14:29:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238751#M772884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T14:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table declaration in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238752#M772885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raymond,&lt;/P&gt;&lt;P&gt;Tried this as well..But still giving me a short dump..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 14:30:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238752#M772885</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T14:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table declaration in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238753#M772886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So inside your function module then, you can read the importing table and then build the output table, maybe using comma as your delimiter.  Here IM_TAB is the imcoming table.  You can pass LT_DATA back out via an EXPORTING parameter or TABLES parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

FIELD-SYMBOLS: &amp;lt;fs_im_tab&amp;gt; TYPE ANY,
               &amp;lt;fs_comp&amp;gt;   type any.

DATA: lt_data TYPE TABLE OF string.
DATA: ls_data TYPE string.


LOOP AT im_tab ASSIGNING &amp;lt;fs_im_tab&amp;gt; .
  DO.
    ASSIGN COMPONENT sy-index OF STRUCTURE &amp;lt;fs_im_tab&amp;gt; TO &amp;lt;fs_comp&amp;gt;.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      EXIT.
    ENDIF.
    IF sy-index = 1.
      ls_data = &amp;lt;fs_comp&amp;gt;.
    ELSE.
      CONCATENATE ls_data &amp;lt;fs_comp&amp;gt; INTO ls_data SEPARATED BY ','.
    ENDIF.
  ENDDO.
  APPEND ls_data TO lt_data.
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>Fri, 18 Jan 2008 14:32:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238753#M772886</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2008-01-18T14:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table declaration in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238754#M772887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, so which approach did you try, what does the dump say, and you may want to post the code of the function module, and/or is interface definition.&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>Fri, 18 Jan 2008 14:35:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238754#M772887</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2008-01-18T14:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table declaration in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238755#M772888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help. Here is the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS p_delim TYPE sy-input OBLIGATORY DEFAULT '|'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: rec_hdr TYPE zwm_sch_waybill_fhdr.&lt;/P&gt;&lt;P&gt;DATA: rec_a01 TYPE zwm_sch_waybill_a01.&lt;/P&gt;&lt;P&gt;DATA: rec_a02 TYPE zwm_sch_waybill_a02.&lt;/P&gt;&lt;P&gt;DATA: rec_b01 TYPE zwm_sch_waybill_b01.&lt;/P&gt;&lt;P&gt;DATA: rec_b02 TYPE zwm_sch_waybill_b02.&lt;/P&gt;&lt;P&gt;DATA: rec_b03 TYPE zwm_sch_waybill_b03.&lt;/P&gt;&lt;P&gt;DATA: rec_b04 TYPE zwm_sch_waybill_b04.&lt;/P&gt;&lt;P&gt;DATA: rec_c01 TYPE zwm_sch_waybill_c01.&lt;/P&gt;&lt;P&gt;DATA: rec_c02 TYPE zwm_sch_waybill_c02.&lt;/P&gt;&lt;P&gt;DATA: rec_c03 TYPE zwm_sch_waybill_c03.&lt;/P&gt;&lt;P&gt;DATA: rec_d01 TYPE zwm_sch_waybill_d01.&lt;/P&gt;&lt;P&gt;DATA: rec_d02 TYPE zwm_sch_waybill_d02.&lt;/P&gt;&lt;P&gt;DATA: rec_d03 TYPE zwm_sch_waybill_d03.&lt;/P&gt;&lt;P&gt;DATA: rec_d04 TYPE zwm_sch_waybill_d04.&lt;/P&gt;&lt;P&gt;DATA: rec_e01 TYPE zwm_sch_waybill_e01.&lt;/P&gt;&lt;P&gt;DATA: rec_e02 TYPE zwm_sch_waybill_e02.&lt;/P&gt;&lt;P&gt;DATA: rec_e03 TYPE zwm_sch_waybill_e03.&lt;/P&gt;&lt;P&gt;DATA: rec_e04 TYPE zwm_sch_waybill_e04.&lt;/P&gt;&lt;P&gt;DATA: rec_f01 TYPE zwm_sch_waybill_f01.&lt;/P&gt;&lt;P&gt;DATA: rec_g01 TYPE zwm_sch_waybill_g01.&lt;/P&gt;&lt;P&gt;DATA: rec_ftr TYPE zwm_sch_waybill_fftr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: rec_fixed TYPE string.&lt;/P&gt;&lt;P&gt;DATA: rec_delimited TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF rec_struc OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE zfile_struc.&lt;/P&gt;&lt;P&gt;DATA: END OF rec_struc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rec_hdr-rectype        = 'FHDR'                                                        .&lt;/P&gt;&lt;P&gt;rec_hdr-filetype       = 'LP'                                                          .&lt;/P&gt;&lt;P&gt;rec_hdr-fformat        = 'DLM'                                                         .&lt;/P&gt;&lt;P&gt;rec_hdr-partenrid      = 'SCEE'                                                        .&lt;/P&gt;&lt;P&gt;rec_hdr-testmode       = 'T'                                                           .&lt;/P&gt;&lt;P&gt;rec_hdr-docver         =  7                                                            .&lt;/P&gt;&lt;P&gt;rec_hdr-ftimezone      = 'GMT'                                                         .&lt;/P&gt;&lt;P&gt;rec_hdr-ftimestamp     =  20081801110244                                               .&lt;/P&gt;&lt;P&gt;rec_hdr-dummy1         = '0000000000'                                                  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rec_a01-rectype        = 'A01'                                                         .&lt;/P&gt;&lt;P&gt;rec_a01-doctype        = 'LP'                                                          .&lt;/P&gt;&lt;P&gt;rec_a01-waybno         =  1234567890                                                   .&lt;/P&gt;&lt;P&gt;rec_a01-clirefno1      = 'Sender ref 1'                                                .&lt;/P&gt;&lt;P&gt;rec_a01-clirefno2      = 'Sender ref 2'                                                .&lt;/P&gt;&lt;P&gt;rec_a01-clireftype     =  5                                                            .&lt;/P&gt;&lt;P&gt;rec_a01-msgfunc        =  6                                                            .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rec_a02-rectype        = 'A02'                                                         .&lt;/P&gt;&lt;P&gt;rec_a02-clisendate     =  20080118                                                     .&lt;/P&gt;&lt;P&gt;rec_a02-clideliverdate = ''                                                            .&lt;/P&gt;&lt;P&gt;rec_a02-clisentime     = '11:08'                                                       .&lt;/P&gt;&lt;P&gt;rec_a02-clidelivertime = ''                                                            .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rec_b01-rectype        = 'B01'                                                         .&lt;/P&gt;&lt;P&gt;rec_b01-sendcc         = 'PL'                                                          .&lt;/P&gt;&lt;P&gt;rec_b01-sendid         =  1234567                                                      .&lt;/P&gt;&lt;P&gt;rec_b01-sendsop        =  9999999                                                      .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rec_b02-rectype        = 'B02'                                                         .&lt;/P&gt;&lt;P&gt;rec_b02-sendpost       = '12-345'                                                      .&lt;/P&gt;&lt;P&gt;rec_b02-senddept       = ''                                                            .&lt;/P&gt;&lt;P&gt;rec_b02-sendcity       = ''                                                            .&lt;/P&gt;&lt;P&gt;rec_b02-sendstreet     = 'Streetname'                                                  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rec_ftr-rectype        = 'FFTR'                                                        .&lt;/P&gt;&lt;P&gt;rec_ftr-filedocs       =  99                                                           .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM delimit USING rec_hdr.&lt;/P&gt;&lt;P&gt;PERFORM delimit USING rec_a01.&lt;/P&gt;&lt;P&gt;PERFORM delimit USING rec_a02.&lt;/P&gt;&lt;P&gt;PERFORM delimit USING rec_b01.&lt;/P&gt;&lt;P&gt;PERFORM delimit USING rec_b02.&lt;/P&gt;&lt;P&gt;PERFORM delimit USING rec_ftr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM delimit USING inrec.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------" /&gt;&lt;P&gt;data: v_length type sy-tleng.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'Z_FILENAME_CONTENT_SETUP'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      delimiter            = p_delim&lt;/P&gt;&lt;P&gt;   IMPORTING&lt;/P&gt;&lt;P&gt;     delimited_data       = rec_delimited&lt;/P&gt;&lt;P&gt;     length                   = v_length&lt;/P&gt;&lt;P&gt; TABLES&lt;/P&gt;&lt;P&gt;   struc                =  inrec&lt;/P&gt;&lt;P&gt;            .&lt;/P&gt;&lt;P&gt;Importing declaration&lt;/P&gt;&lt;P&gt;rec_delimited type string&lt;/P&gt;&lt;P&gt;length type sy-tleng&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exporting declaration&lt;/P&gt;&lt;P&gt;delimiter like sy-input&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables dec&lt;/P&gt;&lt;P&gt;struc type standard table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data I am passing is a structure and not a table but in the FM we have to declare it as internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 14:44:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238755#M772888</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T14:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table declaration in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238756#M772889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You definitly have a few issues here my friend.  First, if you have the structure INREC, you need to APPEND this line to an internal table in order to pass this via the TABLES parameter, trying to pass this INREC is probably producing your dump, you need to pass an internal table when using the TABLES parameters, otherwise you need to pass this via the IMPORTING parameters.&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>Fri, 18 Jan 2008 14:51:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238756#M772889</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2008-01-18T14:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table declaration in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238757#M772890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Rich. I will try to process it as an internal table because I have to use a delimiter between all the fields in the structure before outputting it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 14:55:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-declaration-in-fm/m-p/3238757#M772890</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T14:55:30Z</dc:date>
    </item>
  </channel>
</rss>

