<?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 Adapting BAPIs in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/adapting-bapis/m-p/2649585#M610674</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had to add some additional fields to the positions of sales orders.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nevertheless I would like to have a non-SAP-system create orders in SAP. Normally I would use BAPI_SALESORDER_CREATEFROMDAT2 for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is: Can I in some way change BAPI_SALESORDER_CREATEFROMDAT2 so that the new fields in my orders are being filled with data from the external system, too?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Jens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Aug 2007 11:50:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-10T11:50:29Z</dc:date>
    <item>
      <title>Adapting BAPIs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adapting-bapis/m-p/2649585#M610674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had to add some additional fields to the positions of sales orders.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nevertheless I would like to have a non-SAP-system create orders in SAP. Normally I would use BAPI_SALESORDER_CREATEFROMDAT2 for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is: Can I in some way change BAPI_SALESORDER_CREATEFROMDAT2 so that the new fields in my orders are being filled with data from the external system, too?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Jens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 11:50:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adapting-bapis/m-p/2649585#M610674</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T11:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Adapting BAPIs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adapting-bapis/m-p/2649586#M610675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a tables parameter called extensionin in the function module interface.  This table can be used to populate your additional fields assuming that they are included in the appends for VBAK, VBKD, VBAP and VBEP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function module documentaion provides details on how to populate this parameter.  Select the function module documentation, and then click on the extensionin link and it should take you there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris H.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 12:04:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adapting-bapis/m-p/2649586#M610675</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-10T12:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Adapting BAPIs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adapting-bapis/m-p/2649587#M610676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Jens!&lt;/P&gt;&lt;P&gt;I believe that note 143580 would be a good starting point for you. I never did &lt;/P&gt;&lt;P&gt;it with BAPI_SALESORDER_CREATEFROMDAT2, but I'll show you how I did it with BAPI_PO_CREATE1. It has the EXTENSIONIN table parameter&lt;/P&gt;&lt;P&gt;so I suppose they function in similar way. So:&lt;/P&gt;&lt;P&gt;1. You need to find which structures&lt;/P&gt;&lt;P&gt;fits your function to be extended. For BAPI_PO_CREATE1 it was BAPI_TE_MEPOHEADER for&lt;/P&gt;&lt;P&gt;purchase order header and BAPI_TE_MEPOITEM for items. Sometimes there are pairs to structures with the same name and trailing "X", like BAPI_TE_MEPOHEADERX. They containt one-character flag for each field for marking the fields which need to be passed.&lt;/P&gt;&lt;P&gt;2. Find an .INCLUDE in this structure which was included there for enhancements. In my case it was CI_EKKODB. This is the structure which you&lt;/P&gt;&lt;P&gt;need to modify.&lt;/P&gt;&lt;P&gt;3. Just add your field here, but be careful! This structure was&lt;/P&gt;&lt;P&gt;included in many other tables and structures, and if there's already field with &lt;/P&gt;&lt;P&gt;the same name, you're in trouble. That was my case, so I had to name it &lt;/P&gt;&lt;P&gt;differently. To stay on the safe side, it's common (though not obligatory) to &lt;/P&gt;&lt;P&gt;name it with leading "Z".&lt;/P&gt;&lt;P&gt;4. Pass this field using EXTENSIONIN structure. It works in somewhat&lt;/P&gt;&lt;P&gt;weird way. The EXTENSIONIN structure (in your case BAPIPAREX) has 5 fields: STRUCTURE and 4 VALUEPART fields. &lt;/P&gt;&lt;P&gt;This is how it worked with me:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;s_extensionin-structure        = 'BAPI_TE_MEPOHEADER'.
s_bapi_te_mepoheader-zoic_mot   = l_field.
s_extensionin-valuepart1       = s_bapi_te_mepoheader.
APPEND s_extensionin TO t_extensionin.
CLEAR s_extensionin.
s_extensionin-structure        = 'BAPI_TE_MEPOHEADERX'.
s_bapi_te_mepoheaderx-zoic_mot = 'X'.
s_extensionin-valuepart1       = s_bapi_te_mepoheaderx.
APPEND s_extensionin TO t_extensionin.
*...
CALL FUNCTION 'BAPI_PO_CREATE1'
  EXPORTING poheader         = s_po_header
            poheaderx        = s_po_headerx
  IMPORTING exppurchaseorder = &amp;lt;outtab_valid&amp;gt;-ebeln
  TABLES    return           = t_return
            poitem           = t_po_items
            poitemx          = t_po_itemsx
            poschedulex      = t_po_schedulex
            poschedule       = t_po_schedule
            extensionin      = t_extensionin
            potextheader     = t_po_texthead.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;With your function it is probably similar, but not the same. I hope the&lt;/P&gt;&lt;P&gt;mentioned note would help you.&lt;/P&gt;&lt;P&gt;Now you passed your field, but what to do with it? You need to find some user-&lt;/P&gt;&lt;P&gt;exit to handle this field and pass value to where it belongs. I found a BADI for my&lt;/P&gt;&lt;P&gt;function, and did:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ls_mepoheader-oic_mot = ls_mepoheader-zoic_mot.
im_header-&amp;gt;set_data( ls_mepoheader ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This was specific for my use - you need to find out how to do it in your case. I hope with the note from the beginning of my post and similar procedure to mine, you'll be able to do it.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Igor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2007 18:17:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adapting-bapis/m-p/2649587#M610676</guid>
      <dc:creator>former_member185943</dc:creator>
      <dc:date>2007-08-10T18:17:00Z</dc:date>
    </item>
  </channel>
</rss>

