cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Partner function in order save

Former Member
0 Kudos

Hi experts,

We need to delete the partner function from the order whil changiing the order.

So we are trying to delete the partner function in order save badi in Prepare method passing the values to CRM ORDER MAINTAIN function module,

but its now working.

Could you pls suggest any other alternative ofr the same......or any mistake am doing in the code

ls_partner_maint-ref_guid = ls_orderadm_i-guid.

ls_partner_maint-ref_handle = '0000'.

ls_partner_maint-ref_kind = 'B'.

ls_partner_maint-ref_partner_handle = '0000'.

ls_partner_maint-ref_partner_fct = 'LF'.

ls_partner_maint-ref_partner_no = ls_partner_lf-partner_no.

ls_partner_maint-kind_of_entry = 'C'.

ls_partner_maint-partner_fct = 'LF'.

ls_partner_maint-partner_no = ls_partner_lf-partner_no.

ls_partner_maint-no_type = 'BP'.

ls_partner_maint-display_type = 'BP'.

INSERT ls_partner_maint INTO TABLE lt_partner_maint_del.

ls_input_flds-ref_guid = ls_orderadm_i-guid.

ls_input_flds-ref_handle = '0000'.

ls_input_flds-ref_kind = 'B'.

ls_input_flds-objectname = 'PARTNER'.

ls_logical_key-ref_partner_handle = '0000'.

ls_logical_key-ref_partner_fct = 'LF'.

ls_logical_key-ref_partner_no = ls_partner_lf-partner_no.

ls_logical_key-ref_no_type = 'BP'.

ls_logical_key-ref_display_type = 'BP'.

ls_input_flds-logical_key = ls_logical_key.

ls_input_fld_names-fieldname = 'PARTNER_FCT'.

INSERT ls_input_fld_names INTO TABLE lt_input_fld_names.

ls_input_flds-field_names[] = lt_input_fld_names[].

INSERT ls_input_flds INTO TABLE lt_input_flds_maint.

CLEAR ls_input_flds.

CLEAR ls_partner_maint.

REFRESH lt_input_fld_names.

Thanks,

Aniket

View Entire Topic
Former Member
0 Kudos

Hi Aaniket,

There are 2 things in this scenario;

-Say if you are trying to change the partner in save badi that is determined using config, then you need to ask you configuration consultant to enable the changing parameter values for that particular partner fucntion in config.

- And say if you are changing some partner fucntion that is determined based on some inputs like camapign on transcation then those can be modified using CRM_ORDER_MAINTAIN . No need to take help of fucntional consultant

If you need any more inputs then do let me know

Former Member
0 Kudos

Hi John,

We are inserting one partner function LF on order save processing some input conditions by the user.

and its getting inserted correctly for each item, and we are using that for pricing on item level.

But now the case is when user changes the saved order at item level we need to check the conditions

and if conditions are failing we need to delete the partner function for that item which was inserted during the order create.

So here we are trying to delete the partner function LF at item level.

Thanks,

Aniket

Former Member
0 Kudos

Even for delete you can use crm order maintain. And make sure you pass D mode in mode field when u r using Crm order maintian.

ls_partner-ref_guid = gs_order-guid.

ls_partner-ref_handle = '0000000000'.

ls_partner-ref_kind = 'A'.

ls_partner-ref_partner_handle = '0000'.

ls_partner-ref_partner_fct = '00000001'.

ls_partner-ref_partner_no = gs_part-ref_partner_no.

ls_partner-ref_no_type = 'BP'.

ls_partner-ref_display_type = 'BP'.

ls_partner-partner_guid = gs_part-bp_partner_guid.

ls_partner-kind_of_entry = ''.

ls_partner-partner_fct = ''.

ls_partner-partner_no = gs_part-ref_partner_no.

ls_partner-display_type = 'BP'.

ls_partner-no_type = 'BP'.

ls_partner-mainpartner = 'X'.

INSERT ls_partner INTO TABLE lt_partner.

***Input Fields

CONCATENATE '000000000001' l_part ' BPBP' INTO l_key.

CLEAR gs_input_fields.

CLEAR ls_input_fields.

gs_input_fields-ref_guid = gs_order-guid.

gs_input_fields-ref_handle = '0000000000'.

gs_input_fields-ref_kind = 'A'.

gs_input_fields-objectname = 'PARTNER'.

gs_input_fields-logical_key = l_key.

gs_fields-fieldname = 'PARTNER_FCT'.

INSERT gs_fields INTO TABLE gs_input_fields-field_names.

