As a follow-on from my previous post where I explained How to Use Custom Relationships in Training and Event Management (like specifying that one event type is a module of another event type), I will now explain how to configure the system to allow you to use a Vendor as the organizer of a course or event type.
The SAP standard configuration allows you to use a “Prospect”, “Customer”, “Organizational Unit” or “Company” as the organizer of the event type or course, but it doesn’t give the option to use a “Vendor” as the organizer.
If like many companies, you are using SAP for your Sales and Distribution processes, and maintain Vendor master data, then using a Vendor as the event organizer would make sense - if you are using external providers for the courses, then they will already exist in the system in Sales & Distribution, and there is no need to capture that vendor as a resource or company just for the sake of Training and Event Management. Leveraging the existing master data you have for vendors will prevent dual maintenance of vendor data, eliminate incorrectly captured vendor details and also allow you to report on events that were organized by specific vendors,
Firstly we need to create an interface program – this program will allow us to use the standard Vendor search helps to find a vendor in the training module. Create a new program named ZHR_LIFNR_OBJ_INTERFACE - note that I simply copied and drastically simplified program RHKUNA00 which is used for the customer integration. You will see in the next step how we link to this program. Copy and paste the following code:
PROGRAM zhr_lifnr_obj_interface MESSAGE-ID 5a.
DATA: BEGIN OF fot_tab_wa,
plvar LIKE p1000-plvar,
otype LIKE p1000-otype,
objid LIKE p1000-objid,
short LIKE p1000-short,
stext LIKE p1000-stext,
begda LIKE plog-begda,
endda LIKE plog-endda,
pick TYPE c,
realo LIKE objec-realo,
END OF fot_tab_wa.
*&---------------------------------------------------------------------*
*& Form get_maco
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->GM_MACO text
*----------------------------------------------------------------------*
FORM get_maco USING gm_maco TYPE any.
gm_maco = 'RMAN_PRSP_LIFNR'.
ENDFORM. "get_maco
*&---------------------------------------------------------------------*
*& Form get_name
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->GK_KUNNR text
* -->VALUE text
* -->(GK_RESV1) text
* -->VALUE text
* -->(GK_RESV2) text
* -->VALUE text
* -->(GK_BEGDA) text
* -->VALUE text
* -->(GK_ENDDA) text
* -->GK_SHORT text
* -->GK_STEXT text
* -->GK_SUBRC text
*----------------------------------------------------------------------*
FORM get_name USING gk_kunnr TYPE c
value(gk_resv1) TYPE c
value(gk_resv2) TYPE c
value(gk_begda) TYPE d
value(gk_endda) TYPE d
gk_short TYPE c
gk_stext TYPE c
gk_subrc TYPE any.
SELECT SINGLE name1 FROM lfa1 INTO gk_stext WHERE lifnr = gk_kunnr .
ENDFORM. "get_name
*&---------------------------------------------------------------------*
*& Form get_time_interval
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->VALUE text
* -->(GTI_KTNRA) text
* -->GTI_BEGDA text
* -->GTI_ENDDA text
* -->GTI_SUBRC text
*----------------------------------------------------------------------*
FORM get_time_interval USING value(gti_ktnra) TYPE c
gti_begda TYPE d
gti_endda TYPE d
gti_subrc TYPE any.
gti_begda = '19000101'.
gti_endda = '99991231'.
ENDFORM. "get_time_interval
*&---------------------------------------------------------------------*
*& Form add_values_from_maco_get
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->VALUE text
* -->(AVFMG_PLVAR) text
* -->VALUE text
* -->(AVFMG_OTYPE) text
* -->AVFMG_SEL_OBJID text
*----------------------------------------------------------------------*
FORM add_values_from_maco_get
USING value(avfmg_plvar) LIKE objec-plvar
value(avfmg_otype) LIKE objec-otype
avfmg_sel_objid TYPE c.
DATA: lv_lifnr TYPE lifnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = avfmg_sel_objid
IMPORTING
output = lv_lifnr
EXCEPTIONS
OTHERS = 0.
avfmg_sel_objid = lv_lifnr.
ENDFORM. "add_values_from_maco_get
*---------------------------------------------------------------------*
* FORM EXIST_EXTOBJ deaktiviert QPXK62886 *
*---------------------------------------------------------------------*
* Pruefung,ob Debitor im Intervall begdt/enddt existiert *
*---------------------------------------------------------------------*
* --> VALUE(EK_OBJID) *
* --> VALUE(EK_BUKRS) *
* --> VALUE(EK_WERKS) *
* --> VALUE(EK_BEGDA) *
* --> VALUE(EK_ENDDA) *
* <-- EK_SUBRC *
*---------------------------------------------------------------------*
FORM exist_extobj USING value(ek_objid) TYPE c "YSBUNI
value(ek_bukrs) TYPE any
value(ek_werks) TYPE any
value(ek_begda) TYPE d
value(ek_endda) TYPE d
ek_subrc TYPE any. "YSB616865
ek_subrc = 0.
ENDFORM. "exist_extobj
*---------------------------------------------------------------------*
* FORM CHECK_MACO "YNKK64794 *
*---------------------------------------------------------------------*
* Pruefung ob MACO *
*---------------------------------------------------------------------*
* VALUE(CM_MACO) *
* CM_OBJID *
* CM_SUBRC *
*---------------------------------------------------------------------*
FORM check_maco USING value(cm_maco) TYPE c "YSBUNI
cm_objid TYPE c
cm_subrc TYPE any. "#EC CALLED
DATA : vendor TYPE lifnr.
vendor = cm_maco.
cm_subrc = 0.
cm_objid = vendor.
ENDFORM. "check_maco
*---------------------------------------------------------------------*
* FORM FILL_OBJID_TAB "YNKK94468 *
*---------------------------------------------------------------------*
* Fuellen Tabelle fuer PLOG-MC *
*---------------------------------------------------------------------*
* FOT_TAB *
* VALUE(FOT_PLVAR) *
* VALUE(FOT_OTYPE) *
* VALUE(FOT_SEARCH) *
* VALUE(FOT_LIMIT) *
* FOT_CHECK *
*---------------------------------------------------------------------*
FORM fill_objid_tab
TABLES fot_tab STRUCTURE fot_tab_wa "YSBUNI
USING value(fot_plvar) TYPE c
value(fot_otype) TYPE c
value(fot_search) TYPE c
value(fot_limit) TYPE i
fot_check TYPE i. "#EC CALLED
DATA: lt_selopt TYPE TABLE OF bapivendor_10,
ls_selopt TYPE bapivendor_10,
lt_results TYPE TABLE OF bapivendor_11,
ls_results TYPE bapivendor_11.
CLEAR : fot_tab[], fot_tab.
ls_selopt-tabname = 'LFA1'.
ls_selopt-fieldname = 'LIFNR'.
ls_selopt-fieldvalue = fot_search.
APPEND ls_selopt TO lt_selopt.
CALL FUNCTION 'BAPI_VENDOR_FIND'
TABLES
selopt_tab = lt_selopt
result_tab = lt_results.
READ TABLE lt_results INDEX 1 INTO ls_results.
IF sy-subrc = 0 AND ls_results-type NE 'E'.
fot_tab-plvar = fot_plvar.
fot_tab-otype = fot_otype.
CLEAR : fot_tab-objid.
fot_tab-pick = ' '.
fot_tab-realo = ls_results-vendor_no.
PERFORM get_name USING ls_results-vendor_no
space space sy-datum sy-datum space
fot_tab-stext
sy-subrc.
fot_tab-short = fot_tab-stext.
TRANSLATE fot_tab-short TO UPPER CASE. "#EC SYNTCHAR
APPEND fot_tab.
ENDIF.
ENDFORM. "fill_objid_tab
Now we need to create a new custom object type. Note that the customer namespace for objects is 00-99. I will use “91” for our new “Vendor” object.
Go to the IMG (transaction SPRO) and follow the menu path “”Training and Event Management->Basic Settings->Object Type Modeling Enhancement-> Object Type-> Define Object Types”
Click on the “New Entries” button
Enter object ID 91 and description “Vendor”.
Once done, go back and then select the “External Object Types” option
Add a new entry as follows: (make sure to specify the “Interface” as the program name that we created earlier… (ZHR_LIFNR_OBJ_INTERFACE)
Now save this so that we can move to the next step...
Go to the IMG (transaction SPRO) and follow the menu path “Training and Event Management-> Basic Settings-> Object Type Modeling Enhancement-> Relationship-> Maintain Relationships”
Find and select relationship 036 (“is organized by”)
Once you have selected 036, then go to the “Allowed Relationships” settings
Add a new entry as follows:
Once you have saved this you are done!
If you go to the Business Event Manager, you will now be able to select a Vendor. To test it, do the following:
Go to “Human Resources->Training and Event Management->Business Events->Business Event Menu”
Right click on an event type to schedule a new event
Now under the Organizer Data section, you will see “Vendor” in the drop-down.
And when you use the F4 input help, you will get the Vendor Search help
Once you select your vendor, it will be pulled through along with the vendor name...
And that's it! Let me know if you found this useful or if you have any suggestions for improvements on this solution...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 |