<?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: Error in BAPI_RESERVATION_CREATE Program? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355381#M7203</link>
    <description>&lt;P&gt;So what is the prioblem, did you get an error in return table?&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Raymond&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jan 2017 11:22:49 GMT</pubDate>
    <dc:creator>RaymondGiuseppi</dc:creator>
    <dc:date>2017-01-12T11:22:49Z</dc:date>
    <item>
      <title>Error in BAPI_RESERVATION_CREATE Program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355380#M7202</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Pl find my coding below, while executing the same, the value of the cost center field is saved to Profit center field in RKPF table,&lt;/P&gt;&lt;P&gt;pl suggest.&lt;/P&gt;&lt;P&gt;type-pools :truxs.&lt;BR /&gt;
selection-screen begin of block blck with frame title text-011.&lt;BR /&gt;
parameters:p_file type rlgrap-filename .&lt;BR /&gt;
&lt;BR /&gt;
selection-screen end of block blck.&lt;BR /&gt;
&lt;BR /&gt;
types: begin of st_resb,&lt;BR /&gt;&lt;BR /&gt;
 bwart type rkpf-bwart,&lt;BR /&gt;
 werks type resb-werks,&lt;BR /&gt;
 matnr type resb-matnr,&lt;BR /&gt;
 erfmg type resb-erfmg,&lt;BR /&gt;
 lgort type resb-lgort,&lt;BR /&gt;end of st_resb.&lt;BR /&gt;
&lt;BR /&gt;
data:it_itab type table of st_itab,&lt;BR /&gt;
 wa_itab type st_itab,&lt;BR /&gt;
 it_raw type truxs_t_text_data.&lt;BR /&gt;
&lt;BR /&gt;
at selection-screen on value-request for p_file. "F1 help for file input&lt;BR /&gt;
&lt;BR /&gt;
 call function 'F4_FILENAME'&lt;BR /&gt;
 exporting&lt;BR /&gt;
 field_name = 'P_FILE'&lt;BR /&gt;
 importing&lt;BR /&gt;
 file_name = p_file.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
start-of-selection.&lt;BR /&gt;
&lt;BR /&gt;
 call function 'TEXT_CONVERT_XLS_TO_SAP'&lt;BR /&gt;
 exporting&lt;BR /&gt;
* I_FIELD_SEPERATOR =&lt;BR /&gt;
* i_line_header = p_head&lt;BR /&gt;
 i_tab_raw_data = it_raw " WORK TABLE&lt;BR /&gt;
 i_filename = p_file&lt;BR /&gt;
 tables&lt;BR /&gt;
 i_tab_converted_data = it_itab[]          "ACTUAL DATA&lt;BR /&gt;
 exceptions&lt;BR /&gt;
 conversion_failed = 1&lt;BR /&gt;
 others = 2.&lt;BR /&gt;
&lt;BR /&gt;
 if sy-subrc &amp;lt;&amp;gt; 0.&lt;BR /&gt;
 message id sy-msgid type sy-msgty number sy-msgno&lt;BR /&gt;
 with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;BR /&gt;
 endif.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
 data :wa1_headdata type bapirkpfc,&lt;BR /&gt;
 wa_headdata type bapirkpfc ,&lt;BR /&gt;
 it2_headdata type bapirkpfc,&lt;BR /&gt;
 it_itemdata type table of bapiresbc,&lt;BR /&gt;
 wa_itemdata type bapiresbc,&lt;BR /&gt;
 wa_return type bapireturn occurs 0 with header line .&lt;BR /&gt;
&lt;BR /&gt;
 data: res_no like bapirkpfc-res_no,&lt;BR /&gt;
 tlines type i.&lt;BR /&gt;
&lt;BR /&gt;
loop at it_itab into wa_itab.&lt;BR /&gt;
&lt;BR /&gt;
 wa_headdata-res_date = sy-datum.&lt;BR /&gt;
* WA_HEADDATA-MOVE_PLANT = WA_ITAB-WERKS.&lt;BR /&gt;
 wa_headdata-move_type = wa_itab-bwart.&lt;BR /&gt;
 wa_headdata-cost_ctr = wa_itab-kostl.&lt;BR /&gt;
* WA_HEADDATA-CREATED_BY = SY-UNAME.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
*LOOP AT IT_ITAB INTO WA_ITAB.&lt;BR /&gt;
 wa_itemdata-material = wa_itab-matnr.&lt;BR /&gt;
 wa_itemdata-quantity = wa_itab-erfmg.&lt;BR /&gt;
 wa_itemdata-store_loc = wa_itab-lgort.&lt;BR /&gt;
 wa_itemdata-plant = wa_itab-werks.&lt;BR /&gt;
 wa_itemdata-req_date = sy-datum.&lt;BR /&gt;
 append wa_itemdata to it_itemdata.&lt;BR /&gt;
 clear wa_itemdata.&lt;BR /&gt;
perform check.&lt;BR /&gt;
clear wa_resb.&lt;BR /&gt;
endloop.&lt;BR /&gt;
&lt;BR /&gt;
*BREAK-POINT.&lt;BR /&gt;
call function 'BAPI_RESERVATION_CREATE'&lt;BR /&gt;
 exporting&lt;BR /&gt;
 reservation_header = wa_headdata&lt;BR /&gt;
