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: 

ME31K : BAPI_AGREEMENT_MAINTAIN

Former Member
0 Kudos

Hi

i am trying to create the contract using BAPI : BAPI_AGREEMENT_MAINTAIN .

BUT i am getting an error : "Please enter material number or account assignment category"

i am passing the following parameters

wa_contract_header-vendor = '300005' .

wa_contract_header-doc_type = 'ZK' .

wa_contract_header-creat_date = sy-datum.

wa_contract_header-purch_org = '1005' .

wa_contract_header-pur_group = 'E60' .

wa_contract_header-vper_start = sy-datum.

wa_contract_header-vper_end = l_date.

wa_contract_header-doc_cat = 'K'.

wa_contract_header_x-vendor = cns_x.

wa_contract_header_x-doc_type = cns_x.

wa_contract_header_x-creat_date = cns_x.

wa_contract_header_x-purch_org = cns_x.

wa_contract_header_x-pur_group = cns_x.

wa_contract_header_x-vper_start = cns_x.

wa_contract_header_x-vper_end = cns_x.

wa_contract_header_x-doc_cat = cns_x.

wa_contract_detail-agrmt_item = '10'.

wa_contract_detail-plant = 'CH00'.

wa_contract_detail-stge_loc = '3000'.

wa_contract_detail-matl_group = '701000FIN'.

wa_contract_detail-material = '502233 T'.

wa_contract_detail-ematerial = '502233 T'.

wa_contract_detail-net_price = '10.00'.

wa_contract_detail-target_qty = '100'.

APPEND wa_contract_detail TO it_contract_detail.

wa_contract_detail_x-agrmt_item = cns_x.

wa_contract_detail_x-plant = cns_x.

wa_contract_detail_x-stge_loc = cns_x.

wa_contract_detail_x-matl_group = cns_x.

wa_contract_detail_x-material = cns_x.

wa_contract_detail-ematerial = cns_x.

wa_contract_detail_x-net_price = cns_x.

wa_contract_detail_x-target_qty = cns_x.

APPEND wa_contract_detail_x TO it_contract_detail_x.

CALL FUNCTION 'BAPI_AGREEMENT_MAINTAIN'

EXPORTING

im_agreement_header = wa_contract_header

im_agreement_header_x = wa_contract_header_x

TABLES

ext_return = it_return

imt_agreement_items = it_contract_detail

imt_agreement_items_x = it_contract_detail_x.

Any help will be useful

Regards

Rahul

2 REPLIES 2

Former Member
0 Kudos

Hi,

I think u have used wa_contract_detail-ematerial = cns_x. instead of wa_contract_detail_x-ematerial = cns_x.

Thanks & Regards,

Harish

Former Member
0 Kudos

Hi

i am trying to create the contract using BAPI : BAPI_AGREEMENT_MAINTAIN .

BUT i am getting an error : "Please enter material number or account assignment category"

i am passing the following parameters

wa_contract_header-vendor = '300005' .

wa_contract_header-doc_type = 'ZK' .

wa_contract_header-creat_date = sy-datum.

wa_contract_header-purch_org = '1005' .

wa_contract_header-pur_group = 'E60' .

wa_contract_header-vper_start = sy-datum.

wa_contract_header-vper_end = l_date.

wa_contract_header-doc_cat = 'K'.

wa_contract_header_x-vendor = cns_x.

wa_contract_header_x-doc_type = cns_x.

wa_contract_header_x-creat_date = cns_x.

wa_contract_header_x-purch_org = cns_x.

wa_contract_header_x-pur_group = cns_x.

wa_contract_header_x-vper_start = cns_x.

wa_contract_header_x-vper_end = cns_x.

wa_contract_header_x-doc_cat = cns_x.

wa_contract_detail-agrmt_item = '10'.

wa_contract_detail-plant = 'CH00'.

wa_contract_detail-stge_loc = '3000'.

wa_contract_detail-matl_group = '701000FIN'.

wa_contract_detail-material = '502233 T'.

wa_contract_detail-net_price = '10.00'.

wa_contract_detail-target_qty = '100'.

APPEND wa_contract_detail TO it_contract_detail.

wa_contract_detail_x-agrmt_item = cns_x.

wa_contract_detail_x-plant = cns_x.

wa_contract_detail_x-stge_loc = cns_x.

wa_contract_detail_x-matl_group = cns_x.

wa_contract_detail_x-material = cns_x.

wa_contract_detail_x-net_price = cns_x.

wa_contract_detail_x-target_qty = cns_x.

APPEND wa_contract_detail_x TO it_contract_detail_x.

CALL FUNCTION 'BAPI_AGREEMENT_MAINTAIN'

EXPORTING

im_agreement_header = wa_contract_header

im_agreement_header_x = wa_contract_header_x

TABLES

ext_return = it_return

imt_agreement_items = it_contract_detail

imt_agreement_items_x = it_contract_detail_x.

Any help will be useful

Regards

Rahul