<?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: Using BAPI_PO_CREATE to create a PO with reference to another PO/item in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-bapi-po-create-to-create-a-po-with-reference-to-another-po-item/m-p/2505826#M566434</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kristina,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   you can check this bapi information below: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Short Text&lt;/P&gt;&lt;P&gt;Create Purchase Order&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Functionality&lt;/P&gt;&lt;P&gt;Function module BAPI_PO_CREATE1 enables you to create purchase orders. The BAPI uses the technology behind the Enjoy purchase order transaction ( ME21N).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, the IDoc type PORDCR1 is available. The data from this IDoc automatically populates the interface parameters of the function module BAPI_PO_CREATE1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Functionality in Detail&lt;/P&gt;&lt;P&gt;Authorization&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following authorization objects are checked when an Enjoy purchase order is created (activity 01):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M_BEST_BSA (document type in PO)&lt;/P&gt;&lt;P&gt;M_BEST_EKG (purchasing group in PO)&lt;/P&gt;&lt;P&gt;M_BEST_EKO (purchasing organization in PO)&lt;/P&gt;&lt;P&gt;M_BEST_WRK (plant in PO)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Controlling adoption of field values via X parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For most tables, you can determine via your own parameters in the associated X parameter in each case (e.g. PoItemX) whether fields are to be set initial, values inserted via the interface, or default values adopted (e.g. from Customizing or master records) (for example, it is not mandatory to adopt the material group from an underlying purchase requisition - you can change it with the BAPI).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transfer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Header data&lt;/P&gt;&lt;P&gt;The header data of the Enjoy purchase order is transferred in the table PoHeader.&lt;/P&gt;&lt;P&gt;Item data&lt;/P&gt;&lt;P&gt;The item data of the Enjoy purchase order is stored in the table PoItem (general item data). The delivery schedule lines are stored in the table PoSchedule.&lt;/P&gt;&lt;P&gt;Use the table PoAccount to specify the account assignment information. If account assignments have been specified for services and limits, you show the relevant account assignment line in PoAccount in the table PoSrvAccessValues via the package number of the service or the limit.&lt;/P&gt;&lt;P&gt;Services and limits&lt;/P&gt;&lt;P&gt;Services, free limits and limits with contract reference can be specified in the tables PoServices, PoLimits, and PoContractLimits.&lt;/P&gt;&lt;P&gt;Conditions&lt;/P&gt;&lt;P&gt;Conditions are transferred in the table PoCond; header conditions in the table PoCondHeader. Price determination is reinitiated via the parameter CALCTYPE in the table PoItem.&lt;/P&gt;&lt;P&gt;Vendor and delivery address&lt;/P&gt;&lt;P&gt;The vendor's address can be specified individually in the table PoAddrVendor; the delivery address in the table PoAddrDelivery. If you do not make any individual specification, the fields will be populated via the central address management facility.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note&lt;/P&gt;&lt;P&gt;In this method, the following restrictions apply with regard to addresses:&lt;/P&gt;&lt;P&gt;Addresses can only be created with this method - they cannot be changed. You can only change address data with the method BAPI_ADDRESSORG_CHANGE.&lt;/P&gt;&lt;P&gt;When you create addresses, they are not checked by the method. An Enjoy purchase order may therefore contain faulty address data.&lt;/P&gt;&lt;P&gt;Partner roles&lt;/P&gt;&lt;P&gt;The partners can be maintained individually via the table PoPartner (with the exception of the partner role "vendor").&lt;/P&gt;&lt;P&gt;Import/export data&lt;/P&gt;&lt;P&gt;Import/Export data can be specified per item in the table PoExpImpItem. Foreign trade data can only be transferred as default data for new items.&lt;/P&gt;&lt;P&gt;Texts&lt;/P&gt;&lt;P&gt;Header and item texts can be transferred in the tables PoTextHeader and PoTextItem. Texts for services are imported in the table PoServicesText.&lt;/P&gt;&lt;P&gt;Version Management&lt;/P&gt;&lt;P&gt;You can make use of the Version Management facility via the table AllVersions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Return&lt;/P&gt;&lt;P&gt;The PO number is returned in the parameter ExpPurchaseOrder. In addition, all information except the service and export/import tables is placed in the output structures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Return messages&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Messages are returned in the parameter Return. This also contains information as to whether interface data has been wrongly or probably wrongly (heuristical interface check) populated. When a PO has been created successfully, the PO number is also placed in the return table with the appropriate message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Restrictions&lt;/P&gt;&lt;P&gt;With this function module, it is not possible to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create subcontracting components (you can only use existing ones)&lt;/P&gt;&lt;P&gt;Create configurations (you can only use existing ones)&lt;/P&gt;&lt;P&gt;Change message records (table NAST) and additional message data (this data can only be determined via the message determination facility (Customizing))&lt;/P&gt;&lt;P&gt;Attach documents to the purchase order&lt;/P&gt;&lt;P&gt;See also further information in SAP Note 197958.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;Example of population of BAPI interface in the Function Builder&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POHEADER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMP_CODE = 1000 &lt;/P&gt;&lt;P&gt;DOC_TYPE = NB &lt;/P&gt;&lt;P&gt;ITEM_INTVL = 00001 &lt;/P&gt;&lt;P&gt;VENDOR = 0000001000 &lt;/P&gt;&lt;P&gt;PMNTTRMS = 0001 &lt;/P&gt;&lt;P&gt;PURCH_ORG = 1000 &lt;/P&gt;&lt;P&gt;PUR_GROUP = 001 &lt;/P&gt;&lt;P&gt;CURRENCY = EUR &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POHEADERX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMP_CODE = X &lt;/P&gt;&lt;P&gt;DOC_TYPE = X &lt;/P&gt;&lt;P&gt;ITEM_INTVL = X &lt;/P&gt;&lt;P&gt;VENDOR = X &lt;/P&gt;&lt;P&gt;PMNTTRMS = X &lt;/P&gt;&lt;P&gt;PURCH_ORG = X &lt;/P&gt;&lt;P&gt;PUR_GROUP = X &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POITEM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;MATERIAL = 100-100 &lt;/P&gt;&lt;P&gt;PLANT = 1000 &lt;/P&gt;&lt;P&gt;STGE_LOC = 0001 &lt;/P&gt;&lt;P&gt;QUANTITY = 15.000 &lt;/P&gt;&lt;P&gt;TAX_CODE = V0 &lt;/P&gt;&lt;P&gt;ITEM_CAT = 0 &lt;/P&gt;&lt;P&gt;ACCTASSCAT = K &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POITEMX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;MATERIAL = X &lt;/P&gt;&lt;P&gt;PLANT = X &lt;/P&gt;&lt;P&gt;STGE_LOC = X &lt;/P&gt;&lt;P&gt;QUANTITY = X &lt;/P&gt;&lt;P&gt;TAX_CODE = X &lt;/P&gt;&lt;P&gt;ITEM_CAT = X &lt;/P&gt;&lt;P&gt;ACCTASSCAT = X &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POSCHEDULE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;SCHED_LINE = 0001 &lt;/P&gt;&lt;P&gt;DELIVERY_DATE = 02.12.2002 &lt;/P&gt;&lt;P&gt;QUANTITY = 6.000 &lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;SCHED_LINE = 0002 &lt;/P&gt;&lt;P&gt;DELIVERY_DATE = 03.12.2002 &lt;/P&gt;&lt;P&gt;QUANTITY = 5.000 &lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;SCHED_LINE = 0003 &lt;/P&gt;&lt;P&gt;DELIVERY_DATE = 04.12.2002 &lt;/P&gt;&lt;P&gt;QUANTITY = 4.000 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POSCHEDULEX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;SCHED_LINE = 0001 &lt;/P&gt;&lt;P&gt;PO_ITEMX = X &lt;/P&gt;&lt;P&gt;SCHED_LINEX = X &lt;/P&gt;&lt;P&gt;DELIVERY_DATE = X &lt;/P&gt;&lt;P&gt;QUANTITY = X &lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;SCHED_LINE = 0002 &lt;/P&gt;&lt;P&gt;PO_ITEMX = X &lt;/P&gt;&lt;P&gt;SCHED_LINEX = X &lt;/P&gt;&lt;P&gt;DELIVERY_DATE = X &lt;/P&gt;&lt;P&gt;QUANTITY = X &lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;SCHED_LINE = 0003 &lt;/P&gt;&lt;P&gt;PO_ITEMX = X &lt;/P&gt;&lt;P&gt;SCHED_LINEX = X &lt;/P&gt;&lt;P&gt;DELIVERY_DATE = X &lt;/P&gt;&lt;P&gt;QUANTITY = X &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POACCOUNT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;SERIAL_NO = 01 &lt;/P&gt;&lt;P&gt;QUANTITY = 15.000 &lt;/P&gt;&lt;P&gt;GL_ACCOUNT = 0000400000 &lt;/P&gt;&lt;P&gt;COSTCENTER = 0000001000 &lt;/P&gt;&lt;P&gt;CO_AREA = 1000 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POACCOUNTX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;SERIAL_NO = 01 &lt;/P&gt;&lt;P&gt;QUANTITY = X &lt;/P&gt;&lt;P&gt;GL_ACCOUNT = X &lt;/P&gt;&lt;P&gt;COSTCENTER = X &lt;/P&gt;&lt;P&gt;CO_AREA = X &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POCOND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITM_NUMBER = 000001 &lt;/P&gt;&lt;P&gt;COND_ST_NO = 001 &lt;/P&gt;&lt;P&gt;COND_TYPE = PB00 &lt;/P&gt;&lt;P&gt;COND_VALUE = 79.900000000 &lt;/P&gt;&lt;P&gt;CURRENCY = EUR &lt;/P&gt;&lt;P&gt;CURRENCY_ISO = EUR &lt;/P&gt;&lt;P&gt;COND_UNIT = KG &lt;/P&gt;&lt;P&gt;COND_P_UNT = 1 &lt;/P&gt;&lt;P&gt;CHANGE_ID = U &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POCONDX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITM_NUMBER =  000001 &lt;/P&gt;&lt;P&gt;COND_ST_NO =  000 &lt;/P&gt;&lt;P&gt;ITM_NUMBERX =  X &lt;/P&gt;&lt;P&gt;COND_TYPE =  X &lt;/P&gt;&lt;P&gt;COND_VALUE =  X &lt;/P&gt;&lt;P&gt;CURRENCY =  X &lt;/P&gt;&lt;P&gt;CHANGE_ID =  X &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POPARTNER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARTNERDESC =  OA &lt;/P&gt;&lt;P&gt;LANGU =  EN &lt;/P&gt;&lt;P&gt;BUSPARTNO =  0000001100 &lt;/P&gt;&lt;P&gt;PARTNERDESC =  GS &lt;/P&gt;&lt;P&gt;LANGU =  EN &lt;/P&gt;&lt;P&gt;BUSPARTNO =  0000001200 &lt;/P&gt;&lt;P&gt;PARTNERDESC =  PI &lt;/P&gt;&lt;P&gt;LANGU =  EN &lt;/P&gt;&lt;P&gt;BUSPARTNO =  0000001000 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help in the Case of Problems&lt;/P&gt;&lt;P&gt;SAP Note 197958 lists answers to frequently asked questions (FAQs). (Note 499626 contains answers to FAQs relating specifically to External Services Management.)&lt;/P&gt;&lt;P&gt;If you have detected an error in the function of a BAPI, create a reproducible example in the test data directory in the Function Builder (transaction code SE37). SAP Note 375886 tells you how to do this.&lt;/P&gt;&lt;P&gt;If the problem persists, create a Customer Problem Message for the componente MM-PUR-PO-BAPI, and document the reproducible example where appropriate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Customer Enhancements&lt;/P&gt;&lt;P&gt;The following customer exits (function modules) are available for the BAPI BAPI_PO_CREATE1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXIT_SAPL2012_001 (at start of BAPI)&lt;/P&gt;&lt;P&gt;EXIT_SAPL2012_003 (at end of BAPI)&lt;/P&gt;&lt;P&gt;The following customer exits (function modules) are available for the BAPI BAPI_PO_CHANGE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXIT_SAPL2012_002 (at start of BAPI)&lt;/P&gt;&lt;P&gt;EXIT_SAPL2012_004 (at end of BAPI)&lt;/P&gt;&lt;P&gt;These exits belong to the enhancement SAPL2012 (see also transaction codes SMOD and CMOD).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is also the option of populating customers' own fields for header, item, or account assignment data via the parameter EXTENSIONIN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further information&lt;/P&gt;&lt;P&gt;Further information on purchase order BAPIs is available in SAP Note 197958.&lt;/P&gt;&lt;P&gt;If you test the BAPIs BAPI_PO_CREATE1 or BAPI_PO_CHANGE in the Function Builder (transaction code SE37), no database updates will be carried out. If you need this function, take a look at Note 420646.&lt;/P&gt;&lt;P&gt;The BAPI BAPI_PO_GETDETAIL serves to read the details of a purchase order. The BAPI cannot read all details (e.g. conditions). However, you can use the BAPI BAPI_PO_CHANGE for this purpose if just the document number is populated and the invoker has change authorizations for purchase orders.&lt;/P&gt;&lt;P&gt;Frequently used BAPIs for purchase orders are BAPI_PO_CREATE, BAPI_PO_CREATE1, BAPI_PO_CHANGE, BAPI_PO_GETDETAIL, BAPI_PO_GETITEMS, BAPI_PO_GETITEMSREL, and BAPI_PO_GETRELINFO.&lt;/P&gt;&lt;P&gt;For more information on purchase orders, refer to the SAP library (under MM Purchasing -&amp;gt; Purchase Orders) or the Help for the Enjoy Purchase Order, or choose the path Tools -&amp;gt; ABAP Workbench -&amp;gt; Overview -&amp;gt; BAPI Explorer from the SAP Easy Access menu.&lt;/P&gt;&lt;P&gt;Parameters&lt;/P&gt;&lt;P&gt;POHEADER&lt;/P&gt;&lt;P&gt;POHEADERX&lt;/P&gt;&lt;P&gt;POADDRVENDOR&lt;/P&gt;&lt;P&gt;TESTRUN&lt;/P&gt;&lt;P&gt;MEMORY_UNCOMPLETE&lt;/P&gt;&lt;P&gt;MEMORY_COMPLETE&lt;/P&gt;&lt;P&gt;POEXPIMPHEADER&lt;/P&gt;&lt;P&gt;POEXPIMPHEADERX&lt;/P&gt;&lt;P&gt;VERSIONS&lt;/P&gt;&lt;P&gt;NO_MESSAGING&lt;/P&gt;&lt;P&gt;NO_MESSAGE_REQ&lt;/P&gt;&lt;P&gt;NO_AUTHORITY&lt;/P&gt;&lt;P&gt;NO_PRICE_FROM_PO&lt;/P&gt;&lt;P&gt;EXPPURCHASEORDER&lt;/P&gt;&lt;P&gt;EXPHEADER&lt;/P&gt;&lt;P&gt;EXPPOEXPIMPHEADER&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;POITEM&lt;/P&gt;&lt;P&gt;POITEMX&lt;/P&gt;&lt;P&gt;POADDRDELIVERY&lt;/P&gt;&lt;P&gt;POSCHEDULE&lt;/P&gt;&lt;P&gt;POSCHEDULEX&lt;/P&gt;&lt;P&gt;POACCOUNT&lt;/P&gt;&lt;P&gt;POACCOUNTPROFITSEGMENT&lt;/P&gt;&lt;P&gt;POACCOUNTX&lt;/P&gt;&lt;P&gt;POCONDHEADER&lt;/P&gt;&lt;P&gt;POCONDHEADERX&lt;/P&gt;&lt;P&gt;POCOND&lt;/P&gt;&lt;P&gt;POCONDX&lt;/P&gt;&lt;P&gt;POLIMITS&lt;/P&gt;&lt;P&gt;POCONTRACTLIMITS&lt;/P&gt;&lt;P&gt;POSERVICES&lt;/P&gt;&lt;P&gt;POSRVACCESSVALUES&lt;/P&gt;&lt;P&gt;POSERVICESTEXT&lt;/P&gt;&lt;P&gt;EXTENSIONIN&lt;/P&gt;&lt;P&gt;EXTENSIONOUT&lt;/P&gt;&lt;P&gt;POEXPIMPITEM&lt;/P&gt;&lt;P&gt;POEXPIMPITEMX&lt;/P&gt;&lt;P&gt;POTEXTHEADER&lt;/P&gt;&lt;P&gt;POTEXTITEM&lt;/P&gt;&lt;P&gt;ALLVERSIONS&lt;/P&gt;&lt;P&gt;POPARTNER&lt;/P&gt;&lt;P&gt;POCOMPONENTS&lt;/P&gt;&lt;P&gt;POCOMPONENTSX&lt;/P&gt;&lt;P&gt;POSHIPPING&lt;/P&gt;&lt;P&gt;POSHIPPINGX&lt;/P&gt;&lt;P&gt;POSHIPPINGEXP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward pts if found usefull:)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sathish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jul 2007 07:20:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-11T07:20:41Z</dc:date>
    <item>
      <title>Using BAPI_PO_CREATE to create a PO with reference to another PO/item</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-bapi-po-create-to-create-a-po-with-reference-to-another-po-item/m-p/2505824#M566432</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;I am trying to use the BAPI_PO_CREATE to create a PO with reference to another PO/item.  So far I have not found a way to make this work.  I can see that you can do this in ME21, but not sure if the bapi can do this too.  We are in 4.6C, so I have to use this bapi instead of BAPI_PO_CREATE1.  Any help would be appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Kristina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 21:07:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-bapi-po-create-to-create-a-po-with-reference-to-another-po-item/m-p/2505824#M566432</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T21:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using BAPI_PO_CREATE to create a PO with reference to another PO/item</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-bapi-po-create-to-create-a-po-with-reference-to-another-po-item/m-p/2505825#M566433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check with below FM :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ME_CREATE_DOCUMENT ,if you need example code check with where used list&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 22:53:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-bapi-po-create-to-create-a-po-with-reference-to-another-po-item/m-p/2505825#M566433</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T22:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using BAPI_PO_CREATE to create a PO with reference to another PO/item</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-bapi-po-create-to-create-a-po-with-reference-to-another-po-item/m-p/2505826#M566434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kristina,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   you can check this bapi information below: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Short Text&lt;/P&gt;&lt;P&gt;Create Purchase Order&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Functionality&lt;/P&gt;&lt;P&gt;Function module BAPI_PO_CREATE1 enables you to create purchase orders. The BAPI uses the technology behind the Enjoy purchase order transaction ( ME21N).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, the IDoc type PORDCR1 is available. The data from this IDoc automatically populates the interface parameters of the function module BAPI_PO_CREATE1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Functionality in Detail&lt;/P&gt;&lt;P&gt;Authorization&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following authorization objects are checked when an Enjoy purchase order is created (activity 01):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M_BEST_BSA (document type in PO)&lt;/P&gt;&lt;P&gt;M_BEST_EKG (purchasing group in PO)&lt;/P&gt;&lt;P&gt;M_BEST_EKO (purchasing organization in PO)&lt;/P&gt;&lt;P&gt;M_BEST_WRK (plant in PO)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Controlling adoption of field values via X parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For most tables, you can determine via your own parameters in the associated X parameter in each case (e.g. PoItemX) whether fields are to be set initial, values inserted via the interface, or default values adopted (e.g. from Customizing or master records) (for example, it is not mandatory to adopt the material group from an underlying purchase requisition - you can change it with the BAPI).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transfer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Header data&lt;/P&gt;&lt;P&gt;The header data of the Enjoy purchase order is transferred in the table PoHeader.&lt;/P&gt;&lt;P&gt;Item data&lt;/P&gt;&lt;P&gt;The item data of the Enjoy purchase order is stored in the table PoItem (general item data). The delivery schedule lines are stored in the table PoSchedule.&lt;/P&gt;&lt;P&gt;Use the table PoAccount to specify the account assignment information. If account assignments have been specified for services and limits, you show the relevant account assignment line in PoAccount in the table PoSrvAccessValues via the package number of the service or the limit.&lt;/P&gt;&lt;P&gt;Services and limits&lt;/P&gt;&lt;P&gt;Services, free limits and limits with contract reference can be specified in the tables PoServices, PoLimits, and PoContractLimits.&lt;/P&gt;&lt;P&gt;Conditions&lt;/P&gt;&lt;P&gt;Conditions are transferred in the table PoCond; header conditions in the table PoCondHeader. Price determination is reinitiated via the parameter CALCTYPE in the table PoItem.&lt;/P&gt;&lt;P&gt;Vendor and delivery address&lt;/P&gt;&lt;P&gt;The vendor's address can be specified individually in the table PoAddrVendor; the delivery address in the table PoAddrDelivery. If you do not make any individual specification, the fields will be populated via the central address management facility.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note&lt;/P&gt;&lt;P&gt;In this method, the following restrictions apply with regard to addresses:&lt;/P&gt;&lt;P&gt;Addresses can only be created with this method - they cannot be changed. You can only change address data with the method BAPI_ADDRESSORG_CHANGE.&lt;/P&gt;&lt;P&gt;When you create addresses, they are not checked by the method. An Enjoy purchase order may therefore contain faulty address data.&lt;/P&gt;&lt;P&gt;Partner roles&lt;/P&gt;&lt;P&gt;The partners can be maintained individually via the table PoPartner (with the exception of the partner role "vendor").&lt;/P&gt;&lt;P&gt;Import/export data&lt;/P&gt;&lt;P&gt;Import/Export data can be specified per item in the table PoExpImpItem. Foreign trade data can only be transferred as default data for new items.&lt;/P&gt;&lt;P&gt;Texts&lt;/P&gt;&lt;P&gt;Header and item texts can be transferred in the tables PoTextHeader and PoTextItem. Texts for services are imported in the table PoServicesText.&lt;/P&gt;&lt;P&gt;Version Management&lt;/P&gt;&lt;P&gt;You can make use of the Version Management facility via the table AllVersions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Return&lt;/P&gt;&lt;P&gt;The PO number is returned in the parameter ExpPurchaseOrder. In addition, all information except the service and export/import tables is placed in the output structures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Return messages&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Messages are returned in the parameter Return. This also contains information as to whether interface data has been wrongly or probably wrongly (heuristical interface check) populated. When a PO has been created successfully, the PO number is also placed in the return table with the appropriate message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Restrictions&lt;/P&gt;&lt;P&gt;With this function module, it is not possible to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create subcontracting components (you can only use existing ones)&lt;/P&gt;&lt;P&gt;Create configurations (you can only use existing ones)&lt;/P&gt;&lt;P&gt;Change message records (table NAST) and additional message data (this data can only be determined via the message determination facility (Customizing))&lt;/P&gt;&lt;P&gt;Attach documents to the purchase order&lt;/P&gt;&lt;P&gt;See also further information in SAP Note 197958.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;Example of population of BAPI interface in the Function Builder&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POHEADER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMP_CODE = 1000 &lt;/P&gt;&lt;P&gt;DOC_TYPE = NB &lt;/P&gt;&lt;P&gt;ITEM_INTVL = 00001 &lt;/P&gt;&lt;P&gt;VENDOR = 0000001000 &lt;/P&gt;&lt;P&gt;PMNTTRMS = 0001 &lt;/P&gt;&lt;P&gt;PURCH_ORG = 1000 &lt;/P&gt;&lt;P&gt;PUR_GROUP = 001 &lt;/P&gt;&lt;P&gt;CURRENCY = EUR &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POHEADERX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMP_CODE = X &lt;/P&gt;&lt;P&gt;DOC_TYPE = X &lt;/P&gt;&lt;P&gt;ITEM_INTVL = X &lt;/P&gt;&lt;P&gt;VENDOR = X &lt;/P&gt;&lt;P&gt;PMNTTRMS = X &lt;/P&gt;&lt;P&gt;PURCH_ORG = X &lt;/P&gt;&lt;P&gt;PUR_GROUP = X &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POITEM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;MATERIAL = 100-100 &lt;/P&gt;&lt;P&gt;PLANT = 1000 &lt;/P&gt;&lt;P&gt;STGE_LOC = 0001 &lt;/P&gt;&lt;P&gt;QUANTITY = 15.000 &lt;/P&gt;&lt;P&gt;TAX_CODE = V0 &lt;/P&gt;&lt;P&gt;ITEM_CAT = 0 &lt;/P&gt;&lt;P&gt;ACCTASSCAT = K &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POITEMX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;MATERIAL = X &lt;/P&gt;&lt;P&gt;PLANT = X &lt;/P&gt;&lt;P&gt;STGE_LOC = X &lt;/P&gt;&lt;P&gt;QUANTITY = X &lt;/P&gt;&lt;P&gt;TAX_CODE = X &lt;/P&gt;&lt;P&gt;ITEM_CAT = X &lt;/P&gt;&lt;P&gt;ACCTASSCAT = X &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POSCHEDULE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;SCHED_LINE = 0001 &lt;/P&gt;&lt;P&gt;DELIVERY_DATE = 02.12.2002 &lt;/P&gt;&lt;P&gt;QUANTITY = 6.000 &lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;SCHED_LINE = 0002 &lt;/P&gt;&lt;P&gt;DELIVERY_DATE = 03.12.2002 &lt;/P&gt;&lt;P&gt;QUANTITY = 5.000 &lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;SCHED_LINE = 0003 &lt;/P&gt;&lt;P&gt;DELIVERY_DATE = 04.12.2002 &lt;/P&gt;&lt;P&gt;QUANTITY = 4.000 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POSCHEDULEX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;SCHED_LINE = 0001 &lt;/P&gt;&lt;P&gt;PO_ITEMX = X &lt;/P&gt;&lt;P&gt;SCHED_LINEX = X &lt;/P&gt;&lt;P&gt;DELIVERY_DATE = X &lt;/P&gt;&lt;P&gt;QUANTITY = X &lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;SCHED_LINE = 0002 &lt;/P&gt;&lt;P&gt;PO_ITEMX = X &lt;/P&gt;&lt;P&gt;SCHED_LINEX = X &lt;/P&gt;&lt;P&gt;DELIVERY_DATE = X &lt;/P&gt;&lt;P&gt;QUANTITY = X &lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;SCHED_LINE = 0003 &lt;/P&gt;&lt;P&gt;PO_ITEMX = X &lt;/P&gt;&lt;P&gt;SCHED_LINEX = X &lt;/P&gt;&lt;P&gt;DELIVERY_DATE = X &lt;/P&gt;&lt;P&gt;QUANTITY = X &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POACCOUNT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;SERIAL_NO = 01 &lt;/P&gt;&lt;P&gt;QUANTITY = 15.000 &lt;/P&gt;&lt;P&gt;GL_ACCOUNT = 0000400000 &lt;/P&gt;&lt;P&gt;COSTCENTER = 0000001000 &lt;/P&gt;&lt;P&gt;CO_AREA = 1000 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POACCOUNTX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PO_ITEM = 00001 &lt;/P&gt;&lt;P&gt;SERIAL_NO = 01 &lt;/P&gt;&lt;P&gt;QUANTITY = X &lt;/P&gt;&lt;P&gt;GL_ACCOUNT = X &lt;/P&gt;&lt;P&gt;COSTCENTER = X &lt;/P&gt;&lt;P&gt;CO_AREA = X &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POCOND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITM_NUMBER = 000001 &lt;/P&gt;&lt;P&gt;COND_ST_NO = 001 &lt;/P&gt;&lt;P&gt;COND_TYPE = PB00 &lt;/P&gt;&lt;P&gt;COND_VALUE = 79.900000000 &lt;/P&gt;&lt;P&gt;CURRENCY = EUR &lt;/P&gt;&lt;P&gt;CURRENCY_ISO = EUR &lt;/P&gt;&lt;P&gt;COND_UNIT = KG &lt;/P&gt;&lt;P&gt;COND_P_UNT = 1 &lt;/P&gt;&lt;P&gt;CHANGE_ID = U &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POCONDX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITM_NUMBER =  000001 &lt;/P&gt;&lt;P&gt;COND_ST_NO =  000 &lt;/P&gt;&lt;P&gt;ITM_NUMBERX =  X &lt;/P&gt;&lt;P&gt;COND_TYPE =  X &lt;/P&gt;&lt;P&gt;COND_VALUE =  X &lt;/P&gt;&lt;P&gt;CURRENCY =  X &lt;/P&gt;&lt;P&gt;CHANGE_ID =  X &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameter: POPARTNER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARTNERDESC =  OA &lt;/P&gt;&lt;P&gt;LANGU =  EN &lt;/P&gt;&lt;P&gt;BUSPARTNO =  0000001100 &lt;/P&gt;&lt;P&gt;PARTNERDESC =  GS &lt;/P&gt;&lt;P&gt;LANGU =  EN &lt;/P&gt;&lt;P&gt;BUSPARTNO =  0000001200 &lt;/P&gt;&lt;P&gt;PARTNERDESC =  PI &lt;/P&gt;&lt;P&gt;LANGU =  EN &lt;/P&gt;&lt;P&gt;BUSPARTNO =  0000001000 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help in the Case of Problems&lt;/P&gt;&lt;P&gt;SAP Note 197958 lists answers to frequently asked questions (FAQs). (Note 499626 contains answers to FAQs relating specifically to External Services Management.)&lt;/P&gt;&lt;P&gt;If you have detected an error in the function of a BAPI, create a reproducible example in the test data directory in the Function Builder (transaction code SE37). SAP Note 375886 tells you how to do this.&lt;/P&gt;&lt;P&gt;If the problem persists, create a Customer Problem Message for the componente MM-PUR-PO-BAPI, and document the reproducible example where appropriate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Customer Enhancements&lt;/P&gt;&lt;P&gt;The following customer exits (function modules) are available for the BAPI BAPI_PO_CREATE1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXIT_SAPL2012_001 (at start of BAPI)&lt;/P&gt;&lt;P&gt;EXIT_SAPL2012_003 (at end of BAPI)&lt;/P&gt;&lt;P&gt;The following customer exits (function modules) are available for the BAPI BAPI_PO_CHANGE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXIT_SAPL2012_002 (at start of BAPI)&lt;/P&gt;&lt;P&gt;EXIT_SAPL2012_004 (at end of BAPI)&lt;/P&gt;&lt;P&gt;These exits belong to the enhancement SAPL2012 (see also transaction codes SMOD and CMOD).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is also the option of populating customers' own fields for header, item, or account assignment data via the parameter EXTENSIONIN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further information&lt;/P&gt;&lt;P&gt;Further information on purchase order BAPIs is available in SAP Note 197958.&lt;/P&gt;&lt;P&gt;If you test the BAPIs BAPI_PO_CREATE1 or BAPI_PO_CHANGE in the Function Builder (transaction code SE37), no database updates will be carried out. If you need this function, take a look at Note 420646.&lt;/P&gt;&lt;P&gt;The BAPI BAPI_PO_GETDETAIL serves to read the details of a purchase order. The BAPI cannot read all details (e.g. conditions). However, you can use the BAPI BAPI_PO_CHANGE for this purpose if just the document number is populated and the invoker has change authorizations for purchase orders.&lt;/P&gt;&lt;P&gt;Frequently used BAPIs for purchase orders are BAPI_PO_CREATE, BAPI_PO_CREATE1, BAPI_PO_CHANGE, BAPI_PO_GETDETAIL, BAPI_PO_GETITEMS, BAPI_PO_GETITEMSREL, and BAPI_PO_GETRELINFO.&lt;/P&gt;&lt;P&gt;For more information on purchase orders, refer to the SAP library (under MM Purchasing -&amp;gt; Purchase Orders) or the Help for the Enjoy Purchase Order, or choose the path Tools -&amp;gt; ABAP Workbench -&amp;gt; Overview -&amp;gt; BAPI Explorer from the SAP Easy Access menu.&lt;/P&gt;&lt;P&gt;Parameters&lt;/P&gt;&lt;P&gt;POHEADER&lt;/P&gt;&lt;P&gt;POHEADERX&lt;/P&gt;&lt;P&gt;POADDRVENDOR&lt;/P&gt;&lt;P&gt;TESTRUN&lt;/P&gt;&lt;P&gt;MEMORY_UNCOMPLETE&lt;/P&gt;&lt;P&gt;MEMORY_COMPLETE&lt;/P&gt;&lt;P&gt;POEXPIMPHEADER&lt;/P&gt;&lt;P&gt;POEXPIMPHEADERX&lt;/P&gt;&lt;P&gt;VERSIONS&lt;/P&gt;&lt;P&gt;NO_MESSAGING&lt;/P&gt;&lt;P&gt;NO_MESSAGE_REQ&lt;/P&gt;&lt;P&gt;NO_AUTHORITY&lt;/P&gt;&lt;P&gt;NO_PRICE_FROM_PO&lt;/P&gt;&lt;P&gt;EXPPURCHASEORDER&lt;/P&gt;&lt;P&gt;EXPHEADER&lt;/P&gt;&lt;P&gt;EXPPOEXPIMPHEADER&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;POITEM&lt;/P&gt;&lt;P&gt;POITEMX&lt;/P&gt;&lt;P&gt;POADDRDELIVERY&lt;/P&gt;&lt;P&gt;POSCHEDULE&lt;/P&gt;&lt;P&gt;POSCHEDULEX&lt;/P&gt;&lt;P&gt;POACCOUNT&lt;/P&gt;&lt;P&gt;POACCOUNTPROFITSEGMENT&lt;/P&gt;&lt;P&gt;POACCOUNTX&lt;/P&gt;&lt;P&gt;POCONDHEADER&lt;/P&gt;&lt;P&gt;POCONDHEADERX&lt;/P&gt;&lt;P&gt;POCOND&lt;/P&gt;&lt;P&gt;POCONDX&lt;/P&gt;&lt;P&gt;POLIMITS&lt;/P&gt;&lt;P&gt;POCONTRACTLIMITS&lt;/P&gt;&lt;P&gt;POSERVICES&lt;/P&gt;&lt;P&gt;POSRVACCESSVALUES&lt;/P&gt;&lt;P&gt;POSERVICESTEXT&lt;/P&gt;&lt;P&gt;EXTENSIONIN&lt;/P&gt;&lt;P&gt;EXTENSIONOUT&lt;/P&gt;&lt;P&gt;POEXPIMPITEM&lt;/P&gt;&lt;P&gt;POEXPIMPITEMX&lt;/P&gt;&lt;P&gt;POTEXTHEADER&lt;/P&gt;&lt;P&gt;POTEXTITEM&lt;/P&gt;&lt;P&gt;ALLVERSIONS&lt;/P&gt;&lt;P&gt;POPARTNER&lt;/P&gt;&lt;P&gt;POCOMPONENTS&lt;/P&gt;&lt;P&gt;POCOMPONENTSX&lt;/P&gt;&lt;P&gt;POSHIPPING&lt;/P&gt;&lt;P&gt;POSHIPPINGX&lt;/P&gt;&lt;P&gt;POSHIPPINGEXP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward pts if found usefull:)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sathish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2007 07:20:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-bapi-po-create-to-create-a-po-with-reference-to-another-po-item/m-p/2505826#M566434</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-11T07:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using BAPI_PO_CREATE to create a PO with reference to another PO/item</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-bapi-po-create-to-create-a-po-with-reference-to-another-po-item/m-p/2505827#M566435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your replies!  As for the first option, I can not use ME_CREATE_DOCUMENT because it is not a released function on our system, plus I don't think this function has any copy with reference capability, or if it does, I do not know how to make that work.  As for the second option, I can not use BAPI_PO_CREATE1, as this is not a released function on our system.  I can only use BAPI_PO_CREATE on our system, and I do not know if this bapi has copy capabilities and if it does I don't know how to invoke it.....any help on this would be appreciated.  I have read the function documentation, and it did not help me in this regard.  Any additional help you have is very much appreciated.  Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2007 16:12:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-bapi-po-create-to-create-a-po-with-reference-to-another-po-item/m-p/2505827#M566435</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-11T16:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using BAPI_PO_CREATE to create a PO with reference to another PO/item</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-bapi-po-create-to-create-a-po-with-reference-to-another-po-item/m-p/2505828#M566436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I give you an example. It works well...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZMM_CARGA_PEDIDOS_CS&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  zmm_carga_pedidos_cs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            L O G   D E   M O D I F I C A C I O N E S&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES:&lt;/P&gt;&lt;P&gt;  ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                  tipos y variables                                  *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: t_items      LIKE bapiekpo   OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      t_items_app  LIKE bapiekpo   OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      t_items_tx   LIKE bapiekpotx OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      t_header     LIKE bapiekkol,&lt;/P&gt;&lt;P&gt;      t_header_app LIKE bapiekkol  OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      t_header_tx  LIKE bapiekkotx OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      t_linea      LIKE tline OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      t_extent     LIKE bapiparex OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      t_extent_app LIKE bapi_te_po_header OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      t_history    LIKE bapiekbes OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      t_return     LIKE bapiret2 OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: po_header    LIKE bapimepoheader,&lt;/P&gt;&lt;P&gt;      po_headerx   LIKE bapimepoheaderx,&lt;/P&gt;&lt;P&gt;      po_items     LIKE bapimepoitem OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      po_itemx     LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      poschedule   LIKE bapimeposchedule OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      poschedulex  LIKE bapimeposchedulx OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      poaccount    LIKE bapimepoaccount OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      poaccountx   LIKE bapimepoaccountx OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      po_business_partner LIKE bapiekkop OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      t_txt_h      LIKE bapimepotextheader OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      po_cond      LIKE bapimepocond OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      po_condx     LIKE bapimepocondx OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      po_hcond     LIKE bapimepocondheader OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      po_hcondx    LIKE bapimepocondheaderx OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF t_sched_app OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE bapieket.&lt;/P&gt;&lt;P&gt;DATA:   ebeln TYPE ebeln.&lt;/P&gt;&lt;P&gt;DATA: END OF t_sched_app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF t_account_app OCCURS 0.&lt;/P&gt;&lt;P&gt;DATA:   ebeln TYPE ebeln.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE bapiekkn.&lt;/P&gt;&lt;P&gt;DATA: END OF t_account_app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF t_condic OCCURS 0.&lt;/P&gt;&lt;P&gt;DATA:   ebeln TYPE ebeln.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE konv.&lt;/P&gt;&lt;P&gt;DATA: END OF t_condic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS: slis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF t_log OCCURS 0,&lt;/P&gt;&lt;P&gt;        lights,&lt;/P&gt;&lt;P&gt;        ebeln LIKE ekko-ebeln,&lt;/P&gt;&lt;P&gt;        bsart LIKE ekko-bsart,&lt;/P&gt;&lt;P&gt;        bukrs LIKE ekko-bukrs,&lt;/P&gt;&lt;P&gt;        werks LIKE ekpo-werks,&lt;/P&gt;&lt;P&gt;        mensg LIKE t_return-message,&lt;/P&gt;&lt;P&gt;        anter LIKE ekko-ebeln,&lt;/P&gt;&lt;P&gt;END OF t_log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF t_aux OCCURS 0,&lt;/P&gt;&lt;P&gt;        pos LIKE konv-kposn,&lt;/P&gt;&lt;P&gt;      END OF t_aux.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  gt_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;  gs_layout   TYPE slis_layout_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA c_ebeln LIKE ekko-ebeln.&lt;/P&gt;&lt;P&gt;DATA l_append.&lt;/P&gt;&lt;P&gt;DATA l_anter LIKE ekko-ebeln.&lt;/P&gt;&lt;P&gt;DATA w_borrar.&lt;/P&gt;&lt;P&gt;DATA w_modif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Parametros de seleccion&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK 0001 WITH FRAME.&lt;/P&gt;&lt;P&gt;PARAMETERS:&lt;/P&gt;&lt;P&gt;  fecha LIKE ekko-bedat OBLIGATORY.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK 0001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK 0002 WITH FRAME.&lt;/P&gt;&lt;P&gt;PARAMETERS:&lt;/P&gt;&lt;P&gt;  file_h(128) OBLIGATORY LOWER CASE,&lt;/P&gt;&lt;P&gt;  file_i(128) OBLIGATORY LOWER CASE,&lt;/P&gt;&lt;P&gt;  file_e(128) OBLIGATORY LOWER CASE,&lt;/P&gt;&lt;P&gt;  file_c(128) OBLIGATORY LOWER CASE,&lt;/P&gt;&lt;P&gt;  file_p(128) OBLIGATORY LOWER CASE,&lt;/P&gt;&lt;P&gt;  file_k(128) OBLIGATORY LOWER CASE,&lt;/P&gt;&lt;P&gt;  file_a(128) OBLIGATORY LOWER CASE,&lt;/P&gt;&lt;P&gt;  file_s(128) OBLIGATORY LOWER CASE.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK 0002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR file_h.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      file_name     = file_h&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      mask_too_long = 1&lt;/P&gt;&lt;P&gt;      OTHERS        = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR file_i.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      file_name     = file_i&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      mask_too_long = 1&lt;/P&gt;&lt;P&gt;      OTHERS        = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR file_e.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      file_name     = file_e&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      mask_too_long = 1&lt;/P&gt;&lt;P&gt;      OTHERS        = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR file_c.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      file_name     = file_c&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      mask_too_long = 1&lt;/P&gt;&lt;P&gt;      OTHERS        = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR file_p.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      file_name     = file_p&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      mask_too_long = 1&lt;/P&gt;&lt;P&gt;      OTHERS        = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR file_s.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      file_name     = file_s&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      mask_too_long = 1&lt;/P&gt;&lt;P&gt;      OTHERS        = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR file_k.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      file_name     = file_k&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      mask_too_long = 1&lt;/P&gt;&lt;P&gt;      OTHERS        = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR file_a.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      file_name     = file_a&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      mask_too_long = 1&lt;/P&gt;&lt;P&gt;      OTHERS        = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Inicio del Programa&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PERFORM upload_files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT t_header_app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM condiciones.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM separar_tablas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM extensiones.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_anter = po_header-po_number.&lt;/P&gt;&lt;P&gt;    CLEAR po_header-po_number.&lt;/P&gt;&lt;P&gt;    CLEAR c_ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BAPI_PO_CREATE1'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        poheader         = po_header&lt;/P&gt;&lt;P&gt;        poheaderx        = po_headerx&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        exppurchaseorder = c_ebeln&lt;/P&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;P&gt;        return           = t_return&lt;/P&gt;&lt;P&gt;        poitem           = po_items&lt;/P&gt;&lt;P&gt;        poitemx          = po_itemx&lt;/P&gt;&lt;P&gt;        poschedule       = poschedule&lt;/P&gt;&lt;P&gt;        poschedulex      = poschedulex&lt;/P&gt;&lt;P&gt;        poaccount        = poaccount&lt;/P&gt;&lt;P&gt;        poaccountx       = poaccountx&lt;/P&gt;&lt;P&gt;        pocond           = po_cond&lt;/P&gt;&lt;P&gt;        pocondx          = po_condx&lt;/P&gt;&lt;P&gt;        extensionin      = t_extent&lt;/P&gt;&lt;P&gt;        potextheader     = t_txt_h&lt;/P&gt;&lt;P&gt;        potextitem       = t_items_tx&lt;/P&gt;&lt;P&gt;        popartner        = po_business_partner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT t_return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CASE t_return-type.&lt;/P&gt;&lt;P&gt;        WHEN 'E'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         IF t_return-id NE 'BAPI' AND t_return-id NE 'MEPO'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.&lt;/P&gt;&lt;P&gt;            MOVE 1 TO t_log-lights.&lt;/P&gt;&lt;P&gt;            t_log-ebeln = c_ebeln.&lt;/P&gt;&lt;P&gt;            t_log-bsart = t_header_app-doc_type.&lt;/P&gt;&lt;P&gt;            t_log-bukrs = t_header_app-co_code.&lt;/P&gt;&lt;P&gt;            t_log-werks = po_items-plant.&lt;/P&gt;&lt;P&gt;            t_log-mensg = t_return-message.&lt;/P&gt;&lt;P&gt;            t_log-anter = l_anter.&lt;/P&gt;&lt;P&gt;            APPEND t_log.&lt;/P&gt;&lt;P&gt;            CLEAR l_append.&lt;/P&gt;&lt;P&gt;            EXIT.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       WHEN 'W'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         IF t_return-message CS 'La ctd.pedido'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           w_modif = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           MOVE 3 TO t_log-lights.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           t_log-ebeln = c_ebeln.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           t_log-bsart = t_header_app-doc_type.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           t_log-bukrs = t_header_app-co_code.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           t_log-werks = po_items-plant.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           t_log-mensg = text-000.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           t_log-anter = l_anter.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           l_append = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         ELSE.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           MOVE 3 TO t_log-lights.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           t_log-ebeln = c_ebeln.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           t_log-bsart = t_header_app-doc_type.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           t_log-bukrs = t_header_app-co_code.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           t_log-werks = po_items-plant.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           t_log-mensg = text-000.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           t_log-anter = l_anter.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           l_append = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        WHEN OTHERS.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         IF t_return-message CS 'El precio neto'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          w_modif = 'X'.&lt;/P&gt;&lt;P&gt;          MOVE 3 TO t_log-lights.&lt;/P&gt;&lt;P&gt;          t_log-ebeln = c_ebeln.&lt;/P&gt;&lt;P&gt;          t_log-bsart = t_header_app-doc_type.&lt;/P&gt;&lt;P&gt;          t_log-bukrs = t_header_app-co_code.&lt;/P&gt;&lt;P&gt;          t_log-werks = po_items-plant.&lt;/P&gt;&lt;P&gt;          t_log-mensg = text-000.&lt;/P&gt;&lt;P&gt;          t_log-anter = l_anter.&lt;/P&gt;&lt;P&gt;          l_append = 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF l_append EQ 'X'.&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          wait = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      APPEND t_log.&lt;/P&gt;&lt;P&gt;      CLEAR l_append.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF w_modif = 'X'. "Cambio aquellos campos que cambian automaticamente&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM separar_tablas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      PERFORM formato_2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      po_header-po_number = c_ebeln.&lt;/P&gt;&lt;P&gt;      po_headerx-po_number = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'BAPI_PO_CHANGE'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          purchaseorder = c_ebeln&lt;/P&gt;&lt;P&gt;          poheader      = po_header&lt;/P&gt;&lt;P&gt;          poheaderx     = po_headerx&lt;/P&gt;&lt;P&gt;        TABLES&lt;/P&gt;&lt;P&gt;          return        = t_return&lt;/P&gt;&lt;P&gt;          poitem        = po_items&lt;/P&gt;&lt;P&gt;          poitemx       = po_itemx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      LOOP AT t_return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CASE t_return-type.&lt;/P&gt;&lt;P&gt;          WHEN 'E'.&lt;/P&gt;&lt;P&gt;            CLEAR l_append.&lt;/P&gt;&lt;P&gt;            CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.&lt;/P&gt;&lt;P&gt;            EXIT.&lt;/P&gt;&lt;P&gt;          WHEN OTHERS.&lt;/P&gt;&lt;P&gt;            l_append = 'X'.&lt;/P&gt;&lt;P&gt;        ENDCASE.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF l_append EQ 'X'.&lt;/P&gt;&lt;P&gt;        CLEAR l_append.&lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            wait = 'X'.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; PERFORM textos. "Probar que la BAPI lo haga bien&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PERFORM imprime_log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------" /&gt;&lt;P&gt;FIN DEL PROGRAMA----&lt;/P&gt;&lt;HR originaltext="------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  UPLOAD_FILES&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM upload_files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      filename                = file_h&lt;/P&gt;&lt;P&gt;      filetype                = 'DAT'&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      data_tab                = t_header_app&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      conversion_error        = 1&lt;/P&gt;&lt;P&gt;      file_open_error         = 2&lt;/P&gt;&lt;P&gt;      file_read_error         = 3&lt;/P&gt;&lt;P&gt;      invalid_type            = 4&lt;/P&gt;&lt;P&gt;      no_batch                = 5&lt;/P&gt;&lt;P&gt;      unknown_error           = 6&lt;/P&gt;&lt;P&gt;      invalid_table_width     = 7&lt;/P&gt;&lt;P&gt;      gui_refuse_filetransfer = 8&lt;/P&gt;&lt;P&gt;      customer_error          = 9&lt;/P&gt;&lt;P&gt;      no_authority            = 10&lt;/P&gt;&lt;P&gt;      OTHERS                  = 11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      filename                = file_a&lt;/P&gt;&lt;P&gt;      filetype                = 'DAT'&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      data_tab                = t_account_app&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      conversion_error        = 1&lt;/P&gt;&lt;P&gt;      file_open_error         = 2&lt;/P&gt;&lt;P&gt;      file_read_error         = 3&lt;/P&gt;&lt;P&gt;      invalid_type            = 4&lt;/P&gt;&lt;P&gt;      no_batch                = 5&lt;/P&gt;&lt;P&gt;      unknown_error           = 6&lt;/P&gt;&lt;P&gt;      invalid_table_width     = 7&lt;/P&gt;&lt;P&gt;      gui_refuse_filetransfer = 8&lt;/P&gt;&lt;P&gt;      customer_error          = 9&lt;/P&gt;&lt;P&gt;      no_authority            = 10&lt;/P&gt;&lt;P&gt;      OTHERS                  = 11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      filename                = file_i&lt;/P&gt;&lt;P&gt;      filetype                = 'DAT'&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      data_tab                = t_items_app&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      conversion_error        = 1&lt;/P&gt;&lt;P&gt;      file_open_error         = 2&lt;/P&gt;&lt;P&gt;      file_read_error         = 3&lt;/P&gt;&lt;P&gt;      invalid_type            = 4&lt;/P&gt;&lt;P&gt;      no_batch                = 5&lt;/P&gt;&lt;P&gt;      unknown_error           = 6&lt;/P&gt;&lt;P&gt;      invalid_table_width     = 7&lt;/P&gt;&lt;P&gt;      gui_refuse_filetransfer = 8&lt;/P&gt;&lt;P&gt;      customer_error          = 9&lt;/P&gt;&lt;P&gt;      no_authority            = 10&lt;/P&gt;&lt;P&gt;      OTHERS                  = 11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      filename                = file_e&lt;/P&gt;&lt;P&gt;      filetype                = 'DAT'&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      data_tab                = t_extent_app&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      conversion_error        = 1&lt;/P&gt;&lt;P&gt;      file_open_error         = 2&lt;/P&gt;&lt;P&gt;      file_read_error         = 3&lt;/P&gt;&lt;P&gt;      invalid_type            = 4&lt;/P&gt;&lt;P&gt;      no_batch                = 5&lt;/P&gt;&lt;P&gt;      unknown_error           = 6&lt;/P&gt;&lt;P&gt;      invalid_table_width     = 7&lt;/P&gt;&lt;P&gt;      gui_refuse_filetransfer = 8&lt;/P&gt;&lt;P&gt;      customer_error          = 9&lt;/P&gt;&lt;P&gt;      no_authority            = 10&lt;/P&gt;&lt;P&gt;      OTHERS                  = 11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      filename                = file_c&lt;/P&gt;&lt;P&gt;      filetype                = 'DAT'&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      data_tab                = t_header_tx&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      conversion_error        = 1&lt;/P&gt;&lt;P&gt;      file_open_error         = 2&lt;/P&gt;&lt;P&gt;      file_read_error         = 3&lt;/P&gt;&lt;P&gt;      invalid_type            = 4&lt;/P&gt;&lt;P&gt;      no_batch                = 5&lt;/P&gt;&lt;P&gt;      unknown_error           = 6&lt;/P&gt;&lt;P&gt;      invalid_table_width     = 7&lt;/P&gt;&lt;P&gt;      gui_refuse_filetransfer = 8&lt;/P&gt;&lt;P&gt;      customer_error          = 9&lt;/P&gt;&lt;P&gt;      no_authority            = 10&lt;/P&gt;&lt;P&gt;      OTHERS                  = 11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      filename                = file_p&lt;/P&gt;&lt;P&gt;      filetype                = 'DAT'&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      data_tab                = t_items_tx&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      conversion_error        = 1&lt;/P&gt;&lt;P&gt;      file_open_error         = 2&lt;/P&gt;&lt;P&gt;      file_read_error         = 3&lt;/P&gt;&lt;P&gt;      invalid_type            = 4&lt;/P&gt;&lt;P&gt;      no_batch                = 5&lt;/P&gt;&lt;P&gt;      unknown_error           = 6&lt;/P&gt;&lt;P&gt;      invalid_table_width     = 7&lt;/P&gt;&lt;P&gt;      gui_refuse_filetransfer = 8&lt;/P&gt;&lt;P&gt;      customer_error          = 9&lt;/P&gt;&lt;P&gt;      no_authority            = 10&lt;/P&gt;&lt;P&gt;      OTHERS                  = 11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      filename                = file_s&lt;/P&gt;&lt;P&gt;      filetype                = 'DAT'&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      data_tab                = t_sched_app&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      conversion_error        = 1&lt;/P&gt;&lt;P&gt;      file_open_error         = 2&lt;/P&gt;&lt;P&gt;      file_read_error         = 3&lt;/P&gt;&lt;P&gt;      invalid_type            = 4&lt;/P&gt;&lt;P&gt;      no_batch                = 5&lt;/P&gt;&lt;P&gt;      unknown_error           = 6&lt;/P&gt;&lt;P&gt;      invalid_table_width     = 7&lt;/P&gt;&lt;P&gt;      gui_refuse_filetransfer = 8&lt;/P&gt;&lt;P&gt;      customer_error          = 9&lt;/P&gt;&lt;P&gt;      no_authority            = 10&lt;/P&gt;&lt;P&gt;      OTHERS                  = 11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      filename                = file_k&lt;/P&gt;&lt;P&gt;      filetype                = 'DAT'&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      data_tab                = t_condic&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      conversion_error        = 1&lt;/P&gt;&lt;P&gt;      file_open_error         = 2&lt;/P&gt;&lt;P&gt;      file_read_error         = 3&lt;/P&gt;&lt;P&gt;      invalid_type            = 4&lt;/P&gt;&lt;P&gt;      no_batch                = 5&lt;/P&gt;&lt;P&gt;      unknown_error           = 6&lt;/P&gt;&lt;P&gt;      invalid_table_width     = 7&lt;/P&gt;&lt;P&gt;      gui_refuse_filetransfer = 8&lt;/P&gt;&lt;P&gt;      customer_error          = 9&lt;/P&gt;&lt;P&gt;      no_authority            = 10&lt;/P&gt;&lt;P&gt;      OTHERS                  = 11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " UPLOAD_FILES&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  SEPARAR_TABLAS&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM separar_tablas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA l_itm_number LIKE po_cond-itm_number.&lt;/P&gt;&lt;P&gt;  DATA l_cond_type LIKE po_cond-cond_type.&lt;/P&gt;&lt;P&gt;  DATA l_change_id LIKE po_cond-change_id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Datos de Cabecera&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  po_header-po_number =   t_header_app-po_number.&lt;/P&gt;&lt;P&gt;  po_header-comp_code =   t_header_app-co_code.&lt;/P&gt;&lt;P&gt;  po_header-doc_type =    t_header_app-doc_type.&lt;/P&gt;&lt;P&gt;  po_header-delete_ind =  t_header_app-delete_ind.&lt;/P&gt;&lt;P&gt;  po_header-status =      t_header_app-status.&lt;/P&gt;&lt;P&gt;  po_header-creat_date =  t_header_app-created_on.&lt;/P&gt;&lt;P&gt;  po_header-created_by =  t_header_app-created_by.&lt;/P&gt;&lt;P&gt;  po_header-item_intvl =  t_header_app-item_intvl.&lt;/P&gt;&lt;P&gt;  po_header-vendor =      t_header_app-vendor.&lt;/P&gt;&lt;P&gt;  po_header-langu =       t_header_app-language.&lt;/P&gt;&lt;P&gt;  po_header-pmnttrms =    t_header_app-pmnttrms.&lt;/P&gt;&lt;P&gt;  po_header-dscnt1_to =   t_header_app-dscnt1_to.&lt;/P&gt;&lt;P&gt;  po_header-dscnt2_to =   t_header_app-dscnt2_to.&lt;/P&gt;&lt;P&gt;  po_header-dscnt3_to =   t_header_app-dscnt3_to.&lt;/P&gt;&lt;P&gt;  po_header-dsct_pct1 =   t_header_app-cash_disc1.&lt;/P&gt;&lt;P&gt;  po_header-dsct_pct2 =   t_header_app-cash_disc2.&lt;/P&gt;&lt;P&gt;  po_header-purch_org =   t_header_app-purch_org.&lt;/P&gt;&lt;P&gt;  po_header-pur_group =   t_header_app-pur_group.&lt;/P&gt;&lt;P&gt;  po_header-currency =    t_header_app-currency.&lt;/P&gt;&lt;P&gt;  po_header-exch_rate =   t_header_app-exch_rate.&lt;/P&gt;&lt;P&gt;  po_header-ex_rate_fx =  t_header_app-ex_rate_fx.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; po_header-doc_date =    t_header_app-doc_date.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  po_header-doc_date = fecha.&lt;/P&gt;&lt;P&gt;  po_header-vper_start =  t_header_app-vper_start.&lt;/P&gt;&lt;P&gt;  po_header-vper_end =    t_header_app-vper_end.&lt;/P&gt;&lt;P&gt;  po_header-warranty =    t_header_app-warranty.&lt;/P&gt;&lt;P&gt;  po_header-quotation =   t_header_app-quotation.&lt;/P&gt;&lt;P&gt;  po_header-quot_date =   t_header_app-quot_dead.&lt;/P&gt;&lt;P&gt;  po_header-ref_1 =       t_header_app-ref_1.&lt;/P&gt;&lt;P&gt;  po_header-sales_pers =  t_header_app-sales_pers.&lt;/P&gt;&lt;P&gt;  po_header-telephone =   t_header_app-telephone.&lt;/P&gt;&lt;P&gt;  po_header-suppl_vend =  t_header_app-suppl_vend.&lt;/P&gt;&lt;P&gt;  po_header-customer =    t_header_app-customer.&lt;/P&gt;&lt;P&gt;  po_header-agreement =   t_header_app-agreement.&lt;/P&gt;&lt;P&gt;  po_header-gr_message =  t_header_app-gr_message.&lt;/P&gt;&lt;P&gt;  po_header-suppl_plnt =  t_header_app-suppl_plnt.&lt;/P&gt;&lt;P&gt;  po_header-incoterms1 =  t_header_app-incoterms1.&lt;/P&gt;&lt;P&gt;  po_header-incoterms2 =  t_header_app-incoterms2.&lt;/P&gt;&lt;P&gt;  po_header-collect_no =  t_header_app-coll_no.&lt;/P&gt;&lt;P&gt;  po_header-diff_inv =    t_header_app-diff_inv.&lt;/P&gt;&lt;P&gt;  po_header-our_ref =     t_header_app-our_ref.&lt;/P&gt;&lt;P&gt;  po_header-logsystem =   t_header_app-logsystem.&lt;/P&gt;&lt;P&gt;  po_header-subitemint =  t_header_app-subitemint.&lt;/P&gt;&lt;P&gt;  po_header-po_rel_ind =  t_header_app-rel_ind.&lt;/P&gt;&lt;P&gt;  po_header-rel_status =  t_header_app-rel_status.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  po_headerx-po_number =  'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-comp_code =  'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-doc_type =   'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-delete_ind = 'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-status =     'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-creat_date = 'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-created_by = 'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-item_intvl = 'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-vendor =     'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-langu =      'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-pmnttrms =   'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-dscnt1_to =  'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-dscnt2_to =  'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-dscnt3_to =  'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-dsct_pct1 =  'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-dsct_pct2 =  'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-purch_org =  'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-pur_group =  'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-currency =   'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-exch_rate =  'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-ex_rate_fx = 'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-doc_date =   'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-vper_start = 'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-vper_end =   'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-warranty =   'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-quotation =  'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-quot_date =  'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-ref_1 =      'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-sales_pers = 'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-telephone =  'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-suppl_vend = 'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-customer =   'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-agreement =  'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-gr_message = 'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-suppl_plnt = 'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-incoterms1 = 'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-incoterms2 = 'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-collect_no = 'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-diff_inv =   'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-our_ref =    'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-logsystem =  'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-subitemint = 'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-po_rel_ind = 'X'.&lt;/P&gt;&lt;P&gt;  po_headerx-rel_status = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Datos de Posiciones&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT t_items_app WHERE po_number EQ t_header_app-po_number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   PO_ITEMS-PO_PRICE = ' '.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    po_items-po_item =       t_items_app-po_item.&lt;/P&gt;&lt;P&gt;    po_items-delete_ind =    t_items_app-delete_ind.&lt;/P&gt;&lt;P&gt;    po_items-short_text =    t_items_app-short_text.&lt;/P&gt;&lt;P&gt;    po_items-material =      t_items_app-material.&lt;/P&gt;&lt;P&gt;    po_items-ematerial =     t_items_app-pur_mat.&lt;/P&gt;&lt;P&gt;    po_items-plant =         t_items_app-plant.&lt;/P&gt;&lt;P&gt;    po_items-stge_loc =      t_items_app-store_loc.&lt;/P&gt;&lt;P&gt;    po_items-trackingno =    t_items_app-trackingno.&lt;/P&gt;&lt;P&gt;    po_items-matl_group =    t_items_app-mat_grp.&lt;/P&gt;&lt;P&gt;    po_items-info_rec =      t_items_app-info_rec.&lt;/P&gt;&lt;P&gt;    po_items-vend_mat =      t_items_app-vend_mat.&lt;/P&gt;&lt;P&gt;    po_items-quantity =      t_items_app-quantity.&lt;/P&gt;&lt;P&gt;    po_items-po_unit =       t_items_app-unit.&lt;/P&gt;&lt;P&gt;    po_items-orderpr_un =    t_items_app-orderpr_un.&lt;/P&gt;&lt;P&gt;    po_items-conv_num1 =     t_items_app-conv_num1.&lt;/P&gt;&lt;P&gt;    po_items-conv_den1 =     t_items_app-conv_den1.&lt;/P&gt;&lt;P&gt;    po_items-net_price =     t_items_app-net_price.&lt;/P&gt;&lt;P&gt;    po_items-price_unit =    t_items_app-price_unit.&lt;/P&gt;&lt;P&gt;    po_items-gr_pr_time =    t_items_app-gr_pr_time.&lt;/P&gt;&lt;P&gt;    IF t_items_app-tax_code IS INITIAL.&lt;/P&gt;&lt;P&gt;      t_items_app-tax_code = 'U0'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    po_items-tax_code =      t_items_app-tax_code.&lt;/P&gt;&lt;P&gt;    po_items-bon_grp1 =      t_items_app-sett_grp1.&lt;/P&gt;&lt;P&gt;    po_items-qual_insp =     t_items_app-qual_insp.&lt;/P&gt;&lt;P&gt;    po_items-info_upd =      t_items_app-info_upd.&lt;/P&gt;&lt;P&gt;    po_items-prnt_price =    t_items_app-prnt_price.&lt;/P&gt;&lt;P&gt;    po_items-est_price =     t_items_app-est_price.&lt;/P&gt;&lt;P&gt;    po_items-reminder1 =     t_items_app-reminder1.&lt;/P&gt;&lt;P&gt;    po_items-reminder2 =     t_items_app-reminder2.&lt;/P&gt;&lt;P&gt;    po_items-reminder3 =     t_items_app-reminder3.&lt;/P&gt;&lt;P&gt;    po_items-over_dlv_tol =  t_items_app-overdeltol.&lt;/P&gt;&lt;P&gt;    po_items-unlimited_dlv = t_items_app-unlimited.&lt;/P&gt;&lt;P&gt;    po_items-under_dlv_tol = t_items_app-under_tol.&lt;/P&gt;&lt;P&gt;    po_items-val_type =      t_items_app-val_type.&lt;/P&gt;&lt;P&gt;    po_items-no_more_gr =    t_items_app-del_compl.&lt;/P&gt;&lt;P&gt;    po_items-final_inv =     t_items_app-final_inv.&lt;/P&gt;&lt;P&gt;    po_items-item_cat =      t_items_app-item_cat.&lt;/P&gt;&lt;P&gt;    po_items-acctasscat =    t_items_app-acctasscat.&lt;/P&gt;&lt;P&gt;    po_items-distrib =       t_items_app-distrib.&lt;/P&gt;&lt;P&gt;    po_items-part_inv =      t_items_app-part_inv.&lt;/P&gt;&lt;P&gt;    po_items-gr_ind =        t_items_app-gr_ind.&lt;/P&gt;&lt;P&gt;    po_items-gr_non_val =    t_items_app-gr_non_val.&lt;/P&gt;&lt;P&gt;    po_items-ir_ind =        t_items_app-ir_ind.&lt;/P&gt;&lt;P&gt;    po_items-gr_basediv =    t_items_app-gr_basediv.&lt;/P&gt;&lt;P&gt;    po_items-ackn_reqd =     t_items_app-ackn_reqd.&lt;/P&gt;&lt;P&gt;    po_items-acknowl_no =    t_items_app-acknowl_no.&lt;/P&gt;&lt;P&gt;    po_items-agreement =     t_items_app-agreement.&lt;/P&gt;&lt;P&gt;    po_items-agmt_item =     t_items_app-agmt_item.&lt;/P&gt;&lt;P&gt;    po_items-shipping =      t_items_app-shipping.&lt;/P&gt;&lt;P&gt;    po_items-customer =      t_items_app-customer.&lt;/P&gt;&lt;P&gt;    po_items-cond_group =    t_items_app-cond_group.&lt;/P&gt;&lt;P&gt;    po_items-no_disct =      t_items_app-no_c_disc.&lt;/P&gt;&lt;P&gt;    po_items-plan_del =      t_items_app-plan_del.&lt;/P&gt;&lt;P&gt;    po_items-net_weight =    t_items_app-net_weight.&lt;/P&gt;&lt;P&gt;    po_items-weightunit =    t_items_app-weightunit.&lt;/P&gt;&lt;P&gt;    po_items-weightunit_iso = t_items_app-weightunit_iso.&lt;/P&gt;&lt;P&gt;    po_items-taxjurcode =    t_items_app-tax_jur_cd.&lt;/P&gt;&lt;P&gt;    po_items-ctrl_key =      t_items_app-ctr_key_qm.&lt;/P&gt;&lt;P&gt;    po_items-conf_ctrl =     t_items_app-conf_ctrl.&lt;/P&gt;&lt;P&gt;    po_items-rev_lev =       t_items_app-rev_lev.&lt;/P&gt;&lt;P&gt;    po_items-fund =          t_items_app-fund.&lt;/P&gt;&lt;P&gt;    po_items-funds_ctr =     t_items_app-funds_ctr.&lt;/P&gt;&lt;P&gt;    po_items-cmmt_item =     t_items_app-cmmt_item.&lt;/P&gt;&lt;P&gt;    po_items-pricedate =     t_items_app-price_ctr.&lt;/P&gt;&lt;P&gt;    po_items-price_date =    t_items_app-price_date.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   PO_ITEMS-GROSS_WT = T_ITEMS_APP-GROSS_WGHT.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    po_items-volume =        t_items_app-volume.&lt;/P&gt;&lt;P&gt;    po_items-volumeunit =    t_items_app-volumeunit.&lt;/P&gt;&lt;P&gt;    po_items-volumeunit_iso = t_items_app-volumeunit_iso.&lt;/P&gt;&lt;P&gt;    po_items-incoterms1 =    t_items_app-incoterms1.&lt;/P&gt;&lt;P&gt;    po_items-incoterms2 =    t_items_app-incoterms2.&lt;/P&gt;&lt;P&gt;    po_items-pre_vendor =    t_items_app-prior_vend.&lt;/P&gt;&lt;P&gt;    po_items-vend_part =     t_items_app-sub_range.&lt;/P&gt;&lt;P&gt;    po_items-hl_item =       t_items_app-hl_item.&lt;/P&gt;&lt;P&gt;    po_items-gr_to_date =    t_items_app-gr_to_date.&lt;/P&gt;&lt;P&gt;    po_items-supp_vendor =   t_items_app-suppl_vend.&lt;/P&gt;&lt;P&gt;    po_items-sc_vendor =     t_items_app-sc_vendor.&lt;/P&gt;&lt;P&gt;    po_items-kanban_ind =    t_items_app-kanban_ind.&lt;/P&gt;&lt;P&gt;    po_items-ers =           t_items_app-ers.&lt;/P&gt;&lt;P&gt;    po_items-r_promo =       t_items_app-promotion.&lt;/P&gt;&lt;P&gt;    po_items-points =        t_items_app-points.&lt;/P&gt;&lt;P&gt;    po_items-point_unit =    t_items_app-points_un.&lt;/P&gt;&lt;P&gt;    po_items-point_unit_iso = t_items_app-points_un_iso.&lt;/P&gt;&lt;P&gt;    po_items-season =        t_items_app-season_ty.&lt;/P&gt;&lt;P&gt;    po_items-season_yr =     t_items_app-season_yr.&lt;/P&gt;&lt;P&gt;    po_items-bon_grp2 =      t_items_app-sett_grp_2.&lt;/P&gt;&lt;P&gt;    po_items-bon_grp3 =      t_items_app-sett_grp_3.&lt;/P&gt;&lt;P&gt;    po_items-sett_item =     t_items_app-sett_item.&lt;/P&gt;&lt;P&gt;    po_items-minremlife =    t_items_app-remshlife.&lt;/P&gt;&lt;P&gt;    po_items-rfq_no =        t_items_app-rfq.&lt;/P&gt;&lt;P&gt;    po_items-rfq_item =      t_items_app-rfq_item.&lt;/P&gt;&lt;P&gt;    po_items-preq_no =       t_items_app-config_org.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_items-preq_item =     t_items_app-preq_item.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    po_items-si_cat =        t_items_app-si_cat.&lt;/P&gt;&lt;P&gt;    po_items-ret_item =      t_items_app-ret_item.&lt;/P&gt;&lt;P&gt;    po_items-at_relev =      t_items_app-at_relev.&lt;/P&gt;&lt;P&gt;    po_items-order_reason =  t_items_app-ord_reas.&lt;/P&gt;&lt;P&gt;    po_items-int_obj_no =    t_items_app-del_typ_rt.&lt;/P&gt;&lt;P&gt;    po_items-pckg_no =       t_items_app-pckg_no.&lt;/P&gt;&lt;P&gt;    po_items-grant_nbr =     t_items_app-grant_nbr.&lt;/P&gt;&lt;P&gt;    po_items-cmmt_item_long = t_items_app-cmmt_item_long.&lt;/P&gt;&lt;P&gt;    po_items-func_area_long = t_items_app-func_area_long.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND po_items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   PO_ITEMX-PO_PRICE = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    po_itemx-po_item =       t_items_app-po_item.&lt;/P&gt;&lt;P&gt;    po_itemx-delete_ind =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-short_text =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-material =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-ematerial =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-plant =         'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-stge_loc =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-trackingno =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-matl_group =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-info_rec =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-vend_mat =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-quantity =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-po_unit =       'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-orderpr_un =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-conv_num1 =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-conv_den1 =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-net_price =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-price_unit =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-gr_pr_time =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-tax_code =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-bon_grp1 =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-qual_insp =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-info_upd =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-prnt_price =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-est_price =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-reminder1 =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-reminder2 =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-reminder3 =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-over_dlv_tol =  'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-unlimited_dlv = 'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-under_dlv_tol = 'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-val_type =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-no_more_gr =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-final_inv =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-item_cat =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-acctasscat =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-distrib =       'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-part_inv =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-gr_ind =        'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-gr_non_val =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-ir_ind =        'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-gr_basediv =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-ackn_reqd =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-acknowl_no =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-agreement =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-agmt_item =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-shipping =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-customer =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-cond_group =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-no_disct =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-plan_del =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-net_weight =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-weightunit =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-weightunit_iso = 'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-taxjurcode =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-ctrl_key =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-conf_ctrl =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-rev_lev =       'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-fund =          'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-funds_ctr =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-cmmt_item =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-pricedate =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-price_date =    'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   PO_ITEMX-GROSS_WT = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    po_itemx-volume =        'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-volumeunit =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-volumeunit_iso = 'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-incoterms1 =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-incoterms2 =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-pre_vendor =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-vend_part =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-hl_item =       'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-gr_to_date =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-supp_vendor =   'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-sc_vendor =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-kanban_ind =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-ers =           'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-r_promo =       'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-points =        'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-point_unit =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-point_unit_iso = 'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-season =        'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-season_yr =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-bon_grp2 =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-bon_grp3 =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-sett_item =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-minremlife =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-rfq_no =        'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-rfq_item =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-preq_no =       'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_itemx-preq_item =     'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    po_itemx-si_cat =        'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-ret_item =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-at_relev =      'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-order_reason =  'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-int_obj_no =    'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-pckg_no =       'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-grant_nbr =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-cmmt_item =     'X'.&lt;/P&gt;&lt;P&gt;    po_itemx-func_area_long = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND po_itemx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT t_sched_app WHERE ebeln EQ t_header_app-po_number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    poschedule-po_item =        t_sched_app-po_item.&lt;/P&gt;&lt;P&gt;    poschedule-sched_line =     t_sched_app-serial_no.&lt;/P&gt;&lt;P&gt;    poschedule-delivery_date =  t_sched_app-deliv_date.&lt;/P&gt;&lt;P&gt;    poschedule-quantity =       t_sched_app-quantity.&lt;/P&gt;&lt;P&gt;    poschedule-deliv_time =     t_sched_app-deliv_time.&lt;/P&gt;&lt;P&gt;    poschedule-preq_no =        t_sched_app-preq_no.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   poschedule-preq_item =      t_sched_app-preq_item.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   poschedule-del_datcat_ext = t_sched_app-del_datcat_ext.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND poschedule.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    poschedulex-po_item =        t_sched_app-po_item.&lt;/P&gt;&lt;P&gt;    poschedulex-sched_line =     t_sched_app-serial_no.&lt;/P&gt;&lt;P&gt;    poschedulex-delivery_date =  'X'.&lt;/P&gt;&lt;P&gt;    poschedulex-quantity =       'X'.&lt;/P&gt;&lt;P&gt;    poschedulex-deliv_time =     'X'.&lt;/P&gt;&lt;P&gt;    poschedulex-preq_no =        'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   poschedulex-preq_item =      'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   poschedulex-del_datcat_ext = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND poschedulex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT t_account_app WHERE ebeln EQ t_header_app-po_number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    poaccount-po_item =     t_account_app-po_item.&lt;/P&gt;&lt;P&gt;    poaccount-serial_no =   t_account_app-serial_no.&lt;/P&gt;&lt;P&gt;    poaccount-quantity =    t_account_app-quantity.&lt;/P&gt;&lt;P&gt;    poaccount-distr_perc =  t_account_app-distr_perc.&lt;/P&gt;&lt;P&gt;    poaccount-gl_account =  t_account_app-g_l_acct.&lt;/P&gt;&lt;P&gt;    poaccount-bus_area =    t_account_app-bus_area.&lt;/P&gt;&lt;P&gt;    poaccount-costcenter =  t_account_app-cost_ctr.&lt;/P&gt;&lt;P&gt;    poaccount-sd_doc =      t_account_app-sd_doc.&lt;/P&gt;&lt;P&gt;    poaccount-itm_number =  t_account_app-sdoc_item.&lt;/P&gt;&lt;P&gt;    poaccount-sched_line =  t_account_app-sched_line.&lt;/P&gt;&lt;P&gt;    poaccount-asset_no =    t_account_app-asset_no.&lt;/P&gt;&lt;P&gt;    poaccount-sub_number =  t_account_app-sub_number.&lt;/P&gt;&lt;P&gt;    poaccount-orderid =     t_account_app-order_no.&lt;/P&gt;&lt;P&gt;    poaccount-gr_rcpt =     t_account_app-gr_rcpt.&lt;/P&gt;&lt;P&gt;    poaccount-unload_pt =   t_account_app-unload_pt.&lt;/P&gt;&lt;P&gt;    poaccount-co_area =     t_account_app-co_area.&lt;/P&gt;&lt;P&gt;    poaccount-costobject =  t_account_app-cost_obj.&lt;/P&gt;&lt;P&gt;    poaccount-profit_ctr =  t_account_app-profit_ctr.&lt;/P&gt;&lt;P&gt;    poaccount-wbs_element = t_account_app-wbs_elem_e.&lt;/P&gt;&lt;P&gt;    poaccount-network =     t_account_app-network.&lt;/P&gt;&lt;P&gt;    poaccount-rl_est_key =  t_account_app-rl_est_key.&lt;/P&gt;&lt;P&gt;    poaccount-part_acct =   t_account_app-part_acct.&lt;/P&gt;&lt;P&gt;    poaccount-cmmt_item =   t_account_app-cmmt_item.&lt;/P&gt;&lt;P&gt;    poaccount-rec_ind =     t_account_app-rec_ind.&lt;/P&gt;&lt;P&gt;    poaccount-funds_ctr =   t_account_app-funds_ctr.&lt;/P&gt;&lt;P&gt;    poaccount-fund =        t_account_app-fund.&lt;/P&gt;&lt;P&gt;    poaccount-func_area =   t_account_app-func_area.&lt;/P&gt;&lt;P&gt;    poaccount-ref_date =    t_account_app-ref_date.&lt;/P&gt;&lt;P&gt;    poaccount-cmmt_item_long = t_account_app-cmmt_item_long.&lt;/P&gt;&lt;P&gt;    poaccount-func_area_long = t_account_app-func_area_long.&lt;/P&gt;&lt;P&gt;    poaccount-res_item =    t_account_app-res_item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE t_items_app WITH KEY po_number = t_account_app-ebeln&lt;/P&gt;&lt;P&gt;                                    po_item   = t_account_app-po_item.&lt;/P&gt;&lt;P&gt;    IF t_items_app-tax_code IS INITIAL.&lt;/P&gt;&lt;P&gt;      t_items_app-tax_code = 'U0'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    poaccount-tax_code = t_items_app-tax_code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND poaccount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    poaccountx-po_item =     t_account_app-po_item.&lt;/P&gt;&lt;P&gt;    poaccountx-serial_no =   t_account_app-serial_no.&lt;/P&gt;&lt;P&gt;    poaccountx-quantity =    'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-distr_perc =  'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-gl_account =  'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-bus_area =    'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-costcenter =  'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-sd_doc =      'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-itm_number =  'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-sched_line =  'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-asset_no =    'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-sub_number =  'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-orderid =     'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-gr_rcpt =     'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-unload_pt =   'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-co_area =     'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-costobject =  'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-profit_ctr =  'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-wbs_element = 'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-network =     'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-rl_est_key =  'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-part_acct =   'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-cmmt_item =   'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-rec_ind =     'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-funds_ctr =   'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-fund =        'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-func_area =   'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-ref_date =    'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-cmmt_item =   'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-func_area =   'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-res_item =    'X'.&lt;/P&gt;&lt;P&gt;    poaccountx-tax_code =    'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND poaccountx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT t_header_app-suppl_vend IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    po_business_partner-buspartno = t_header_app-suppl_vend.&lt;/P&gt;&lt;P&gt;    po_business_partner-partnerdesc = 'PM'.&lt;/P&gt;&lt;P&gt;    po_business_partner-langu = t_header_app-language.&lt;/P&gt;&lt;P&gt;    APPEND po_business_partner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT t_header_app-diff_inv IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    po_business_partner-buspartno = t_header_app-diff_inv.&lt;/P&gt;&lt;P&gt;    po_business_partner-partnerdesc = 'EF'.&lt;/P&gt;&lt;P&gt;    po_business_partner-langu = t_header_app-language.&lt;/P&gt;&lt;P&gt;    APPEND po_business_partner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Textos de Cabecera&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT t_header_tx.&lt;/P&gt;&lt;P&gt;    MOVE-CORRESPONDING t_header_tx TO t_txt_h.&lt;/P&gt;&lt;P&gt;    APPEND t_txt_h.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR w_borrar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Condiciones&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT t_condic WHERE ebeln EQ t_header_app-po_number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF t_condic-kschl EQ 'ZPB0'.&lt;/P&gt;&lt;P&gt;      w_borrar = 'X'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    t_aux-pos = t_condic-kposn.&lt;/P&gt;&lt;P&gt;    APPEND t_aux.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    po_cond-itm_number   = t_condic-kposn.&lt;/P&gt;&lt;P&gt;    po_cond-cond_type    = t_condic-kschl.&lt;/P&gt;&lt;P&gt;    po_cond-cond_value   = t_condic-kbetr.&lt;/P&gt;&lt;P&gt;    po_cond-currency     = t_condic-waers.&lt;/P&gt;&lt;P&gt;    po_cond-change_id    = 'I'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   PO_COND-COND_ST_NO = '007'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   PO_COND-COND_COUNT = '07'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   PO_COND-CONDISACTI = 'Y'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-condition_no = t_condic-knumv.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-cond_count   = t_condic-zaehk.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-cond_unit    = t_condic-kmein.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-cond_p_unt   = t_condic-kpein.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-applicatio   = t_condic-kappl.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-conpricdat   = t_condic-kdatu.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-calctypcon   = t_condic-krech.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-conbaseval   = t_condic-kawrt.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-conexchrat   = t_condic-kkurs.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-numconvert   = t_condic-kumza.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-denominato   = t_condic-kumne.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-condtype     = t_condic-kntyp.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-stat_con     = t_condic-kstat.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-scaletype    = t_condic-knprs.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-accruals     = t_condic-kruek.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-coninvolst   = t_condic-kreli.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-condorigin   = t_condic-kherk.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-groupcond    = t_condic-kgrpe.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-cond_updat   = t_condic-koupd.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-access_seq   = t_condic-kolnr.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-condcount    = t_condic-kopos.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-condcntrl    = t_condic-ksteu.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-condisacti   = t_condic-kinak.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-condclass    = t_condic-koaid.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-factbasval   = t_condic-kfaktor.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-scalebasin   = t_condic-kzbzg.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-scalbasval   = t_condic-kstbs.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-unitmeasur   = t_condic-konms.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-currenckey   = t_condic-konws.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-condincomp   = t_condic-kfkiv.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-condconfig   = t_condic-kvarc.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-condchaman   = t_condic-kmprs.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-cond_no      = t_condic-knumh.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_cond-vendor_no    = t_condic-lifnr.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND po_cond.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    po_condx-itm_number   = t_condic-kposn.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-cond_type    = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    po_condx-cond_value   = 'X'.&lt;/P&gt;&lt;P&gt;    po_condx-change_id    = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND po_condx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    po_condx-itm_number   = t_condic-kposn.&lt;/P&gt;&lt;P&gt;    po_condx-itm_numberx  = 'X'.&lt;/P&gt;&lt;P&gt;    po_condx-cond_type    = 'X'.&lt;/P&gt;&lt;P&gt;    po_condx-cond_value   = 'X'.&lt;/P&gt;&lt;P&gt;    po_condx-currency     = 'X'.&lt;/P&gt;&lt;P&gt;    po_condx-change_id    = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   PO_CONDX-COND_ST_NO = '007'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   PO_CONDX-COND_ST_NOX = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   PO_CONDX-COND_COUNT = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   PO_CONDX-CONDISACTI = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-condition_no = t_condic-knumv.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-condition_nox = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-cond_count   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-cond_unit    = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-cond_p_unt   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-applicatio   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-conpricdat   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-calctypcon   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-conbaseval   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-conexchrat   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-numconvert   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-denominato   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-condtype     = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-stat_con     = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-scaletype    = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-accruals     = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-coninvolst   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-condorigin   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-groupcond    = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-cond_updat   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-access_seq   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-condcount    = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-condcntrl    = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-condisacti   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-condclass    = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-factbasval   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-scalebasin   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-scalbasval   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-unitmeasur   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-currenckey   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-condincomp   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-condconfig   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-condchaman   = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-cond_no      = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   po_condx-vendor_no    = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND po_condx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF w_borrar EQ 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DELETE ADJACENT DUPLICATES FROM t_aux.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR po_cond.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT t_aux.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      po_cond-itm_number   = t_aux-pos.&lt;/P&gt;&lt;P&gt;      po_cond-cond_type    = 'PBXX'.&lt;/P&gt;&lt;P&gt;      po_cond-change_id    = 'D'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      APPEND po_cond.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR po_condx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT t_aux.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      po_condx-itm_number   = t_aux-pos.&lt;/P&gt;&lt;P&gt;      po_condx-cond_type    = 'X'.&lt;/P&gt;&lt;P&gt;      po_condx-change_id    = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      APPEND po_condx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " SEPARAR_TABLAS&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  CLEAR&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR po_header.&lt;/P&gt;&lt;P&gt;  CLEAR po_headerx.&lt;/P&gt;&lt;P&gt;  CLEAR po_items.    REFRESH po_items.&lt;/P&gt;&lt;P&gt;  CLEAR po_itemx.    REFRESH po_itemx.&lt;/P&gt;&lt;P&gt;  CLEAR poschedule.  REFRESH poschedule.&lt;/P&gt;&lt;P&gt;  CLEAR poschedulex. REFRESH poschedulex.&lt;/P&gt;&lt;P&gt;  CLEAR poaccount.   REFRESH poaccount.&lt;/P&gt;&lt;P&gt;  CLEAR poaccountx.  REFRESH poaccountx.&lt;/P&gt;&lt;P&gt;  CLEAR po_business_partner. REFRESH po_business_partner.&lt;/P&gt;&lt;P&gt;  CLEAR t_return.    REFRESH t_return.&lt;/P&gt;&lt;P&gt;  CLEAR t_txt_h.     REFRESH t_txt_h.&lt;/P&gt;&lt;P&gt;  CLEAR t_items_tx.  REFRESH t_items_tx.&lt;/P&gt;&lt;P&gt;  CLEAR po_cond.     REFRESH po_cond.&lt;/P&gt;&lt;P&gt;  CLEAR po_condx.    REFRESH po_condx.&lt;/P&gt;&lt;P&gt;  CLEAR po_hcond.    REFRESH po_hcond.&lt;/P&gt;&lt;P&gt;  CLEAR po_hcondx.   REFRESH po_hcondx.&lt;/P&gt;&lt;P&gt;  CLEAR t_aux.       REFRESH t_aux.&lt;/P&gt;&lt;P&gt;  CLEAR w_modif.&lt;/P&gt;&lt;P&gt;  CLEAR l_append.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " CLEAR&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  IMPRIME_LOG&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM imprime_log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PERFORM init_fieldcat.&lt;/P&gt;&lt;P&gt;  PERFORM init_layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SORT t_log BY lights.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      i_callback_program = sy-repid&lt;/P&gt;&lt;P&gt;      is_layout          = gs_layout&lt;/P&gt;&lt;P&gt;      it_fieldcat        = gt_fieldcat[]&lt;/P&gt;&lt;P&gt;      i_save             = 'A'&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      t_outtab           = t_log&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      program_error      = 1&lt;/P&gt;&lt;P&gt;      OTHERS             = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " IMPRIME_LOG&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  INIT_FIELDCAT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM init_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  gt_fieldcat-seltext_l = 'Pedido Anterior'.&lt;/P&gt;&lt;P&gt;  gt_fieldcat-fieldname = 'ANTER'.&lt;/P&gt;&lt;P&gt;  gt_fieldcat-ref_tabname = 'T_LOG'.&lt;/P&gt;&lt;P&gt;  APPEND gt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  gt_fieldcat-seltext_l = 'Nuevo Pedido'.&lt;/P&gt;&lt;P&gt;  gt_fieldcat-fieldname = 'EBELN'.&lt;/P&gt;&lt;P&gt;  gt_fieldcat-ref_tabname = 'T_LOG'.&lt;/P&gt;&lt;P&gt;  APPEND gt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  gt_fieldcat-seltext_l = 'Clase Doc. Compras'.&lt;/P&gt;&lt;P&gt;  gt_fieldcat-fieldname = 'BSART'.&lt;/P&gt;&lt;P&gt;  gt_fieldcat-ref_tabname = 'T_LOG'.&lt;/P&gt;&lt;P&gt;  APPEND gt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  gt_fieldcat-seltext_l = 'Sociedad'.&lt;/P&gt;&lt;P&gt;  gt_fieldcat-fieldname = 'BUKRS'.&lt;/P&gt;&lt;P&gt;  gt_fieldcat-ref_tabname = 'T_LOG'.&lt;/P&gt;&lt;P&gt;  APPEND gt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  gt_fieldcat-seltext_l = 'Centro'.&lt;/P&gt;&lt;P&gt;  gt_fieldcat-fieldname = 'WERKS'.&lt;/P&gt;&lt;P&gt;  gt_fieldcat-ref_tabname = 'T_LOG'.&lt;/P&gt;&lt;P&gt;  APPEND gt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  gt_fieldcat-seltext_l = 'Descripción del error'.&lt;/P&gt;&lt;P&gt;  gt_fieldcat-fieldname = 'MENSG'.&lt;/P&gt;&lt;P&gt;  gt_fieldcat-ref_tabname = 'T_LOG'.&lt;/P&gt;&lt;P&gt;  APPEND gt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " INIT_FIELDCAT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  INIT_LAYOUT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM init_layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Mediante esta estructura podemos definir el formato de salida&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  gs_layout-zebra = 'X'.&lt;/P&gt;&lt;P&gt;  gs_layout-f2code = '&amp;amp;amp;ETA'.&lt;/P&gt;&lt;P&gt;  gs_layout-detail_popup = 'X'.&lt;/P&gt;&lt;P&gt;  gs_layout-max_linesize = 80.&lt;/P&gt;&lt;P&gt;  gs_layout-window_titlebar = text-001.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;campos para el uso de Semaforos&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  gs_layout-lights_fieldname = 'LIGHTS'.&lt;/P&gt;&lt;P&gt;  gs_layout-lights_condense = 'X'.&lt;/P&gt;&lt;P&gt;  gs_layout-lights_rollname = 'ZECEP'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " INIT_LAYOUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  EXTENSIONES&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM extensiones.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  MOVE 'BAPI_TE_PO_HEADER' TO t_extent-structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT t_extent_app WHERE po_number EQ t_header_app-po_number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CONCATENATE&lt;/P&gt;&lt;P&gt;    t_extent_app-zterm t_extent_app-zbd1t&lt;/P&gt;&lt;P&gt;    t_extent_app-zbd1p t_extent_app-zbd2t&lt;/P&gt;&lt;P&gt;    t_extent_app-zbd2p t_extent_app-zbd3t&lt;/P&gt;&lt;P&gt;    INTO t_extent-valuepart1.&lt;/P&gt;&lt;P&gt;    APPEND t_extent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " EXTENSIONES&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  TEXTOS&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM textos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA e_head LIKE thead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT t_header_app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR e_head.&lt;/P&gt;&lt;P&gt;    CLEAR t_linea. REFRESH t_linea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT t_header_tx WHERE po_number EQ t_header_app-po_number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      AT FIRST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        e_head-tdobject = 'EKKO'.&lt;/P&gt;&lt;P&gt;        e_head-tdname = c_ebeln.&lt;/P&gt;&lt;P&gt;        e_head-tdspras = 'EN'.&lt;/P&gt;&lt;P&gt;        e_head-tdid = t_header_tx-text_id.&lt;/P&gt;&lt;P&gt;        e_head-tdversion = '00001'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      MOVE t_header_tx-text_form TO t_linea-tdformat.&lt;/P&gt;&lt;P&gt;      MOVE t_header_tx-text_line TO t_linea-tdline.&lt;/P&gt;&lt;P&gt;      APPEND t_linea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF NOT t_header_tx[] IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'SAVE_TEXT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          header          = e_head&lt;/P&gt;&lt;P&gt;          insert          = 'X'&lt;/P&gt;&lt;P&gt;          savemode_direct = 'X'&lt;/P&gt;&lt;P&gt;          owner_specified = 'X'&lt;/P&gt;&lt;P&gt;        TABLES&lt;/P&gt;&lt;P&gt;          lines           = t_linea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " TEXTOS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  condiciones&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM condiciones.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: BEGIN OF t_datos OCCURS 0,&lt;/P&gt;&lt;P&gt;          matnr LIKE eina-matnr,&lt;/P&gt;&lt;P&gt;          lifnr LIKE eina-lifnr,&lt;/P&gt;&lt;P&gt;          ekorg LIKE eine-ekorg,&lt;/P&gt;&lt;P&gt;          werks LIKE eine-werks,&lt;/P&gt;&lt;P&gt;          infnr LIKE eine-infnr,&lt;/P&gt;&lt;P&gt;        END OF t_datos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: BEGIN OF t_konp OCCURS 0,&lt;/P&gt;&lt;P&gt;           kschl LIKE konp-kschl,&lt;/P&gt;&lt;P&gt;        END OF t_konp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: BEGIN OF t_a017 OCCURS 0,&lt;/P&gt;&lt;P&gt;           knumh LIKE konp-knumh,&lt;/P&gt;&lt;P&gt;        END OF t_a017.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE t_items_app WITH KEY po_number = t_header_app-po_number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT t_items_app-info_rec IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT matnr lifnr infnr&lt;/P&gt;&lt;P&gt;      FROM eina&lt;/P&gt;&lt;P&gt;        INTO CORRESPONDING FIELDS OF TABLE t_datos&lt;/P&gt;&lt;P&gt;          WHERE matnr EQ t_items_app-material&lt;/P&gt;&lt;P&gt;            AND lifnr EQ t_header_app-vendor&lt;/P&gt;&lt;P&gt;            AND loekz NE 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT t_datos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SELECT SINGLE werks ekorg&lt;/P&gt;&lt;P&gt;        FROM eine&lt;/P&gt;&lt;P&gt;          INTO CORRESPONDING FIELDS OF t_datos&lt;/P&gt;&lt;P&gt;            WHERE infnr EQ t_datos-infnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      MODIFY t_datos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT knumh&lt;/P&gt;&lt;P&gt;      FROM a017&lt;/P&gt;&lt;P&gt;        INTO TABLE t_a017&lt;/P&gt;&lt;P&gt;        FOR ALL ENTRIES IN t_datos&lt;/P&gt;&lt;P&gt;          WHERE lifnr = t_datos-lifnr&lt;/P&gt;&lt;P&gt;            AND matnr = t_datos-matnr&lt;/P&gt;&lt;P&gt;            AND werks = t_datos-werks&lt;/P&gt;&lt;P&gt;            AND ekorg = t_datos-ekorg&lt;/P&gt;&lt;P&gt;            AND datbi &amp;gt;= po_header-doc_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT kschl&lt;/P&gt;&lt;P&gt;      FROM konp&lt;/P&gt;&lt;P&gt;        INTO TABLE t_konp&lt;/P&gt;&lt;P&gt;        FOR ALL ENTRIES IN t_a017&lt;/P&gt;&lt;P&gt;          WHERE knumh = t_a017-knumh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT t_konp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      LOOP AT t_condic WHERE kschl EQ t_konp-kschl&lt;/P&gt;&lt;P&gt;                         AND ebeln EQ t_header_app-po_number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        DELETE t_condic INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT t_condic WHERE ebeln EQ t_header_app-po_number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      DELETE t_condic INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR t_condic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " condiciones&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2007 15:29:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-bapi-po-create-to-create-a-po-with-reference-to-another-po-item/m-p/2505828#M566436</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-19T15:29:30Z</dc:date>
    </item>
  </channel>
</rss>

