cancel
Showing results for 
Search instead for 
Did you mean: 

Defaulting Currency Value to 'USD' during BP Creation.

mukesh_mishra
Explorer
0 Kudos

Hi All,

During a BP Creation for a role of Company Owner, the Currency value in the Billing Tab of the Sales Area Data has to defaulted to 'USD'.

Can anybody suggest as to how do we go about it?

An early response to this will be highly appreciated.

Thanks & Regards,

Mukesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mukesh,

You can implement the BADI 'BUPA_FRG0030_UPDATE' and then you can call the function

CALL FUNCTION 'CRM_BUPA_FRG0030_CALLBACK'

then modify the data

then

CALL FUNCTION 'CRM_BUPA_FRG0030_SAVE'

Reward if it solves your problem

Regards,

Srini

mukesh_mishra
Explorer
0 Kudos

Hi Srini,

I created an implementation for BADI 'BUPA_FRG0030_UPDATE' and then called the function

CALL FUNCTION 'CRM_BUPA_FRG0030_CALLBACK'

but it is not having any entry during creation of a BP.

Only if i give a particular value in the Billing tab, it shows an entry and if i change the value to some other currency, its not reflecting in the BP even after calling

CALL FUNCTION 'CRM_BUPA_FRG0030_SAVE'.

Am i missing out on something?

Can u please clarify on this.

Regards,

Srini

Former Member
0 Kudos

Dear Mishra,

first check whether you have Reference BP or Not.

if you have then

  • get reference customer.

CALL FUNCTION 'CRM_BUPA_CONSUMER_GET_REFERENC'

  • get the reference BP billing data.

CALL FUNCTION 'CRM_BUPA_FRG0030_READ'

pass all that reference BP billing data to current BP billing data.

like

IT_LNK0030_OLD = LT_LNK0030_OLD

IT_LNK0030_NEW = LT_LNK0030_NEW

IT_LNK0031_OLD = LT_LNK0031_OLD

IT_LNK0031_NEW = LT_LNK0031_NEW

IT_SET0030_OLD = LT_SET0030_OLD

IT_SET0030_NEW = LT_SET0030_NEW.

here change the Currency data in LT_SET0030_NEW-CURRENCY

then

  • save the set data.

CALL FUNCTION 'CRM_BUPA_FRG0030_SAVE'

Regards,

Srini

mukesh_mishra
Explorer
0 Kudos

Hi Srini,

Thanks for the response. I really appreciate it.

Guess we are close to the solution, but missing out on something small.

I am pasting the entire code here and it goes as follows.

data: lt_changed_instance type crmt_bus_link_key_t,

ls_changed_instance type crmt_bus_link_key,

lt_lnk0030_old type crmt_but_lnk0030_t,

lt_lnk0030_new type crmt_but_lnk0030_t,

lt_set0030_old type crmt_but_set0030_t,

lt_set0030_new type crmt_but_set0030_t,

lt_lnk0031_old type crmt_but_lnk0031_t,

lt_lnk0031_new type crmt_but_lnk0031_t,

lv_in_update_task type crmt_bu_boolean.

data lv_outbound_active type c.

  • Check if outbound processing is active

call function 'BUPA_OUTBOUND_CHECK_ACTIVE'

importing

ev_active = lv_outbound_active.

check not lv_outbound_active is initial.

call function 'CRM_BUPA_BDOC_SET_UPD_FLAG'

exporting

name = 'SET30'.

  • Check if TFW is active.

call function 'TFW_STRATEGY_D_READ'

exporting

iv_tfw_object = 'BUPA'

exceptions

no_default_strategy_exist = 1

parameter_error = 2

others = 3.

check sy-subrc = 0.

  • Check if a switch own->ref took place

call function 'CRM_BUPA_FRG0030_CALLBACK'

importing

et_lnk0030_old = lt_lnk0030_old

et_lnk0030_new = lt_lnk0030_new

et_lnk0031_old = lt_lnk0031_old

et_lnk0031_new = lt_lnk0031_new

et_set0030_old = lt_set0030_old

