<?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: Service Entry sheet with BAPI in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/service-entry-sheet-with-bapi/m-p/5219175#M1207022</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;PRE&gt;&lt;CODE&gt;
REPORT test_program.

DATA: wa_header TYPE bapiessrc,
i_return TYPE bapiret2 OCCURS 0 WITH HEADER LINE,
ws_entrysheet_no TYPE bapiessr-sheet_no,
i_service TYPE bapiesllc OCCURS 0 WITH HEADER LINE,
i_service_acc TYPE bapiesklc OCCURS 0 WITH HEADER LINE,
i_service_text TYPE bapieslltx OCCURS 0 WITH HEADER LINE,
i_account TYPE bapiesknc OCCURS 0 WITH HEADER LINE,
ws_pack_no TYPE packno.


DATA: ws_po TYPE bapiekko-po_number,
po_items TYPE bapiekpo OCCURS 0 WITH HEADER LINE,
po_services TYPE bapiesll OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF wa_po_header OCCURS 1.
INCLUDE STRUCTURE bapiekkol.
DATA: END OF wa_po_header.

DATA: BEGIN OF bapi_return_po OCCURS 1.
INCLUDE STRUCTURE bapireturn.
DATA: END OF bapi_return_po.

DATA: serial_no LIKE bapiesknc-serial_no,
line_no LIKE bapiesllc-line_no.

DATA: bapi_esll LIKE bapiesllc OCCURS 1 WITH HEADER LINE.

ws_po = '4300000051'.

CALL FUNCTION 'BAPI_PO_GETDETAIL'
EXPORTING
purchaseorder = ws_po
items = 'X'
services = 'X'
IMPORTING
po_header = wa_po_header
TABLES
po_items = po_items
po_item_services = po_services
return = bapi_return_po.

wa_header-po_number = po_items-po_number.
wa_header-po_item = po_items-po_item.
wa_header-short_text = 'Sample'.
wa_header-pckg_no = 1.

serial_no = 0.
line_no = 1.

bapi_esll-pckg_no = 1.
bapi_esll-line_no = line_no.
bapi_esll-outl_level = '0'.
bapi_esll-outl_ind = 'X'.
bapi_esll-subpckg_no = 2.
APPEND bapi_esll.


LOOP AT po_services WHERE NOT short_text IS INITIAL.
line_no = line_no + 1.
CLEAR bapi_esll.
* MOVE-CORRESPONDING po_services TO bapi_esll.
* bapi_esll-gr_price = '456'.
bapi_esll-pckg_no = 2.
bapi_esll-line_no = line_no.
bapi_esll-service = po_services-service.
bapi_esll-quantity = po_services-quantity.
bapi_esll-gr_price = po_services-gr_price.
bapi_esll-price_unit = po_services-price_unit.
APPEND bapi_esll.
ENDLOOP.

CALL FUNCTION 'BAPI_ENTRYSHEET_CREATE'
EXPORTING
entrysheetheader = wa_header
* testrun = 'X'
IMPORTING
entrysheet = ws_entrysheet_no
TABLES
* ENTRYSHEETACCOUNTASSIGNMENT =
entrysheetservices = bapi_esll
* entrysheetsrvaccassvalues = i_service_acc
return = i_return
* entrysheetservicestexts = i_service_text
* ENTRYSHEETHEADERTEXT =
.

break gbpra8.
LOOP AT i_return.

ENDLOOP.

DATA: ws_wait TYPE bapita-wait.

ws_wait = '3'.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = ws_wait.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Krishna...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Mar 2009 04:47:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-03-02T04:47:51Z</dc:date>
    <item>
      <title>Service Entry sheet with BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/service-entry-sheet-with-bapi/m-p/5219173#M1207020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to create service entry sheet with BAPI_ENTRYSHEET_CREATE. can anyone tell me step by step process like what data I need to maintain in which table?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2009 10:55:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/service-entry-sheet-with-bapi/m-p/5219173#M1207020</guid>
      <dc:creator>former_member329310</dc:creator>
      <dc:date>2009-02-24T10:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Service Entry sheet with BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/service-entry-sheet-with-bapi/m-p/5219174#M1207021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Go to Wiki tab of this site and search with BAPI_ENTRYSHEET_CREATE (from search option on the right top of the page).  You'll find more examples of this bapi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2009 05:40:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/service-entry-sheet-with-bapi/m-p/5219174#M1207021</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-27T05:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Service Entry sheet with BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/service-entry-sheet-with-bapi/m-p/5219175#M1207022</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;PRE&gt;&lt;CODE&gt;
