2012 Aug 22 1:14 PM
Hi All,
We are using BAPI BAPI_REQUISITION_CREATE to upload PR's from legacy.
PR's are perfectly creating but the services are not updating.
we have gone through SDN links and notes but no use.
Request you to let us know why this issue is happening. PFB the code.
call function 'NUMBER_GET_NEXT'
exporting
nr_range_nr = '01'
object = 'SERVICE'
importing
number = l_packno
exceptions
interval_not_found = 1
number_range_not_intern = 2
object_not_found = 3
quantity_is_0 = 4
quantity_is_not_1 = 5
interval_overflow = 6
buffer_overflow = 7
others = 8.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
bapi_services-pckg_no = l_packno.
bapi_services-line_no = 1.
bapi_services-subpckg_no = bapi_services-pckg_no + 1.
bapi_services-outl_ind = 'X'.
bapi_services-from_line = 1.
l_packno = bapi_services-subpckg_no.
l_lineno = bapi_services-line_no.
append bapi_services.
clear bapi_services.
*************************try*********************************
bapi_services-pckg_no = l_packno."tmp_struct-packno.
bapi_services-line_no = l_lineno + 1."tmp_struct-introw - 1.
bapi_services-ext_line = 10.
bapi_services-base_uom = tmp_struct-sruom.
bapi_services-gr_price = tmp_struct-kbetr.
bapi_services-short_text = tmp_struct-ktext.
bapi_services-price_unit = tmp_struct-peinh.
bapi_services-matl_group = tmp_struct-matkl.
bapi_services-quantity = tmp_struct-menge.
append bapi_services.
clear bapi_services.
*************************try*********************************
bapi_srvacc-pckg_no = l_packno.
bapi_srvacc-line_no = l_lineno + 1.
bapi_srvacc-serno_line = 1.
bapi_srvacc-serial_no = 1.
bapi_srvacc-quantity = tmp_struct-menge.
bapi_srvacc-percentage = 100.
bapi_srvacc-net_value = tmp_struct-kbetr.
append bapi_srvacc.
clear bapi_srvacc.
Thanks,
Santosh
2012 Aug 22 1:27 PM
compare your settings with OSS Note 420331 - BAPI_REQUISITION_CREATE: Template for services
2013 May 22 12:15 PM
Dear Jurgen,
Thanks for sharing it, i came across same problem and my problem is fixed by applying this Note 420331.
Best Regards
Mohsin Abbasi
MM Consultant
2012 Aug 22 1:28 PM
Hello Santosh,
you will probably need to post this question in the abapper forums. However you should include whole code, this is not the whole program, is it?
Anyway...by my personal experience, you havent forget to include the magic formula 'BAPI_TRANSACTION_COMMIT' after the actual BAPI call, right?
2012 Aug 22 2:31 PM
Hi Petr,
Thanks for the reply.
'BAPI_TRANSACTION_COMMIT' is already there in after the bapi call.
Still no use.
CALL FUNCTION 'BAPI_REQUISITION_CREATE'
EXPORTING
skip_items_with_error = ''
automatic_source = ''
IMPORTING
number = bapi_number
TABLES
requisition_items = bapi_items[]
requisition_account_assignment = bapi_accounts[]
* REQUISITION_ITEM_TEXT =
requisition_limits = bapi_limits[]
* REQUISITION_CONTRACT_LIMITS =
requisition_services = bapi_services[]
requisition_srv_accass_values = bapi_srvacc[]
return = bapi_return[].
* REQUISITION_SERVICES_TEXT =
* REQUISITION_ADDRDELIVERY =
* extensionin = bapi_exten[].
IF l_errflag NE 'X'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
WAIT UP TO '2' SECONDS.
ENDIF.
Thanks,
Santosh
2012 Aug 22 2:38 PM
moved from MM to
ABAP Connectivity
with so much code in it, it cannot be a MM application specific problem
2012 Aug 23 10:44 AM
Hi All,
I am able to resolve the issue of service tab not updating.
Now i am facing new issue. when im trying to update two line items facing below error.
"No account assignment exists for service line 0000000010"
Note 1030206 related to above error is already inlcuded in the system.
Please advice.
Thanks,
Santosh
2012 Aug 23 11:47 AM
I am not sure if the note relates to this error. The note fixes a problem with multiple account assignments, your error says it cannot find any.
Can you try to find the error number, I cannot find the given message in T100 table (which holds all SAP messages)
2012 Aug 23 12:24 PM
2012 Aug 23 12:50 PM
you should use the message number and search for OSS notes. OSS notes are really my first place if I meet a strange message.
check this note: Note 499626 - FAQ: BAPIs in the service procurement
2012 Aug 23 7:44 PM
Apply note 767284
Reason and Prerequisites
Program Error.
Note 552114 must be applied as a prerequisite.
Reference to related Notes
Number Short text
1000184 Account assignment error when document transfer to back end
You can check in transaction SE37
SE37 -> BAPI_PO_CREATE1 -> Where used List (ctrl + shift + F3)
Let me know how you get on