<?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: Problem using BAPI_REQUISITION_CREATE with service...... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-bapi-requisition-create-with-service/m-p/6593227#M1436159</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;t_items-doc_type = 'SVEN'.
  t_items-del_datcat = '1'. "D
  t_items-deliv_date = '20100201'.
  t_items-plant = 'EN01'.
  t_items-store_loc = 'E101'.
  t_items-pur_group = 'E01'.
  t_items-mat_grp = '0609'.
  t_items-quantity = 1.
  t_items-unit = 'AU'.
  t_items-purch_org = 'ELN'.
  t_items-item_cat = '9'. "D
  t_items-acctasscat = 'K' .
  t_items-short_text = 'SeRVICE Server'.
  t_items-preq_item = lv_item_no.
  t_items-pckg_no = lv_pckg_no.
  APPEND t_items.

  data lv_pckg_tmp like t_service-pckg_no.
  LOOP AT t_items.
    t_service-pckg_no = t_items-pckg_no.
    t_service-subpckg_no = t_service-pckg_no + 1.
    t_service-line_no = lv_serv_line_no.
    t_service-ext_line = 0.
    t_service-outl_ind  = 'X'.
    t_service-from_line  = 1.


    APPEND t_service.
    clear: t_service-outl_ind, t_service-from_line.


    lv_pckg_tmp = t_items-pckg_no + 1.
* LOOP AT T_SERVICE.
    t_service-pckg_no = lv_pckg_tmp.
    t_service-subpckg_no = 0.
    t_service-line_no = t_service-line_no + '0000000001'.
    t_service-ext_line = t_service-ext_line + lv_serv_ext_line.

    t_service-service = '00000000FS00200064'.
    t_service-ext_serv = '999999'.


    t_service-quantity = '1.000'.
    t_service-base_uom = 'AU'.
    t_service-uom_iso = 'PCE'.
    t_service-price_unit = 1.

    t_service-gr_price = '450.000'.
    t_service-short_text = 'Maintenance server'.
    APPEND t_service.

*  END LOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: fajar.ahmad on Jan 25, 2010 8:43 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jan 2010 07:37:04 GMT</pubDate>
    <dc:creator>ahmad_fajar</dc:creator>
    <dc:date>2010-01-25T07:37:04Z</dc:date>
    <item>
      <title>Problem using BAPI_REQUISITION_CREATE with service......</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-bapi-requisition-create-with-service/m-p/6593226#M1436158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have encountered problems using BAPI_REQUISITION_CREATE, for creating PR&lt;/P&gt;&lt;P&gt;with service items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know there is some formatting that you have to do&lt;/P&gt;&lt;P&gt;before sending internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's running great with IDES&lt;/P&gt;&lt;P&gt;but  problem occured  when  dev. on Development Server.&lt;/P&gt;&lt;P&gt;It wouldn't update the service line item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried almost everything and running out ideas.&lt;/P&gt;&lt;P&gt;Heres the code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  DATA: t_return LIKE bapireturn OCCURS 0 WITH HEADER LINE.
  DATA: t_text type BAPIEBANTX.
  DATA: lv_itemcat LIKE t_items-item_cat.
  DATA: lv_serv_line_no LIKE t_service-line_no,
        lv_serv_ext_line LIKE t_service-ext_line,
        lv_pckg_no LIKE t_items-pckg_no,
        lv_item_no LIKE t_items-preq_item,
        lv_serr_no LIKE t_acc_asgmt-serial_no.
 

*  break-point.
  IF t_items[] IS INITIAL.
    gv_msg = 'Item is empty'.
    EXIT.
  ENDIF.

  IF t_service[] IS INITIAL.
    gv_msg = 'Service is empty'.
    EXIT.
  ENDIF.

  IF t_acc_asgmt[] IS INITIAL.
    gv_msg = 'Account assignment is empty'.
    EXIT.
  ENDIF.
  CLEAR: t_items[], t_service[], t_acc_asgmt[],t_serv_acc[],
  t_items, t_service, t_acc_asgmt,t_serv_acc.
** Initial constant for services &amp;amp; package link
  lv_serv_line_no = 1.
  lv_serv_ext_line = 10.
  lv_pckg_no = '0000000001'.
  lv_item_no = '00010'.
  lv_serr_no = 01.

  DATA: RCODE LIKE INRI-RETURNCODE.


  CALL FUNCTION 'NUMBER_GET_NEXT'
       EXPORTING
            NR_RANGE_NR = '01'
            OBJECT = 'SERVICE'
*         QUANTITY = E03
*         SUBOBJECT = E04
*         TOYEAR = E05
       IMPORTING
            NUMBER = lv_pckg_no
*         QUANTITY = I02
            RETURNCODE = RCODE
       EXCEPTIONS
            INTERVAL_NOT_FOUND = 01
            NUMBER_RANGE_NOT_INTERN = 02
            OBJECT_NOT_FOUND = 03
            QUANTITY_IS_0 = 04.

lv_pckg_no = lv_pckg_no + 1.