* NO_COMMIT =&lt;BR /&gt;
 movement_auto ='X'&lt;BR /&gt;
 importing&lt;BR /&gt;
 reservation = res_no&lt;BR /&gt;
 tables&lt;BR /&gt;
 reservation_items = it_itemdata&lt;BR /&gt;
* RETURN =&lt;BR /&gt;
 .&lt;BR /&gt;
*BREAK-POINT.&lt;BR /&gt;
&lt;BR /&gt;
 call function 'BAPI_TRANSACTION_COMMIT'&lt;BR /&gt;
 exporting&lt;BR /&gt;
 wait = 'X'&lt;BR /&gt;
* IMPORTING&lt;BR /&gt;
* RETURN = WA_RETURN&lt;BR /&gt;
 .&lt;BR /&gt;
*BREAK-POINT.&lt;BR /&gt;
&lt;BR /&gt;
 describe table wa_return lines tlines.&lt;BR /&gt;
 if tlines gt 0.&lt;BR /&gt;
 format color col_negative.&lt;BR /&gt;
 write : / 'Update Failed.',wa_return-message(200), 255 ' '.&lt;BR /&gt;
 else.&lt;BR /&gt;
 format color col_normal.&lt;BR /&gt;
 write :res_no, 'Reservation created successfully ', 255 ' '.&lt;BR /&gt;
 endif.&lt;BR /&gt;
 form check.&lt;BR /&gt;
 loop at it_resb into wa_resb.&lt;BR /&gt;
 wa1_headdata-move_type = wa_resb-bwart.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
 if wa1_headdata-move_type ne wa_headdata-move_type.&lt;BR /&gt;
 message 'Pl Maintain a Single movement type throughout the Excel file' type 'A'.&lt;BR /&gt;
endif.&lt;BR /&gt;
endloop.&lt;BR /&gt;
endform.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 11:14:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355380#M7202</guid>
      <dc:creator>satheshkumar44</dc:creator>
      <dc:date>2017-01-12T11:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Error in BAPI_RESERVATION_CREATE Program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355381#M7203</link>
      <description>&lt;P&gt;So what is the prioblem, did you get an error in return table?&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Raymond&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 11:22:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355381#M7203</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2017-01-12T11:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Error in BAPI_RESERVATION_CREATE Program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355382#M7204</link>
      <description>&lt;P&gt;Can you point me to a place in your coding where you deal with profit center and/or cost center?&lt;/P&gt;&lt;P&gt;And if there is no place in your coding then the value falls either from heaven or the data in your Excel source are in different order as you expect it in your program.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 12:04:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355382#M7204</guid>
      <dc:creator>JL23</dc:creator>
      <dc:date>2017-01-12T12:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Error in BAPI_RESERVATION_CREATE Program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355383#M7205</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for your reply,&lt;/P&gt;&lt;P&gt;"wa_headdata-cost_ctr = wa_itab-kostl." in this line that im placing the value of cost center from excel to the internal table ,&lt;/P&gt;&lt;P&gt;pl note that i checked the program execution with breakpoint and in that the values are assigning correctly the "kostl" field but after  program execution while checking database the saved cost center is different(i.e) cost center value is saved in profit center field, and the generated reservation cost center value is some other cost center than the input given to BAPI.&lt;/P&gt;&lt;P&gt;I didnt assign the profit center field at any point in the program&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 04:20:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355383#M7205</guid>
      <dc:creator>satheshkumar44</dc:creator>
      <dc:date>2017-01-16T04:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Error in BAPI_RESERVATION_CREATE Program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355384#M7206</link>
      <description>&lt;P&gt;Hi Mr.Raymond,&lt;/P&gt;&lt;P&gt;The problem is  the data is not getting saved in database ,&lt;/P&gt;&lt;P&gt;i checked with breakpoint too,the values are correctly fetched by BAPI from internal tables but the data is not etting saved and in return message it shows ''update plant'' even after i updated the plant details in both heater and itemdata.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 04:26:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355384#M7206</guid>
      <dc:creator>satheshkumar44</dc:creator>
      <dc:date>2017-01-16T04:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Error in BAPI_RESERVATION_CREATE Program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355385#M7207</link>
      <description>&lt;P&gt;what about showing some screenshots, e.g. from source file and from debugger with the cost center field value &lt;/P&gt;&lt;P&gt;Did you already create a reservation manually and checked if the values came correct?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 06:37:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355385#M7207</guid>
      <dc:creator>JL23</dc:creator>
      <dc:date>2017-01-16T06:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error in BAPI_RESERVATION_CREATE Program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355386#M7208</link>
      <description>&lt;P&gt;What are the actual message class and number, also where did you pass header-plant field, could you post the actual tested code, the code where the return-type is checked for 'E' error before commit?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 07:43:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355386#M7208</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2017-01-16T07:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Error in BAPI_RESERVATION_CREATE Program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355387#M7209</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for your reply , the issue has been resolved..issue raised due to wrong field reference given&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 07:44:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-bapi-reservation-create-program/m-p/355387#M7209</guid>
      <dc:creator>satheshkumar44</dc:creator>
      <dc:date>2017-01-16T07:44:26Z</dc:date>
    </item>
  </channel>
</rss>

