cancel
Showing results for 
Search instead for 
Did you mean: 

department(name) in target group

Former Member
0 Kudos

Hello experts,

I need the columns department and departmentname when displaying the members of a target group.

Default they are not there. I tried to add a new attribut "department" in component SEGED_TG, View ELTARGETGROUPITEM.

There is BOL-Entity SEGTgItem and in this Entity there is no department and no related Entities....

I can take another Entity, but there is no value in department then...

How can I display department of a contact in target group with value?

Thx a lot in advance,

Martin

Ps. using CRM 20007

Edited by: MartinSch on Jul 23, 2009 8:57 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Martin,

Can you tell me the BOL Entity which has the Department Number, let me see if there is a relation between Target Group Member and that BOL Entity ? There should be one as the Target Group Member is also Business Partner...

Regards,

Masood Imrani S.

Former Member
0 Kudos

Hello Masood,

BOL Entity BuilContactPerson got the Department and Departmentname in it.

Thank you,

Martin

Former Member
0 Kudos

Hi Martin.

I did not find a direct relation between the TG Members and BuilCotactperson. One way to solve this is to include a field Department in method GET_TABLE_LINE_SAMPLE of view:SEGED_TG/ELTARGETGROUPITEM .

Generate getters and setters for this attribute and add to UI.

Now in GET method yoou can populate the Department Number by accessing it based on Member (Partner ID) using Function Module like BUPR_CONTP_GET_DETAIL.

Make the field Display only in GET_I method.

This method can be used if you are trying to only display the Dept Name.

Regards,

Masood Imrani S.

Former Member
0 Kudos

Hello Masood,

thank you for your answer, I'll try that.

So I guess, if there is no relation, you have to program the logic to get the attribute's value manually...

I also need the field "department_text". How can I look for it, in which BOL-Entity it is, without searching it manually in BOL-Entities?

I couldn't find a possibility until now...

Thx a lot.

Martin

Former Member
0 Kudos

Martin,

For Department Text you need to add another attribute same way as Department and include code like this in the Dept Text GET method

DATA: text     TYPE bu_text20,
        lv_abtnr TYPE bu_abtnr.

  lv_abtnr = get_department( attribute_path = 'DEPARTMENT'
                           iterator = iterator )

  SELECT SINGLE bez20 FROM tb911  INTO (text)
    WHERE spras = sy-langu AND
          abtnr = lv_abtnr.
  IF sy-subrc = 0.
    value = text.
  ENDIF.

Masood Imrani S.

Former Member
0 Kudos

Hi Masood, I got the Department_Text, thank you! I had the same thought and just copied the get-method from another view, where the Department_Text exists, it's nearly the same coding.

A question to that:

I did not find a direct relation between the TG Members and BuilCotactperson. One way to solve this is to include a field Department in method GET_TABLE_LINE_SAMPLE of view:SEGED_TG/ELTARGETGROUPITEM .

Generate getters and setters for this attribute and add to UI.

Now in GET method yoou can populate the Department Number by accessing it based on Member (Partner ID) using Function Module like BUPR_CONTP_GET_DETAIL.

Make the field Display only in GET_I method.

This method can be used if you are trying to only display the Dept Name.

I don't understand the part where I have to add a field in GET_TABLE_LINE_SAMPLE.

Isn't it enough, to add a new attribute and to write code in the get-method (how I did it with department_text) to get the department?

Or do I have to add a field in class ZL_SEGED_TG_ELTARGETGROU2_CTXT (I have to create the method GET_TABLE_LINE_SAMPLE first, because it exists only in CL_SEGED_TG_ELTRAGETGROU2_CTXT class).

Thanks a lot and best regards,

Martin

Former Member
0 Kudos

Martin,

For all the table views this method GET_TABLE_LINE_SAMPLE will be available in the context node class i.e., CL_SEGED_TG_ELTARGETGROU2_CN01. Remove the Filter and you can see the method. To add a field to a table view context node we include an attribute in this method and generate the getters ans setters. If you see the code inside this method you will understand.

