<?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: Data upload in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-upload/m-p/2946421#M694630</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Vijji,&lt;/P&gt;&lt;P&gt;i am using upload function for uploading data from Flat file to Internal table but the control goes to Application Server I don't know why.?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just want to upload data from my local PC&lt;/P&gt;&lt;P&gt;Is there any default setting where i can set it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thankx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Oct 2007 06:53:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-15T06:53:21Z</dc:date>
    <item>
      <title>Data upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-upload/m-p/2946418#M694627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Sir,&lt;/P&gt;&lt;P&gt;I m working on APO,i just want to upload data into ZTables.(Data are available in Flat files )&lt;/P&gt;&lt;P&gt;How can i done this plese tell me all steps..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thankx in Advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 06:22:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-upload/m-p/2946418#M694627</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-15T06:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Data upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-upload/m-p/2946419#M694628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a BDC upload you need to write a program which created BDC sessions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steps: &lt;/P&gt;&lt;P&gt;1. Work out the transaction you would use to create the data manually. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Use transaction SHDB to record the creation of one material master data. &lt;/P&gt;&lt;P&gt;    Click the New recording button or the Menu - Recording - Create &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Save the recording, and then go back a screen and go to the overview. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Select the recording and click on Edit - Create Program. Give the program a Z name, and select transfer from recording. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. Edit the program. You will see that all the data you entered is hard-coded into the program. You need to make the following changes: &lt;/P&gt;&lt;P&gt;5.1 After the start-of-selection, Call ws_upload to upload the file (the excel file needs to be saved as TAB separated). &lt;/P&gt;&lt;P&gt;5.2 After the open-group, Loop on the uploaded data. For each line, perform validation checks on the data, then modify the perform bdc_field commands to use the file data. &lt;/P&gt;&lt;P&gt;5.3. After perform bdc_transaction, add the endloop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Execute the program. It will have options to create a batch session or to process directly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These are all my finds . Might be it will be useful to you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Direct call of transactions, session handling: &lt;/P&gt;&lt;P&gt;/nxxxx This terminates the current transaction, and starts transaction xxxx &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/n This terminates the transaction. This generally corresponds to pressing F15 to go back. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/nend This termiantes all separate sessions and logs off (corresponds to System - Logoff). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/nex This terminates all separate sessions and logs off immediately (without any warning!). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/oxxxx This opens a new session and starts transaction xxxx in This session. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/o This lists existing sessions and allows deletion or opening of a new session. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/i This terminates the current session (corresponds to System End &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/i1, /i2,... This terminates the session with the number given. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.xyzw Fast path: 'xyzw' refers to the underlined letters in the menus. This type of navigation is uncommon and is provided more for emergencies (such as a defective mouse). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Batch &lt;/P&gt;&lt;P&gt;The following commands can be entered in correction mode ('Process in foreground' or 'Display errors only') when processing a batch input session: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/n This terminates the current batch input transaction and characterizes it as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/bdel This deletes the current batch input transaction. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/bend This terminates batch input processing and sets the session to Failed &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/bda This switches from Display errors only to Process in foreground &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/bde This switches from Process in foreground to Display errors only &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP/4 &lt;/P&gt;&lt;P&gt;/h This switches into debugging mode. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/hs This switches into debugging mode and activates the debugging of system functions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Buffer &lt;/P&gt;&lt;P&gt;WARNING: Resetting buffers can significantly change the performance of the entire system for a long time. &lt;/P&gt;&lt;P&gt;It should therefore only be used where there is a good reason tdso. As of release 3.0B system administator authorization is required (authorization object (S_ADMI_FCD). The action is noted in the system log. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/$SYNC This resets all buffers of the application server &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/$CUA This resets the CUA buffer of the application server &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/$TAB This resets the TABLE buffers of the application server &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/$NAM This resets the nametab buffer of the application server &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/$DYNP This resets the screen buffer of the application server &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward points.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Gangula Vikram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 06:25:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-upload/m-p/2946419#M694628</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-15T06:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Data upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-upload/m-p/2946420#M694629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Arvind,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. First you have to down load the data from Flat file in to Internal table. For that you can use GUI_Download.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Then append the value from Internal table to Data base table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 06:29:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-upload/m-p/2946420#M694629</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-15T06:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Data upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-upload/m-p/2946421#M694630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Vijji,&lt;/P&gt;&lt;P&gt;i am using upload function for uploading data from Flat file to Internal table but the control goes to Application Server I don't know why.?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just want to upload data from my local PC&lt;/P&gt;&lt;P&gt;Is there any default setting where i can set it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thankx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 06:53:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-upload/m-p/2946421#M694630</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-15T06:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Data upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-upload/m-p/2946422#M694631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. First you have to down load the data from Flat file in to Internal table. For that you can use &amp;lt;i&amp;gt;&amp;lt;b&amp;gt;file_read_and_convert_sap_data&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Then append the value from Internal table to Data base table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 07:06:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-upload/m-p/2946422#M694631</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-15T07:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Data upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-upload/m-p/2946423#M694632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chek the below code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: /sapapo/matkey,&lt;/P&gt;&lt;P&gt;        /sapapo/loc.&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;                      TYPES                                          *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Structure for uploading the Flat file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TYPES : BEGIN OF t_upload,&lt;/P&gt;&lt;P&gt;        item           TYPE matnr,            "Material Number&lt;/P&gt;&lt;P&gt;        t(1)           TYPE c,                "Material Type&lt;/P&gt;&lt;P&gt;        description    TYPE maktx,            "Material Description&lt;/P&gt;&lt;P&gt;        lot            TYPE charg_d,          "Batch Number&lt;/P&gt;&lt;P&gt;        status         TYPE char1,            "Status&lt;/P&gt;&lt;P&gt;        quantity       TYPE /sapapo/cif_omng, "Quantity&lt;/P&gt;&lt;P&gt;        uom(3)         TYPE c,                "Base Unit of Measure&lt;/P&gt;&lt;P&gt;        bpcs_facility  TYPE char2,            "Version Number Component&lt;/P&gt;&lt;P&gt;        bpcs_wh        TYPE zbpcs_wh,         "BPCS Warehouse&lt;/P&gt;&lt;P&gt;        location       TYPE char6,            "Location&lt;/P&gt;&lt;P&gt;        exp_date       TYPE datum,            "Lot Expiration Date&lt;/P&gt;&lt;P&gt;        lot_create     TYPE datum,            "Lot Creation Date&lt;/P&gt;&lt;P&gt;        avl_date       TYPE datum,            "Lot Availability&lt;/P&gt;&lt;P&gt;        dpl_date       TYPE datum,            "Inventory 0 date&lt;/P&gt;&lt;P&gt;        END OF t_upload,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Structure for uploading the Flat file from app server&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        BEGIN OF t_file,&lt;/P&gt;&lt;P&gt;          text(500) TYPE c,                  "Flatfile&lt;/P&gt;&lt;P&gt;        END OF t_file,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Structure for data retrieval from db or from file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      BEGIN OF t_temp,&lt;/P&gt;&lt;P&gt;      mandt          TYPE mandt,               "Client&lt;/P&gt;&lt;P&gt;      id             TYPE int4,                "Unique ID&lt;/P&gt;&lt;P&gt;      item           TYPE /sapapo/matnr,       "Material Number&lt;/P&gt;&lt;P&gt;      lot            TYPE charg_d,             "Batch Number&lt;/P&gt;&lt;P&gt;      bpcs_facility  TYPE char2,               "Version Number Component&lt;/P&gt;&lt;P&gt;      bpcs_wh        TYPE zbpcs_wh,            "BPCS Warehouse&lt;/P&gt;&lt;P&gt;      location       TYPE char6,               "Location&lt;/P&gt;&lt;P&gt;      material_type  TYPE char1,               "Material Type&lt;/P&gt;&lt;P&gt;      description    TYPE maktx,               "Material Description&lt;/P&gt;&lt;P&gt;      status         TYPE char1,               "Status&lt;/P&gt;&lt;P&gt;      quantity       TYPE /sapapo/cif_omng,    "Quantity&lt;/P&gt;&lt;P&gt;      uom            TYPE /sapapo/meins,       "Base Unit of Measure&lt;/P&gt;&lt;P&gt;      exp_date       TYPE datum,               "Lot Expiration Date&lt;/P&gt;&lt;P&gt;      lot_create     TYPE datum,               "Lot Creation Date&lt;/P&gt;&lt;P&gt;      avl_date       TYPE datum,              "Lot Availability&lt;/P&gt;&lt;P&gt;      dpl_date       TYPE datum,              "Inventory 0 date&lt;/P&gt;&lt;P&gt;      END OF t_temp,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Structure for Material ID determination&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      BEGIN OF t_matid,&lt;/P&gt;&lt;P&gt;      matid TYPE /sapapo/matid,             "Internal number for product&lt;/P&gt;&lt;P&gt;      matnr TYPE /sapapo/matnr,             "Product ID&lt;/P&gt;&lt;P&gt;      END OF t_matid,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Structure for unit of measure&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      BEGIN OF t_msehi,&lt;/P&gt;&lt;P&gt;      matnr TYPE /sapapo/matnr,&lt;/P&gt;&lt;P&gt;      meins TYPE msehi,                    "Unit of Measurement&lt;/P&gt;&lt;P&gt;      meinh TYPE /sapapo/lrmei,&lt;/P&gt;&lt;P&gt;      umrez TYPE /sapapo/umrez,&lt;/P&gt;&lt;P&gt;      umren TYPE /sapapo/umren,&lt;/P&gt;&lt;P&gt;      END OF t_msehi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Declaration of table type&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; t_type TYPE STANDARD TABLE OF t_temp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_map,&lt;/P&gt;&lt;P&gt;        bpcs_facility       TYPE zbpcs_facility,&lt;/P&gt;&lt;P&gt;        bpcs_wh             TYPE zbpcs_wh,&lt;/P&gt;&lt;P&gt;        bpcs_location	 TYPE zbpcs_location,&lt;/P&gt;&lt;P&gt;        sap_plant           TYPE zsap_plant,&lt;/P&gt;&lt;P&gt;        description	       TYPE /sapapo/ret_text_generic,&lt;/P&gt;&lt;P&gt;       END OF t_map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_err_uom,&lt;/P&gt;&lt;P&gt;        matnr TYPE /sapapo/matnr,&lt;/P&gt;&lt;P&gt;        uom(3),&lt;/P&gt;&lt;P&gt;       END OF t_err_uom.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_err,&lt;/P&gt;&lt;P&gt;         matnr TYPE /sapapo/matnr,&lt;/P&gt;&lt;P&gt;         maktx TYPE /sapapo/maktx,&lt;/P&gt;&lt;P&gt;         charg          TYPE charg_d,             "Batch Number&lt;/P&gt;&lt;P&gt;         bpcs_facility  TYPE char2,&lt;/P&gt;&lt;P&gt;         bpcs_wh        TYPE zbpcs_wh,&lt;/P&gt;&lt;P&gt;         location       TYPE char6,&lt;/P&gt;&lt;P&gt;         quantity       TYPE /sapapo/cif_omng,&lt;/P&gt;&lt;P&gt;         uom(3),&lt;/P&gt;&lt;P&gt;         msg(117),&lt;/P&gt;&lt;P&gt;       END OF t_err.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;                  INTERNAL TABLE DECLARATION                         *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA :&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for uploading the Flat file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       i_upload             TYPE STANDARD TABLE OF t_upload,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for data retrieval from db or from file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       i_temp               TYPE STANDARD TABLE OF t_temp,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for receipts(used in BAPI_POSRVAPS_GETLIST2)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       i_receipts           TYPE STANDARD TABLE OF bapi10502poouto,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for receipts(used in BAPI_POSRVAPS_SAVEMULTI3)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       i_receiptsi          TYPE STANDARD TABLE OF bapi10502poouti,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for bapireturn&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       i_return             TYPE STANDARD TABLE OF bapiret2,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for reference receipts&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       i_receiptsx          TYPE STANDARD TABLE OF bapi10502pooutix,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for content in email&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       i_email              TYPE STANDARD TABLE OF solisti1,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for content in email cc&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       i_cc                 TYPE STANDARD TABLE OF solisti1,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for receiver in email&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       i_objcont            TYPE STANDARD TABLE OF solisti1,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table for mapping&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       i_map                TYPE STANDARD TABLE OF t_map,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table to capture invalid UoM&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       i_err_uom            TYPE STANDARD TABLE OF t_err_uom,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table to display error message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       i_err                TYPE STANDARD TABLE OF t_err,&lt;/P&gt;&lt;P&gt;       i_matnr_err          TYPE STANDARD TABLE OF bapilocrange.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;                  WORKAREA DECLARATION                               *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA :&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Workarea for uploading the Flat file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      wa_upload     TYPE t_upload,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Workarea  for data retrieval from db or from file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      wa_temp       TYPE t_temp,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Workarea  for receipts(used in BAPI_POSRVAPS_GETLIST2)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       wa_receipts  TYPE bapi10502poouto,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Workarea  for BAPI return&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       wa_return    TYPE bapiret2,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Workarea  for header in email&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       wa_header    TYPE  so_text255,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Workarea for content in email&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       wa_objcont   TYPE solisti1,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Workarea for mapping table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       wa_map       TYPE t_map,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Workarea for invalid UoM&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       wa_err_uom   TYPE t_err_uom,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Workarea for error message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       wa_err       TYPE t_err,&lt;/P&gt;&lt;P&gt;       wa_matnr_err TYPE bapilocrange.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;                        VARIABLES                                    *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:  v_fname       TYPE rlgrap-filename,     "File name variable&lt;/P&gt;&lt;P&gt;       v_quantity(20),                         "For Quantity&lt;/P&gt;&lt;P&gt;       v_mailid(50),                           "For MailID&lt;/P&gt;&lt;P&gt;       v_cc(50),                               "For CC&lt;/P&gt;&lt;P&gt;       v_file(250),                            "App server flatfile&lt;/P&gt;&lt;P&gt;       v_tfill       TYPE sy-tfill.             "DB Count&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;                        CONSTANTS                                    *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS : c_lpn(20)   TYPE c VALUE 'ZDIR_APPDATA',"Logical File Path&lt;/P&gt;&lt;P&gt;            c_simid(3)  TYPE c VALUE '000',           "Planning version&lt;/P&gt;&lt;P&gt;            c_atpcat(2) TYPE c VALUE 'ZG',            "ATP Category&lt;/P&gt;&lt;P&gt;            c_x(1)      TYPE c VALUE 'X',             "Const. for 'X'.&lt;/P&gt;&lt;P&gt;            c_1(1)      TYPE c VALUE '1',             "Const. for '1'.&lt;/P&gt;&lt;P&gt;            c_3(1)      TYPE c VALUE '3',             "Const. for '3'.&lt;/P&gt;&lt;P&gt;            c_midf(15)  TYPE c VALUE 'BPCS_INV/SAP/', "Mid. Folders&lt;/P&gt;&lt;P&gt;            c_low(4)    TYPE c VALUE 'LOW',&lt;/P&gt;&lt;P&gt;            c_high(4)   TYPE c VALUE 'HIGH',&lt;/P&gt;&lt;P&gt;            c_vl        TYPE msehi VALUE 'VL',&lt;/P&gt;&lt;P&gt;            c_vil       TYPE msehi VALUE 'VIL',&lt;/P&gt;&lt;P&gt;            c_vi        TYPE msehi VALUE 'VI'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;                  PARAMETERS &amp;amp;  SELECT-OPTIONS                       *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&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 b1 WITH FRAME TITLE text-001.&lt;/P&gt;&lt;P&gt;PARAMETERS : p_flint TYPE filename-pathintern&lt;/P&gt;&lt;P&gt;             DEFAULT c_lpn OBLIGATORY ,        " Logical Path Name&lt;/P&gt;&lt;P&gt;             p_aserv RADIOBUTTON GROUP grp ,   " Application server&lt;/P&gt;&lt;P&gt;             p_flext TYPE filename-fileextern, " Application File Name&lt;/P&gt;&lt;P&gt;             p_pserv RADIOBUTTON GROUP grp,    " Presentation Server&lt;/P&gt;&lt;P&gt;             p_file  TYPE rlgrap-filename.     " Presentation File Name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN : END OF BLOCK b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE text-f01.&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: s_matnr FOR /sapapo/matkey-matnr,&lt;/P&gt;&lt;P&gt;                s_werks FOR /sapapo/loc-locno,&lt;/P&gt;&lt;P&gt;                s_status FOR zdtsint046_inv-status,&lt;/P&gt;&lt;P&gt;                s_type  FOR zdtsint046_inv-material_typ,&lt;/P&gt;&lt;P&gt;                s_lot FOR zdtsint046_inv-lot,&lt;/P&gt;&lt;P&gt;                s_faclty FOR zdtsint046_inv-bpcs_facility,&lt;/P&gt;&lt;P&gt;                s_wh FOR zdtsint046_inv-bpcs_wh,&lt;/P&gt;&lt;P&gt;                s_bin FOR zdtsint046_inv-location.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK b5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN : BEGIN OF BLOCK b4 WITH FRAME TITLE text-033.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS :p_logsys TYPE bapigenfields-logsystem&lt;/P&gt;&lt;P&gt;                             OBLIGATORY,          " Logical System&lt;/P&gt;&lt;P&gt;             p_simid  TYPE bapigenfields-vrsioex&lt;/P&gt;&lt;P&gt;                      OBLIGATORY DEFAULT c_simid, " Planning Version&lt;/P&gt;&lt;P&gt;             p_atpcat TYPE  bapiapoatpcat-atpcat  "ATP Category&lt;/P&gt;&lt;P&gt;                      OBLIGATORY DEFAULT c_atpcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN : END OF BLOCK b4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN : BEGIN OF BLOCK b3 WITH FRAME TITLE text-032.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS : s_mailid FOR v_mailid NO INTERVALS OBLIGATORY, "Email&lt;/P&gt;&lt;P&gt;                 s_cc     FOR v_cc     NO INTERVALS.  "CC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN : END OF BLOCK b3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.&lt;/P&gt;&lt;P&gt;PARAMETERS : p_chk AS CHECKBOX ,           "Check Box for read database&lt;/P&gt;&lt;P&gt;             p_dlt AS CHECKBOX DEFAULT 'X'."Check all PReqs&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN : END OF BLOCK b2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  getfilename&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&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; It displays the f4 help for presentation server file name           *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; User can select the file from presentation server                   *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;     &amp;lt;--PV_file             Input file name                          *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM getfilename CHANGING pv_file TYPE rlgrap-filename.&lt;/P&gt;&lt;P&gt;  DATA: BEGIN OF logfile,&lt;/P&gt;&lt;P&gt;          directory(80) TYPE c,&lt;/P&gt;&lt;P&gt;          name(7)       TYPE c,&lt;/P&gt;&lt;P&gt;          path          TYPE string,&lt;/P&gt;&lt;P&gt;          pc_file       TYPE string,&lt;/P&gt;&lt;P&gt;          pc_path       TYPE string,&lt;/P&gt;&lt;P&gt;          selection     TYPE filetable,&lt;/P&gt;&lt;P&gt;          rc            TYPE i,&lt;/P&gt;&lt;P&gt;          action        TYPE i,&lt;/P&gt;&lt;P&gt;          no_reload     TYPE c VALUE '',&lt;/P&gt;&lt;P&gt;          lines         LIKE sy-tabix,&lt;/P&gt;&lt;P&gt;  END OF logfile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD cl_gui_frontend_services=&amp;gt;file_open_dialog&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      initial_directory = logfile-pc_path&lt;/P&gt;&lt;P&gt;      default_filename  = '&lt;STRONG&gt;.&lt;/STRONG&gt;'&lt;/P&gt;&lt;P&gt;      default_extension = '&lt;STRONG&gt;.&lt;/STRONG&gt;'&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      file_table        = logfile-selection&lt;/P&gt;&lt;P&gt;      user_action       = logfile-action&lt;/P&gt;&lt;P&gt;      rc                = logfile-rc&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      OTHERS            = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE logfile-selection INDEX 1 INTO pv_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " getfilename1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  validate_screen&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&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;Subroutine to validate the selection-screen entries&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM validate_screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF p_aserv EQ c_x.&lt;/P&gt;&lt;P&gt;    IF NOT p_flext IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; This perform generate the physical path using&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; file_get_name function module.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      PERFORM get_physical_file.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Input File Name on Application server is mandatory.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      MESSAGE e501.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF p_pserv = c_x.&lt;/P&gt;&lt;P&gt;    IF p_file IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; File Name on Presentation server is mandatory&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      MESSAGE e502.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      MOVE p_file TO v_fname.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.                   "IF p_pserv = c_x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " validate_screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  get_physical_file&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&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;Subroutine to get the physical file name&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM get_physical_file.&lt;/P&gt;&lt;P&gt;*--Call the function module to get the physical file name for the&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;logical file path provided.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CONCATENATE c_midf p_flext INTO v_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'FILE_GET_NAME_USING_PATH'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      logical_path               = p_flint&lt;/P&gt;&lt;P&gt;      file_name                  = v_file&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      file_name_with_path        = v_file&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      path_not_found             = 1&lt;/P&gt;&lt;P&gt;      missing_parameter          = 2&lt;/P&gt;&lt;P&gt;      operating_system_not_found = 3&lt;/P&gt;&lt;P&gt;      file_system_not_found      = 4&lt;/P&gt;&lt;P&gt;      OTHERS                     = 5.&lt;/P&gt;&lt;P&gt;  IF sy-subrc NE 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;ENDFORM.                    " get_physical_file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp;      Form  upload_file&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Subroutine to upload data from App server or presentation server&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;FORM upload_file.&lt;/P&gt;&lt;P&gt;*--If the presentation server radio button is chosen.&lt;/P&gt;&lt;P&gt;  IF p_pserv = c_x .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Perform which selects the input file from presentation server&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; using Function GUI_UPLOAD&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    PERFORM get_presentation_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IF the application server radio button is chosen.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ELSEIF p_aserv = c_x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Perform which selects the input file from application server&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; using OPEN DATASET&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    PERFORM get_application_file.&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.                    " upload_file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp;      Form  get_presentation_file&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Subroutine to get the presentation file name&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;FORM get_presentation_file.&lt;/P&gt;&lt;P&gt;*--Local Variables&lt;/P&gt;&lt;P&gt;  DATA: lv_file TYPE string.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Local constants&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CONSTANTS : lc_type TYPE char10 VALUE 'ASC'. "File type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--CLear&lt;/P&gt;&lt;P&gt;  CLEAR lv_file.&lt;/P&gt;&lt;P&gt;  MOVE v_fname TO lv_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Call the function to get the file into an internal table.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      filename                = lv_file&lt;/P&gt;&lt;P&gt;      filetype                = lc_type&lt;/P&gt;&lt;P&gt;      has_field_separator     = c_x&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      data_tab                = i_upload&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      file_open_error         = 1&lt;/P&gt;&lt;P&gt;      file_read_error         = 2&lt;/P&gt;&lt;P&gt;      no_batch                = 3&lt;/P&gt;&lt;P&gt;      gui_refuse_filetransfer = 4&lt;/P&gt;&lt;P&gt;      invalid_type            = 5&lt;/P&gt;&lt;P&gt;      no_authority            = 6&lt;/P&gt;&lt;P&gt;      unknown_error           = 7&lt;/P&gt;&lt;P&gt;      bad_data_format         = 8&lt;/P&gt;&lt;P&gt;      header_not_allowed      = 9&lt;/P&gt;&lt;P&gt;      separator_not_allowed   = 10&lt;/P&gt;&lt;P&gt;      header_too_long         = 11&lt;/P&gt;&lt;P&gt;      unknown_dp_error        = 12&lt;/P&gt;&lt;P&gt;      access_denied           = 13&lt;/P&gt;&lt;P&gt;      dp_out_of_memory        = 14&lt;/P&gt;&lt;P&gt;      disk_full               = 15&lt;/P&gt;&lt;P&gt;      dp_timeout              = 16&lt;/P&gt;&lt;P&gt;      OTHERS                  = 17.&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.                    " get_presentation_file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp;      Form  get_application_file&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Subroutine to get the application file name&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;FORM get_application_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Local Variables&lt;/P&gt;&lt;P&gt;  DATA : lv_dsn(250) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Declaration of local constants&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CONSTANTS : lc_tab TYPE x VALUE '09'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Work Area&lt;/P&gt;&lt;P&gt;  DATA: lwa_file TYPE t_file.         "App server flatfile&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lv_dsn = v_file.&lt;/P&gt;&lt;P&gt;*-- Open Dataset&lt;/P&gt;&lt;P&gt;  OPEN DATASET lv_dsn FOR INPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;  IF sy-subrc NE 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; File not found&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    MESSAGE e503.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Read each line from the dataset and append to an internal table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DO.&lt;/P&gt;&lt;P&gt;*-- Read dataset and pass it to an internal table.&lt;/P&gt;&lt;P&gt;      READ DATASET lv_dsn INTO lwa_file.&lt;/P&gt;&lt;P&gt;      IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        SPLIT lwa_file-text AT lc_tab&lt;/P&gt;&lt;P&gt;                                  INTO  wa_upload-item&lt;/P&gt;&lt;P&gt;                                        wa_upload-t&lt;/P&gt;&lt;P&gt;                                        wa_upload-description&lt;/P&gt;&lt;P&gt;                                        wa_upload-lot&lt;/P&gt;&lt;P&gt;                                        wa_upload-status&lt;/P&gt;&lt;P&gt;                                        v_quantity&lt;/P&gt;&lt;P&gt;                                        wa_upload-uom&lt;/P&gt;&lt;P&gt;                                        wa_upload-bpcs_facility&lt;/P&gt;&lt;P&gt;                                        wa_upload-bpcs_wh&lt;/P&gt;&lt;P&gt;                                        wa_upload-location&lt;/P&gt;&lt;P&gt;                                        wa_upload-exp_date&lt;/P&gt;&lt;P&gt;                                        wa_upload-lot_create&lt;/P&gt;&lt;P&gt;                                        wa_upload-avl_date&lt;/P&gt;&lt;P&gt;                                        wa_upload-dpl_date.&lt;/P&gt;&lt;P&gt;        wa_upload-quantity = v_quantity.&lt;/P&gt;&lt;P&gt;        CONDENSE wa_upload-item.&lt;/P&gt;&lt;P&gt;**Call conversion exit for material&lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            input  = wa_upload-item&lt;/P&gt;&lt;P&gt;          IMPORTING&lt;/P&gt;&lt;P&gt;            output = wa_upload-item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        APPEND wa_upload TO i_upload.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CLEAR :wa_upload,&lt;/P&gt;&lt;P&gt;               lwa_file,&lt;/P&gt;&lt;P&gt;               v_quantity.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;        EXIT.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDDO.&lt;/P&gt;&lt;P&gt;*-- Close Dataset .&lt;/P&gt;&lt;P&gt;    CLOSE DATASET lv_dsn.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " get_application_file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 07:13:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-upload/m-p/2946423#M694632</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2007-10-15T07:13:33Z</dc:date>
    </item>
  </channel>
</rss>

