Application Development 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: 

BAPI

Former Member
0 Kudos

Need to enhance a project where,

Webmethods triggers the BAPI_SALESORDER_CREATEFROMDAT1.

Initially no price was added to this BAPI.

Now i added a condition price by defaulting the condition type.

The condition price is showing 10 times more, e.g 100 is shown as 1000.

Is this expected? in that case do i need to devide price by 10 and then send to BAPI?

Also intially pricing condition use to appear by default to the SO created by this BAPI. This condition type still exists. How to remove it?

I know that this BAPI is obsolete, but it is already in use.

Your help will be greately appreciated.

And points will be awarded.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

do you also put in the currency?? if not this could be the reason of the increasing of the condition amount. Try to put in the currency in ORDER_ITEMS_IN-CURRENCY

and now give me the points ))

good luck!

3 REPLIES 3

Former Member
0 Kudos

Hi,

do you also put in the currency?? if not this could be the reason of the increasing of the condition amount. Try to put in the currency in ORDER_ITEMS_IN-CURRENCY

and now give me the points ))

good luck!

0 Kudos

Wow dude,it works. But can u explain me on this.

Even if i had not given the USD, it took it by default but mulityplied by 10. When i explicitly gave USD, it took the right amount, i am surprised. A lot thanks to you. Never realised this.

But my another question is still unanswered, hence did not give u full marks :P.

When i run this BAPI directly, (SE37) it works fine.

But when Webmethods calls this BAPI, then by default a condition type gets included. I am not able to understand wht settings i need to enable/disable to remove this default cond. type. Any idea?

Please note that , this calling on BAPI thru WM was written by somebody else. I checked all possible fields to this BAPI, did not get any hint.

Any kind of help will be rewarded.

thanks

0 Kudos

Hi,

Since the BAPI is calling by 3rd party, that is very difficult for your to trace why does the defaulted condition type being included during the call. Thus i would suggest below:

1. Check on the 3rd party side on the input passed in.

2. If confirm they didn't pass in any suspicious input, then you need to debug the BAPI FM during the 3rd party call. Under the BAPI u may need to code an infinity loop at the begining of the FM.

eg:

data: a type i value 0.
do.
  if a = 1.
    exit.
  endif.
enddo.

after activate your FM, ask the 3rd party trigger the BAPI call, then you may need to goto tcode SM50 you will get a dialog session being hold for the BAPI. Note: you can determine the correct dialog work process by determine the program name or user id. Then highlight it, goto menu Program/session->Program->Debugging. Immediately an addition popup will bring you to the BAPI FM debugging mode. And you will notice you will stuck in the DO~ENDDO loop where you coded as above. change the value of variable A to 1, then you can continue debug the FM for where is the cause of defaulted condition type coming from.

FYI, above is applicable for the BAPI calling within SAP itself.

Hope it helps.