Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Using Purchase Requisition Creation BAPI

Former Member
0 Likes
2,303

Hey all,

I am using BAPI_REQUISITION_CREATE. I am accessing this BAPI through a webapplication that i have developed. I am able to create a normal Purchase Requisition but I am not able to add a Service ITem to it in case the Item category is Service.

I am filling the service data table with Price, Quantity, Unit and Short Text. I can see that the link between a row in Service Table and Requisition Item Table is a Package no. which i believe is auto-generated. I think this might the reason why i am not able to create a service item as i dont have that number. I am not sure if i am right. Does anybody have used this BAPI, if so then how did you created a Service Item through it. Please help me out soon, as this thing is very urgent.

Regards,

Bilal Nazir

5 REPLIES 5
Read only

Former Member
0 Likes
1,277

Hi,

As you have rightly said the package number is the key and will be automatically generated and it has nothing to do wiht the failure to create a PR.

What is the ITEAM CATEGROY you are passing to the line item. It has to be <b>D </b> for the services line items and after that you pass the data to services table, it should create the requisition. You also will have to pass the account assignment data for the service line items as well.

REQUISITION_SERVICES STRUCTURE BAPIESLLC OPTIONAL

REQUISITION_SRV_ACCASS_VALUES STRUCTURE BAPIESKLC

Regards,

Ravi

Note : Please mark the helpful answers

Message was edited by: Ravikumar Allampallam

Read only

Former Member
0 Likes
1,277

Hi Bilal,

try to have alook at the function module,

IDOC_INPUT_PREQCR.

See for the sample usage of the bapi:

CALL FUNCTION 'BAPI_REQUISITION_CREATE'

exporting

SKIP_ITEMS_WITH_ERROR = SKIP_ITEMS_WITH_ERROR

AUTOMATIC_SOURCE = AUTOMATIC_SOURCE

importing

NUMBER = NUMBER

tables

REQUISITION_ITEMS = REQUISITION_ITEMS

REQUISITION_ACCOUNT_ASSIGNMENT = REQUISITION_ACCOUNT_ASSIGNMENT

REQUISITION_ITEM_TEXT = REQUISITION_ITEM_TEXT

REQUISITION_LIMITS = REQUISITION_LIMITS

REQUISITION_CONTRACT_LIMITS = REQUISITION_CONTRACT_LIMITS

REQUISITION_SERVICES = REQUISITION_SERVICES

REQUISITION_SRV_ACCASS_VALUES = REQUISITION_SRV_ACCASS_VALUES

RETURN = RETURN

REQUISITION_SERVICES_TEXT = REQUISITION_SERVICES_TEXT

REQUISITION_ADDRDELIVERY = REQUISITION_ADDRDELIVERY

EXTENSIONIN = EXTENSIONIN

exceptions

OTHERS = 1

.

Regards,

Ravi

Read only

0 Likes
1,277

Hey Ravi,

I was having a look at the mentioned function module but i am not sure how to execute it. I want to know from you is that what are the necessary fields in Services Table that we need to fill in order to create a Service Line Item. Since the package no. is auto-generated, is there any other necessary field without which a service cant be created.

And i am using the Item Category 'D'. It doesnt give me any errors. It just creates the Item in requisition table and no service with it, although i entered the service in service table.

Regards,

Bilal

Read only

Former Member
0 Likes
1,277

Hi Bilal,

alright, so it's almost a year later, so this is more for all the others that might stumble across this question:

To link between the PR item and the service, you need to fill out the pckg_no field, as you already figured out. Since you don't know this auto-generated number during the creation process, you can just use 00000001. To my knowledge, you need to also fill out the "SERVICE" field in the service table, not just the fields you mentioned. There is a nice SAP note on how to fill out the service and srvaccass tables, either with a header service item or without one. Don't know the URL to this SAP note, but should be easily findable.

regards,

Fabian

Read only

0 Likes
1,277

Hi,

Please refer this OSS:

Note 922372 - BAPI_REQUISITION_CREATE: SE029 for a service item

Regards

Subramanian