REPORT test_program.

DATA: wa_header TYPE bapiessrc,
i_return TYPE bapiret2 OCCURS 0 WITH HEADER LINE,
ws_entrysheet_no TYPE bapiessr-sheet_no,
i_service TYPE bapiesllc OCCURS 0 WITH HEADER LINE,
i_service_acc TYPE bapiesklc OCCURS 0 WITH HEADER LINE,
i_service_text TYPE bapieslltx OCCURS 0 WITH HEADER LINE,
i_account TYPE bapiesknc OCCURS 0 WITH HEADER LINE,
ws_pack_no TYPE packno.


DATA: ws_po TYPE bapiekko-po_number,
po_items TYPE bapiekpo OCCURS 0 WITH HEADER LINE,
po_services TYPE bapiesll OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF wa_po_header OCCURS 1.
INCLUDE STRUCTURE bapiekkol.
DATA: END OF wa_po_header.

DATA: BEGIN OF bapi_return_po OCCURS 1.
INCLUDE STRUCTURE bapireturn.
DATA: END OF bapi_return_po.

DATA: serial_no LIKE bapiesknc-serial_no,
line_no LIKE bapiesllc-line_no.

DATA: bapi_esll LIKE bapiesllc OCCURS 1 WITH HEADER LINE.

ws_po = '4300000051'.

CALL FUNCTION 'BAPI_PO_GETDETAIL'
EXPORTING
purchaseorder = ws_po
items = 'X'
services = 'X'
IMPORTING
po_header = wa_po_header
TABLES
po_items = po_items
po_item_services = po_services
return = bapi_return_po.

wa_header-po_number = po_items-po_number.
wa_header-po_item = po_items-po_item.
wa_header-short_text = 'Sample'.
wa_header-pckg_no = 1.

serial_no = 0.
line_no = 1.

bapi_esll-pckg_no = 1.
bapi_esll-line_no = line_no.
bapi_esll-outl_level = '0'.
bapi_esll-outl_ind = 'X'.
bapi_esll-subpckg_no = 2.
APPEND bapi_esll.


LOOP AT po_services WHERE NOT short_text IS INITIAL.
line_no = line_no + 1.
CLEAR bapi_esll.
* MOVE-CORRESPONDING po_services TO bapi_esll.
* bapi_esll-gr_price = '456'.
bapi_esll-pckg_no = 2.
bapi_esll-line_no = line_no.
bapi_esll-service = po_services-service.
bapi_esll-quantity = po_services-quantity.
bapi_esll-gr_price = po_services-gr_price.
bapi_esll-price_unit = po_services-price_unit.
APPEND bapi_esll.
ENDLOOP.

CALL FUNCTION 'BAPI_ENTRYSHEET_CREATE'
EXPORTING
entrysheetheader = wa_header
* testrun = 'X'
IMPORTING
entrysheet = ws_entrysheet_no
TABLES
* ENTRYSHEETACCOUNTASSIGNMENT =
entrysheetservices = bapi_esll
* entrysheetsrvaccassvalues = i_service_acc
return = i_return
* entrysheetservicestexts = i_service_text
* ENTRYSHEETHEADERTEXT =
.

break gbpra8.
LOOP AT i_return.

ENDLOOP.

DATA: ws_wait TYPE bapita-wait.

ws_wait = '3'.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = ws_wait.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Krishna...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2009 04:47:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/service-entry-sheet-with-bapi/m-p/5219175#M1207022</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-02T04:47:51Z</dc:date>
    </item>
  </channel>
</rss>

