<?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 How do I connect bapi_billingdoc_Create to a open data set upload program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-connect-bapi-billingdoc-create-to-a-open-data-set-upload-program/m-p/490107#M16484</link>
    <description>&lt;P&gt;Hell all, Im doing a project where I need to write an upload program to intake a pipe delimited file from the server and then automatically create an invoice in the background for them. so far heres the code for the upload and it works fine. But I am lost when it comes to connecting the two and the bapi aspect. Please help! thanks!&lt;/P&gt;
  &lt;P&gt;types: begin of ty_string,&lt;BR /&gt;str(1000) type c,&lt;BR /&gt;end of ty_string.&lt;BR /&gt; &lt;BR /&gt;data it_final type table of ty_string.&lt;BR /&gt;data wa_final type ty_string .&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;types: begin of ty_split,&lt;BR /&gt;*&lt;BR /&gt;document_no(20) type c,&lt;BR /&gt;document_date(20) type c,&lt;BR /&gt;document_amount(20) type c,&lt;BR /&gt;document_type(20) type c,&lt;BR /&gt;description(20) type c,&lt;BR /&gt;vendor_id(20) type c,&lt;BR /&gt;image_id(20) type c,&lt;BR /&gt;po_number(20) type c,&lt;BR /&gt;voucher_no(20) type c,&lt;BR /&gt;location(20) type c,&lt;BR /&gt;item_code(20) type c,&lt;BR /&gt;item_description(20) type c,&lt;BR /&gt;po_no(20) type c,&lt;BR /&gt;po_line_num(20) type c,&lt;BR /&gt;amount(20) type c,&lt;BR /&gt;gl_account(20) type c,&lt;BR /&gt;profit_center(20) type c,&lt;BR /&gt;cost_center(20) type c,&lt;BR /&gt;company_code(20) type c,&lt;BR /&gt;project_code(20) type c,&lt;BR /&gt;purchase_org(20) type c,&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;end of ty_split.&lt;BR /&gt; &lt;BR /&gt;data: it_split type table of ty_split with header line.&lt;BR /&gt;data: wa_split type ty_split.&lt;BR /&gt; &lt;BR /&gt;DATA: v_excel_string(2000) TYPE c,&lt;BR /&gt;v_file LIKE v_excel_string VALUE 'D:\TEST\TEST1.CSV', " name of the file&lt;BR /&gt;delimiter TYPE c VALUE '|'. " delimiter with default value space&lt;BR /&gt; &lt;BR /&gt;"--------------------selection--screen-------------------------&lt;BR /&gt; &lt;BR /&gt;SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE text-100.&lt;BR /&gt;SELECTION-SCREEN SKIP 1.&lt;BR /&gt; &lt;BR /&gt;SELECTION-SCREEN BEGIN OF BLOCK pipe_file&lt;BR /&gt;WITH FRAME TITLE text-101.&lt;BR /&gt;PARAMETERS:p_path TYPE rlgrap-filename&lt;BR /&gt;MEMORY ID xw2,&lt;BR /&gt;p_folder TYPE string LOWER CASE,&lt;BR /&gt;p_arch TYPE string LOWER CASE.&lt;BR /&gt; &lt;BR /&gt;SELECTION-SCREEN END OF BLOCK pipe_file.&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;SELECTION-SCREEN END OF BLOCK 1.&lt;BR /&gt; &lt;BR /&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.&lt;BR /&gt; &lt;BR /&gt;* Get the filename from the user&lt;BR /&gt;CALL FUNCTION 'WS_FILENAME_GET'&lt;BR /&gt;EXPORTING&lt;BR /&gt;def_filename = ' '&lt;BR /&gt;* DEF_PATH = ' '&lt;BR /&gt;mask = ',*.txt,*.*.'&lt;BR /&gt;* MODE = '0'&lt;BR /&gt;title = 'Upload File'(078)&lt;BR /&gt;IMPORTING&lt;BR /&gt;filename = p_path&lt;BR /&gt;* RC = L_RC&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;inv_winsys = 1&lt;BR /&gt;no_batch = 2&lt;BR /&gt;selection_cancel = 3&lt;BR /&gt;selection_error = 4&lt;BR /&gt;OTHERS = 5.&lt;BR /&gt; &lt;BR /&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_folder.&lt;BR /&gt;cl_gui_frontend_services=&amp;gt;directory_browse(&lt;BR /&gt;EXPORTING&lt;BR /&gt;window_title = 'Select import location'&lt;BR /&gt;initial_folder = p_folder&lt;BR /&gt;CHANGING&lt;BR /&gt;selected_folder = p_folder&lt;BR /&gt;).&lt;BR /&gt; &lt;BR /&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_arch.&lt;BR /&gt;cl_gui_frontend_services=&amp;gt;directory_browse(&lt;BR /&gt;EXPORTING&lt;BR /&gt;window_title = 'Select archive location'&lt;BR /&gt;initial_folder = p_arch&lt;BR /&gt;CHANGING&lt;BR /&gt;selected_folder = p_arch&lt;BR /&gt;).&lt;BR /&gt;"----------------------------program code--------------------------------------------&lt;BR /&gt; &lt;BR /&gt;START-OF-SELECTION.&lt;BR /&gt; &lt;BR /&gt;v_file = p_path.&lt;BR /&gt; &lt;BR /&gt;OPEN DATASET v_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.&lt;BR /&gt;IF sy-subrc NE 0.&lt;BR /&gt;WRITE:/ 'error opening file'.&lt;BR /&gt;ELSE.&lt;BR /&gt;DO." sy-subrc EQ 0 ).&lt;BR /&gt;READ DATASET v_file INTO wa_final.&lt;BR /&gt;IF sy-subrc = 0. "wa_it_final IS INITIAL.&lt;BR /&gt;SPLIT wa_final-str AT '|' INTO&lt;BR /&gt; &lt;BR /&gt;wa_split-document_no&lt;BR /&gt;wa_split-document_date&lt;BR /&gt;wa_split-document_amount&lt;BR /&gt;wa_split-document_type&lt;BR /&gt;wa_split-description&lt;BR /&gt;wa_split-vendor_id&lt;BR /&gt;wa_split-image_id&lt;BR /&gt;wa_split-po_number&lt;BR /&gt;wa_split-voucher_no&lt;BR /&gt;wa_split-location&lt;BR /&gt;wa_split-item_code&lt;BR /&gt;wa_split-item_description&lt;BR /&gt;wa_split-po_no&lt;BR /&gt;wa_split-po_line_num&lt;BR /&gt;wa_split-amount&lt;BR /&gt;wa_split-gl_account&lt;BR /&gt;wa_split-profit_center&lt;BR /&gt;wa_split-cost_center&lt;BR /&gt;wa_split-company_code&lt;BR /&gt;wa_split-project_code&lt;BR /&gt;wa_split-purchase_org.&lt;BR /&gt; &lt;BR /&gt;APPEND wa_split TO it_split.&lt;BR /&gt; &lt;BR /&gt;WRITE:/ wa_split-document_no,&lt;BR /&gt;wa_split-document_date,&lt;BR /&gt;wa_split-document_amount,&lt;BR /&gt;wa_split-document_type,&lt;BR /&gt;wa_split-description,&lt;BR /&gt;wa_split-vendor_id,&lt;BR /&gt;wa_split-image_id,&lt;BR /&gt;wa_split-po_number,&lt;BR /&gt;wa_split-voucher_no,&lt;BR /&gt;wa_split-location,&lt;BR /&gt;wa_split-item_code,&lt;BR /&gt;wa_split-item_description,&lt;BR /&gt;wa_split-po_no,&lt;BR /&gt;wa_split-po_line_num,&lt;BR /&gt;wa_split-amount,&lt;BR /&gt;wa_split-gl_account,&lt;BR /&gt;wa_split-profit_center,&lt;BR /&gt;wa_split-cost_center,&lt;BR /&gt;wa_split-company_code,&lt;BR /&gt;wa_split-project_code,&lt;BR /&gt;wa_split-purchase_org.&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;" APPEND wa_final TO it_final.&lt;BR /&gt;ELSE.&lt;BR /&gt;EXIT.&lt;BR /&gt;ENDIF.&lt;BR /&gt;CLEAR wa_final.&lt;BR /&gt;ENDDO.&lt;BR /&gt;ENDIF.&lt;BR /&gt;CLOSE DATASET v_file.&lt;/P&gt;</description>
    <pubDate>Tue, 01 Aug 2017 14:11:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2017-08-01T14:11:10Z</dc:date>
    <item>
      <title>How do I connect bapi_billingdoc_Create to a open data set upload program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-connect-bapi-billingdoc-create-to-a-open-data-set-upload-program/m-p/490107#M16484</link>
      <description>&lt;P&gt;Hell all, Im doing a project where I need to write an upload program to intake a pipe delimited file from the server and then automatically create an invoice in the background for them. so far heres the code for the upload and it works fine. But I am lost when it comes to connecting the two and the bapi aspect. Please help! thanks!&lt;/P&gt;
  &lt;P&gt;types: begin of ty_string,&lt;BR /&gt;str(1000) type c,&lt;BR /&gt;end of ty_string.&lt;BR /&gt; &lt;BR /&gt;data it_final type table of ty_string.&lt;BR /&gt;data wa_final type ty_string .&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;types: begin of ty_split,&lt;BR /&gt;*&lt;BR /&gt;document_no(20) type c,&lt;BR /&gt;document_date(20) type c,&lt;BR /&gt;document_amount(20) type c,&lt;BR /&gt;document_type(20) type c,&lt;BR /&gt;description(20) type c,&lt;BR /&gt;vendor_id(20) type c,&lt;BR /&gt;image_id(20) type c,&lt;BR /&gt;po_number(20) type c,&lt;BR /&gt;voucher_no(20) type c,&lt;BR /&gt;location(20) type c,&lt;BR /&gt;item_code(20) type c,&lt;BR /&gt;item_description(20) type c,&lt;BR /&gt;po_no(20) type c,&lt;BR /&gt;po_line_num(20) type c,&lt;BR /&gt;amount(20) type c,&lt;BR /&gt;gl_account(20) type c,&lt;BR /&gt;profit_center(20) type c,&lt;BR /&gt;cost_center(20) type c,&lt;BR /&gt;company_code(20) type c,&lt;BR /&gt;project_code(20) type c,&lt;BR /&gt;purchase_org(20) type c,&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;end of ty_split.&lt;BR /&gt; &lt;BR /&gt;data: it_split type table of ty_split with header line.&lt;BR /&gt;data: wa_split type ty_split.&lt;BR /&gt; &lt;BR /&gt;DATA: v_excel_string(2000) TYPE c,&lt;BR /&gt;v_file LIKE v_excel_string VALUE 'D:\TEST\TEST1.CSV', " name of the file&lt;BR /&gt;delimiter TYPE c VALUE '|'. " delimiter with default value space&lt;BR /&gt; &lt;BR /&gt;"--------------------selection--screen-------------------------&lt;BR /&gt; &lt;BR /&gt;SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE text-100.&lt;BR /&gt;SELECTION-SCREEN SKIP 1.&lt;BR /&gt; &lt;BR /&gt;SELECTION-SCREEN BEGIN OF BLOCK pipe_file&lt;BR /&gt;WITH FRAME TITLE text-101.&lt;BR /&gt;PARAMETERS:p_path TYPE rlgrap-filename&lt;BR /&gt;MEMORY ID xw2,&lt;BR /&gt;p_folder TYPE string LOWER CASE,&lt;BR /&gt;p_arch TYPE string LOWER CASE.&lt;BR /&gt; &lt;BR /&gt;SELECTION-SCREEN END OF BLOCK pipe_file.&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;SELECTION-SCREEN END OF BLOCK 1.&lt;BR /&gt; &lt;BR /&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.&lt;BR /&gt; &lt;BR /&gt;* Get the filename from the user&lt;BR /&gt;CALL FUNCTION 'WS_FILENAME_GET'&lt;BR /&gt;EXPORTING&lt;BR /&gt;def_filename = ' '&lt;BR /&gt;* DEF_PATH = ' '&lt;BR /&gt;mask = ',*.txt,*.*.'&lt;BR /&gt;* MODE = '0'&lt;BR /&gt;title = 'Upload File'(078)&lt;BR /&gt;IMPORTING&lt;BR /&gt;filename = p_path&lt;BR /&gt;* RC = L_RC&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;inv_winsys = 1&lt;BR /&gt;no_batch = 2&lt;BR /&gt;selection_cancel = 3&lt;BR /&gt;selection_error = 4&lt;BR /&gt;OTHERS = 5.&lt;BR /&gt; &lt;BR /&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_folder.&lt;BR /&gt;cl_gui_frontend_services=&amp;gt;directory_browse(&lt;BR /&gt;EXPORTING&lt;BR /&gt;window_title = 'Select import location'&lt;BR /&gt;initial_folder = p_folder&lt;BR /&gt;CHANGING&lt;BR /&gt;selected_folder = p_folder&lt;BR /&gt;).&lt;BR /&gt; &lt;BR /&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_arch.&lt;BR /&gt;cl_gui_frontend_services=&amp;gt;directory_browse(&lt;BR /&gt;EXPORTING&lt;BR /&gt;window_title = 'Select archive location'&lt;BR /&gt;initial_folder = p_arch&lt;BR /&gt;CHANGING&lt;BR /&gt;selected_folder = p_arch&lt;BR /&gt;).&lt;BR /&gt;"----------------------------program code--------------------------------------------&lt;BR /&gt; &lt;BR /&gt;START-OF-SELECTION.&lt;BR /&gt; &lt;BR /&gt;v_file = p_path.&lt;BR /&gt; &lt;BR /&gt;OPEN DATASET v_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.&lt;BR /&gt;IF sy-subrc NE 0.&lt;BR /&gt;WRITE:/ 'error opening file'.&lt;BR /&gt;ELSE.&lt;BR /&gt;DO." sy-subrc EQ 0 ).&lt;BR /&gt;READ DATASET v_file INTO wa_final.&lt;BR /&gt;IF sy-subrc = 0. "wa_it_final IS INITIAL.&lt;BR /&gt;SPLIT wa_final-str AT '|' INTO&lt;BR /&gt; &lt;BR /&gt;wa_split-document_no&lt;BR /&gt;wa_split-document_date&lt;BR /&gt;wa_split-document_amount&lt;BR /&gt;wa_split-document_type&lt;BR /&gt;wa_split-description&lt;BR /&gt;wa_split-vendor_id&lt;BR /&gt;wa_split-image_id&lt;BR /&gt;wa_split-po_number&lt;BR /&gt;wa_split-voucher_no&lt;BR /&gt;wa_split-location&lt;BR /&gt;wa_split-item_code&lt;BR /&gt;wa_split-item_description&lt;BR /&gt;wa_split-po_no&lt;BR /&gt;wa_split-po_line_num&lt;BR /&gt;wa_split-amount&lt;BR /&gt;wa_split-gl_account&lt;BR /&gt;wa_split-profit_center&lt;BR /&gt;wa_split-cost_center&lt;BR /&gt;wa_split-company_code&lt;BR /&gt;wa_split-project_code&lt;BR /&gt;wa_split-purchase_org.&lt;BR /&gt; &lt;BR /&gt;APPEND wa_split TO it_split.&lt;BR /&gt; &lt;BR /&gt;WRITE:/ wa_split-document_no,&lt;BR /&gt;wa_split-document_date,&lt;BR /&gt;wa_split-document_amount,&lt;BR /&gt;wa_split-document_type,&lt;BR /&gt;wa_split-description,&lt;BR /&gt;wa_split-vendor_id,&lt;BR /&gt;wa_split-image_id,&lt;BR /&gt;wa_split-po_number,&lt;BR /&gt;wa_split-voucher_no,&lt;BR /&gt;wa_split-location,&lt;BR /&gt;wa_split-item_code,&lt;BR /&gt;wa_split-item_description,&lt;BR /&gt;wa_split-po_no,&lt;BR /&gt;wa_split-po_line_num,&lt;BR /&gt;wa_split-amount,&lt;BR /&gt;wa_split-gl_account,&lt;BR /&gt;wa_split-profit_center,&lt;BR /&gt;wa_split-cost_center,&lt;BR /&gt;wa_split-company_code,&lt;BR /&gt;wa_split-project_code,&lt;BR /&gt;wa_split-purchase_org.&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;" APPEND wa_final TO it_final.&lt;BR /&gt;ELSE.&lt;BR /&gt;EXIT.&lt;BR /&gt;ENDIF.&lt;BR /&gt;CLEAR wa_final.&lt;BR /&gt;ENDDO.&lt;BR /&gt;ENDIF.&lt;BR /&gt;CLOSE DATASET v_file.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 14:11:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-connect-bapi-billingdoc-create-to-a-open-data-set-upload-program/m-p/490107#M16484</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-08-01T14:11:10Z</dc:date>
    </item>
  </channel>
</rss>

