Creating Service PO using BAPI_PO_CREATE1
Hi gurus,
I am trying to create a PO with service lines using BAPI_PO_CREATE1 but am getting the following errror even though i have passed values to the structures POSERVICES POSRVACCESSVALUES and POACCOUNT along with item and header details:
Please maintain services or limits
Please suggest what are the basic details that need to be passed to the structures for creating a PO with service lines.
Hi,
You need to use Package Number to link the services with the item. Check the tables like ESKN to know how the linking works with your existing data.
There are lot of posts related to this. Please do a search to get detailed answers. Thanks for your patience!!
Regards,
Yogesh
Similar Messages
-
Problem while creating service PO using bapi_po_create1
hi all,
i am getting error :
In case of account assignment, please enter acc. assignment data for item
what does this mean?
please help,,
thanks,
Siddhartha PrakashHi Sid.
I'm having this same problems on creating PO Service. Did you solve it? How did you do that?
I'm using a PR and the Category is 'Y', and I cant find where is the problem.
The tables that I'm passing to the BAPI_PO_CREATE1 are:
POITEM/ POITEMX
POACCOUNT/ POACCOUNTX
POSERVICES
POSRVACCESSVALUES
Please, if you have any idea, let me know!
Tks a lot!
Renata -
Error while creating a Service PO using BAPI_PO_CREATE1
Hi,
Im facing Error as "In case of account assignment, please enter acc. assignment data for item" while creating Service PO using BAPI_PO_CREATE1.
Header Data
w_poheader-comp_code = w_src-bukrs. "Company Code
w_poheader-doc_type = w_src-bsart. "Document type
w_poheader-delete_ind = w_src-vrtkz. "Deletion Indicator
CLEAR: lv_date.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = w_src-aedat
IMPORTING
date_internal = lv_date
EXCEPTIONS
date_external_is_invalid = 1
OTHERS = 2.
w_poheader-creat_date = lv_date. "Creation Date
w_poheader-created_by = sy-uname. "Creator Name
w_poheader-vendor = w_src-lifnr. "Vendor
w_poheader-pmnttrms = w_src-zterm. "Payment Terms
w_poheader-purch_org = w_src-ekorg. "Purchase Organization
w_poheader-pur_group = w_src-ekgrp. "Purchase Group
w_poheader-ref_1 = w_src-ihrez. "OLD PO
w_poheaderx-comp_code = 'X'. "Company Code
w_poheaderx-doc_type = 'X'. "Document type
w_poheaderx-delete_ind = 'X'. "Deletion Indicator
w_poheaderx-creat_date = 'X'. "Creation Date
w_poheaderx-created_by = 'X'.
w_poheaderx-vendor = 'X'.
w_poheaderx-pmnttrms = 'X'. "Payment Terms
w_poheaderx-purch_org = 'X'. "Purchase Organization
w_poheaderx-pur_group = 'X'. "Purchase Group
w_poheaderx-ref_1 = 'X'.
Item Data
w_poitem-po_item = w_src-ebelp.
IF NOT w_src-elikz IS INITIAL.
w_poitem-delete_ind = w_src-elikz.
ENDIF.
IF NOT w_src-txz01 IS INITIAL.
w_poitem-short_text = w_src-txz01.
ENDIF.
IF NOT w_src-werks IS INITIAL.
w_poitem-plant = w_src-werks.
ENDIF.
Material group
IF NOT w_src-matkl IS INITIAL.
w_poitem-matl_group = w_src-matkl.
ENDIF.
Open or Partial Qty
IF w_src-opqty IS NOT INITIAL.
w_poitem-quantity = w_src-opqty.
ELSEIF NOT w_src-paqty IS INITIAL.
w_poitem-quantity = w_src-paqty.
ENDIF.
IF NOT w_src-meins IS INITIAL.
w_poitem-po_unit = w_src-meins. "Base Unit of Measure
ENDIF.
IF NOT w_src-netpr IS INITIAL.
w_poitem-net_price = w_src-netpr. "Net Price
ENDIF.
IF NOT w_src-mwskz IS INITIAL.
w_poitem-tax_code = w_src-mwskz.
ENDIF.
IF NOT w_src-pstyp IS INITIAL.
w_poitem-item_cat = w_src-pstyp.
ENDIF.
IF NOT w_src-knttp IS INITIAL.
w_poitem-acctasscat = w_src-knttp.
ENDIF.
IF NOT w_src-vrtkz IS INITIAL.
w_poitem-distrib = w_src-vrtkz.
ENDIF.
Package No
IF NOT w_src-packno IS INITIAL.
w_poitem-pckg_no = w_src-packno. "Package no
ENDIF.
IF w_poitem-delete_ind IS INITIAL AND
w_poitem-short_text IS INITIAL AND
w_poitem-plant IS INITIAL AND
w_poitem-matl_group IS INITIAL AND
w_poitem-quantity IS INITIAL AND
w_poitem-po_unit IS INITIAL AND
w_poitem-net_price IS INITIAL AND
w_poitem-tax_code IS INITIAL.
CLEAR lv_item.
ELSE.
APPEND w_poitem TO i_poitem.
CLEAR: w_poitem.
lv_item = 'X'.
ENDIF.
w_poitemx-po_item = w_src-ebelp.
w_poitemx-delete_ind = 'X'.
w_poitemx-short_text = 'X'.
w_poitemx-plant = 'X'.
w_poitemx-matl_group = 'X'.
w_poitemx-quantity = 'X'.
w_poitemx-po_unit = 'X'.
w_poitemx-net_price = 'X'.
w_poitemx-tax_code = 'X'.
w_poitemx-item_cat = 'X'.
w_poitemx-acctasscat = 'X'.
w_poitemx-distrib = 'X'.
IF NOT w_src-packno IS INITIAL.
w_poitemx-pckg_no = 'X'.
ENDIF.
IF lv_item = 'X'.
APPEND w_poitemx TO i_poitemx.
CLEAR: w_poitemx,
lv_item.
ENDIF.
PO Deliery Address
w_poaddrdelivery-po_item = w_src-ebelp.
IF NOT w_src-adrn2 IS INITIAL.
w_poaddrdelivery-addr_no = w_src-adrn2.
APPEND w_poaddrdelivery TO i_poaddrdelivery.
CLEAR w_poaddrdelivery.
ENDIF.
POschedule
w_poschedule-po_item = w_src-ebelp.
CLEAR: lv_date.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = w_src-eindt
IMPORTING
date_internal = lv_date
EXCEPTIONS
date_external_is_invalid = 1
OTHERS = 2.
IF NOT lv_date IS INITIAL.
w_poschedule-del_datcat_ext = 'D'. "Delivery Date in Day Format
w_poschedule-delivery_date = lv_date.
w_poschedule-quantity = w_src-menge.
APPEND w_poschedule TO i_poschedule.
CLEAR w_poschedule.
lv_schd = 'X'.
ENDIF.
w_poschedulex-po_item = w_src-ebelp.
w_poschedulex-del_datcat_ext = 'X'.
w_poschedulex-delivery_date = 'X'.
w_poschedulex-quantity = 'X'.
IF lv_schd = 'X'.
APPEND w_poschedulex TO i_poschedulex.
CLEAR : w_poschedulex,
lv_schd.
ENDIF.
PO Account Assignment
w_poaccount-po_item = w_src-ebelp.
w_poaccount-serial_no = w_src-zekkn.
Distribution Indicator is 1
IF w_src-vrtkz EQ '1'.
w_poaccount-distr_perc = w_src-vproz.
IF NOT w_src-menge IS INITIAL.
CLEAR lv_menge.
lv_menge = w_src-menge.
ENDIF.
lv_acct_qty = lv_menge * w_src-vproz / 100.
Get Round value of Quanity
frac = FRAC( lv_acct_qty ).
IF frac EQ 0.
lv_acct_qty = FLOOR( lv_acct_qty ).
ELSE.
lv_acct_qty = CEIL( lv_acct_qty ).
ENDIF.
w_poaccount-quantity = lv_acct_qty.
ELSEIF w_src-vrtkz IS INITIAL.
w_poaccount-quantity = w_src-menge.
ENDIF.
w_poaccount-gl_account = w_src-saknr.
w_poaccount-costcenter = w_src-kostl.
w_poaccount-asset_no = w_src-anln1.
w_poaccount-wbs_element = w_src-wbs.
w_poaccount-network = w_src-nplnr.
w_poaccount-tax_code = w_src-mwskz.
w_poaccount-activity = w_src-vornr.
APPEND w_poaccount TO i_poaccount.
CLEAR w_poaccount.
w_poaccountx-po_item = w_src-ebelp.
w_poaccountx-serial_no = w_src-zekkn.
IF w_src-vrtkz EQ '1'.
w_poaccountx-distr_perc = 'X'.
ENDIF.
w_poaccountx-quantity = 'X'.
w_poaccountx-gl_account = 'X'.
w_poaccountx-costcenter = 'X'.
w_poaccountx-wbs_element = 'X'.
w_poaccountx-network = 'X'.
w_poaccountx-tax_code = 'X'.
w_poaccountx-activity = 'X'.
APPEND w_poaccountx TO i_poaccountx.
CLEAR w_poaccountx.
PO Services
w_poservices-pckg_no = w_src-packno. "Package no
w_poservices-line_no = w_src-srv_line_no. "Line item
w_poservices-ext_line = w_src-extrow. "External line
w_poservices-outl_level = 0.
w_poservices-outl_ind = 'X'.
w_poservices-subpckg_no = w_src-sub_packno. "Sub package no
w_poservices-quantity = w_src-srqty. "Service Quantity
w_poservices-base_uom = w_src-srmeins. "Service Basic unit of Measure
w_poservices-price_unit = '1'.
w_poservices-from_line = '1'.
w_poservices-gr_price = w_src-brtwr. "GR Price
w_poservices-short_text = w_src-sh_text1. "Service Short Text
w_poservices-matl_group = w_src-matkl. "Material Group
APPEND w_poservices TO i_poservices.
CLEAR w_poservices.
PO Service Access values
w_posrvacc-pckg_no = w_src-packno. "Package no
w_posrvacc-line_no = w_src-srv_line_no. "Line item
w_posrvacc-serno_line = w_src-zekkn. "'01'..
IF w_src-vproz IS INITIAL.
w_posrvacc-percentage = '100.0'.
ENDIF.
w_posrvacc-serial_no = w_src-zekkn. "'01'.
w_posrvacc-quantity = w_src-srqty. "Service Quantity
w_posrvacc-net_value = w_src-srqty. "Net value
APPEND w_posrvacc TO i_posrvacc.
CLEAR w_posrvacc.
ENDIF.
***Create a NEW PO
AT END OF ihrez.
Call BAPI
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = w_poheader
poheaderx = w_poheaderx
IMPORTING
exppurchaseorder = gv_ebeln
TABLES
return = i_return
poitem = i_poitem[]
poitemx = i_poitemx[]
poaddrdelivery = i_poaddrdelivery[]
poschedule = i_poschedule[]
poschedulex = i_poschedulex[]
poaccount = i_poaccount[]
poaccountx = i_poaccountx[]
poservices = i_poservices[]
posrvaccessvalues = i_posrvacc[]
extensionin = i_extensionin[].
Commit the Transaction
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
Regards,
Deepthi.1. If we get error as "In case of account assignment, please enter acc. assignment data for item" than First cehck whetaher u have authorization to Tcode ME23n or not. In my case, I din't had authorization to Me23n tcode.
2. If we get Error as "Please Mainatain Services or Limits". Please create a Service PO in the following Order.
*& Internal Table Declaration
DATA : i_intern TYPE STANDARD TABLE OF alsmex_tabline WITH HEADER LINE,
i_poitem TYPE STANDARD TABLE OF bapimepoitem,
i_poitemx TYPE STANDARD TABLE OF bapimepoitemx,
i_poaddrdelivery TYPE STANDARD TABLE OF bapimepoaddrdelivery,
i_poschedule TYPE STANDARD TABLE OF bapimeposchedule,
i_poschedulex TYPE STANDARD TABLE OF bapimeposchedulx,
i_poaccount TYPE STANDARD TABLE OF bapimepoaccount,
i_poaccountx TYPE STANDARD TABLE OF bapimepoaccountx,
i_poservices TYPE STANDARD TABLE OF bapiesllc,
i_posrvacc TYPE STANDARD TABLE OF bapiesklc,
i_extensionin TYPE STANDARD TABLE OF bapiparex,
i_return TYPE STANDARD TABLE OF bapiret2.
*& Work Area Declaration
DATA:
w_poheader TYPE bapimepoheader,
w_poheaderx TYPE bapimepoheaderx,
w_poitem TYPE bapimepoitem,
w_poitemx TYPE bapimepoitemx,
w_poaddrdelivery TYPE bapimepoaddrdelivery,
w_poschedule TYPE bapimeposchedule,
w_poschedulex TYPE bapimeposchedulx,
w_poaccount TYPE bapimepoaccount,
w_poaccountx TYPE bapimepoaccountx,
w_poservices TYPE bapiesllc,
w_posrvacc TYPE bapiesklc,
w_extensionin TYPE bapiparex,
w_return TYPE bapiret2.
START-OF-SELECTION.
Header Data
w_poheader-comp_code = '5791'. "Company Code
w_poheader-doc_type = 'Z0CM'. "Document type
w_poheader-creat_date = sy-datum. "lv_date. "Creation Date
w_poheader-created_by = sy-uname. "Creator Name
w_poheader-vendor = '0005012343'. "Vendor
w_poheader-pmnttrms = 'Z004'. "Payment Terms
w_poheader-purch_org = 'P000'. "Purchase Organization
w_poheader-pur_group = '001'. "Purchase Group
w_poheader-ref_1 = '004500007671'. "OLD PO
w_poheaderx-comp_code = 'X'. "Company Code
w_poheaderx-doc_type = 'X'. "Document type
w_poheaderx-creat_date = 'X'. "Creation Date
w_poheaderx-created_by = 'X'.
w_poheaderx-vendor = 'X'.
w_poheaderx-pmnttrms = 'X'. "Payment Terms
w_poheaderx-purch_org = 'X'. "Purchase Organization
w_poheaderx-pur_group = 'X'. "Purchase Group
w_poheaderx-ref_1 = 'X'.
Item Data
w_poitem-po_item = '000010'.
w_poitem-short_text = 'Z0CM - Default Appr. Test '.
w_poitem-plant = '5368'.
Trackign no
w_poitem-trackingno = ''.
Material group
w_poitem-matl_group = '119'.
w_poitem-po_unit = 'EA'. "Base Unit of Measure
w_poitem-net_price = '17500.00'. "Net Price
w_poitem-tax_code = 'I0'.
w_poitem-item_cat = '9'.
w_poitem-acctasscat = 'K'.
w_poitem-distrib = space.
Package must be given in item to create Service PO
w_poitem-pckg_no = 0000000001.
APPEND w_poitem TO i_poitem.
CLEAR: w_poitem.
w_poitemx-po_item = '000010'.
w_poitemx-delete_ind = 'X'.
w_poitemx-short_text = 'X'.
w_poitemx-plant = 'X'.
w_poitemx-trackingno = 'X'.
w_poitemx-matl_group = 'X'.
w_poitemx-quantity = 'X'.
w_poitemx-po_unit = 'X'.
w_poitemx-net_price = 'X'.
w_poitemx-tax_code = 'X'.
w_poitemx-item_cat = 'X'.
w_poitemx-acctasscat = 'X'.
w_poitemx-distrib = 'X'.
w_poitemx-pckg_no = 'X'.
APPEND w_poitemx TO i_poitemx.
CLEAR: w_poitemx.
PO Deliery Address
w_poaddrdelivery-po_item = '000010'.
w_poaddrdelivery-addr_no = '0000061208'.
APPEND w_poaddrdelivery TO i_poaddrdelivery.
CLEAR w_poaddrdelivery.
POschedule
w_poschedule-po_item = '000010'..
DATA : LV_DATE TYPE SY-DATUM,
lv_schd.
CLEAR: lv_date.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = '12/2/2009'
IMPORTING
date_internal = lv_date
EXCEPTIONS
date_external_is_invalid = 1
OTHERS = 2.
IF NOT lv_date IS INITIAL.
w_poschedule-del_datcat_ext = 'D'. "Delivery Date in Day Format
w_poschedule-delivery_date = lv_date.
w_poschedule-quantity = '1.000'.
APPEND w_poschedule TO i_poschedule.
CLEAR w_poschedule.
lv_schd = 'X'.
ENDIF.
w_poschedulex-po_item = '000010'.
w_poschedulex-del_datcat_ext = 'X'.
w_poschedulex-delivery_date = 'X'.
w_poschedulex-quantity = 'X'.
IF lv_schd = 'X'.
APPEND w_poschedulex TO i_poschedulex.
CLEAR : w_poschedulex,
lv_schd.
ENDIF.
PO Account Assignment
w_poaccount-po_item = '000010'.
w_poaccount-serial_no = '01'.
w_poaccount-distr_perc = ''.
w_poaccount-quantity = '1.000'.
w_poaccount-gl_account = '0000603064'.
w_poaccount-costcenter = '0053680100'.
w_poaccount-asset_no = ''.
w_poaccount-wbs_element = ''.
w_poaccount-network = ''.
w_poaccount-tax_code = 'I0'.
w_poaccount-activity = ''.
APPEND w_poaccount TO i_poaccount.
CLEAR w_poaccount.
w_poaccountx-po_item = '000010'.
w_poaccountx-serial_no = '01'.
w_poaccountx-distr_perc = 'X'.
w_poaccountx-quantity = 'X'.
w_poaccountx-gl_account = 'X'.
w_poaccountx-costcenter = 'X'.
w_poaccountx-wbs_element = 'X'.
w_poaccountx-network = 'X'.
w_poaccountx-tax_code = 'X'.
w_poaccountx-activity = 'X'.
w_poaccountx-cmmt_item = 'X'.
APPEND w_poaccountx TO i_poaccountx.
CLEAR w_poaccountx.
Extension for ZZSub
w_extensionin-structure = 'BAPI_TE_MEPOACCOUNTING'.
w_extensionin-valuepart1+0(5) = '00010'..
w_extensionin-valuepart1+5(2) = '01'.
w_extensionin-valuepart1+28(5) = ''.
APPEND w_extensionin TO i_extensionin.
CLEAR w_extensionin.
w_extensionin-structure = 'BAPI_TE_MEPOACCOUNTINGX'.
w_extensionin-valuepart1+0(5) = '00010'.
w_extensionin-valuepart1+5(2) = '01'.
w_extensionin-valuepart1+11(1) = 'X'.
APPEND w_extensionin TO i_extensionin.
CLEAR w_extensionin.
Extension to add Expense Type only
w_extensionin-structure = 'BAPI_TE_MEPOHEADER'.
w_extensionin-valuepart1+10(4) = '0131'.
APPEND w_extensionin TO i_extensionin.
CLEAR w_extensionin.
w_extensionin-structure = 'BAPI_TE_MEPOHEADERX'.
w_extensionin-valuepart1+10(4) = 'X'.
APPEND w_extensionin TO i_extensionin.
CLEAR w_extensionin.
EXPORT i_extensionin[] TO MEMORY ID 'SUB'.
PO Services
PO Services( One Line Iem)
Assign the dummy no as Pacakage no
w_poservices-pckg_no = 0000000001. "(assign package no as a dummy number)
w_poservices-line_no = 0000000001. "Line item
w_poservices-outl_ind = 'X'.
Assign Dummy no as sub package no
w_poservices-subpckg_no = 0000000003. "(Dummy No.) "Sub package no
w_poservices-from_line = '1'.
APPEND w_poservices TO i_poservices.
CLEAR w_poservices.
PO Services(Second Line Item )
Assign the same sub package dummy no which is mentioned above
w_poservices-pckg_no = 0000000003. "(Dummy No.) "Sub package no
w_poservices-line_no = 0000000002.
w_poservices-ext_line = '0000000010'. "External line
w_poservices-quantity = '17500.0'. "Service Quantity
w_poservices-base_uom = 'EA'. "Service Basic unit of Measure
w_poservices-price_unit = '1'.
w_poservices-gr_price = '1'. "GR Price
w_poservices-short_text = 'Z0CM - Default Appr. T'. "Service Short Text
w_poservices-matl_group = '119'. "w_src-matkl. "Material Group
APPEND w_poservices TO i_poservices.
CLEAR w_poservices.
PO Service Access values
w_posrvacc-pckg_no = 0000000003. "w_src-sub_packno. "Sub package no
w_posrvacc-line_no = 0000000002. "w_src-srv_line_no. "Line item
w_posrvacc-serno_line = '01'.
w_posrvacc-percentage = '100.0'.
w_posrvacc-serial_no = '01'.
w_posrvacc-quantity = '17500.0'. "w_src-srqty. "Service Quantity
APPEND w_posrvacc TO i_posrvacc.
CLEAR w_posrvacc.
DATA : gv_ebeln TYPE ebeln.
Call BAPI
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = w_poheader
poheaderx = w_poheaderx
IMPORTING
exppurchaseorder = gv_ebeln
TABLES
return = i_return
poitem = i_poitem[]
poitemx = i_poitemx[]
poaddrdelivery = i_poaddrdelivery[]
poschedule = i_poschedule[]
poschedulex = i_poschedulex[]
poaccount = i_poaccount[]
poaccountx = i_poaccountx[]
poservices = i_poservices[]
posrvaccessvalues = i_posrvacc[]
extensionin = i_extensionin[].
Commit the Transaction
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
WRITE:/5 gv_ebeln COLOR 5.
SKIP 2.
DATA : lv_msg TYPE string.
LOOP AT i_return INTO w_return WHERE type = 'E'.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = w_return-id
lang = 'EN'
no = w_return-number
v1 = w_return-message_v1
v2 = w_return-message_v2
v3 = w_return-message_v3
v4 = w_return-message_v4
IMPORTING
msg = lv_msg
EXCEPTIONS
not_found = 1
OTHERS = 2.
WRITE:/10 lv_msg.
ENDLOOP. -
Account Assignment is not populated while creating service PO using BAPI
Hi All,
I am creating a service PO using BAPI_PO_CREATE1 and Its creating PO, But when I go to ME23n and check Account Assignment in Services then Its empty.
Please help me as I am not able to understand what could be the problem...
Thanks & Regards,
Prabhat PandeyThanks for your most valuable answer.
Regards,
Prabhat -
Creation of invoicing plan while creating the PO using BAPI_PO_CREATE1
Hi, basically I'm creating a PO using BAPI_PO_CREATE1 and then creating Invoicing plan thru ME22 using BDC.
Could anyone please help me if there is any possibility of creation of invoicing plan while creating the PO itself using BAPI_PO_CREATE1.
thanks in advance.Hi,
Have you tried filling up the invoicing plan related tables of the bapi ?
*" INVPLANHEADER STRUCTURE BAPI_INVOICE_PLAN_HEADER OPTIONAL
*" INVPLANHEADERX STRUCTURE BAPI_INVOICE_PLAN_HEADERX OPTIONAL
*" INVPLANITEM STRUCTURE BAPI_INVOICE_PLAN_ITEM OPTIONAL
*" INVPLANITEMX STRUCTURE BAPI_INVOICE_PLAN_ITEMX OPTIONAL
Regards. -
Creating service PO using BAPI - Created PO doesnot exist!!!
Hi,
I am creating service PO using BAPI_PO_create. BAPI returns a PO number at the completion of excution. But when i check in ME23N Po does not exist. Niether does it Exist in EKKO/EKPO tables.
also there is a structure BAPIESKLC in this BAPI. Though i know htis a link for account assignment i am not very clear on the fields. Specially the percenatge field.
Can someone guid me on This?
Thanks on advance,
ShwethaPlease do check if there are any dumps in the system, after the commit work command.
For this, you should check transaction code ST22.
Any dumps ?
Edited by: Lior Tabib on Jul 13, 2011 9:35 AM
Edited by: Lior Tabib on Jul 13, 2011 9:35 AM -
Problem in customer address while creating service notification using IW51
Hi Experts,
I am trying to create a BDC recording for creating Service Notification using transaction IW51. I have done the recording as follows. On the First screen I am entering notification type. Then on the next screen I am entering the Sold to party and its address by clicking on the icon besides it. After that i enter Functional location, equipment, priority and req end date and save it. When I am running this recording after transferring it to a progam , somehow the address disappears for the newly created notification. I am not able to figure out the reason. Kindly guide me.
Thanks,
SonalI assume you have tried this with update mode = 'A'-all and watched it actually work correctly? May I ask why the BDC instead of BAPI? Is it because you're creating a new partner? If so, are you pressing save on that partner creation?
-
How to create SERVICE PR using BAPI_PR_CREATE
Hi everyone,
How to create SERVICE PR using BAPI_PR_CREATE
Regards,
My Code(it doesn't work,I don't know what's wrong.):
*& Report ZWTEST
REPORT zwtest.
DATA: header TYPE bapimereqheader,
headerx TYPE bapimereqheaderx,
item LIKE TABLE OF bapimereqitemimp WITH HEADER LINE,
itemx LIKE TABLE OF bapimereqitemx WITH HEADER LINE,
account LIKE TABLE OF bapimereqaccount WITH HEADER LINE,
accountx LIKE TABLE OF bapimereqaccountx WITH HEADER LINE,
service LIKE TABLE OF bapi_srv_service_line WITH HEADER LINE,
servicex LIKE TABLE OF bapi_srv_service_linex WITH HEADER LINE,
serviceaccount LIKE TABLE OF bapi_srv_acc_data WITH HEADER LINE,
serviceaccountx LIKE TABLE OF bapi_srv_acc_datax WITH HEADER LINE,
preq_no LIKE bapimereqheader-preq_no,
lt_return LIKE TABLE OF bapiret2 WITH HEADER LINE,
wa_return LIKE bapiret2.
header-pr_type = 'NB'."订单类型(采购)
headerx-pr_type = 'X'.
CLEAR: item.
item-preq_item = '00010'.
item-pur_group = '426'."采购组
item-short_text = '服务类PR'."短文本
item-plant = '1051'."工厂
item-matl_group = 'AS07'."物料组
item-item_cat = '9'."项目类别
item-acctasscat = 'K'."科目分配类别
item-pckg_no = '0000000001'."软件包编号
APPEND item.
CLEAR: itemx.
itemx-preq_item = '00010'.
itemx-preq_itemx = 'X'.
itemx-pur_group = 'X'."采购组
itemx-short_text = 'X'."短文本
itemx-plant = 'X'."工厂
itemx-matl_group = 'X'."物料组
itemx-item_cat = 'X'."项目类别
itemx-acctasscat = 'X'."科目分配类别
itemx-pckg_no = 'X'."软件包编号
APPEND itemx.
CLEAR: account.
account-preq_item = '00010'.
account-serial_no = '01'.
*account-quantity = '0.955'.
*account-distr_perc = '95.5'.
account-gl_account = '4205020000'.
account-costcenter = '1042000001'.
*account-co_area = 'CNOC'.
*account-profit_ctr = '9999999999'.
APPEND account.
CLEAR: accountx.
accountx-preq_item = '00010'.
accountx-serial_no = '01'.
accountx-preq_itemx = 'X'.
accountx-serial_nox = 'X'.
*accountx-quantity = 'X'.
*accountx-distr_perc = 'X'.
accountx-gl_account = 'X'.
accountx-costcenter = 'X'.
*accountx-co_area = 'X'.
*accountx-profit_ctr = 'X'.
APPEND accountx.
CLEAR: service.
service-doc_item = '00010'.
service-outline = '0000000001'.
service-srv_line = '0000000010'.
service-short_text = 'service test'.
service-quantity = '10.000'.
service-uom = 'AU'.
service-gross_price = '10.00'.
service-currency = 'CNY'.
*service-matl_group = 'AS07'."物料组
APPEND service.
CLEAR: servicex.
servicex-doc_item = '00010'.
servicex-outline = '0000000001'.
servicex-srv_line = '0000000010'.
servicex-short_text = 'X'.
servicex-quantity = 'X'.
servicex-uom = 'X'.
servicex-gross_price = 'X'.
servicex-currency = 'X'.
*servicex-matl_group = 'X'.
APPEND servicex.
CLEAR: serviceaccount.
serviceaccount-doc_item = '00010'.
serviceaccount-outline = '0000000001'.
serviceaccount-srv_line = '0000000010'.
serviceaccount-serial_no = '01'.
serviceaccount-serial_no_item = '01'.
serviceaccount-percent = '100'.
APPEND serviceaccount.
CLEAR: serviceaccountx.
serviceaccountx-doc_item = '00010'.
serviceaccountx-outline = '0000000001'.
serviceaccountx-srv_line = '0000000010'.
serviceaccountx-serial_no = '01'.
serviceaccountx-serial_no_item = 'X'.
serviceaccountx-percent = 'X'.
APPEND serviceaccountx.
CALL FUNCTION 'BAPI_PR_CREATE'
EXPORTING
prheader = header
prheaderx = headerx
* TESTRUN =
IMPORTING
number = preq_no
* PRHEADEREXP =
TABLES
return = lt_return
pritem = item
pritemx = itemx
* PRITEMEXP =
* PRITEMSOURCE =
praccount = account
* PRACCOUNTPROITSEGMENT =
praccountx = accountx
* PRADDRDELIVERY =
* PRITEMTEXT =
* PRHEADERTEXT =
* EXTENSIONIN =
* EXTENSIONOUT =
* PRVERSION =
* PRVERSIONX =
* ALLVERSIONS =
* PRCOMPONENTS =
* PRCOMPONENTSX =
* SERVICEOUTLINE =
* SERVICEOUTLINEX =
servicelines = service
servicelinesx = servicex
* SERVICELIMIT =
* SERVICELIMITX =
* SERVICECONTRACTLIMITS =
* SERVICECONTRACTLIMITSX =
serviceaccount = serviceaccount
serviceaccountx = serviceaccountx
* SERVICELONGTEXTS =
* SERIALNUMBER =
* SERIALNUMBERX =
* 处理错误消息:通过判断消息的类型,来判断BAPI是否成功
READ TABLE lt_return INTO wa_return WITH KEY type = 'E'.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
WRITE: / '成功创建采购申请', preq_no.
ENDIF.
LOOP AT lt_return INTO wa_return.
WRITE: / wa_return-message, wa_return-type, wa_return-id, wa_return-number.
ENDLOOP.see note:
1950319 - How to create service PR with BAPI_PR_CREATE.pdf -
Create service PR using BAPI_PR_CREATE
Hi experts,
I am trying to create service PR using BAPI_PR_CREATE, though i am a able to create a service PR with account assignment category = 'K'(i.e. cost centre), I am not ble to create PR with acc. assign. category = 'N' (i.e. network).
It gives me an error saying please entre operation/activity number, when i pass the activity number in the acc. assgn. data structure in the BAPI, it gives an error that the network XXX cannot be assigned with an the activity number.
As this BAPI is for ME51N, i do not understand why does it ask for an activity number.Can you please help.
RegardsSolved Using Item category 9 instead of D
-
I need your help how to create service plan using programm
Hello everybody
I met some difficulities when writing a programm which is used to create service plan.
I used the function module 'crm_order_maintain'.
Can you tell me how to set the parameters:
IT_SERVICEPLAN_I
IT_SERVICEPLAN_IE
The two parameters is used as cycle data.
I'm waiting for your help.
If you have any idea,please apply to my message .Thank you very much. ^ ^Hi,
I think there is standard way of creating service plans using actions..
The standard method used is CREATE_ORDER_SRVPLAN.
Regards,
PePe -
Error while creating service PO by BAPI_PO_CREATE1
Hi,
I am trying to create a service PO using the BAPI_PO_CREATE1 with reference to service PR and I am getting an "In case of account assignment, please enter acc. assignment data for item" for which i found so many threads but none had resolved this error in my case eventhough i filled up all the required structure such as
LOOP AT gt_esll INTO gs_esll.
gs_services-pckg_no = gs_esll-packno.
gs_services-line_no = gs_esll-introw.
gs_services-subpckg_no = gs_esll-sub_packno.
gs_services-quantity = gs_esll-menge.
gs_services-base_uom = gs_esll-meins.
gs_services-gr_price = gs_esll-brtwr.
gs_services-outl_ind = 'X'.
APPEND gs_services TO gt_services.
CLEAR gs_services.
ENDLOOP.
LOOP AT gt_esll1 INTO gs_esll1.
gs_services-pckg_no = gs_esll1-packno.
gs_services-line_no = gs_esll1-introw.
gs_services-ext_line = gs_esll1-extrow.
gs_services-quantity = gs_esll1-menge.
gs_services-base_uom = gs_esll1-meins.
gs_services-gr_price = gs_esll1-brtwr.
APPEND gs_services TO gt_services.
CLEAR gs_services.
gs_servalues-pckg_no = gs_esll1-packno.
gs_servalues-line_no = gs_esll1-introw.
gs_servalues-serno_line = '01'.
gs_servalues-quantity = gs_esll1-menge.
gs_servalues-net_value = gs_esll1-brtwr.
APPEND gs_servalues TO gt_servalues.
CLEAR: gs_servalues, gs_esll1.
ENDLOOP.
gs_poacct-po_item = gv_poitm.
gs_poacct-serial_no = gs_ebkn-zebkn.
gs_poacct-quantity = gs_ebkn-menge.
gs_poacct-gl_account = gs_ebkn-sakto.
gs_poacct-costcenter = gs_ebkn-kostl.
gs_poacct-co_area = gs_ebkn-kokrs.
APPEND gs_poacct TO gt_poacct.
CLEAR gs_poacct.
gs_poacctx-po_item = gv_poitm.
gs_poacctx-serial_no = gs_ebkn-zebkn.
gs_poacctx-po_itemx = 'X'.
gs_poacctx-serial_nox = 'X'.
gs_poacctx-quantity = 'X'.
gs_poacctx-gl_account = 'X'.
gs_poacctx-costcenter = 'X'.
gs_poacctx-co_area = 'X'.
APPEND gs_poacctx TO gt_poacctx.
CLEAR : gs_poacctx, gs_ebkn.
LOOP AT gt_ppsitm INTO gs_ppsitm.
CLEAR: gs_poitm. " gt_poitm.
READ TABLE gt_matnr INTO gs_matnr WITH KEY banfn = gs_ppsitm-banfn bnfpo = gs_ppsitm-bnfpo.
CLEAR: gs_poitm.
gv_poitm = gv_poitm + 10.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = gv_poitm
IMPORTING
OUTPUT = gv_poitm.
gs_poitm-po_item = gv_poitm.
gs_poitm-quantity = gs_ppsitm-menge.
gs_poitm-po_unit = gs_matnr-meins.
gs_poitm-net_price = gs_ppsitm-quote_price.
* gs_poitm-price_unit = '1'.
gs_poitm-tax_code = gs_ppsitm-mwskz.
gs_poitm-preq_no = gs_ppsitm-banfn.
gs_poitm-preq_item = gs_ppsitm-bnfpo.
IF gs_matnr-packno IS NOT INITIAL.
gs_poitm-pckg_no = gs_matnr-packno. " ADDED BY SKE FOR SERVICE PO
ENDIF.
gs_poitm-item_cat = gs_matnr-pstyp.
gs_poitm-acctasscat = gs_matnr-knttp.
APPEND gs_poitm TO gt_poitm.
ENDLOOP.
aftrer executing this bapi, the accounts structure has been cleared whereas other sturcture has values.
Please give me some hints to fix this.
Thanks in Advance,
Kalidass.Hi pranav,
from EBAN table i got the package no for a PR and passing that package No into ESLL table i am getting the subpaack No.
SELECT banfn bnfpo txz01 matnr bsart ekgrp meins pstyp knttp packno FROM eban
INTO TABLE gt_matnr
FOR ALL ENTRIES IN gt_ppsitm
WHERE banfn = gt_ppsitm-banfn
AND bnfpo = gt_ppsitm-bnfpo.
SELECT packno introw package sub_packno FROM esll
INTO CORRESPONDING FIELDS OF TABLE gt_esll
FOR ALL ENTRIES IN gt_matnr
WHERE packno = gt_matnr-packno.
IF gt_esll IS NOT INITIAL.
SELECT packno introw extrow package sub_packno menge meins brtwr ktext1 FROM ESLL
INTO TABLE gt_esll1
FOR ALL ENTRIES IN gt_esll
WHERE packno = gt_esll-sub_packno.
ENDIF.
LOOP AT gt_esll INTO gs_esll.
gs_services-pckg_no = gs_esll-packno.
gs_services-line_no = gs_esll-introw.
gs_services-subpckg_no = gs_esll-sub_packno.
gs_services-quantity = gs_esll-menge.
gs_services-base_uom = gs_esll-meins.
gs_services-gr_price = gs_esll-brtwr.
gs_services-outl_ind = 'X'.
APPEND gs_services TO gt_services.
CLEAR gs_services.
ENDLOOP.
LOOP AT gt_esll1 INTO gs_esll1.
gs_services-pckg_no = gs_esll1-packno.
gs_services-line_no = gs_esll1-introw.
gs_services-ext_line = gs_esll1-extrow.
gs_services-quantity = gs_esll1-menge.
gs_services-base_uom = gs_esll1-meins.
gs_services-gr_price = gs_esll1-brtwr.
APPEND gs_services TO gt_services.
CLEAR gs_services.
gs_servalues-pckg_no = gs_esll1-packno.
gs_servalues-line_no = gs_esll1-introw.
gs_servalues-serno_line = '01'.
gs_servalues-quantity = gs_esll1-menge.
gs_servalues-net_value = gs_esll1-brtwr.
APPEND gs_servalues TO gt_servalues.
CLEAR: gs_servalues, gs_esll1.
ENDLOOP.
Edited by: Kalidass Etienne.S on Jan 31, 2012 11:07 AM -
Creation of Service POs using BAPI_PO_CREATE1
Hi Friends,
I am trying to create service POs through BAPI (BAPI_PO_CREATE1). I am facing different errors like Please maintain service or limits eve though I am providing the details in POSERVICES. Can any one suggest me the fields which we have to provide for creating the service POs.
I am using this BAPI in LSMW.
Thanks,
Gagan ChodhryCheck this it may help u.
DATA: BEGIN OF po_header OCCURS 0.
INCLUDE STRUCTURE BAPIEKKOC.
DATA: END OF po_header.
DATA: BEGIN OF po_iteam OCCURS 10.
INCLUDE STRUCTURE BAPIEKPOC.
DATA: END OF po-items.
DATA: BEGIN OF PO_ITEM_SCHEDULES OCCURS 0.
INCLUDE STRUCTURE BAPIEKET.
DATA: END OF PO_ITEM_SCHEDULES.
DATA: BEGIN OF I_BAPIRETURN OCCURS 0.
INCLUDE STRUCTURE BAPIRETURN.
DATA: END OF I_BAPIRETURN.
CALL FUNCTION 'BAPI_PO_CREATE'
EXPORTING
PO_HEADER = PO_HEADER
SKIP_ITEMS_WITH_ERROR = 'X'
TABLES
PO_ITEMS = PO_ITEMS
PO_ITEM_SCHEDULES = PO_ITEM_SCHEDULES
RETURN = I_BAPIRETURN
EXCEPTIONS
OTHERS = 1.
Regards -
Problem creating Service POs with BAPI_PO_CREATE1
Hi.
I'm trying to create service POs with data that i read from an excel file, to do this I'm using the bapi: <b>BAPI_PO_CREATE1</b> I'm passing the following parameters:
IMPORT:
- poheader
- poheaderx
TABLES:
- return
- poitem
- poitemx
- poaccount
- poaccountx
- poservices
- posrvaccessvalues
- poservices text
- extensionin
When I execute the bapi, I'm getting the following messages into table return:
<i>W - Error transferring ExtensionIn data for enhancement CI_EKKODB
E - No instance of object type PurchaseOrder has been created. External reference:
E - PO header data still faulty
E - Purchase order date is in the past
I - Change WBS Element could not be effected
E - You cannot maintain service specs. due to incomplete transfer structure</i>
Can anybody, please say me what am i doing wrong? How this bapi works?
Regards.
Gregory.Hello My friend
Check this code:
Code listing for: LZMMIUP001F01
Description: Include LZMMIUP001F01
***INCLUDE LZMMIUP001F01 .
*& Form fill_item
text
-->P_WA text
FORM fill_item TABLES: poitem STRUCTURE bapimepoitem "Item Data
poitemx STRUCTURE bapimepoitemx "Item Data (Change Parameter
USING wa STRUCTURE zlo_mmcnv009
package.
item number
poitem-po_item = wa-itemnum.
poitemx-po_itemx = 'X'.
poitemx-po_item = wa-itemnum.
IF package <> ''.
poitem-pckg_no = package.
poitemx-pckg_no = 'X'.
ENDIF.
*Account Assignment Category
IF wa-category <> ''.
poitem-acctasscat = wa-category.
poitemx-acctasscat = 'X'.
ENDIF.
*Item Category in Purchasing Document
IF wa-itemcat <> ''.
poitem-item_cat = wa-itemcat.
poitemx-item_cat = 'X'.
ENDIF.
*Short Text
IF wa-sortxt <> ''.
poitem-short_text = wa-sortxt.
poitemx-short_text = 'X'.
ENDIF.
*Material Number
IF wa-material <> ''.
poitem-material = wa-material.
poitemx-material = 'X'.
ENDIF.
Unit of Measure
IF wa-undmesure <> ''.
poitem-po_unit = wa-undmesure.
poitemx-po_unit = 'X'.
ENDIF.
*Purchase Order Quantity
IF wa-quantity <> ''.
poitem-quantity = wa-quantity.
poitemx-quantity = 'X'.
ENDIF.
*Net Price in Purchasing Document
IF wa-netprice <> ''.
poitem-net_price = wa-netprice.
poitemx-net_price = 'X'.
ENDIF.
*Plant
IF wa-plant <> ''.
poitem-plant = wa-plant.
poitemx-plant = 'X'.
ENDIF.
*Material Group
IF wa-matgrp <> ''.
poitem-matl_group = wa-matgrp.
poitemx-matl_group = 'X'.
ENDIF.
*Free Item
IF wa-free <> ''.
poitem-free_item = wa-free.
poitemx-free_item = 'X'.
ENDIF.
APPEND poitem.
APPEND poitemx.
ENDFORM. " fill_item
*& Form fill_header
text
-->P_WA text
FORM fill_header USING wa STRUCTURE zlo_mmcnv009
poheader STRUCTURE bapimepoheader "Header Data
poheaderx STRUCTURE bapimepoheaderx. "Header Data (Change Toolbar)
DATA: dia(2), mes(2), ano(4),
vendor(10) TYPE n.
dia = wa-docdate(2).
mes = wa-docdate+2(2).
ano = wa-docdate+4(4).
CONCATENATE ano mes dia INTO wa-docdate.
dia = wa-datestart(2).
mes = wa-datestart+2(2).
ano = wa-datestart+4(4).
CONCATENATE ano mes dia INTO wa-datestart.
dia = wa-datend(2).
mes = wa-datend+2(2).
ano = wa-datend+4(4).
CONCATENATE ano mes dia INTO wa-datend.
Document Type
IF wa-doctyp <> ''.
poheader-doc_type = wa-doctyp.
poheaderx-doc_type = 'X'.
ENDIF.
vendor number
IF wa-vendor <> ''.
IF NOT ( wa-vendor CA sy-abcde ).
vendor = wa-vendor.
poheader-vendor = vendor.
poheaderx-vendor = 'X'.
ELSE.
poheader-vendor = wa-vendor.
poheaderx-vendor = 'X'.
ENDIF.
ENDIF.
Document Date
IF wa-docdate <> ''.
poheader-doc_date = wa-docdate.
poheaderx-doc_date = 'X'.
ENDIF.
purchasing organization
IF wa-organiz <> ''.
poheader-purch_org = wa-organiz.
poheaderx-purch_org = 'X'.
ENDIF.
Purchasing Group
IF wa-purgroup <> ''.
poheader-pur_group = wa-purgroup.
poheaderx-pur_group = 'X'.
ENDIF.
Start of Validity Period
IF wa-datestart <> ''.
poheader-vper_start = wa-datestart.
poheaderx-vper_start = 'X'.
ENDIF.
End of Validity Period
IF wa-datend <> ''.
poheader-vper_end = wa-datend.
poheaderx-vper_end = 'X'.
ENDIF.
Company Code
IF wa-compcode <> ''.
poheader-comp_code = wa-compcode.
poheaderx-comp_code = 'X'.
ENDIF.
Status of Purchasing Document
IF wa-status <> ''.
poheader-status = wa-status.
poheaderx-status = 'X'.
ENDIF.
ENDFORM. " fill_header
*& Form fill_account
text
-->P_WA text
FORM fill_account TABLES poaccount STRUCTURE bapimepoaccount
poaccountx STRUCTURE bapimepoaccountx
USING wa STRUCTURE zlo_mmcnv009.
DATA: account(10) TYPE n.
poaccount-po_item = wa-itemnum.
poaccountx-po_item = wa-itemnum.
*Cost Centre
poaccount-costcenter = wa-coscenter.
poaccountx-costcenter = 'X'.
*Order Number
poaccount-orderid = wa-ordernumb.
poaccountx-orderid = 'X'.
*"G/L Account Number
IF wa-accnumb <> ''.
account = wa-accnumb.
poaccount-gl_account = account."wa-accnumb.
poaccountx-gl_account = 'X'.
ENDIF.
IF NOT ( wa-coscenter = '' AND
wa-ordernumb = '' AND
wa-accnumb = '' ).
APPEND poaccount.
APPEND poaccountx.
ENDIF.
ENDFORM. " fill_account
*& Form fill_schedule
text
-->P_WA text
FORM fill_schedule TABLES poschedule STRUCTURE bapimeposchedule
poschedulex STRUCTURE bapimeposchedulx
USING wa STRUCTURE zlo_mmcnv009.
DATA: dia(2), mes(2), ano(4).
dia = wa-delivdate(2).
mes = wa-delivdate+2(2).
ano = wa-delivdate+4(4).
CONCATENATE ano mes dia INTO wa-delivdate.
*Delivery Date
poschedule-po_item = wa-itemnum.
poschedulex-po_item = wa-itemnum.
poschedule-delivery_date = wa-delivdate.
poschedulex-delivery_date = 'X'.
IF NOT wa-delivdate = ''.
APPEND poschedule.
APPEND poschedulex.
ENDIF.
ENDFORM. " fill_schedule
*& Form fill_header_contract
text
-->P_WA text
-->P_HEADER text
-->P_HEADERX text
FORM fill_header_contract USING wa STRUCTURE zlo_mmcnv009
coheader STRUCTURE bapimeoutheader
coheaderx STRUCTURE bapimeoutheaderx.
DATA: dia(2), mes(2), ano(4).
dia = wa-datestart(2).
mes = wa-datestart+2(2).
ano = wa-datestart+4(4).
CONCATENATE ano mes dia INTO wa-datestart.
dia = wa-datend(2).
mes = wa-datend+2(2).
ano = wa-datend+4(4).
CONCATENATE ano mes dia INTO wa-datend.
Purchasing Document Date
coheader-doc_date = sy-datum.
coheaderx-doc_date = 'X'.
*Item Number Interval
coheader-item_intvl = '10'.
coheaderx-item_intvl = 'X'.
Currency Key
coheader-currency = 'BHD'.
coheaderx-currency = 'X'.
languaje
coheader-langu = 'EN'.
coheaderx-langu = 'X'.
Document Type
IF wa-doctyp <> ''.
coheader-doc_type = wa-doctyp.
coheaderx-doc_type = 'X'.
ENDIF.
vendor number
IF wa-vendor <> ''.
coheader-vendor = wa-vendor.
coheaderx-vendor = 'X'.
ENDIF.
purchasing organization
IF wa-organiz <> ''.
coheader-purch_org = wa-organiz.
coheaderx-purch_org = 'X'.
ENDIF.
Purchasing Group
IF wa-purgroup <> ''.
coheader-pur_group = wa-purgroup.
coheaderx-pur_group = 'X'.
ENDIF.
Start of Validity Period
IF wa-datestart <> ''.
coheader-vper_start = wa-datestart.
coheaderx-vper_start = 'X'.
ENDIF.
End of Validity Period
IF wa-datend <> ''.
coheader-vper_end = wa-datend.
coheaderx-vper_end = 'X'.
ENDIF.
ENDFORM. " fill_header_contract
*& Form fill_item_contract
text
-->P_WA text
-->P_COITEM text
-->P_COITEMX text
FORM fill_item_contract TABLES: coitem STRUCTURE bapimeoutitem
coitemx STRUCTURE bapimeoutitemx
USING wa STRUCTURE zlo_mmcnv009.
item number
coitem-item_no = wa-itemnum.
coitemx-item_no = wa-itemnum.
coitemx-item_nox = 'X'.
*Material Number
IF wa-material <> ''.
coitem-material = wa-material.
coitemx-material = 'X'.
ENDIF.
*Target Quantity
IF wa-quantity <> ''.
coitem-target_qty = wa-quantity.
coitemx-target_qty = 'X'.
ENDIF.
*Net Price in Purchasing Document
IF wa-netprice <> ''.
coitem-net_price = wa-netprice.
coitemx-net_price = 'X'.
ENDIF.
APPEND coitem.
APPEND coitemx.
ENDFORM. " fill_item_contract
*& Form fill_service
text
-->P_POSERVICES text
-->P_T_ITEM text
-->P_ITEMNUM text
FORM fill_service TABLES poservices STRUCTURE bapiesllc
t_item STRUCTURE zlo_mmcnv009
poservices_2 STRUCTURE bapiesklc
USING itemnum packno.
DATA: line(10) TYPE n,
service(18) TYPE n,
packno2(10) TYPE n.
poservices-pckg_no = packno.
packno2 = packno.
packno = packno + 1.
poservices-line_no = '0000000001'.
poservices-outl_ind = 'X'.
poservices-subpckg_no = packno.
APPEND poservices.
line = '0000000002'.
LOOP AT t_item WHERE itemnum = itemnum.
IF t_item-activity <> ''.
IF NOT ( t_item-activity CA sy-abcde ).
service = t_item-activity.
poservices-service = service.
ELSE.
poservices-service = t_item-activity.
ENDIF.
ELSE.
poservices-service = t_item-activity.
ENDIF.
poservices-pckg_no = packno.
poservices-line_no = line. "itemnum.
poservices-ext_line = t_item-line.
poservices-quantity = t_item-quantity1.
poservices-base_uom = t_item-undmed.
poservices-gr_price = t_item-price.
poservices-short_text = t_item-shortxt.
poservices-subpckg_no = '0000000000'.
poservices-outl_ind = ''.
APPEND poservices.
poservices_2-pckg_no = packno.
poservices_2-line_no = line.
poservices_2-SERNO_LINE =
poservices_2-SERIAL_NO =
poservices_2-quantity = t_item-quantity1.
poservices_2-net_value = t_item-price.
APPEND poservices_2.
line = line + 1.
ENDLOOP.
ENDFORM. " fill_service
*& Form fill_pocond
text
-->P_POCOND text
-->P_POCONDX text
-->P_WA text
FORM fill_pocond TABLES pocond STRUCTURE bapimepocond
pocondx STRUCTURE bapimepocondx
USING wa STRUCTURE zlo_mmcnv009.
*Net Price in Purchasing Document
IF wa-netprice <> ''.
pocond-itm_number = wa-itemnum.
pocondx-itm_number = wa-itemnum.
pocond-cond_value = wa-netprice.
pocondx-cond_value = 'X'.
pocond-currency = 'BHD'.
pocondx-currency = 'X'.
pocond-cond_type = 'PBXX'.
pocondx-cond_type = 'X'.
*COND_TYPE
APPEND pocond.
APPEND pocondx.
ENDIF.
ENDFORM. " fill_pocond -
Creating service order using BAPI_BUSPROCESSND_CREATEMULTI
Hi Experts,
I have a requirement to create a Service order using a BAPI.
I'm trying to use the BAPI BAPI_BUSPROCESSND_CREATEMULTI. I found some code related to this BAPI on this forum and and I've written my code based on that and while executing it i'm getting a short dump. Could anyone please help me figure out what the problem is.
My code is as follows:
data: lv_header_guid type guid_32.
data: begin of lit_header occurs 0,
include type BAPIBUS20001_HEADER_INS,
end of lit_header.
data: wa_header type BAPIBUS20001_HEADER_INS.
data: begin of lit_inputfields occurs 0,
include type BAPIBUS20001_INPUT_FIELDS,
end of lit_inputfields.
data: wa_inputfields type BAPIBUS20001_INPUT_FIELDS.
data: begin of lit_partner occurs 0,
include type BAPIBUS20001_PARTNER_INS,
end of lit_partner.
data: wa_partner type BAPIBUS20001_PARTNER_INS.
Create Contract header guid
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_32 = lv_header_guid.
Fill orderadm_h
wa_header-guid = lv_header_guid.
wa_header-process_type = 'YSC'.
APPEND wa_header TO lit_header.
Fill input fields
MOVE: lv_header_guid TO wa_inputfields-ref_guid,
'A' TO wa_inputfields-ref_kind,
'0001' TO wa_partner-ref_partner_handle,
'ORDERADM_H' TO wa_inputfields-objectname,
'PROCESS_TYPE' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
CLEAR wa_inputfields.
Fill PARTNER DETAILS
Sold to Party
MOVE: lv_header_guid TO wa_partner-ref_guid,
'A' TO wa_partner-ref_kind,
'0001' TO wa_partner-ref_partner_handle,
'CRM000' TO wa_partner-partner_fct,
'5000000288' TO wa_partner-partner_no,
'BP' TO wa_partner-no_type,
'BP' TO wa_partner-display_type,
'X' TO wa_partner-mainpartner.
APPEND wa_partner TO lit_partner.
CLEAR wa_partner.
Fill input fields
MOVE: lv_header_guid TO wa_inputfields-ref_guid,
'A' TO wa_inputfields-ref_kind,
'0001' TO wa_inputfields-logical_key,
'PARTNER' TO wa_inputfields-objectname.
MOVE 'PARTNER_FCT' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
MOVE 'PARTNER_NO' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
MOVE 'NO_TYPE' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
MOVE 'DISPLAY_TYPE' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
CLEAR wa_inputfields.
CALL FUNCTION 'BAPI_BUSPROCESSND_CREATEMULTI'
TABLES
HEADER = lit_header
ITEM =
ACTIVITY =
SALES =
PARTNER = lit_partner
ORGANISATION =
SHIPPING =
APPOINTMENT =
TEXT =
SERVICE_OS =
STATUS =
INPUT_FIELDS = lit_inputfields
CREATED_PROCESS =
RETURN =
LEAD =
OPPORTUNITY =
PRODUCT =
SCHEDULELINE =
CUSTOMER_HEAD =
CUSTOMER_ITEM =
PRICING =
PRICING_ITEM =
CONDITION_CREATE =
BILLING =
CONFIG_CFG =
CONFIG_BLB =
CONFIG_INS =
CONFIG_PRT =
CONFIG_VAL =
CONFIG_VK =
CONFIG_REF =
ADDRESS =
BILLPLAN =
BILLPLAN_DATE =
EXTENSIONIN =
DOCUMENT_FLOW =
BATCH =
PRICING_AGR_CRM =
FINPROD_ITEM =
CANCEL =
CANCEL_IR =
PRODUCT_LIST =
PRODUCTS =
OBJECTS =
PAYPLAN =
PAYPLAN_DATE =
CONFIG_FILTER_CFG =
CONFIG_FILTER_INS =
CONFIG_FILTER_PRT =
CONFIG_FILTER_VAL =
ACTIVITY_I =
EXT_REF =
ENDFUNCTION.
I'm getting the following dump.
Runtime Errors ITAB_ILLEGAL_COMPONENT
Date and Time 07.09.2006 21:29:03
Short dump has not been completely stored (too big)
Short text
Invalid line component &V2 in "... KEY k1 = v1 ... kn = vn".
Error analysis
When the ABAP/4 program "SAPLCRM_BUSPROCESSND_BAPI" attempted to process the
internal table "HEADER[]"
with "... KEY k1 = v1 ... kn = vn", a component "HANDLE " was specified
dynamically as the contents
of the field "LV_STR_HANDLE". However, the line type "u" of the internal table
"HEADER[]"
contains no component "HANDLE ".
| -
Information on where terminated
Termination occurred in the ABAP program "SAPLCRM_BUSPROCESSND_BAPI" - in
"SET_RETURN_VALUES".
The main program was "RS_TESTFRAME_CALL ".
In the source code you have the termination point in line 36
of the (Include) program "LCRM_BUSPROCESSND_BAPIF80".
Source Code Extract
Line
SourceCde
6
7
text
8
9
-->P_LT_ORDERADM_H_COM text
10
-->P_LT_ORDERADM_I_COM text
11
<--P_HEADER text
12
<--P_ITEM text
13
14
form set_return_values tables header structure BAPIBUS20001_HEADER_INS
15
item structure BAPIBUS20001_item
16
using p_lt_orderadm_h_com type any table
17
p_lt_orderadm_i_com type any table
18
19
20
data: lv_str_handle type fieldname,
21
lv_str_headerhandle type fieldname,
22
lv_str_objectid type fieldname.
23
24
25
field-symbols: <ls_orderadm_h> type crmt_orderadm_h_com,
26
<ls_orderadm_i> type crmt_orderadm_i_com,
27
<ls_header> type BAPIBUS20001_HEADER_INS,
28
<ls_item> type BAPIBUS20001_item.
29
30
31
lv_str_handle = 'HANDLE'.
32
lv_str_headerhandle = 'HEADER_HANDLE'.
33
lv_str_objectid = 'OBJECT_ID'.
34
35
loop at p_lt_orderadm_h_com assigning <ls_orderadm_h>.
>>>>>
read table header with key (lv_str_handle) = <ls_orderadm_h>-handle
37
(lv_str_objectid) = <ls_orderadm_h>-object_id
38
assigning <ls_header>.
39
if sy-subrc = 0.
40
<ls_header>-guid = <ls_orderadm_h>-guid.
41
endif.
42
endloop.
| 43|
Could anyone please help me with this.
Thanks,
Preethi
Message was edited by: Preethi SoothFirst off. Debug.
Put a break point on the line that is generating the short dump and run your code. The ABAP debugger should display before the dump...now....
The error specifies that the line type of the table HEADER (which is the internal representation of your lit_header table and has line type BAPIBUS20001_HEADER_INS ) doesn't have a field called HANDLE.
Check if it does (it should have or something is very wrong, and you should report a bug to SAP).
Check all runtime variables for that command. See if the table has any values in it. Try using your lit_header table with header-line or not.
Your in a far better position to determine what the error is then me. Right now, I don't have access to a CRM server.
From my experience that BAPI is a piece of .... It is hard finding functions in CRM that actually do what you want...properly...Try using CRM_ORDER_CREATE (i think it's called like that). Much better, and if you need RFC capability just write a wrapper RFC.
Message was edited by: João Sousa -
Service PO Using BAPI_PO_CREATE1
Hi,
I am using Bapi_Po_Create new service PO from the existing agreement. I am getting the PO Number but i am not getting the services that i was mensioned in the POSERVICES table. Can any body tell me how to get the given services into the PO with code.Hi,
This table contains the services and services specifications outline for the purchase order.
Field OUTL_IND is used to flag a line as an outline line. The service lines are assigned to the outline lines using the fields PCKG_NO (for the service line) and SUBPCKG_NO (for the outline line).
The outline hierarchy is mapped using the fields LINE_NO and HI_LINE_NO. Field HI_LINE_NO links to field LINE_NO of the hierarchically superior outline.
Note
In method BAPI_PO_CHANGE, you can only create service items, you cannot change them.
Reward if useful!
Maybe you are looking for
-
Print dialog options in case sensitive file system
Since changing the file system running Lion and Mountain Lion from Mac OS Extended (Journaled) to Mac OS Extended (Case-sensitive, Journaled), certain features in print dialogs have disappeared. Particularly the option to print notes with slides in M
-
Table set to Autofit to Contents doesn't display correctly in RH10
Upgraded from RH9 to RH10 and all my tables are set to Autofit to Contents. After upgrading, the first column of every table is huge/wide, therefore, it's very difficult to work with the remaining columns because they're so condensed. I've been wai
-
VPRS Condition is missing in invoice for bacth determine line item
Hi Gurus, I have an Concern, My user has created Sales order with three line items. He did delivery and Invoice individually for each line item. For 2 line items he entered batch manually and did invoice there we didn't find any issue. For third line
-
hi how do i set a block or field to be locked and unlocked. default property is locked from update or insert when u click edit, set insert and update records to yes and change the colour.
-
Process for Scheduling Agreement
Please tell me the process for Scheduling Agreement? I have created Scheduling Agreement thru ME31L and delivery schedule thru ME38. what is the further process?