*BREAK-POINT.
    
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COuld anyone double check my coding.&lt;/P&gt;&lt;P&gt;How to fix this?Does anyone else has same problem with me?.&lt;/P&gt;&lt;P&gt;I  checked all formatting and structure using BAPI_REQUISTION_GETDETAIL. &lt;/P&gt;&lt;P&gt;It should be allright. As I said Its running on IDES Server but wont on Dev Server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Useful help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: fajar.ahmad on Jan 25, 2010 8:28 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: fajar.ahmad on Jan 25, 2010 8:34 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 07:25:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-bapi-requisition-create-with-service/m-p/6593226#M1436158</guid>
      <dc:creator>ahmad_fajar</dc:creator>
      <dc:date>2010-01-25T07:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using BAPI_REQUISITION_CREATE with service......</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-bapi-requisition-create-with-service/m-p/6593227#M1436159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;t_items-doc_type = 'SVEN'.
  t_items-del_datcat = '1'. "D
  t_items-deliv_date = '20100201'.
  t_items-plant = 'EN01'.
  t_items-store_loc = 'E101'.
  t_items-pur_group = 'E01'.
  t_items-mat_grp = '0609'.
  t_items-quantity = 1.
  t_items-unit = 'AU'.
  t_items-purch_org = 'ELN'.
  t_items-item_cat = '9'. "D
  t_items-acctasscat = 'K' .
  t_items-short_text = 'SeRVICE Server'.
  t_items-preq_item = lv_item_no.
  t_items-pckg_no = lv_pckg_no.
  APPEND t_items.

  data lv_pckg_tmp like t_service-pckg_no.
  LOOP AT t_items.
    t_service-pckg_no = t_items-pckg_no.
    t_service-subpckg_no = t_service-pckg_no + 1.
    t_service-line_no = lv_serv_line_no.
    t_service-ext_line = 0.
    t_service-outl_ind  = 'X'.
    t_service-from_line  = 1.


    APPEND t_service.
    clear: t_service-outl_ind, t_service-from_line.


    lv_pckg_tmp = t_items-pckg_no + 1.
* LOOP AT T_SERVICE.
    t_service-pckg_no = lv_pckg_tmp.
    t_service-subpckg_no = 0.
    t_service-line_no = t_service-line_no + '0000000001'.
    t_service-ext_line = t_service-ext_line + lv_serv_ext_line.

    t_service-service = '00000000FS00200064'.
    t_service-ext_serv = '999999'.


    t_service-quantity = '1.000'.
    t_service-base_uom = 'AU'.
    t_service-uom_iso = 'PCE'.
    t_service-price_unit = 1.

    t_service-gr_price = '450.000'.
    t_service-short_text = 'Maintenance server'.
    APPEND t_service.

*  END LOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: fajar.ahmad on Jan 25, 2010 8:43 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 07:37:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-bapi-requisition-create-with-service/m-p/6593227#M1436159</guid>
      <dc:creator>ahmad_fajar</dc:creator>
      <dc:date>2010-01-25T07:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using BAPI_REQUISITION_CREATE with service......</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-bapi-requisition-create-with-service/m-p/6593228#M1436160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;t_acc_asgmt-serial_no = lv_serr_no.
    t_acc_asgmt-preq_item = t_items-preq_item.
    t_acc_asgmt-preq_qty = t_items-quantity.

    t_acc_asgmt-g_l_acct = '6357120100'.
    t_acc_asgmt-cost_ctr = '001-D-ELN'.
    t_acc_asgmt-CO_AREA  = 'ELN'.
    t_acc_asgmt-PROFIT_CTR = '001-D-ELN'.
    t_acc_asgmt-bus_area = 'ELN'.
*  T_ACC_ASGMT-TO_COSTCTR = 'X'.
    APPEND t_acc_asgmt.

    t_serv_acc-pckg_no = t_service-pckg_no.
    t_serv_acc-line_no = t_service-line_no.
    t_serv_acc-serno_line = t_acc_asgmt-serial_no.
    t_serv_acc-serial_no = t_serv_acc-serno_line.
    t_serv_acc-percentage = '100.0'.
    t_serv_acc-QUANTITY = '1.000'.
    APPEND t_serv_acc.

 ENDLOOP.

  BREAK-POINT.
  CALL FUNCTION 'BAPI_REQUISITION_CREATE'
* EXPORTING
* SKIP_ITEMS_WITH_ERROR =
  IMPORTING
  number = e_number
  TABLES
  requisition_items = t_items
  requisition_account_assignment = t_acc_asgmt
* REQUISITION_ITEM_TEXT =
* REQUISITION_LIMITS =
* REQUISITION_CONTRACT_LIMITS =
   requisition_services = t_service
   requisition_srv_accass_values = t_serv_acc
  return = t_return
* REQUISITION_SERVICES_TEXT =
* EXTENSIONIN =
* REQUISITION_ADDRDELIVERY =
  .
  READ TABLE t_return WITH KEY type = 'E'.

*Function called for commit  read table i_return with key type = 'E'.

    IF sy-subrc &amp;lt;&amp;gt; 0 .
*Function called for commit
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
           EXPORTING
                wait = 'X'.
      ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
    ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: fajar.ahmad on Jan 25, 2010 8:51 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 07:39:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-using-bapi-requisition-create-with-service/m-p/6593228#M1436160</guid>
      <dc:creator>ahmad_fajar</dc:creator>
      <dc:date>2010-01-25T07:39:37Z</dc:date>
    </item>
  </channel>
</rss>

