<?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: How to create BAPI structure dynamically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-bapi-structure-dynamically/m-p/12048499#M1968564</link>
    <description>&lt;P&gt;Thanks for replying back on my post. I should have been more specific. &lt;/P&gt;&lt;P&gt;I have a requirement to call multiple BAPI's which are not available in development environment, not even their structures, for example in below example i need to define header, headerx, v_vbeln......etc in data declaration but structure bapisdhead1, bapisdhead1x.. etc are not available in development system. I do not want to create all structures in DDIC as these are many .I am looking if i can create structure type dynamically. &lt;/P&gt;&lt;P&gt;DATA: header LIKE bapisdhead1.&lt;BR /&gt;
DATA: headerx LIKE bapisdhead1x.&lt;BR /&gt;
DATA: item LIKE bapisditem OCCURS 0 WITH HEADER LINE.&lt;BR /&gt;
DATA: itemx LIKE bapisditemx OCCURS 0 WITH HEADER LINE.&lt;BR /&gt;
DATA: partner LIKE bapipartnr OCCURS 0 WITH HEADER LINE.&lt;BR /&gt;
DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.&lt;BR /&gt;
DATA: lt_schedules_inx TYPE STANDARD TABLE OF bapischdlx&lt;BR /&gt;
 WITH HEADER LINE.&lt;BR /&gt;
DATA: lt_schedules_in TYPE STANDARD TABLE OF bapischdl&lt;BR /&gt;
 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'&lt;BR /&gt;
 EXPORTING&lt;BR /&gt;
 sales_header_in = header&lt;BR /&gt;
 sales_header_inx = headerx&lt;BR /&gt;
 IMPORTING&lt;BR /&gt;
 salesdocument_ex = v_vbeln&lt;BR /&gt;
 TABLES&lt;BR /&gt;
 return = return&lt;BR /&gt;
 sales_items_in = item&lt;BR /&gt;
 sales_items_inx = itemx&lt;BR /&gt;
 sales_schedules_in = lt_schedules_in&lt;BR /&gt;
 sales_schedules_inx = lt_schedules_inx&lt;BR /&gt;
 sales_partners = partner.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Sep 2019 14:06:45 GMT</pubDate>
    <dc:creator>former_member602416</dc:creator>
    <dc:date>2019-09-02T14:06:45Z</dc:date>
    <item>
      <title>How to create BAPI structure dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-bapi-structure-dynamically/m-p/12048497#M1968562</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
  &lt;P&gt;I have a requirement to call sales order create/change BAPIs from my report program . These BAPIS do not exist in development environment but available at RFC destination. I need to write logic to call them from development environment and test it from development itself.&lt;/P&gt;
  &lt;P&gt;Can you please advice how can i define structures and table to pass the data to BAPI function as BAPI structures are not available in development.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 12:55:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-bapi-structure-dynamically/m-p/12048497#M1968562</guid>
      <dc:creator>former_member602416</dc:creator>
      <dc:date>2019-09-02T12:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to create BAPI structure dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-bapi-structure-dynamically/m-p/12048498#M1968563</link>
      <description>&lt;P&gt;What do you expect from us? You can define structures/internal tables either in your program or in DDIC. But I think this is not the answer you want to hear, do you?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 13:43:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-bapi-structure-dynamically/m-p/12048498#M1968563</guid>
      <dc:creator>UweFetzer_se38</dc:creator>
      <dc:date>2019-09-02T13:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to create BAPI structure dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-bapi-structure-dynamically/m-p/12048499#M1968564</link>
      <description>&lt;P&gt;Thanks for replying back on my post. I should have been more specific. &lt;/P&gt;&lt;P&gt;I have a requirement to call multiple BAPI's which are not available in development environment, not even their structures, for example in below example i need to define header, headerx, v_vbeln......etc in data declaration but structure bapisdhead1, bapisdhead1x.. etc are not available in development system. I do not want to create all structures in DDIC as these are many .I am looking if i can create structure type dynamically. &lt;/P&gt;&lt;P&gt;DATA: header LIKE bapisdhead1.&lt;BR /&gt;
DATA: headerx LIKE bapisdhead1x.&lt;BR /&gt;
DATA: item LIKE bapisditem OCCURS 0 WITH HEADER LINE.&lt;BR /&gt;
DATA: itemx LIKE bapisditemx OCCURS 0 WITH HEADER LINE.&lt;BR /&gt;
DATA: partner LIKE bapipartnr OCCURS 0 WITH HEADER LINE.&lt;BR /&gt;
DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.&lt;BR /&gt;
DATA: lt_schedules_inx TYPE STANDARD TABLE OF bapischdlx&lt;BR /&gt;
 WITH HEADER LINE.&lt;BR /&gt;
DATA: lt_schedules_in TYPE STANDARD TABLE OF bapischdl&lt;BR /&gt;
 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'&lt;BR /&gt;
 EXPORTING&lt;BR /&gt;
 sales_header_in = header&lt;BR /&gt;
 sales_header_inx = headerx&lt;BR /&gt;
 IMPORTING&lt;BR /&gt;
 salesdocument_ex = v_vbeln&lt;BR /&gt;
 TABLES&lt;BR /&gt;
 return = return&lt;BR /&gt;
 sales_items_in = item&lt;BR /&gt;
 sales_items_inx = itemx&lt;BR /&gt;
 sales_schedules_in = lt_schedules_in&lt;BR /&gt;
 sales_schedules_inx = lt_schedules_inx&lt;BR /&gt;
 sales_partners = partner.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 14:06:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-bapi-structure-dynamically/m-p/12048499#M1968564</guid>
      <dc:creator>former_member602416</dc:creator>
      <dc:date>2019-09-02T14:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to create BAPI structure dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-bapi-structure-dynamically/m-p/12048500#M1968565</link>
      <description>&lt;P&gt;You could use in your program a variable for the FM name, and could create dynamic internal structure and table from ddic structure reference get from a RFC enabled FM such as DDIF_FIELDINFO_GET using class such as &lt;A href="https://launchpad.support.sap.com/#/solutions/scnforums/?q=cl_abap_structdescr%252520%252520cl_abap_tabledescr"&gt;cl_abap_structdescr or cl_abap_tabledescr&lt;/A&gt;, so what is your exact problem?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;bapi_name = 'BAPI_SALESDOCU_CREATEFROMDATA1'.
CALL FUNCTION bapi_name DESTINATION target
  EXPORTING
    sales_header_in = &amp;lt;header&amp;gt;
    sales_header_inx = &amp;lt;headerx&amp;gt;
  IMPORTING
    salesdocument_ex = &amp;lt;v_vbeln&amp;gt;
  TABLES
    return = return
    sales_items_in = &amp;lt;item&amp;gt;.
    " ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Sep 2019 14:39:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-bapi-structure-dynamically/m-p/12048500#M1968565</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2019-09-02T14:39:22Z</dc:date>
    </item>
  </channel>
</rss>

