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

PO BAPI

madan_ullasa
Contributor
0 Likes
1,274

Hi frnds,

I am developing a program to automate PO modification. I am using BAPI_PO_CHANGE. The problem is that the PO's to be modified has first line item manually entered. This line item has the field 'agreement no.' filled with a value. This values is the source for other values including the 'Net price'. This net price is set to a value in some other transaction. so when we enter the subsequent line items we will have to manually change the net price. So how can i handle this in BAPI_PO_CHANGE. It always gives an error since the program fills the agreement no. value and then automatically fills the net price value which will give an error. how do i over ride this ?

All replies will be given points !!

regards,

Madan.

1 ACCEPTED SOLUTION
Read only

pole_li
Active Participant
0 Likes
1,221

Hi Madan,

Could you post the error message of the BAPI for further analyse?

Regards

Pole

12 REPLIES 12
Read only

Former Member
0 Likes
1,221

Hi

In ths Fm you specified Pls try to use the structure

POITEMX type BAPIMEPOITEMX and fill the required values ie the values you want to change and pass this to FM.

I think this would solve ur problem.

Reward if helpful.

Best Wishes,

Chandralekha

Read only

0 Likes
1,221

i have done that. But the net price is dependant on the value of agreement field. so the agreement field fills the value to net price field which is an error value. this value is not replaced by the value iam passing from the program..

Thanks.

Read only

pole_li
Active Participant
0 Likes
1,222

Hi Madan,

Could you post the error message of the BAPI for further analyse?

Regards

Pole

Read only

0 Likes
1,221

Hi Li,

This is the error in the debug mode.. this value comes from the agreement value in ME33.

I will have to override this net price value from ME33 with the value from program.

"Target value of contract 60000127 exceeded by 79,400.00 USD"

Thanks.

Read only

pole_li
Active Participant
0 Likes
1,221

Hi Madan,

Can you change Net Price of that PO in ME22N manually?

If not, it can not be changed in BAPI.

I have tried in our system, the Net price can be changed only if

I set the agreement field to blank, otherwise, the Net price field

is greyed out.

Regards,

Pole

Edited by: Pole li on Jul 4, 2008 11:10 AM

Read only

0 Likes
1,221

hi Li,

I will tell you how it works in ME22N.

We enter all the values including the agreement value and also the correct net price value. Then we save it. we get the error message i had put in my earlier mail. then we go to the net price value field and then enter it again manually and save it. In the second save the correct value is saved.

Hope you got what i am trying to convey...

Regards,

Madan..

Read only

pole_li
Active Participant
0 Likes
1,221

Hi Madan,

Maybe you should try to change the net price through

POCOND

POCONDX

table.

Regards,

Pole

Read only

0 Likes
1,221

The fact that you are getting an error message and ME22N is still letting you save the document sounds like a bug in the screen to me which is not repeated in the BAPI code. I've had a similar experience with MIRO and BAPI_INCOMINGINVOICE_CREATE where the screen allowed me to enter a null withholding tax code with a base tax value of 0 but the BAPI errored. In that situation, the only thing I could do was do a modification to the SAP code. Or if you are on the right release, you could consider the better option of an enhancement point.

Read only

0 Likes
1,221

Hi,

My PO is not getting saved. As i mentioned the PO is taking the net price value from the agreement no. The value for the agreement no. is also passed from my program. This agreement value determines the net price, which is an error. I am also passing the correct net price value from my program. But the preference is given to the value detemined by the agreement no. Hence the BAPI returns an error.

Regards,

Madan.

Read only

0 Likes
1,221

You could try raising an OSS note with SAP to ask them to confirm whether the BAPI will what you want it to do or not. But it sounds to me as if it won't - and if the BAPI is not designed to do what you want then no amount of messing about with input parameters will make it.

If ME22 will allow you to do what you want, you could try using a BDC based on ME22 instead.

Read only

0 Likes
1,221

Hi Christine,

I really appreciate your follow up on this issue. I have put a mail to SAP. Waiting for the reply. BTW I work for IDT in Malaysia. Basically I am from India. Here for couple of years. How about you?

Regards,

Madan..

Read only

0 Likes
1,221

UK. I've been doing SAP and previously Oracle programming for longer than I care to remember.