et_set0030_new = lt_set0030_new.

  • lt_set0030_new-currency = 'USD'.

call function 'CRM_BUPA_FRG0030_SAVE'

exporting

iv_in_update_task = lv_in_update_task

it_lnk0030_old = lt_lnk0030_old

it_lnk0031_old = lt_lnk0031_old

it_set0030_old = lt_set0030_old

it_lnk0030_new = lt_lnk0030_new

it_lnk0031_new = lt_lnk0031_new

it_set0030_new = lt_set0030_new.

Whats happening here in, when i create a BP without entering any information on the Billing tab, there are no entries in lt_set0030_old and its obvious that the currency field will be blank which is the case.

But when i create a BP with some entry in the billing tab..lets c Currency is INR and then change it to USD in debug mode, it still is not persisting the change.

Can u notice some catch or anything which is missing which is stopping us to populate the value during creation.

Thanks in Advance,

Warm Regards,

Mukesh

Former Member
0 Kudos

Dear Mukesh,

first check whether do you have reference BP defined or not.

SPRO->Customer Relationship Management -> Master Data -> Business Partner -> Basic Settings -> Maintain Reference Business Partner for Consumers.

if not create the one in R/3 (VD07). so that it will be replicated to CRM.

maintain all the data except sales office, sales group and sales district data.

Please copy and paste this and then debug and solve if there are any issues according to your scenarios.

DATA: WA_CHANGED_INSTANCES TYPE CRMT_BUS_LNK0030_KEY,

LT_LNK0030_OLD TYPE CRMT_BUT_LNK0030_T,

LT_LNK0030_NEW TYPE CRMT_BUT_LNK0030_T,

LT_SET0030_OLD TYPE CRMT_BUT_SET0030_T,

LT_SET0030_NEW TYPE CRMT_BUT_SET0030_T,

LT_LNK0031_OLD TYPE CRMT_BUT_LNK0031_T,

LT_LNK0031_NEW TYPE CRMT_BUT_LNK0031_T,

LV_IN_UPDATE_TASK TYPE CRMT_BU_BOOLEAN.

DATA: IT_BUT100_OLD TYPE TABLE OF BUT100.

DATA: IT_BUT100_NEW TYPE TABLE OF BUT100.

DATA: LS_BUT100_NEW TYPE BUT100.

DATA: LV_PARTNER TYPE BU_PARTNER.

DATA: LV_PARTNER_GUID TYPE BU_PARTNER_GUID.

DATA: IV_PARTNER_GUID TYPE BU_PARTNER_GUID.

DATA: ET_RETURN TYPE BUS_BAPI-RETURN_TABLE,

EV_ERROR TYPE BUS_BAPI-ERROR,

LS_DATA TYPE CRMT_BUS_SET0030. "CRMT_BUS_SET0030

DATA: IS_SALES_AREA TYPE CRMT_BUS_SALES_AREA.

DATA: LV_COM_STRUCTURE TYPE CRMT_BUS_SALES_COM.

DATA LV_OUTBOUND_ACTIVE TYPE C.

  • Check if outbound processing is active

CALL FUNCTION 'BUPA_OUTBOUND_CHECK_ACTIVE'

IMPORTING

EV_ACTIVE = LV_OUTBOUND_ACTIVE.

CHECK NOT LV_OUTBOUND_ACTIVE IS INITIAL.

CALL FUNCTION 'CRM_BUPA_BDOC_SET_UPD_FLAG'

EXPORTING

NAME = 'SET30'.

  • Check if TFW is active.

CALL FUNCTION 'TFW_STRATEGY_D_READ'

EXPORTING

IV_TFW_OBJECT = 'BUPA'

EXCEPTIONS

NO_DEFAULT_STRATEGY_EXIST = 1

PARAMETER_ERROR = 2

OTHERS = 3.

CHECK SY-SUBRC = 0.

  • get roles.

CALL FUNCTION 'BUPA_ROLES_CALLBACK'

TABLES

ET_BUT100_OLD = IT_BUT100_OLD

ET_BUT100_NEW = IT_BUT100_NEW.

