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

BAPI_PR_CREATE Error !

Former Member
0 Likes
2,541

Hi all,

I am trying to test BAPI_PR_CREATE manually. The only mandatory table is PRITEM and I had filled it. But DOC TYPE is also mandatory for ME51N, hence I filled this field in table PRITEMEXP as well even though this is not mandatory.

But while checking the T163 table, the PSTYP (Item Category) is not being picked up from the program and it is raising an exception NOT_FOUND hence a Short Dump is displayed.

Kindly help me out in rectifying the error/ Letting me know the inputs to this BAPI.

Warm Regards,

Vijay

10 REPLIES 10
Read only

Former Member
0 Likes
1,738

Hi Vijay,

Try using this Function Module "BAPI_REQUISITION_CREATE". In the FM you have specified it is not required to provide the PRITEMEXP but set value 'X' in PRITEMX to fields you have passed in PRITEM. Then it should work and also don't forget to put 'BAPI_TRANSACTION_COMMIT'.

Hope this would have helped you.

Thanks,

Prashanth

Read only

0 Likes
1,738

Hi Prashant,

Thanks for the inputs.

I tried doing it the way you suggested, but it returns an error asking for Document Type.

I am not in a position to use BAPI_REQUISITION_CREATE because we cannot maintain the header texts through this BAPI. Any inputs for maintaining the Header texts using the same?

Warm regards,

Vijay.

Read only

0 Likes
1,738

Hi,

Can you send me the corresponding Header and Item Details you have paseed before calling this FM so i can check if you have left any thing in it.

Thanks,

Prashanth

Read only

0 Likes
1,738

Hi Prashant,

Please find below the parameters that I am passing:

PRITEM:

PREQ_ITEM = 00010

SHORT_TEXT = Test

MATERIAL = ss10

PLANT = M251

Quantity = 25

UNIT = EA

DELIV_DATE = 05/31/2007

ITEM_CAT = 0

ACCTASSCAT = F

I have marked the corresponding flags for these fields in PRITEMX.

I had run the program without filling DOC_TYPE in PRITEMEXP, and it threw an error "Enter a Document Type".

Even after filling in DOC_TYPE = NB, it throws the same error.

Kindly advise.

Warm Regards,

Vijay

Read only

0 Likes
1,738

Hi Vijay,

Sorry for the late response. If you have not finished it then,

Remove the values from PRITEMEXP.

Fill PRITEMX as Follws

PREQ_ITEM = 00010

SHORT_TEXT = 'X'

MATERIAL = 'X'

PLANT = 'X'

Quantity = 'X'

UNIT = 'X'

DELIV_DATE = 'X'

ITEM_CAT = 'X'

ACCTASSCAT = 'X'.

now you try. I should work.

Thanks,

Prashanth

Read only

0 Likes
1,738

HI Prashant,

I had done this testing before!

But the result remains the same. I filled in PRITEM and PRITEMX with the values as below. And left PRITEMEXP blank. It shows the error "Enter Document Type".

Please advise.

Warm Regards,

Vijay

Read only

0 Likes
1,738

Hi,

Remove Header Details also and hope this is not required. Aslo try the FM i have given you coz it worked for me. Mean while i'll also try out and let you know once fixed.

Thanks,

Prashanth

Read only

0 Likes
1,738

Hi Vijay,

Fill in these values alone it works,

PREQ_ITEM = 00010

*SHORT_TEXT = Test

MATERIAL = ss10

PLANT = M251

Storage_location =

Quantity = 25

UNIT = EA

DELIV_DATE = 05/31/2007

*ITEM_CAT = 0

*ACCTASSCAT = F

Other things get determined it self.

Thanks,

Prashanth

Read only

0 Likes
1,738

Hi Prashanth,

Tough luck again! It gives an error NOT_FOUND as it cannot find an Item Category.

Has it worked for you ??

Warm Regards,

Vijay

Read only

0 Likes
1,738

Hi Vijay

Did you get this to work eventually?

I have the same issue:

E ME 083 Enter Document Type

E BAPI 001 No instance of object type PurchaseRequisition has been created. External reference: # 5

E ME 083 Enter Plant

Thanks!

DH