cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI for finding amount in VK11 / VK12 Transaction

Former Member
0 Kudos

Hi All,

I want to find the amount value from VK12 Transaction.Can anyone suggest me which BAPI / Function Module I should use.

I found some BAPIs on net but still not able to decide which one I should use

RV_CONDITION_COPY

BAPI_PRICES_CONDITIONS

Thanks In Advance

Saurabh Shrivastava


Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

SELECT SINGLE knumh FROM a367 INTO condition_no WHERE aland = country AND werks = plant AND regio = region

AND matnr = material AND datab LE validity AND datbi GE validity.

IF sy-subrc EQ 0.

   SELECT SINGLE kbetr FROM konp INTO amount WHERE knumh = condition_no.

ENDIF.

Solved

Answers (2)

Answers (2)

Former Member
0 Kudos

All of the items you need to specify (Country/Plant/Region/Material/Release status/Valid On) can be passed into BAPI_SALESORDER_SIMULATE.  Sreekanth is correct in that direct access of the condition tables is faster.  I know of 2 instances in our ERP where they are accessed.  And that is 2 instances which must be adjusted when a new price condition is defined.

Former Member
0 Kudos

Check out  BAPI_SALESORDER_SIMULATE.  It accepts the partner number and conditions table as VK12 does.

Former Member
0 Kudos

Hi,

Thanks for the post.but based on condition type and key combination of

Country/Plant/Region/Material/Release status/Valid On,  I want the amount.

BAPI you suggested is taking the details from sales order like

ORDER_HEADER_IN

ORDER_ITEMS_IN

ORDER_PARTNERS

ORDER_SCHEDULE_IN

ORDER_ITEMS_OUT

ORDER_CFGS_REF

ORDER_CFGS_INST

ORDER_CFGS_PART_OF

ORDER_CFGS_VALUE

ORDER_CFGS_BLOB

ORDER_CCARD

ORDER_CCARD_EX

ORDER_SCHEDULE_EX

ORDER_CONDITION_EX

ORDER_INCOMPLETE

MESSAGETABLE

EXTENSIONIN

PARTNERADDRESSES

These all fields i Dont know...

Can you suggest me other bapis so that i can get the amount.

Former Member
0 Kudos

Hi,

There is an alternative why can't u use directly the condition tables instead of BAPI's in that way it will reduce your performance of the program.

Regards,

Sreekanth

Former Member
0 Kudos

I was also thinking the same.But still unable to find the right KNUMH (Condition record number) Value from A367 that is used to store the details regarding Country/Plant/Region/Material. Since there may be no of Condition record number for the same material. I am getting no of values for the KNUMH field if I am filtering data based on the Country/Plant/Region/Material form A367 table. if I am filtering data based on the Validity start date (DATAB) in combination with Country/Plant/Region/Material then i am getting the right value for KNUMH Field.But Don't know how to get the Valid From Date from Transaction VK13.

So can you tell me from where I can get the value of Valid From in the VK13/VK12/VK11.

if it is possible then I can do a direct query to the table KONP based on the KNUMH field & will get the amount.

Thanks

Saurabh Shrivastava