Anyhow if you are able to create an attribute using right click and able to add to add the same on UI, then it is fine.

I will give an example also,If you have observed delete and edit buttons on the row selectors of some of the table views, they will be added through GET_TABLE_LINE_SAMPLE as this buttons are not required at BOL level as they are UI specific.

Regards,

Masood Imrani S.

Former Member
0 Kudos

I removed the filter and can see the method in this class.

The coding is:

 method GET_TABLE_LINE_SAMPLE.

    TYPES: BEGIN OF line.

    include type CRMT_MKTTG_GENIL_TG_I_ATTR.

    TYPES:

           END OF line.

    CREATE DATA rv_sample TYPE line.

endmethod. 

Where can I add an attribute here?

Thanks,

Martin

Former Member
0 Kudos

Is it CREATE DATA rv_sample TYPE line ?

So, for example

CREATE DATA department TYPE line ?

Former Member
0 Kudos

Include your field in

TYPES: BEGIN OF line.

include type CRMT_MKTTG_GENIL_TG_I_ATTR.

include department xxxx.

TYPES: END OF line.

Create etc., should remain as it is there.

Former Member
0 Kudos

ok, thx! But first I have to copy the method to a Z-name I think... Because I can't change the original...

Former Member
0 Kudos

Yes, the component,view should be enhanced first.

Then in the context node class should be enhanced(Regenerate GET_i methods by right clicking to make context node class Z one).

Now in SE24, go in change mode and redefine the method.

Former Member
0 Kudos

okay, but how should I redefine the method? Should I copy it to ZGET_TABLE_LINE_SAMPLE?

Because when I'm in SE24 in class ZL_SEGED_TG_ELTARGETGROU2_CN01 the method GET_TABLE_LINE_SAMPLE is implemented in CL_SEGED_.... SAP-class.

sorry, I'm quite new in this CRM-stuff, so I have to ask things like that...

Former Member
0 Kudos

Click on the Redefine by placing the cursor on the method.

Redefine button will be next to Find, Find Next Button in SE24.

It will be enabled only in change mode.

Former Member
0 Kudos

Hello Masood,

thank you, that works with this coding:



TYPES: BEGIN OF line.
include type CRMT_MKTTG_GENIL_TG_I_ATTR.
types:          departmentname type char30.
TYPES: END OF line.

But now, when I click in WebUI on target group, there is a short dump and it tells: "...a field-symbol is not assigned".

I guess I have to assign the new field/attribute/table-line somewhere...?

Edited by: MartinSch on Aug 3, 2009 12:23 PM

Former Member
0 Kudos

Hi Martin,

Activate check point group BSP_WD_EXCEPTION_DISPLAY in TCODE SAAB and check where the dump is coming from.

Basically ,these are the steps to include an attribute in a Table View.

Regards,

Masood Imrani S.

Former Member
0 Kudos

Hello Masood,

yeah, I had an error in my coding, the short dump disappeared!

Now I wanna use the FM BUPR_CONTP_GET_DETAIL in GET_Department Method, but I don't know how to provide the Partner ID for this...

Where can I get the Partner ID, to retrieve the Details?

Thanks a lot,

Martin

Ps. okay, I guess I have to add a new GUID-attribute (which I can rename to department) and there in the GET-method I can provide the FM with the GUID to retrieve the details... I'll try that.

Edited by: MartinSch on Aug 3, 2009 4:36 PM

Edited by: MartinSch on Aug 3, 2009 4:37 PM

Edited by: MartinSch on Aug 3, 2009 4:47 PM

Edited by: MartinSch on Aug 3, 2009 4:48 PM

Former Member
0 Kudos

Martin,

You need not add GUID as you already have PARTNER ID i.e., Member ID.

Access it using the get method GET_MEMBER, like

me->get_member( attribute_path = '//TARGETGROUPITEM /MEMBER' ).

Regards,

Masood Imrani S.

Former Member
0 Kudos

Hallo Masood,

Fiiiiinally it worked all fine!!

Thanks a lot for your patient help!

Kind Regards,

Martin

Answers (0)