READ TABLE IT_BUT100_NEW INTO LS_BUT100_NEW INDEX 1.

CHECK LS_BUT100_NEW-RLTYP = 'CRM006'.

  • get reference customer.

CALL FUNCTION 'CRM_BUPA_CONSUMER_GET_REFERENC'

IMPORTING

EV_PARTNER = LV_PARTNER

EV_PARTNER_GUID = LV_PARTNER_GUID

EXCEPTIONS

NO_REFERENCE_PARTNER = 1

OTHERS = 2.

  • Check if a switch own->ref took place

CALL FUNCTION 'CRM_BUPA_FRG0030_CALLBACK'

IMPORTING

ET_LNK0030_OLD = LT_LNK0030_OLD

ET_LNK0030_NEW = LT_LNK0030_NEW

ET_LNK0031_OLD = LT_LNK0031_OLD

ET_LNK0031_NEW = LT_LNK0031_NEW

ET_SET0030_OLD = LT_SET0030_OLD

ET_SET0030_NEW = LT_SET0030_NEW.

LOOP AT IT_CHANGED_INSTANCES INTO WA_CHANGED_INSTANCES.

IV_PARTNER_GUID = WA_CHANGED_INSTANCES-PARTNER_GUID.

LV_COM_STRUCTURE-SALES_ORG = WA_CHANGED_INSTANCES-SALES_ORG.

LV_COM_STRUCTURE-CHANNEL = WA_CHANGED_INSTANCES-CHANNEL.

LV_COM_STRUCTURE-DIVISION = WA_CHANGED_INSTANCES-DIVISION.

IS_SALES_AREA-SALES_ORG = WA_CHANGED_INSTANCES-SALES_ORG.

IS_SALES_AREA-CHANNEL = WA_CHANGED_INSTANCES-CHANNEL.

IS_SALES_AREA-DIVISION = WA_CHANGED_INSTANCES-DIVISION.

ENDLOOP.

  • copy billing data from reference customer.

CALL FUNCTION 'CRM_BUPA_FRG0030_READ'

EXPORTING

IV_PARTNER_GUID = LV_PARTNER_GUID

IV_COM_STRUCTURE_NAME = 'CRMT_BUS_SALES_COM'

IS_COM_STRUCTURE = LV_COM_STRUCTURE

IMPORTING

ES_DATA = LS_DATA

EXCEPTIONS

NO_VALID_RECORD_FOUND = 1

KEY_STRUCTURE_NOT_SUPPORTED = 2.

  • lt_set0030_new-currency = 'USD'.

  • change LS_DATA-CURRENCY to USD.

CALL FUNCTION 'CRM_BUPA_FRG0030_ADD'

EXPORTING

IV_PARTNER_GUID = IV_PARTNER_GUID

IS_SALES_AREA = IS_SALES_AREA

  • IV_BUSINESS_RULE =

IS_DATA = LS_DATA

IV_X_SAVE = 'X'

IMPORTING

ET_RETURN = ET_RETURN

EV_ERROR = EV_ERROR.

ENDMETHOD.

Regards,

Srini

Answers (2)

Answers (2)

mukesh_mishra
Explorer
0 Kudos

Thanks Srini....

Finally it worked!!

Full points rewarded!!!

Former Member
0 Kudos

Hi,

Thanks for the solution referred in the thread.

We are currently working on an upgrade project from CRM 5.0 to CRM 7.0. The above solution works fine when we create a BP in SAP GUI. But the similar functionality is not achieved in Web UI. Is there any other BADI which needs to be triggered or is there a different approach to handle this situation in Web UI.

Thanks in advance.

Regards,

Sayan

Former Member
0 Kudos

Hello Mukesh,

I suppose your determined sales area is an organizational unit in the organizational mgmt? Go to the organisational mgmt (PPOMA_CRM) and double click on the sales area org. unit determined in the BP screen.

Go the attributes and check if the currency attribute was assigned. If yes, change it to USD or create the attribute.

Maybe clear the buffers (/$SYNC) to make sure the new value is determined correctly.

This should solve your problem.

<b>Reward points if useful!</b>

Regards,

Joost