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

Error in Bapi_pr_create

Former Member
0 Likes
1,274

Hi,

I am trying to call Bapi_PR_Create in a report.

But it gives me an error saying "Plant I001 not defined.Please check your input."

The Bapi creates a PR successfully with the same data when called executed separately.

What could be wrong?

Please help.

11 REPLIES 11
Read only

Former Member
0 Likes
1,163

pls provide your input values and coding.

Read only

0 Likes
1,163

LOOP AT gt_line INTO wa_line.

gt_item_bapi-PLANT = wa_line-werks.

APPEND gt_item_bapi.

CALL FUNCTION 'BAPI_PR_CREATE'

EXPORTING

PRHEADER = gt_header_bapi

PRHEADERX = gt_headerx_bapi

IMPORTING

NUMBER = PREQ_NO

TABLES

RETURN = gt_return

PRITEM = gt_item_bapi

PRITEMX = gt_itemx_bapi

PRITEMEXP = gt_item_exp_bapi

PRACCOUNT = GT_ITEM_ACC_BAPI

PRACCOUNTX = gt_item_accx_bapi

EXTENSIONIN = gt_extensionin

.

The value passed is I001.

Read only

0 Likes
1,163

check the Plant "I001" in the table T001W once.

I am still not convinced.

Read only

0 Likes
1,163

I have checked the value in the table T001W.

The value I001 exists .

Read only

0 Likes
1,163
I have checked the value in the table T001W.

The value I001 exists .

It may be in T001W but can you confirm one more thing also?

are Purchase Org is assgin to that plant, which you are using is assign to your "I001" plant.

Check this path:

Spro>enter price structure>assignment>materials management>assign standard purchase org to plant..

Amit.

Edited by: Amit Gujargoud on Aug 29, 2008 7:57 AM

Read only

0 Likes
1,163

can you provide the message id and message number for the error.

i can tell you exactly what is the error.

Read only

0 Likes
1,163

The message ID is ME.

The number is 003.

Read only

0 Likes
1,163

I just checked all the Places , It is coming from a select on T001W , where the select fails to find the Plant in T001W.

I am 100% sure the plant is not there in T001W. You are using some wrong plant. This is my conclusion.

Check with 1001.

Read only

Former Member
0 Likes
1,163

"Plant I001 not defined.Please check your input."

is it Plant 1001 or I001. check it once.

I feel you entered I001 instead of 1001. so change it to 1001 and see.

Read only

0 Likes
1,163

I have entered i001 and I want this value only.

The field is defined as Char(4)..

Read only

Former Member
0 Likes
1,163

thnks