INSERT gs_input_fields INTO TABLE gt_input_fields.

This logic should delete data of partner. I am using it and ir wokrs fine for me

Former Member
0 Kudos

Hi John,

Thanks a lot for the code.

As this code is used for Partner function deletion at header level you are passing as ref_guid as order guid.

could you please let me know as i want to delete at item level as my partner function is maintained at item level

For ref_guid -


I need to pass the item guid ?

Ref_kind -


' B'?

please check my code am doing the same but its not working....

Thanks,

Aniket

Former Member
0 Kudos

Hi Aaniket,

Do the following thing and you problem will be solved:

Go to se24 and enetr class name as cl_crm10_main

There is method maintain_order- double click on that

Then clicl on very first methof Maintain_io

The you get into the actual method.there is crm_order_mainatin is used. Put a break pointon that.

Now go to transaction, and delete the partner at item level, transaction will go in debug mode and you will come to know which GUids need to be passe. Thi should solve your all issues.

let me know if you still have any issue

Former Member
0 Kudos

Hi John,

Thanks a lot.....for your kind help.

Now am able to delete the partner function at item level......

Soon i will put the code here...once it gets tested..............

Thanks,

Aniket

Former Member
0 Kudos

Hi All,

Issue is resolved and working fine now. Am able to delete the partner function.

This what i have done now.

ls_partner_maint-ref_guid = ls_orderadm_i-guid.

ls_partner_maint-ref_handle = '0000000000'.

ls_partner_maint-ref_kind = 'B'.

ls_partner_maint-ref_partner_handle = '0000'.

ls_partner_maint-ref_partner_fct = 'LF'.

ls_partner_maint-ref_partner_no = ls_partner_lf-partner_no.

ls_partner_maint-ref_no_type = 'BP'.

ls_partner_maint-ref_display_type = 'BP'.

*****************************************************************************************

ls_partner_maint-kind_of_entry = ''. here we need to pass blank

ls_partner_maint-partner_fct = '' . *****************************************************************************************

ls_partner_maint-partner_guid = ls_partner_lf-partner_guid.

ls_partner_maint-partner_no = ls_partner_lf-partner_no.

ls_partner_maint-mainpartner = 'X'.

ls_partner_maint-no_type = 'BP'.

ls_partner_maint-display_type = 'BP'.

INSERT ls_partner_maint INTO TABLE lt_partner_maint_del.

ls_input_flds-ref_guid = ls_orderadm_i-guid.

ls_input_flds-ref_handle = '0000000000'.

ls_input_flds-ref_kind = 'B'.

ls_input_flds-objectname = 'PARTNER'.

ls_logical_key-ref_partner_handle = '0000000000'.

ls_logical_key-ref_partner_fct = 'LF'.

ls_logical_key-ref_partner_no = ls_partner_lf-partner_no.

ls_logical_key-ref_no_type = 'BP'.

ls_logical_key-ref_display_type = 'BP'.

ls_input_flds-logical_key = ls_logical_key.

ls_input_fld_names-fieldname = 'PARTNER_FCT'.

INSERT ls_input_fld_names INTO TABLE lt_input_fld_names.

ls_input_flds-field_names[] = lt_input_fld_names[].

INSERT ls_input_flds INTO TABLE lt_input_flds_maint.

CALL FUNCTION 'CRM_ORDER_MAINTAIN'

EXPORTING

it_text = lt_text_maint

it_partner = lt_partner_maint_del

CHANGING

ct_orderadm_i = lt_orderadm_i_maint

ct_input_fields = lt_input_flds_maint

EXCEPTIONS

error_occurred = 1

document_locked = 2

no_change_allowed = 3

no_authority = 4

OTHERS = 5.

Thanks,

Aniket Korde

Former Member
0 Kudos

Thanks

Aniket

Former Member
0 Kudos

Hi John,

Could you please tell us how to change the item no of product on save, we need to change the item no for order coming from ISA in order save,

This field is NUMBER_INT in orderadm_i table and am trying the same thing which we have done for inserting Text & shipping condition in order save but Item number is not getting changed.

ls_orderadm_i_maint-number_int = ls_item_printseq-line * 10.

ls_input_flds-ref_guid = ls_orderadm_i-guid.

ls_input_flds-objectname = 'ORDERADM_I'.

ls_input_fld_names-fieldname = 'NUMBER_INT'.

ls_input_fld_names-changeable = 'X'.

INSERT ls_input_fld_names INTO TABLE lt_input_fld_names.

Thanks,

Aniket