cancel
Showing results for 
Search instead for 
Did you mean: 

BAdI ORDER_SAVE

Former Member
0 Kudos

I implemented BAdI ORDER_SAVE. With FM "CRM_ORDER_READ" I get all positions. I´ve enhanced the position with EEWB for 1 field. By saving the Order I want to generate a number in the customer field. Does anyone know which FM I should use? FM CRM_CUSTOMER_I_MAINTAIN_OW doesn´t work...

Best regards Andy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Use FM CRM_ORDER_MAINTAIN to save the modified order data.

Ashish

Former Member
0 Kudos

I know FM CRM_ORDER_MAINTAIN, but is it really necessary to use this very huge FM to update only one customer field?

SandeepJha
Product and Topic Expert
Product and Topic Expert
0 Kudos

How are you calling maintain_ow?

Former Member
0 Kudos

I think we can use it. As we can control the input parameters by passing only required fields in structure 'IT_CUSTOMER_H' or 'IT_CUSTOMER_I'

and input fields details in ls_input_fields structure.

Here is the sample code for your reference:

ls_input_fields-ref_guid = ls_orderadm_h-guid.

ls_input_fields-ref_kind = 'A'.

ls_input_fields-objectname = 'CUSTOMER_H'.

ls_fieldnames = 'ZZCUSTOMER_H0XXX'.

insert ls_fieldnames into table lt_fieldnames.

ls_input_fields-field_names = lt_fieldnames.

insert ls_input_fields into table lt_input_fields.

call function 'CRM_ORDER_MAINTAIN'

exporting

it_customer_h = it_customer_h

changing

ct_input_fields = lt_input_fields

exceptions

error_occurred = 1

document_locked = 2

no_change_allowed = 3

no_authority = 4

others = 5.

Hope this may help.

Ashish

Former Member
0 Kudos

I´m in the method IF_EX_ORDER_SAVE~CHANGE_BEFORE_UPDATE

Call Function CRM_ORDER_MAINTAIN with following parameters:

LT_CUSTOMER_I

ref_handle = 0000000000

zznvs_fakturanr = 00000000000000010042 (created via EEWB)

ref_guid = BC0620487EE6062FE10000000A0C141E (position guid)

LT_INPUT

ref_handle = 0000000000

ref_guid = BC0620487EE6062FE10000000A0C141E (position guid)

ref_kind = B (position)

objectname = CUSTOMER_I

LT_INPUT[1]-FIELD_NAMES

Fieldname = ZZNVS_FAKTURANR

... but nothing happens

Former Member
0 Kudos

method IF_EX_ORDER_SAVE~PREPARE is working !!! Thanks to all !!!

Former Member
0 Kudos

Please reward points.

Ashish

Thanks for the points.

Ashish

Edited by: Ashish Arya on May 8, 2008 4:27 PM

Answers (1)

Answers (1)

ashish_nagpal
Active Contributor
0 Kudos

hi

yeah CRM_order_maintain

else you can always use

CRM_ORDER_SAVE BAdi for ur purpose

best regards

ashish