Hi Mohammad,
As replied by Vignesh, you need to use the BadI to implement the custom logic of defaulting the Business Partner Grouping. But as per my analysis, you need to do some coding to retrieve the values from the importing parameters and then set those values to the exporting parameters. I found a code snippet which might be helpful in extraction of the importing and setting exporting values. Based on that, you need to modify your own logic.
For grouping it would look something like this:
ASSIGN cr_me->('TYPED_CONTEXT') TO <typed_context>.
IF sy-subrc = 0.
TRY.
lr_typed_context ?= <typed_context>.
IF lr_typed_context IS BOUND.
ASSIGN lr_typed_context->('HEADER') TO <context_node>.
IF sy-subrc = 0.
lr_node ?= <context_node>.
IF lr_node IS BOUND.
lr_coll_wrapper ?= lr_node->collection_wrapper.
IF lr_coll_wrapper IS BOUND.
lr_current ?= lr_coll_wrapper->get_current( ).
CHECK lr_current IS BOUND.
lr_current->set_property( iv_attr_name = 'BP_GROUP'
iv_value = 'YOUR GROUPING NUMBER' ).
ENDIF.
ENDIF.
ENDIF.
ENDIF.
CATCH cx_sy_move_cast_error.
CATCH cx_crm_cic_parameter_error.
ENDTRY.
ENDIF.
I guess this will provide you with some pointers with regards to data extraction.
Hope this helps.
Thanks,
Samantak.