on 07-23-2009 7:47 AM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
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.
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
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.
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...
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
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
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.