BAPI_PO_CREATE1: For Service Items
Dear All,
I am trying to create an upload program for all the POs which include service items using BAPI_PO_CREATE1.
However, i am facing problems: Systems throws up an error message
<b>"In case of account assignment, please enter acc. assignment data for item"</b>
i have provided all the relavent fields, still could not found the reasons. (we are using services (with service master data in SAP) as line items).
Please find the code:
Fill PO Header Data
wa_poheader-ref_1 = '1'.
wa_poheader-doc_date = '20070730'.
wa_poheader-doc_type = 'ZMN'.
wa_poheader-vendor = '0000100001'.
wa_poheader-purch_org = 'CPO'.
wa_poheader-pur_group = 'P01'.
wa_poheader-currency = 'MYR'.
wa_poheader-incoterms1 = 'CIF'.
wa_poheader-incoterms2 = 'MITV'.
wa_poheaderx-ref_1 = 'X'.
wa_poheaderx-doc_date = 'X'.
wa_poheaderx-doc_type = 'X'.
wa_poheaderx-vendor = 'X'.
wa_poheaderx-purch_org = 'X'.
wa_poheaderx-pur_group = 'X'.
wa_poheaderx-currency = 'X'.
wa_poheaderx-incoterms1 = 'X'.
wa_poheaderx-incoterms2 = 'X'.
Fill PO Line Item Data
wa_poitem-po_item = '00010'.
wa_poitem-quantity = '1'.
wa_poitem-short_text = 'service material'.
wa_poitem-acctasscat = 'K'.
wa_poitem-item_cat = '9'.
wa_poitem-matl_group = 'SERVICE'.
wa_poitem-plant = '1000'.
wa_poitem-net_price = '100'.
wa_poitem-price_unit = '1'.
wa_poitem-pckg_no = '0000000001'.
APPEND wa_poitem TO it_poitem.
PO Line item values to be updated
wa_poitemx-po_item = '00010'.
wa_poitemx-po_itemx = 'X'.
wa_poitemx-quantity = 'X'.
wa_poitemx-short_text = 'X'.
wa_poitemx-acctasscat = 'X'.
wa_poitemx-item_cat = 'X'.
wa_poitemx-matl_group = 'X'.
wa_poitemx-plant = 'X'.
wa_poitemx-net_price = 'X'.
APPEND wa_poitemx TO it_poitemx.
CLEAR: wa_poitem,
wa_poitemx.
Fill Accounting Data
wa_poaccount-po_item = '00010'.
wa_poaccount-serial_no = '01'.
wa_poaccount-creat_date = sy-datum.
wa_poaccount-quantity = '1'.
wa_poaccount-net_value = '100'.
wa_poaccount-costcenter = 'MNCOE0201'.
wa_poaccount-gl_account = '0000505203'.
wa_poaccount-co_area = 'MITV'.
APPEND wa_poaccount TO it_poaccount.
Accounting line item values to be updated
wa_poaccountx-po_item = '00010'.
wa_poaccountx-po_itemx = 'X'.
wa_poaccountx-serial_no = '01'.
wa_poaccountx-serial_no = 'X'.
wa_poaccountx-creat_date = 'X'.
wa_poaccountx-quantity = 'X'.
wa_poaccountx-net_value = 'X'.
wa_poaccountx-costcenter = 'X'.
wa_poaccountx-gl_account = 'X'.
wa_poaccountx-co_area = 'X'.
APPEND wa_poaccountx TO it_poaccountx.
Fill Service Details servicio 1
wa_poservices-pckg_no = '0000000001'.
wa_poservices-line_no = '00010' .
wa_poservices-ext_line = '00010' .
wa_poservices-outl_level = '0'.
wa_poservices-subpckg_no = '0000000000'.
wa_poservices-service = '000000000003000025'.
wa_poservices-edition = '0000' .
wa_poservices-base_uom = 'EA' .
*SERVICES-UOM_ISO = 'C62' .
wa_poservices-quantity = '1' .
wa_poservices-price_unit = '1' .
wa_poservices-ovf_tol = '0' .
wa_poSERVICES-FROM_LINE = '1' .
wa_poservices-short_text = 'Electrical System'.
wa_poservices-pers_no = '00000000' .
wa_poservices-pln_pckg = '0000000000' .
wa_poservices-pln_line = '0000000000' .
wa_poservices-con_pckg = '0000000000' .
wa_poservices-con_line = '0000000000' .
wa_poservices-tmp_pckg = '0000000000' .
wa_poservices-tmp_line = '0000000000' .
wa_poservices-limit_line = '0000000000' .
*SERVICES-TAX_CODE = 'I2' .
wa_poservices-gr_price = '100' .
wa_poservices-matl_group = 'SERVICE'.
APPEND wa_poservices TO it_poservices.
CLEAR wa_poservices.
FIRST ENTRY
posrvaccessvalues-pckg_no = '0000000001'.
posrvaccessvalues-serno_line = '00010'.
posrvaccessvalues-percentage = '100'.
posrvaccessvalues-serial_no = '01'.
posrvaccessvalues-quantity = '1'.
posrvaccessvalues-net_value = '100'.
APPEND posrvaccessvalues .
CLEAR posrvaccessvalues.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = wa_poheader
poheaderx = wa_poheaderx
IMPORTING
exppurchaseorder = w_ponumber
TABLES
return = it_return
poitem = it_poitem
poitemx = it_poitemx
poaccount = it_poaccount
poaccountx = it_poaccountx
polimits = po_limits
poservices = it_poservices
posrvaccessvalues = posrvaccessvalues.
IF NOT w_ponumber IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
WRITE:/ w_ponumber.
ELSE.
LOOP AT it_return INTO wa_return.
WRITE:/ wa_return-message_v1, wa_return-message_v2, wa_return-message.
ENDLOOP.
ENDIF.
Please suggest me where i am going wrong.
Hi,
To commit BAPI or to run it properly , you need to fulfill all required data for BAPI.
You can go to BAPI documentation to check for mandetory parameters and also check with Function consultant for more data and confifuration/
Reward if useful!
Similar Messages
-
PR Price Adopted to PO for service item
We are using idocs which uses BAPI_PO_CREATE1 to load the legacy PO's into ECC. Even though we supply the PO Price which is different than the PR Price for service item, the price is still adopted from PR which we don't want. I checked ML91 and there is a flag which is "Ignore Requisition Price in PO", but for online process, PR price must be adopted to PO for service item. Any Ideas if something can be done with configuration or any enhancements I have to look at.
Hi,
As you needed, use t.code OMET & define functional authorization, choose u201CAdopt PO Priceu201D and u201CRef. to Purchase Requisition" & save. Now in t.code SU01 assign your user ID with parameter ID EFB.& save. Now create PR & then create PO wrt PR, see the valuation price of PR will be taken to PO automatically.
Regards,
Biju K -
Delivery Schedule for Service Item
Hi folks!
Can anyone guide me, how to create delivery schedule for Service item in Purchase Order.
Regards.If it is an external service (Item category D), you cannot enter delivery schedule for individual services.
Lakshman -
Ability to modify Account Assignment Category for Service Item Categories
Dear experts,
Our customer has a requirement to modify the account assignment category when the item category is set to "D" services on a PR and PO line item. This scenario is specific to indirect procurement scenarios in SAP ECC 6.0 MM.
End users may potentially create a PR against a service item category with an incorrect account assignment category. These PRs are created using free form text. No service master exists in these scenarios. During the approval process or during PO creation, an approver or the buyer may need to correct the account assignment category. The account assignment category is "display" only and cannot be modified when the item category is set to "D". The user must delete the line item and create a new line item with the correct account assignment category. The copy function cannot be used because the account assignment copies from the existing line and cannot be modified.
Any recommendations to this issue using standard SAP configuration solutions?
Thanks,
JenniferItem Category to Account Assignment Category combination is already configured. For Service Item Category, we have three account assignment categories configured. All three categories are valid in different scenarios. Sometimes the user selects the incorrect account assignment category (out of the three available) depending on the business scenario. PT9F configuration is already set to Account Assignment category "optional". However, the account assignment category still cannot be modified on the PR when the item category is "D" service.
Any other recommendations? -
Delivery completed indicator in purchase order for service item
How can I make the delivery completed indicator (EKPO-ELIKZ) in a purchase order for a service item ready for direct changes.
Per default this field is hidden on purpose for service items (according to SAP note 735404). Please inform me of customizing entry where that can be changed!
Thanks,
Johnnydelivery completed indicator only gives information for MRP ( That not consider balance qty as onorder stock), it has no control on GR, so I am not sure what you will achieve to mark it in service PO?
-
Transfer of tax indicator to purchase order for service items in shopping cart
Hi all.
I have a problem with the tax indicator in the shopping carts and in the backend purchase orders for service items. If I create a shopping cart with service items with different tax indicators, the backend purchase order have a unique item including all the services. So, all the PO items are under one tax indicator while in the shopping cart there is more than one indicator. I mean, the PO is not correctly replicated with the information of the SC.
Example: shopping cart in SRM with 3 items, tax codes: V1, V2, V1. The standard code transfers the information to the backend, and creates a purchase order with an unique item with the 3 services under tax code V1. So, the second service is not under the correct tax code, and will be wrongly invoiced.
We have debugged all the code of the process, and we think it is a standard bug. When you replicate a PO in the backend from a SC in SRM, have you experienced this behaviour, or the service items are grouped in different PO items each one with the correct tax indicator?
Thanks in advance.Hi again...
I forgot to mention that we have found and applied the note 1822107 (Purchase order: wrong tax code for PO with 2 service items), that fits exactly to our problem. But after testing, it doesn't work.
Regards. -
Error in Viewing Draft Invoice for Service Item Type
Hi
I am facing an error in viewing draft service invoice.
I am saving a document (PO/ Invoice) as draft.
When i am trying to view from document draft list by double-clicking it. the Visual Studio Just-in-Time debugger opens up stating SAP Business One.exe encounterd an problem and by clicking NO button the SAP closes.
Note: The Invoice is created for Service Items, it is working perfect with Item.
This is urgent - any help
I am using 2005 B PL 05 with SQL 2005 on Win 2003 SP1
IndrajitDo you have any Addon's.
As you seek answers here please post a support message to SAP Support
https://websmp205.sap-ag.de/sbo-message-old -
Variable billing for service items using OKS
I've a requirement as follows:
My company wants to create service contracts with FIXED and VARIABLE billing for the same covered products/sites. We know how to setup fixed billing schedule for service items.
How do we setup variable billing using service items (not through usage items)? What are the steps required for us to do that so that upon counter capture for the service item, variable billing is done.
Please help.
Thanks,
SethThe release is R12.1.3
-Seth -
The net price is calculated incorrectly for service items in contracts
The net price is calculated incorrectly for service items. Iu2019m creating a contract for services, transaction ME31K (without service master). At the services level Iu2019m adding u201CConditions Supplementsu201D:
- PRS (gross price) =1000 EUR
- Z999 (discount) = -100 EUR
- ZPRS (cost) = 1500 EUR
The gross price is calculated correctly = 2400. My problem is with the net price, with this example the net price is just 1500 this means that is just considering the condition ZPRS.
Where can I customize the net price determination to considerer all price conditions?
Thanks in adavncedHi,
In the service industries area, SAP uses two calculation schemata,
MS0001 for contract/master services (Z999 must be added to MS0001) and otherwise, MS0000. Assignment
occurs according to the Customizing settings defined under
'Materials Management -> External Services Management -> Maintain
Conditions for Services -> Conditions: Schema for Services'. If you want
to use another calculation schema for contract/master services, you must
define this with an own entry under Maintain Conditions for Services ->
Variable Calculation Schema for Services', for example, in the form 'K
WK value contract MSxxxx service schema', if a corresponding schema
MSxxxx has been defined first.
If Z999 is a header discount for the service outline level, it must be added to MS0002.
Like the standard discount condition type ZA00 the Z999 must have Cond. class A for Discount or surcharge in the condition type setting in the customizing, and no access sequence should be assigned to it.
Please read the notes 798798 and 353482.
Regards,
Edit -
Error : Purchase Order Response for Service items Different
Hi ,
We are getting Error : Purchase Order Response for Service items Different , when creating the PO in SRM 5.0. what must be the reason ?
Thanks & Regards,Problem solved
-
Me21n - Me59n - Exit for Services Items
Hi All,
I am creating a Purchase Order (PO) from a Purchase Requisition (PR).
PR has items which item category = 'D' - Service.
If I select an item and select in menu Item -> Service, it will be listed Serives Items.
I need to copy the column `value` from these service items from PR to PO.
Does anybody know an exit to modify the value field for Service Items, when I am creating a PO from PR?
The table is ESLL.
Thanks,
Janetetry this..
MEQUERY1 Enhancement to Document Overview ME21N/ME51N...
SAP extension name Type Enhancement
MEQUERY1
MEQUERY1 E EXIT_SAPLMEQUERY_001
MEQUERY1 E EXIT_SAPLMEQUERY_002
Regards,
Prabhudas -
Sales order creation for service items?
Hi,
My client is a courier company and it wants to implement sap. You offer only service how do you map in sap??. can we create sales order for service items.?. and how about the entire outbound process can be mapped?. Any ideas or insights or practical experience. Kindly share.
Regards,
Jothiswaran.Jothiswaran,
I think it could be mapped with SAP CS - Sale of service functionality in R/3.
Rough Idea:
Create a Sales order with Service product (Mumbai2chennai) with a Task list (Routing - for each stage). Let it triggers a Service order. Confirm each stage in Service order with Truck number for tracking. Once you complete the delivery, do TECO in Service order. May be advance billing or post billing.
Try in SAP CS.
Babu -
ESO/ERP Integration for Service Items?
Hello experts,
In an ESO/ERP integrated system, can data from Service master in the ERP also be used to create RFQ's and Auctions in ESO?
Are there any special considerations for Service Items in such an integrated environment or would they be treated as regular material master items inside ESO?
Thanks & Regards,
ReshmaHi Reshma
You are right, currently Item type D is nto supported for the ERP - ESO implementation for Document types RFQ, PR, PO that are created from the MSA or the RFx award from SAP ES.
However, you can still try to create the interface using some Z programs if you are pushed to the limit
What you can do?
1) Copy the Program for the BBP_ESI package model it to suit methods that call the Service line into the PR with Item category D - if you are successful here, you can check with the available list of API's on the ES side to check where in the XML extract you can actually incorporate the Service lines
2) Create a Proxy using the existing interface delivered for RFQ or PR from ECC to SAP ES RFx, in PI you can define the Service line logic so that the Payloads in PI can enable this transfer
3) The XML that is generated for this interface must be in Sync with what all RFx expects to process it as a service line, since there is no classification on the SAP ES side for addressing service lines separately.
4) You can also extend the XPRess functionality, since SAP ES views Service and print requests service lines, see if you can somehow integrate creation of an XPress draft from a Service PR in ECC, that too should be possible.
5) If all approaches fail, its better to integrate the SRM SoCo to push the Service lines into SAP ES RFx draft, below would be the approach.
u2022 Requirements from SRM, SAP R/3 or SAP ECC to SRM Sourcing cockpit
u2022 Create Bid invitation in SRM : Draft status
u2022 All SRM Bid Invitations to populate in a new screen developed, this screen will have all bid invitations lined up with a check box next to them, the Bid Invitation can be selected and pushed to SAP E-Sourcing
u2022 Proxy created to extract these fields from SRM and put it in XI outbound
u2022MAP / Cross MAP the data structures and pass the data
u2022 Push the Bid Invitation into SAP E-Sourcing as RFx Draft
u2022 Once the Bid Invitation is pushed into the SAP ESO application, it cannot be modified in SRM
Hope this gives you some fair approach -
Bapi_po_create1 for service
I am trying to create a PO with reference to PR for service.
Getting error saying In case of account assignment, please enter acc. assignment data for item at POITEM level
Normal PO and PO with ref to PR are working fine.
Any clue what might be wrong?
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = wa_header
poheaderx = wa_headerx
poaddrvendor = tb_address
testrun = co_space
* MEMORY_UNCOMPLETE =
* MEMORY_COMPLETE =
* NO_MESSAGING =
* NO_MESSAGE_REQ =
* NO_AUTHORITY =
no_price_from_po = 'X'
* IMPORTING
* EXPPURCHASEORDER =
* EXPHEADER =
TABLES
return = tb_return
poitem = tb_item
poitemx = tb_itemx
* POADDRDELIVERY =
poschedule = tb_sch
poschedulex = tb_schx
poaccount = tb_acc
* POACCOUNTPROFITSEGMENT =
poaccountx = tb_accx
* pocondheader = tb_condheader
* pocondheaderx = tb_condheaderx
pocond = tb_cond
pocondx = tb_condx
polimits = tb_e1bpesuhc
pocontractlimits = tb_e1bpesucc
poservices = tb_service
posrvaccessvalues = tb_e1bpesklc
poservicestext = tb_e1bpeslltx
* EXTENSIONIN =
* EXTENSIONOUT =
potextheader = tb_htext
potextitem = tb_itext
popartner = tb_e1bpekkop
* Following line added for testing purpose
READ TABLE tb_ze1bpekkotx INDEX 1.
IF sy-subrc EQ 0.
st_e1bpekkoc-po_number = tb_ze1bpekkotx-po_number.
ENDIF.
* End of Insertion.
* Fill the PO Header
wa_header-doc_date = st_e1bpekkoc-doc_date.
wa_header-doc_type = st_e1bpekkoc-doc_type.
wa_header-comp_code = st_e1bpekkoc-co_code.
wa_header-purch_org = st_e1bpekkoc-purch_org.
wa_header-pur_group = st_e1bpekkoc-pur_group.
wa_header-vendor = st_e1bpekkoc-vendor.
wa_header-po_number = st_e1bpekkoc-po_number.
wa_header-pmnttrms = st_e1bpekkoa-pmnttrms.
wa_header-dscnt1_to = st_e1bpekkoa-dscnt1_to.
wa_header-dscnt2_to = st_e1bpekkoa-dscnt2_to.
wa_header-dscnt3_to = st_e1bpekkoa-dscnt3_to.
wa_header-dsct_pct1 = st_e1bpekkoa-cash_disc1.
wa_header-dsct_pct2 = st_e1bpekkoa-cash_disc2.
wa_header-created_by = st_e1bpekkoa-created_by.
wa_header-currency = st_e1bpekkoa-currency.
wa_header-exch_rate = st_e1bpekkoa-exch_rate.
wa_header-ex_rate_fx = st_e1bpekkoa-ex_rate_fx.
wa_header-incoterms1 = st_e1bpekkoa-incoterms1.
wa_header-incoterms2 = st_e1bpekkoa-incoterms2.
wa_header-ref_1 = st_e1bpekkoa-ref_1.
wa_header-sales_pers = st_e1bpekkoa-sales_pers.
wa_header-telephone = st_e1bpekkoa-telephone.
* Fill the PO Header Change Toolbar
wa_headerx-doc_date = co_x.
wa_headerx-doc_type = co_x.
wa_headerx-comp_code = co_x.
wa_headerx-purch_org = co_x.
wa_headerx-pur_group = co_x.
wa_headerx-vendor = co_x.
wa_headerx-po_number = co_x.
wa_headerx-pmnttrms = co_x.
wa_headerx-dscnt1_to = co_x.
wa_headerx-dscnt2_to = co_x.
wa_headerx-dscnt3_to = co_x.
wa_headerx-dsct_pct1 = co_x.
wa_headerx-dsct_pct2 = co_x.
wa_headerx-created_by = co_x.
wa_headerx-currency = co_x.
wa_headerx-exch_rate = co_x.
wa_headerx-ex_rate_fx = co_x.
wa_headerx-incoterms1 = co_x.
wa_headerx-incoterms2 = co_x.
wa_headerx-ref_1 = co_x.
wa_headerx-sales_pers = co_x.
wa_headerx-telephone = co_x.
* Fill the Address Table
tb_address-po_number = st_e1bpekkoc-po_number.
tb_address-addr_no = st_e1bpaddress-addrnumber.
tb_address-name = st_e1bpaddress-name1.
tb_address-name_2 = st_e1bpaddress-name2.
tb_address-name_3 = st_e1bpaddress-name3.
tb_address-name_4 = st_e1bpaddress-name4.
tb_address-city = st_e1bpaddress-city1.
tb_address-district = st_e1bpaddress-city2.
tb_address-city_no = st_e1bpaddress-city_code.
tb_address-postl_cod1 = st_e1bpaddress-post_code1.
tb_address-postl_cod2 = st_e1bpaddress-post_code2.
tb_address-postl_cod3 = st_e1bpaddress-post_code3.
tb_address-po_box = st_e1bpaddress-po_box.
tb_address-po_box_cit = st_e1bpaddress-po_box_loc.
tb_address-street = st_e1bpaddress-street.
APPEND tb_address.
* Fill the POItem Table
LOOP AT tb_e1bpekpoc.
tb_item-po_item = tb_e1bpekpoc-po_item.
* Process the material based on the value.
IF tb_e1bpekpoc-material+0(2) EQ co_b9.
tb_item-material = co_space.
ELSE.
tb_item-material = tb_e1bpekpoc-material.
ENDIF.
tb_item-item_cat = tb_e1bpekpoc-item_cat.
tb_item-acctasscat = tb_e1bpekpoc-acctasscat.
tb_item-agreement = tb_e1bpekpoc-agreement.
tb_item-agmt_item = tb_e1bpekpoc-agmt_item.
tb_item-matl_group = tb_e1bpekpoc-mat_grp.
tb_item-short_text = tb_e1bpekpoc-short_text.
tb_item-distrib = tb_e1bpekpoc-distrib.
tb_item-part_inv = tb_e1bpekpoc-part_inv.
tb_item-kanban_ind = tb_e1bpekpoc-kanban_ind.
tb_item-plant = tb_e1bpekpoc-plant.
tb_item-po_unit = tb_e1bpekpoc-unit.
tb_item-po_unit_iso = tb_e1bpekpoc-po_unit_iso.
tb_item-net_price = tb_e1bpekpoc-net_price.
tb_item-conv_num1 = tb_e1bpekpoc-conv_num1.
tb_item-conv_den1 = tb_e1bpekpoc-conv_den1.
tb_item-orderpr_un = tb_e1bpekpoc-orderpr_un.
tb_item-pckg_no = tb_e1bpekpoc-pckg_no.
tb_item-trackingno = tb_e1bpekpoc-trackingno.
tb_item-at_relev = tb_e1bpekpoc-at_relev.
tb_item-po_price = tb_e1bpekpoc-po_price.
tb_item-tax_code = tb_e1bpekpoc-tax_code.
tb_item-preq_name = tb_e1bpekpoc-preq_name.
tb_item-delete_ind = tb_e1bpekpoc-delete_ind.
tb_item-free_item = co_space.
tb_item-material_external = tb_e1bpekpoc-material_external.
*Populate the table from the other segments.
READ TABLE tb_e1bpekpoa WITH KEY po_item = tb_e1bpekpoc-po_item.
IF sy-subrc EQ 0.
tb_item-info_upd = tb_e1bpekpoa-info_upd.
tb_item-gr_ind = tb_e1bpekpoa-gr_ind.
tb_item-ir_ind = tb_e1bpekpoa-ir_ind.
wf_ind_check = co_x.
ENDIF.
READ TABLE tb_e1bpeket WITH KEY po_item = tb_e1bpeket.
IF sy-subrc EQ 0.
tb_item-preq_no = tb_e1bpeket-preq_no.
tb_item-preq_item = tb_e1bpeket-preq_item.
* tb_item-ref_doc = tb_e1bpeket-preq_no.
tb_item-quantity = tb_e1bpeket-quantity.
wf_qty_check = co_x.
ENDIF.
APPEND tb_item.
* Fill the POItemx Table
tb_itemx-po_item = tb_e1bpekpoc-po_item.
tb_itemx-material = co_x.
tb_itemx-item_cat = co_x.
tb_itemx-acctasscat = co_x.
tb_itemx-agreement = co_x.
tb_itemx-agmt_item = co_x.
tb_itemx-matl_group = co_x.
tb_itemx-short_text = co_x.
tb_itemx-distrib = co_x.
tb_itemx-part_inv = co_x.
tb_itemx-kanban_ind = co_x.
tb_itemx-plant = co_x.
tb_itemx-po_unit = co_x.
tb_itemx-po_unit_iso = co_x.
tb_itemx-net_price = co_x.
tb_itemx-conv_num1 = co_x.
tb_itemx-conv_den1 = co_x.
tb_itemx-orderpr_un = co_x.
tb_itemx-pckg_no = co_x.
tb_itemx-trackingno = co_x.
tb_itemx-at_relev = co_x.
tb_itemx-po_price = co_x.
tb_itemx-tax_code = co_x.
tb_itemx-preq_name = co_x.
tb_itemx-delete_ind = co_x.
tb_itemx-free_item = co_x.
tb_itemx-material_external = co_x.
IF NOT wf_ind_check IS INITIAL.
tb_itemx-info_upd = co_x.
tb_itemx-gr_ind = co_x.
tb_itemx-ir_ind = co_x.
ENDIF.
IF NOT wf_qty_check IS INITIAL.
tb_itemx-preq_no = co_x.
tb_itemx-preq_item = co_x.
* tb_itemx-ref_doc = co_x.
tb_itemx-quantity = co_x.
ENDIF.
APPEND tb_itemx.
ENDLOOP.
* Fill the POSCHEDULE Table.
LOOP AT tb_e1bpeket.
tb_sch-po_item = tb_e1bpeket-po_item.
tb_sch-delivery_date = tb_e1bpeket-deliv_date.
tb_sch-quantity = tb_e1bpeket-quantity.
tb_sch-preq_no = tb_e1bpeket-preq_no.
tb_sch-preq_item = tb_e1bpeket-preq_item.
tb_sch-del_datcat_ext = tb_e1bpeket-del_datcat_ext.
APPEND tb_sch.
* Fill the POSCHEDULEX Table
tb_schx-po_item = tb_e1bpeket-po_item.
tb_schx-delivery_date = co_x.
tb_schx-quantity = co_x.
tb_schx-preq_no = co_x.
tb_schx-preq_item = co_x.
tb_sch-del_datcat_ext = co_x.
APPEND tb_schx.
ENDLOOP.
* Fill the POTEXTITEM Table.
LOOP AT tb_e1bpekpotx.
tb_itext-po_number = tb_e1bpekpotx-po_number.
tb_itext-po_item = tb_e1bpekpotx-po_item.
tb_itext-text_id = tb_e1bpekpotx-text_id.
tb_itext-text_form = tb_e1bpekpotx-text_form.
tb_itext-text_line = tb_e1bpekpotx-text_line.
APPEND tb_itext.
ENDLOOP.
* Fill the POTEXTHEADER Table.
LOOP AT tb_ze1bpekkotx.
tb_htext-po_number = tb_ze1bpekkotx-po_number.
tb_htext-text_id = tb_ze1bpekkotx-text_id.
tb_htext-text_form = tb_ze1bpekkotx-text_form.
tb_htext-text_line = tb_ze1bpekkotx-text_line.
APPEND tb_htext.
ENDLOOP.
LOOP AT tb_item.
* Fill the Condition Table.
tb_cond-cond_value = tb_item-net_price.
tb_cond-itm_number = 10. "tb_item-po_item.
tb_cond-currency = st_e1bpekkoa-currency.
tb_cond-change_id = 'I'. "co_i.
tb_cond-condchaman = co_x.
APPEND tb_cond.
tb_condheader-cond_value = tb_item-net_price.
tb_condheader-cond_type = 'PB00'.
tb_condheader-currency = st_e1bpekkoa-currency.
tb_condheader-change_id = 'I'.
tb_condheader-condchaman = co_x.
APPEND tb_condheader.
* Fill the Condition header Table
tb_condx-itm_number = tb_item-po_item.
tb_condx-cond_value = co_x.
tb_condx-cond_type = co_x.
tb_condx-currency = co_x.
tb_condx-change_id = co_x.
tb_condx-condchaman = co_x.
APPEND tb_condx.
tb_condheaderx-cond_type = co_x.
tb_condheaderx-cond_value = co_x.
tb_condheaderx-currency = co_x.
tb_condheaderx-change_id = co_x.
tb_condheaderx-condchaman = co_x.
APPEND tb_condheaderx.
ENDLOOP.
* Testing for PR and Services
IF NOT wf_qty_check IS INITIAL.
SELECT *
FROM eban
INTO TABLE tb_eban_po
FOR ALL ENTRIES IN tb_item
WHERE banfn = tb_item-preq_no
AND bnfpo = tb_item-preq_item.
IF NOT tb_eban_po[] IS INITIAL.
CLEAR lv_tabix.
LOOP AT tb_item.
lv_tabix = sy-tabix.
READ TABLE tb_eban_po WITH KEY banfn = tb_item-preq_no
bnfpo = tb_item-preq_item.
IF sy-subrc EQ 0.
tb_item-item_cat = tb_eban_po-pstyp.
tb_item-acctasscat = tb_eban_po-knttp.
tb_item-gr_basediv = co_x.
* Populate the Service Table
tb_service-pckg_no = tb_eban_po-packno.
tb_service-matl_group = tb_eban_po-matkl.
tb_service-quantity = tb_eban_po-menge.
tb_service-base_uom = tb_eban_po-meins.
tb_service-short_text = tb_eban_po-txz01.
tb_service-base_uom = tb_eban_po-meins.
tb_service-ext_line = '10'.
tb_service-gr_price = tb_eban_po-preis.
APPEND tb_service.
tb_srv_acc-pckg_no = tb_eban_po-packno.
APPEND tb_srv_acc.
READ TABLE tb_itemx INDEX lv_tabix.
IF sy-subrc EQ 0.
tb_itemx-item_cat = co_x.
tb_itemx-acctasscat = co_x.
tb_itemx-gr_basediv = co_x.
MODIFY tb_item INDEX lv_tabix.
MODIFY tb_itemx INDEX lv_tabix.
ENDIF.
tb_item-item_cat = tb_eban_po-pstyp.
tb_item-acctasscat = tb_eban_po-knttp.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
* Fill the POACCOUNT Table.
SELECT *
FROM ebkn
INTO TABLE tb_ebkn_po
FOR ALL ENTRIES IN tb_sch
WHERE banfn = tb_sch-preq_no.
IF NOT tb_ebkn_po[] IS INITIAL.
LOOP AT tb_ebkn_po.
tb_acc-po_item = tb_ebkn_po-bnfpo.
tb_acc-serial_no = tb_ebkn_po-zebkn.
tb_acc-quantity = tb_ebkn_po-menge.
tb_acc-gl_account = tb_ebkn_po-sakto.
tb_acc-costcenter = tb_ebkn_po-kostl.
tb_acc-profit_ctr = tb_ebkn_po-prctr.
tb_acc-co_area = tb_ebkn_po-kokrs.
tb_acc-net_value = tb_ebkn_po-netwr.
APPEND tb_acc.
* Fill the POACCOUNTX Table
tb_accx-po_item = tb_ebkn_po-bnfpo.
tb_accx-po_itemx = co_x.
tb_accx-serial_no = tb_ebkn_po-zebkn.
tb_accx-serial_nox = co_x.
tb_accx-quantity = co_x.
tb_accx-gl_account = co_x.
tb_accx-costcenter = co_x.
tb_accx-profit_ctr = co_x.
tb_accx-co_area = co_x.
tb_accx-net_value = co_x.
APPEND tb_accx.
ENDLOOP.
ENDIF.
ENDFORM.
Edited by: Archish RS on Feb 7, 2008 9:34 AMHello,
The same problem is discussed before two days.
Please have a look at this thread:
https://www.sdn.sap.com/irj/sdn/profile?userid=3461421
solved the issue by debugging.
Don't get too worried, there is an easy way to solve this if you get issues like this. See I was able to create a service PO from ME21N transaction. As you know service PO needs Service lines to be created it's mandatory. Here were my error is.
SAP from front end is using a hierarchical method of creating service lines. Not sure this is always like this!!!
The way you can figure out is ..go and create a PO from front end. use that PO number in BAPI_PO_GETDETAIL.
See the values it returns in the associated tables. Compare these values with your mapping in data load program. Then make the necessary changes. Of course there are things needs to be changed in Both Service line structure and Account structure. good luck
Hope this will solve ur problem
Cheers,
Vasanth -
Multiple Account Assignment issue with BAPI_PO_CREATE1 for service POs
Whle creating service PO through BAPI_PO_CREATE1, The account assignments at the service line items were not being added correctly at the item level, instead they are getting split further wrt tax jurisdiction. This is occuring when an item have multiple service line items with mutltiple account assignments.
The sample code is below, and the all the internal tables and structure were related to BAPI_PO_CREATE1. Tried with BADI ME_TAX_FROM_ADDRESS and User Exit enhancement SAPL2012, which were not helpful for this particular scenario.
Item Details
W_BAPI_ITEM-PO_ITEM = 1.
W_BAPI_ITEMX-PO_ITEM = 1.
W_BAPI_ITEM-ITEM_CAT = D.
W_BAPI_ITEMX-ITEM_CAT = 'X'.
W_BAPI_ITEM-ACCTASSCAT = K.
W_BAPI_ITEMX-ACCTASSCAT = 'X'.
W_BAPI_ITEM-PLANT = USMP. Tax Jurisdiction code 3604931001
W_BAPI_ITEMX-PLANT = 'X'.
W_BAPI_ITEM-MATL_GROUP = IT37.
W_BAPI_ITEMX-MATL_GROUP = 'X'.
W_BAPI_ITEM-QUANTITY = 1.
W_BAPI_ITEMX-QUANTITY = 'X'.
W_BAPI_ITEM-PRICE_UNIT = 1.
W_BAPI_ITEMX-PRICE_UNIT = 'X'.
W_BAPI_ITEM-PO_UNIT = LE.
W_BAPI_ITEMX-PO_UNIT = 'X'.
W_BAPI_ITEM-NET_PRICE = 100.
W_BAPI_ITEMX-NET_PRICE = 'X'.
W_BAPI_ITEM-PCKG_NO = 3456.
W_BAPI_ITEMX-PCKG_NO = 'X'.
W_BAPI_ITEM-PREQ_NAME = RTPTS02.
W_BAPI_ITEMX-PREQ_NAME = 'X'.
APPEND W_BAPI_ITEM TO IT_BAPI_ITEM.
APPEND W_BAPI_ITEMX TO IT_BAPI_ITEMX.
Delivery address details - Tax Jurisdiction 3305923401
W_BAPI_ADDRDEL-PO_ITEM = 1.
W_BAPI_ADDRDEL-NAME = COR.
W_BAPI_ADDRDEL-NAME_2 = Chairman.
W_BAPI_ADDRDEL-BUILD_LONG = 1001R
W_BAPI_ADDRDEL-CITY = plainview.
W_BAPI_ADDRDEL-STREET = old country road.
W_BAPI_ADDRDEL-POSTL_COD1 = 11803.
W_BAPI_ADDRDEL-COUNTRY = US.
W_BAPI_ADDRDEL-REGION = NY.
APPEND W_BAPI_ADDRDEL TO IT_BAPI_ADDRDEL.
First Account Assignment - 3310300441
W_BAPI_POACNT-SERIAL_NO = 1.
W_BAPI_POACNTX-SERIAL_NO = 1.
W_BAPI_POACNTX-SERIAL_NOX = 'X'.
W_BAPI_POACNT-CREAT_DATE = 11/03/2010.
W_BAPI_POACNTX-CREAT_DATE = 'X'.
W_BAPI_POACNT-QUANTITY = 0.75.
W_BAPI_POACNTX-QUANTITY = 'X'.
W_BAPI_POACNT-DISTR_PERC = 75.
W_BAPI_POACNTX-DISTR_PERC = 'X'.
W_BAPI_POACNT-NET_VALUE = 75 .
W_BAPI_POACNTX-NET_VALUE = 'X'.
W_BAPI_POACNT-PO_ITEM = 1.
W_BAPI_POACNTX-PO_ITEM = 1.
W_BAPI_POACNTX-PO_ITEMX = 'X'.
W_BAPI_POACNT-GL_ACCOUNT = 641099.
W_BAPI_POACNTX-GL_ACCOUNT = 'X'.
W_BAPI_POACNT-COSTCENTER = 10010394.
W_BAPI_POACNTX-COSTCENTER = 'X'.
W_BAPI_POACNT-CO_AREA = 1234.
W_BAPI_POACNTX-CO_AREA = 'X'.
APPEND W_BAPI_POACNT TO IT_BAPI_POACNT.
APPEND W_BAPI_POACNTX TO IT_BAPI_POACNTX.
Second Account Assignment
W_BAPI_POACNT-SERIAL_NO = 2.
W_BAPI_POACNTX-SERIAL_NO = 2.
W_BAPI_POACNTX-SERIAL_NOX = 'X'.
W_BAPI_POACNT-CREAT_DATE = 11/03/2010.
W_BAPI_POACNTX-CREAT_DATE = 'X'.
W_BAPI_POACNT-QUANTITY = 0.25.
W_BAPI_POACNTX-QUANTITY = 'X'.
W_BAPI_POACNT-DISTR_PERC = 25.
W_BAPI_POACNTX-DISTR_PERC = 'X'.
W_BAPI_POACNT-NET_VALUE = 25 .
W_BAPI_POACNTX-NET_VALUE = 'X'.
W_BAPI_POACNT-PO_ITEM = 1.
W_BAPI_POACNTX-PO_ITEM = 1.
W_BAPI_POACNTX-PO_ITEMX = 'X'.
W_BAPI_POACNT-GL_ACCOUNT = 641099.
W_BAPI_POACNTX-GL_ACCOUNT = 'X'.
W_BAPI_POACNT-COSTCENTER = 10010393.
W_BAPI_POACNTX-COSTCENTER = 'X'.
W_BAPI_POACNT-CO_AREA = 1234.
W_BAPI_POACNTX-CO_AREA = 'X'.
APPEND W_BAPI_POACNT TO IT_BAPI_POACNT.
APPEND W_BAPI_POACNTX TO IT_BAPI_POACNTX.
Service Item detials
W_BAPI_SERVICE-OUTL_IND = 'X'.
W_BAPI_SERVICE-SUBPCKG_NO = 3457.
W_BAPI_SERVICE-LINE_NO = 1.
W_BAPI_SERVICE-PCKG_NO = 3456.
W_BAPI_SERVICE-EXT_LINE = 0000000000.
W_BAPI_SERVICE-QUANTITY = 0.
W_BAPI_SERVICE-BASE_UOM = 0.
W_BAPI_SERVICE-PRICE_UNIT = 0.
W_BAPI_SERVICE-GR_PRICE = 0.
W_BAPI_SERVICE-SHORT_TEXT = 0.
W_BAPI_SERVICE-MATL_GROUP = 0.
W_BAPI_SERVICE-DISTRIB = 0.
APPEND W_BAPI_SERVICE TO IT_BAPI_SERVICE.
W_BAPI_SERVICE-OUTL_IND = 'X'.
W_BAPI_SERVICE-LINE_NO = 2.
W_BAPI_SERVICE-PCKG_NO = 3457.
W_BAPI_SERVICE-EXT_LINE = 0000000010.
W_BAPI_SERVICE-QUANTITY = 10.
W_BAPI_SERVICE-BASE_UOM = STD.
W_BAPI_SERVICE-PRICE_UNIT = 0.
W_BAPI_SERVICE-GR_PRICE = 5.
W_BAPI_SERVICE-SHORT_TEXT = Cabling Services1.
W_BAPI_SERVICE-MATL_GROUP = IT37.
W_BAPI_SERVICE-DISTRIB = 2.
APPEND W_BAPI_SERVICE TO IT_BAPI_SERVICE.
W_BAPI_SERVICE-OUTL_IND = 'X'.
W_BAPI_SERVICE-LINE_NO = 3.
W_BAPI_SERVICE-PCKG_NO = 3457.
W_BAPI_SERVICE-EXT_LINE = 0000000020.
W_BAPI_SERVICE-QUANTITY = 10.
W_BAPI_SERVICE-BASE_UOM = STD.
W_BAPI_SERVICE-PRICE_UNIT = 0.
W_BAPI_SERVICE-GR_PRICE = 5.
W_BAPI_SERVICE-SHORT_TEXT = Cabling Services2.
W_BAPI_SERVICE-MATL_GROUP = IT37.
W_BAPI_SERVICE-DISTRIB = 2.
APPEND W_BAPI_SERVICE TO IT_BAPI_SERVICE.
Service Account assignment details
W_ACC_SERVICE-PCKG_NO = 3457.
W_ACC_SERVICE-LINE_NO = 2.
W_ACC_SERVICE-SERNO_LINE = 1.
W_ACC_SERVICE-SERIAL_NO = 1. "Account Assignment Link
W_ACC_SERVICE-NET_VALUE = .
W_ACC_SERVICE-QUANTITY = 50 .
W_ACC_SERVICE-PERCENTAGE = 100 .
APPEND W_ACC_SERVICE TO IT_ACC_SERVICE.
W_ACC_SERVICE-PCKG_NO = 3457.
W_ACC_SERVICE-LINE_NO = 3.
W_ACC_SERVICE-SERNO_LINE = 1.
W_ACC_SERVICE-SERIAL_NO = 1. "Account Assignment Link
W_ACC_SERVICE-NET_VALUE = .
W_ACC_SERVICE-QUANTITY = 50 .
W_ACC_SERVICE-PERCENTAGE = 50 .
APPEND W_ACC_SERVICE TO IT_ACC_SERVICE.
W_ACC_SERVICE-PCKG_NO = 3457.
W_ACC_SERVICE-LINE_NO = 3.
W_ACC_SERVICE-SERNO_LINE = 1.
W_ACC_SERVICE-SERIAL_NO = 2. "Account Assignment Link
W_ACC_SERVICE-NET_VALUE = .
W_ACC_SERVICE-QUANTITY = 50 .
W_ACC_SERVICE-PERCENTAGE = 50 .
APPEND W_ACC_SERVICE TO IT_ACC_SERVICE.
EKKN table entries:
When created thru ME21N with the same set of data,which is expected
ZEKKN MENGE NETWR SAKTO KOSTL
01 0.750 75.00 0000641099 0010010394
02 0.250 25.00 0000641099 0010010393
But through BAPI_PO_CREATE1, the below split is being done with respect to Tax Jurisdiction code.
01 0.500 50.00 0000641099 0010010394
02 0.250 25.00 0000641099 0010010394
03 0.250 25.00 0000641099 0010010393
Please advice the solution.
PS: there were different tax jurisdiction codes were being determined.
Plant, Cost Center and Delivery Address.Hi,
To commit BAPI or to run it properly , you need to fulfill all required data for BAPI.
You can go to BAPI documentation to check for mandetory parameters and also check with Function consultant for more data and confifuration/
Reward if useful!
Maybe you are looking for
-
Item in Transfer - classic scenario!!
Hi experts, I am in SRM server 5.0 using the classic scenario. In a particular case a Shopping cart has been approved but not transferred to the backend system. There were no alerts in RZ20,ST22 & SM21 when checked at that time. I have also analyzed
-
How do I redeem a gift card in the South African storefront?
How do I redeem a gift card in the South African storefront?
-
Hi please let me know list of tcodes in bw/bi
-
My treo 700p is cycling at the access powered screen. With a hard reset will arrive at the "erase all data" screen, but returns to the cycle after accepting the erase. Is there a way to make the phone accept a reset? Post relates to: Treo 700p (Ver
-
Adding hyperlink within the Job Posting description in Peoplesoft TAM
Hi All - Is it possible to put a hyperlink in the Job Posting description in TAM. The entire Job posting description is retrieved from the Job Posting Index file which gets created running the delivered process (Verity Job Posting Index Build: HRS_JS