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: 

Read Contract Data

Former Member
0 Kudos

Hi,

Can anyone suggest a FM/BAPI to read the contract data? As in, if I enter the contract number, it should return the details of the contract. I am especially looking for the order quantity in the contract(KWMENG).

This quantity is not maintained in VBAP, for a quantity contract.

Thanks and Regards,

Shivali

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos

Hi Shivali,

YOu can query vbak and vbap tables with order type as 'KTN' for Contract number.

Regards,

Ravi

8 REPLIES 8

Former Member
0 Kudos

Hi Shivali,

Try this Bapi <b>BAPI_CONTRACT_CREATEFROMDATA</b>.

Reward points if helpful.

Regards,

Srikanth.

former_member181962
Active Contributor
0 Kudos

Hi Shivali,

YOu can query vbak and vbap tables with order type as 'KTN' for Contract number.

Regards,

Ravi

Former Member
0 Kudos

Hi,

I have others details for the contract from these tables, but this cumulative order quantity is not maintained in vbak/vbap.

Thanks,

Shivali

0 Kudos

Hi Shivali ,

Did you find a solution for this ?

Even I have a similar req: to fetch the open qty and cummulative order quantity from the contract . Couldn't find the value in VBAP and the screen field shows struture RV45A.

Anyone out there to help on this regard

Regards

Beena

former_member534411
Participant
0 Kudos

Hi,

BAPISDORDER_GETDETAILEDLIST

user above mentioned BAPI as following.

**Filling ORDER_VIEW

is_bapi_view-header = 'X'.

is_bapi_view-item = 'X'.

is_bapi_view-sdschedule = 'X'.

is_bapi_view-business = 'X'.

is_bapi_view-partner = 'X'.

is_bapi_view-address = 'X'.

is_bapi_view-status_h = 'X'.

is_bapi_view-status_i = 'X'.

is_bapi_view-sdcond = 'X'.

is_bapi_view-sdcond_add = 'X'.

is_bapi_view-contract = 'X'.

is_bapi_view-text = 'X'.

is_bapi_view-flow = 'X'.

is_bapi_view-billplan = 'X'.

is_bapi_view-configure = 'X'.

is_bapi_view-credcard = 'X'.

is_bapi_view-incomp_log = 'X'.

is_vbeln-vbeln = g_vbeln.

append is_vbeln.

        • Function Module BAPISDORDER_GETDETAILEDLIST is used to fetch

        • data of the complete sales order

call function 'BAPISDORDER_GETDETAILEDLIST'

exporting

i_bapi_view = is_bapi_view

tables

sales_documents = is_vbeln

order_headers_out = is_order_headers_out

order_items_out = is_order_items_out

order_conditions_out = is_order_conditions_out.

Regards,

Suresh

0 Kudos

Hi Suresh ,

thanks for the reply

This BAPI didn't return the open qty and cumulative order quantity in the contract . It returned all other details

Regards

Beena

Former Member
0 Kudos

Hi Beena,

As I could not find any BAPI/FM I did it manually. Go to table VBFA and enter preceding document as contract number and select all sales orders for that contract. Then sum up their quantities and subtract it from the target quantity in the contract. This will give you the open quantity.

Regards,

Shivali

0 Kudos

Thanks Shivali,

Keeping in mind the option suggested by u , I am looking for some other way that do not hinder the performance .

Regards

Beena