cancel
Showing results for 
Search instead for 
Did you mean: 

Determine BP-Number in BTORGSET

HendrikPeters
Explorer
0 Kudos

Hello

I’ve got the following problem where I could really use your help:

When creating a new activity in SAP CRM the system asks for choosing a sales area (if more than 1 sales area is maintained for the account). Unfortunately the system displays active sales areas as well as "inactive sales areas" (the ones which are "marked for deleting" in combination with the account). Thus, sometimes the user chooses a sales area which is currently not active which possibly leads to errors in follow up orders.

Thus, I want to display the "inactive sales areas" in a different color. (We use this already in the sales-area-overview view on the BP-Account page (component: BP_SALES/CorpAccountSalesAreasOV)

Therefore, I’ve implemented my own iterator (IF_HTMLB_TABLEVIEW_ITERATOR) in the component BTORGSET/OrgDataDetSalesEL and reuse the method which is already used in the sales area overview for painting the inactive sales areas in a different color. The painting itself works fine.
But I do not find a way to determine the account-number. In BTORGSET/OrgDataDetSalesEL I’ve only got the sales area data and not the bp_number. But sales areas are only inactive in combination with an account.

Does anybody have an Idea where I can find the bp_number in BTORGSET/OrgDataDetSalesEL?

I would really appreciate any suggestions.

Kind Regards
Hendrik

Accepted Solutions (1)

Accepted Solutions (1)

HendrikPeters
Explorer
0 Kudos

Meanwhile I solved this issue by myself.

The solution that Vikranth suggested was nearly correct.
The following code worked fine for me:

lr_comp ?= me->comp_controller.
lr_entity ?= lr_comp->typed_context->btorgset->collection_wrapper->get_current( ).
lr_admin_h ?= lr_entity->get_parent( ).


Thank you for the help.

Hendrik

Answers (6)

Answers (6)

HendrikPeters
Explorer
0 Kudos

Hi Vikranth,

The problem is that sales area data (combination of sales org, distribution channel and division) is not in general active or inactive.
Only in combination with a customer those sales area data combinations are active or inactive (inactive = this combination is marked for deleting in ERP-System).

BTORGSET/OrgDataDetSalesEL is the view which pops up if more than one sale area data is maintained when I'm creating a new activity.
In BTORGSET I've only got the the maintained sales area data (of the account which is the contact partner in the newly created activity) but not the account number (from the activity). Thus, I can't check whether this combination is still active or already inactive (marked for deleting in ERP).

I've tried your suggestions above to determine the account number from the activity (using the component controller) but unfortunately lr_ent is initial. Thus I can't determine the account number.

I hope I made my issue more clear now.

Best Regards,
Hendrik

0 Kudos

Hi Hendrik ,

What ever I shared information, it will be applicable for the oneorder application like activity,salesorder,service orders .

But do u need ORG data in the BP_SALES application alone ? ,BUILHEADER context node is to access the current BP details.

Regards

Vikranth

HendrikPeters
Explorer
0 Kudos

Hi Vikranth,
thank you for your reply.
I've implemented your suggestion as follows:
//
DATA:
lr_ent TYPE REF TO cl_crm_bol_entity,
lr_comp TYPE REF TO cl_btorgset_bspwdcomponen_impl.

[...]

lr_comp ?= me->comp_controller.
lr_ent ?= lr_comp->typed_context->parentnode->collection_wrapper->get_current( ).

//

But unfoturnately then lr_ent is initial.

Do you have any idea why?

Best Regards,
Hendrik

0 Kudos

Hi Hendrik,

In the BTORGSET make use of the component controller , to get the parent node in this case (BTAdminH).

Once u get the BTAdminH, get the child relation as partnerset and relavent partner function relation to get the partner .

lr_comp ?= me->comp_controller.

lr_ent ?= lr_comp->typed_context->parentnode->collection_wrapper->get_current( ).

Regards

Vikranth

HendrikPeters
Explorer
0 Kudos

Hi Virkanth,

thank you for your advice!
FM CRM_ORGUNIT_GETBUPA delivers the BP_GUID of the sales organisation which. Ufortunately I don't need this guid.

The view which I mentioned above is called when a BP is determined in an activity and at this BP are more than 1 sales areas maintained.
Then the popup (view) allows you to choose the sales area for this activity.

But sometimes sales areas are marked for deleting and should therefore not be used. Ufortunately the user can't see in the popup which of the sales areas is active and which is marked for deleting.

Thus, I need the number of BP (the contact partner (account id) in the activity) to determine which of the sales area is marked for deleting for this particular BP (account).

I hope that I was able to put my concern across now.

Regards,
Hendrik

0 Kudos

Hi Hendrik,

Pass the org unit number to FM CRM_ORGUNIT_GETBUPA to BP GUID .

Regards

Vikranth