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

change quantity using order maintain

Former Member
0 Likes
457

Hi expert

I'm trying to change the quantity of service confirmation orders using the bapi CRM_ORDER_MAINTAIN .

The bapi work fine and the sy-subr is eq 0 but in the order the quantity is not changed.

please help

Marco

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
416

hi

It all depends on how we populate CT_INPUT_FIELDS and IT_SCHEDLIN_I structures. Following is the sample code.

ls_schedlines-quantity = LV_QUANTITY.

ls_schedlines-guid = gv_schedlin_guid.

ls_schedlines-logical_key = gv_schedlin_guid.

INSERT ls_schedlines INTO TABLE

ls_schedlin_i-schedlines.

ls_schedlin_i-ref_guid = gv_item_guid.

INSERT ls_schedlin_i INTO TABLE gt_schedlin_i.

ls_input_field-ref_guid = gv_item_guid.

ls_input_field-objectname = 'ORDERADM_I'.

ls_input_field_names-fieldname = 'ITM_PROC_IDENT'.

INSERT ls_input_field_names INTO TABLE

ls_input_field-field_names.

INSERT ls_input_field INTO TABLE gt_input_field.

CLEAR ls_input_field.

ls_input_field-ref_kind = 'B'.

ls_input_field-ref_guid = gv_item_guid.

ls_input_field-objectname = 'SCHEDLIN'.

ls_input_field-logical_key = gv_schedlin_guid.

ls_input_field_names-fieldname = 'LOGICAL_KEY'.

INSERT ls_input_field_names INTO TABLE

ls_input_field-field_names.

ls_input_field_names-fieldname = 'QUANTITY'.

INSERT ls_input_field_names INTO TABLE

ls_input_field-field_names.

INSERT ls_input_field INTO TABLE gt_input_field.

CALL FUNCTION 'CRM_ORDER_MAINTAIN'

EXPORTING

IT_SCHEDLIN_I = gt_schedlin_i

IMPORTING

ET_EXCEPTION = LT_EXCEPTION

CHANGING

CT_ORDERADM_I = LT_ORDERADM_I

CT_INPUT_FIELDS = gt_input_field

CV_LOG_HANDLE = LV_LOGHNDL.

regards

Nishant Malhotra

2 REPLIES 2
Read only

Former Member
0 Likes
416

Good day!

May be you forget BAPI_TRANSACTION_COMMIT after FM call?

Read only

Former Member
0 Likes
417

hi

It all depends on how we populate CT_INPUT_FIELDS and IT_SCHEDLIN_I structures. Following is the sample code.

ls_schedlines-quantity = LV_QUANTITY.

ls_schedlines-guid = gv_schedlin_guid.

ls_schedlines-logical_key = gv_schedlin_guid.

INSERT ls_schedlines INTO TABLE

ls_schedlin_i-schedlines.

ls_schedlin_i-ref_guid = gv_item_guid.

INSERT ls_schedlin_i INTO TABLE gt_schedlin_i.

ls_input_field-ref_guid = gv_item_guid.

ls_input_field-objectname = 'ORDERADM_I'.

ls_input_field_names-fieldname = 'ITM_PROC_IDENT'.

INSERT ls_input_field_names INTO TABLE

ls_input_field-field_names.

INSERT ls_input_field INTO TABLE gt_input_field.

CLEAR ls_input_field.

ls_input_field-ref_kind = 'B'.

ls_input_field-ref_guid = gv_item_guid.

ls_input_field-objectname = 'SCHEDLIN'.

ls_input_field-logical_key = gv_schedlin_guid.

ls_input_field_names-fieldname = 'LOGICAL_KEY'.

INSERT ls_input_field_names INTO TABLE

ls_input_field-field_names.

ls_input_field_names-fieldname = 'QUANTITY'.

INSERT ls_input_field_names INTO TABLE

ls_input_field-field_names.

INSERT ls_input_field INTO TABLE gt_input_field.

CALL FUNCTION 'CRM_ORDER_MAINTAIN'

EXPORTING

IT_SCHEDLIN_I = gt_schedlin_i

IMPORTING

ET_EXCEPTION = LT_EXCEPTION

CHANGING

CT_ORDERADM_I = LT_ORDERADM_I

CT_INPUT_FIELDS = gt_input_field

CV_LOG_HANDLE = LV_LOGHNDL.

regards

Nishant Malhotra