Standard ABAP functions for assign resources?
Hi all.
I would like to share this with you all.
After loosing three days looking for any kind of standard FM to assign resources (rooms or instructors) to an event (E), I request your help.
Any of you have found or used those functions in SAP?
Thanks in advance for your support.
Hello Roberto:
the FM we're using is HRIQ_EVENT_CREATE, not very creative , but we found nothing more appropriate, and we found it very flexible to work with events (unluckily flexible is a synonym of complex and hard work).
Let's move into when and how we used it:
regular courses are still created using SAPgui
we needed something more agile to use when a room or resource was needed for unusual activities (meetings for example), and no instructors were needed. We went into a web app. The user will indicate date(s), start and end time and resource. We developed a FM+webservice which "receives" the data inserted by the user and ends executing HRIQ_EVENT_CREATE. (precondition: we have a generic module created with its correpsonding event type needed to execute HRIQ_EVENT_CREATE)
a previous step to the event creation (on a separate FM+webservice) will check for conflicts in the proposed resource reservation, where the user will see a report of conflicts and make necessary changes before submitting the reservation.
Would you like to see our codes? Part of it is in Spanish which'll help you read the code
Cheers,
Michael
Similar Messages
-
Standard ABAP functions for creating events?
Hi,
I'm a little bit confused which ABAP functions to use for creating academic events with schedules (e.g. lecture takes places each Friday at 4 pm), rooms and instructors attached.
Data transfer documentation SAP team recently released ("SLCM Data Transfer" archive, "Intro" document, page 18) suggests <b>HRIQ_CREATE_EVENT</b> as a solution. However, after experimenting for a while, I noticed a note attached to this function that "DO NOT USE ANYMORE, USE <b>HRIQ_EVENT_CREATE</b>".
So which one is the correct/recommended one? Also, if possible, I would prefer an RFC-enabled one.
Thanks
JanekHi Janek,
We've created a custom RFC enabled function module to wrap the SAP function module HRIQ_CREATE_EVENT in. We are on a 4.7 system. Here is our code. Hope it helps.
FUNCTION zcep_event_create .
*"*"Local interface:
*" IMPORTING
*" VALUE(VTASK) TYPE HRRHAP-VTASK DEFAULT 'V'
*" VALUE(EVENTPACKAGEID) TYPE HROBJID
*" VALUE(ACAD_YEAR) TYPE PIQPERYR
*" VALUE(ACAD_SESSION) TYPE PIQPERID
*" TABLES
*" MEETING_PATTERN STRUCTURE ZCEP_MEETINGPATTERN
*" EVENT STRUCTURE ZCEP_EVENT
*" RETURN STRUCTURE BAPIRET2
DATA: is_schedule TYPE bapisched,
schedule TYPE bapisched OCCURS 0 WITH HEADER LINE,
capacity LIKE hri1024,
wa_capacity LIKE hri1024 OCCURS 0 WITH HEADER LINE,
location LIKE bapilocdat-locid OCCURS 0,
new_event_package LIKE p1000 OCCURS 0 WITH HEADER LINE,
objid LIKE hrrootob OCCURS 0 WITH HEADER LINE,
parent LIKE hrhctobjc OCCURS 0 WITH HEADER LINE,
eventid TYPE hrobjid,
event_id_out LIKE bapievdat-eveid,
lt_1739 TYPE TABLE OF p1739,
ls_1739 TYPE p1739,
ls_error_record TYPE bapiret2,
ls_nnnn TYPE wplog,
open_resources_exits TYPE xfeld.
DATA: it_1035 TYPE piq_p1035_t,
it_pt_1035t TYPE piq_hrt1035_t,
it_daysoff TYPE piq_pt1035_t,
it_daysfree TYPE piq_pt1035_t,
ls_daysfree TYPE pt1035,
ls_1035t TYPE hrt1035.
DATA: it_bapiresou TYPE TABLE OF bapiresou,
is_bapiresou TYPE bapiresou,
resources TYPE bapiresou OCCURS 0.
DATA: it_pa0002 TYPE TABLE OF pa0002,
is_pa0002 TYPE pa0002,
it_hrp1000 TYPE TABLE OF hrp1000,
is_hrp1000 TYPE hrp1000,
lv_dayoff(1),
bp(12),
im_begda LIKE sy-datum,
im_endda LIKE sy-datum,
sobid LIKE hrp1001-sobid,
event_counted_dates TYPE dayct,
event_counted_hours TYPE hrsct,
ndays TYPE p1035-ndays,
nhours TYPE p1035-nhours.
FIELD-SYMBOLS: <ls_1035t> LIKE LINE OF it_pt_1035t.
CLEAR gt_error_record[].
SORT event BY short.
SORT meeting_pattern BY eventname.
************************* Get Calender Date *************************
SELECT SINGLE begda endda FROM hrt1750 INTO (im_begda,im_endda)
WHERE peryr = acad_year
AND perid = acad_session
AND timelimit = '0100'.
*************************** Create Event ****************************
LOOP AT event.
CLEAR resources.
LOOP AT meeting_pattern WHERE eventname = event-short.
********************* Create Schedule for Event *********************
CALL FUNCTION 'HRIQ_EVENT_SCHEDULE_BUILD'
EXPORTING
plvar = '01'
istat = '1'
event_begda = event-begda
event_endda = event-endda
monday = meeting_pattern-monday
tuesday = meeting_pattern-tuesday
wednesday = meeting_pattern-wednesday
thursday = meeting_pattern-thursday
friday = meeting_pattern-friday
saturday = meeting_pattern-saturday
sunday = meeting_pattern-sunday
event_beguz = meeting_pattern-start_time
event_enduz = meeting_pattern-end_time
frequency = '1'
event_location = meeting_pattern-location
IMPORTING
pt_1035 = it_1035
pt_1035t = it_pt_1035t
pt_daysoff = it_daysoff
pt_daysfree = it_daysfree
EXCEPTIONS
no_date_number = 1
frequency_is_initial = 2
OTHERS = 3.
LOOP AT it_daysfree INTO ls_daysfree.
CALL FUNCTION 'HRIQ_CHECK_MODULOFFER_DAYSOFF'
EXPORTING
iv_date = ls_daysfree-evdat
IMPORTING
ev_dayoff = lv_dayoff
EXCEPTIONS
otype_not_supported = 0
OTHERS = 0.
IF lv_dayoff = space.
MOVE-CORRESPONDING ls_daysfree TO ls_1035t.
APPEND ls_1035t TO it_pt_1035t.
ENDIF.
ENDLOOP.
* no double entries
SORT it_pt_1035t.
DELETE ADJACENT DUPLICATES FROM it_pt_1035t.
DESCRIBE TABLE it_pt_1035t LINES event_counted_dates.
CLEAR event_counted_hours.
LOOP AT it_pt_1035t INTO ls_1035t.
nhours = ( ls_1035t-enduz - ls_1035t-beguz ) / 3600.
event_counted_hours = event_counted_hours + nhours.
ADD 1 TO ndays.
ENDLOOP.
LOOP AT it_pt_1035t ASSIGNING <ls_1035t>.
MOVE-CORRESPONDING <ls_1035t> TO schedule.
APPEND schedule.
ENDLOOP.
*Room
IF NOT meeting_pattern-room IS INITIAL.
SELECT SINGLE short stext FROM hrp1000
INTO (is_hrp1000-short,is_hrp1000-stext)
WHERE plvar = '01'
AND istat = '1'
AND otype = 'G'
AND objid = meeting_pattern-room
AND begda LE sy-datum
AND endda GE sy-datum.
SELECT SINGLE sobid FROM hrp1001 INTO sobid
WHERE otype = 'G'
AND plvar = '01'
AND istat = '1'
AND relat = '020'
AND rsign = 'A'
AND sclas = 'R'
AND objid = meeting_pattern-room
AND begda LE im_endda
AND endda GE im_begda.
IF sy-subrc = 0.
is_bapiresou-retid = sobid(8).
ENDIF.
LOOP AT it_pt_1035t ASSIGNING <ls_1035t>.
is_bapiresou-resht = is_hrp1000-short.
is_bapiresou-resxt = is_hrp1000-stext.
is_bapiresou-resbg = <ls_1035t>-evdat.
is_bapiresou-resed = <ls_1035t>-evdat.
is_bapiresou-beguz = meeting_pattern-start_time.
is_bapiresou-enduz = meeting_pattern-end_time.
is_bapiresou-resid = meeting_pattern-room.
is_bapiresou-restp = 'G'.
APPEND is_bapiresou TO resources.
ENDLOOP.
ENDIF.
* Instructor
IF NOT meeting_pattern-instructor IS INITIAL.
SELECT SINGLE nachn vorna FROM pa0002
INTO (is_pa0002-nachn, is_pa0002-vorna)
WHERE pernr = meeting_pattern-instructor
AND begda LE im_endda
AND endda GE im_begda.
************************** Meeting Pattern **************************
SELECT SINGLE objid INTO is_bapiresou-retid FROM hrp1000
WHERE plvar = '01'
AND langu = 'E'
AND otype = 'R'
AND mc_short = 'INST-CM'
AND begda LE im_endda
AND endda GE im_begda.
LOOP AT it_pt_1035t ASSIGNING <ls_1035t>.
is_bapiresou-resht = is_pa0002-nachn.
CONCATENATE is_pa0002-vorna is_pa0002-nachn
INTO is_bapiresou-resxt
SEPARATED BY space.
is_bapiresou-resbg = <ls_1035t>-evdat.
is_bapiresou-resed = <ls_1035t>-evdat.
is_bapiresou-beguz = meeting_pattern-start_time.
is_bapiresou-enduz = meeting_pattern-end_time.
is_bapiresou-resid = meeting_pattern-instructor.
is_bapiresou-restp = 'P'.
APPEND is_bapiresou TO resources.
ENDLOOP.
ENDIF.
ENDLOOP.
wa_capacity-kapz1 = event-mincapty.
wa_capacity-kapz2 = event-optcapty.
wa_capacity-kapz3 = event-maxcapty.
capacity = wa_capacity.
CALL FUNCTION 'HRIQ_CREATE_EVENT'
EXPORTING
planversion = '01'
event_id_in = '00000000'
event_short = event-short
event_stext = event-stext
status = '1'
begin_date = event-begda
end_date = event-endda
language = sy-langu
eventtype = event-betype
capacity = capacity
location = meeting_pattern-location
check_resources = ' ' "'X'
vtask = 'B'
IMPORTING
event_id_out = event_id_out
TABLES
schedule = schedule
resources = resources
return = return.
IF sy-subrc NE 0.
CALL FUNCTION 'HRIQ_CLEAR_BUFFER'.
CALL FUNCTION 'HRIQ_CLEAR_PLOG_TAB'.
return-type = 'E'.
return-message = 'Error during save'.
APPEND return.
ENDIF.
LOOP AT return WHERE id = 'HRPIQ000'
AND number = '846'.
return-type = 'E'.
return-message = 'Resources already in use'.
APPEND return.
EXIT.
ENDLOOP.
********************** Create Session offering **********************
MOVE-CORRESPONDING ls_nnnn TO ls_1739.
ls_1739-mandt = sy-mandt.
ls_1739-plvar = '01'.
ls_1739-otype = 'E'.
ls_1739-objid = event_id_out.
ls_1739-istat = '1'.
ls_1739-begda = event-begda.
ls_1739-endda = event-endda.
ls_1739-aedtm = sy-datum.
ls_1739-uname = sy-uname.
ls_1739-infty = '1739'.
ls_1739-peryr = acad_year.
ls_1739-perid = acad_session.
APPEND ls_1739 TO lt_1739.
PERFORM create_infotype USING lt_1739
CHANGING ls_error_record .
APPEND ls_error_record TO return.
READ TABLE return WITH KEY type = 'E'.
IF sy-subrc <> 0 AND vtask = 'V'.
CALL FUNCTION 'HRIQ_UPDATE_DATABASE'
EXPORTING
vtask = 'D'
commit_flg = 'X'
EXCEPTIONS
corr_exit = 1
internal_error = 2
OTHERS = 3.
IF sy-subrc NE 0.
CALL FUNCTION 'HRIQ_CLEAR_BUFFER'.
CALL FUNCTION 'HRIQ_CLEAR_PLOG_TAB'.
return-message = 'Error during save'.
APPEND return.
ENDIF.
ELSE.
CALL FUNCTION 'HRIQ_CLEAR_BUFFER'.
CALL FUNCTION 'HRIQ_CLEAR_PLOG_TAB'.
EXIT.
ENDIF.
********************* Create Relationship(E-SE) *********************
parent-objid = event_id_out.
parent-otype = 'E'.
APPEND parent.
PERFORM create_relation TABLES parent
USING 'B512'
'SE'
event-begda
event-endda
eventpackageid
CHANGING ls_error_record.
ENDLOOP.
IF vtask = 'V' AND ls_error_record IS INITIAL.
PERFORM update_database CHANGING ls_error_record.
ELSE.
APPEND ls_error_record TO return.
CALL FUNCTION 'HRIQ_CLEAR_BUFFER'.
CALL FUNCTION 'HRIQ_CLEAR_PLOG_TAB'.
ENDIF.
DELETE return WHERE type IS INITIAL.
ENDFUNCTION. -
ABAP Functions for creating vendor
Hello,
I would like to create a program for creating vendor automatically by uploading a text file, where the text file contain the vendor information.
Can I ask are there any ABAP function for creating vendor? I have searched a function BAPI_VENDOR_CREATE, but I don't know how to use it.
Can anyone give me some ideas?
Many thanks
SunnyHi,
BAPI_VENDOR_CREATE is a online BAPI which calls the XK01 screen internally. There wont be any import or export parameters for this BAPI. If you have to upload from a text file, you can try with either of the options
1) Use the standard program RFBIKR00 to upload the vendor from the flat file. check the documentation of the report for details
2) Create a BDC recording on XK01 and upload the vendor from the flat file
Vikranth -
ABAP Function for renaming of a planning level?
Hi all,
i wanna know if does exist an ABAP Function for renaming of a planning level or parameter group.
Someone can help me please?
Thanx a lot,
Paolo.<Font Face="Tahoma" Color="Blue">
Hi,
I don't think any such Function Module exists. Nonetheless I can give you a good hint.
All the details of all planning objects (Planning Areas, Planning Levels, Planning Functions. Parameter Groups etc) are stored in UP* Tables. Just go to T-code SE11 and search for tables with name UP*.
Once you know the tables, you can write your own customized ABAP code.
PS: I can recommend above method to just read the details of Planning Objects. I don't think you should be ambitious to change planning object names by attempting to change system table contents. Hope you are getting me.
Regards,
Abhijit
</Font> -
Standard ABAP program for process chains
Hi gurus,
Is there any standard ABAP program to trigger process chains?
I do not have authorization for RSPC_API_CHAIN_START. So is there any alternative function module or any standard ABAP program that I could use?
Please help.Hi Apara,
Did you try scheduling the chain via rspc1? If not then follow the steps as given below and see if it is successful
1) Goto RSPC1.
2) Enter your chain technical name.
3) Go to display variant by right clicking the chain. Select the immediate option. save the settings.
4) Come back to the process chain screen. Click on execute button. See if this succeeds.
or in case if the chain has been already scheduled once:
Just open the PC in RCPC1/RCPC
right click on the start variant (i.e the first process in the PC)
and select display scheduled jobs...
this will show you the released jobs for this pC
just selsct the check box in front of the released job and the select the menu option Job - > selct Repeat scheduling.
selct immediate and remove the periodic tick mark and save which will run your process chain immediately.
But i doubt if you will be able to schedule the process chain via a function module or a ABAP code without prior authorization. Maybe you can request some one from your team to run the chain for you until you get access.
You will surely need to get access for running the chain without which it should not be possible to run the chain.
Thanks
Pawan -
SAP Standard ABAP Proxy for PO 855 SRM-R/3
Hi :
855 PO Confirmation in R/3 from SRM
Can I use the ABAP Proxy "PurchaseOrderConfirmation_In" to Confirm the PO response in SRM from R/3
( In R/3 i get a idoc formatted file as 855 from vendor and can do PO Confirmation uisng custom program in R/3).
PurchaseOrderConfirmation_In is standard abap proxy out of the sap box for the SRM-SUS integration.Sender Interface is PurchaseOrderConfirmation_Out(SUS) and receiver Interface is PurchaseOrderConfirmation_In(SRM) for the PO Confirmation for SUS-SRM scenario.
The 855 file from vendor is in the form of IDOC structure and how to customize the file to be used in conjunction with PurchaseOrderConfirmation_In(as this is based on XML).
How to Convert the 855 IDoc to XML format and feed it to standard SAP Interface PurchaseOrderConfirmation_In via XI ,if yes will this work and how??
Thanks in advance..Hi Srivatsan,
How are you? Hope you remember me..We got a similar kind of requirement in our project. Do you have solution for this issue?
regards
Paris -
How to Use the language function for assignment and validation
Hi All,
If anyone can explain me in details with example ,how to use the language function for assignments and validations?
Thanks
ArnabHi Arnab,
The expression is checked only for the current MDM session.
If u login with the ABC language it will always show the ABC language no matter how many times u execute it.
Try connecting to the DM with the XYZ language.
It should go to the if part rather than else.
Hope it helps.
Thanks,
Minaz -
Standard ABAP report for XI performance monitoring?
Hi All,
Is there any standard ABAP report that can be run in ECC, that would provide summary of which interfaces(namespaces) ran over the 24 hour period in a graphical view.
Regards,
XIerHi,
Performance tuning :
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/70ada5ef-0201-0010-1f8b-c935e444b0ad
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/489f5844-0c01-0010-79be-acc3b52250fd
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/defd5544-0c01-0010-ba88-fd38caee02f7?prtmode=navigate
Performance Tuning Checks in SAP Exchange Infrastructure(XI): Part-III
REgards
Seshagiri -
Hi Experts,
We are trying to obtain a csv file from the data result of a query in a report. Like the option: rsrt, query visualization HTML, export to csv.
Is there any abap function we can use to achieve it ? Our SAP BI version is 3.X, so it's better if this function is used in 7.0 version too.
Thanks in advance.Hi,
Use ADP or RSCRM_BAPI tcode.
Analysis Process Designer (APD): Part - 1
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f06353dd-1fe3-2c10-7197-dd1a2ed3893e?quicklink=index&overridelayout=true
Re: Running Quaries automatically and saving them in as a Excel file in Server
Re: Data transfer to external systems
Re: Loading from a Custom R/3 Table
Re: How can I schedule my Bex report to execute in background
Re: How can I insert the RSCRM_BAPI into Process chain?
Thanks
Reddy -
"Control + F5" standard filter functionality for ALV Grids
Hi all,
After an ALV Grid is displayed on screen there is a standard functionality to filter a selected column.
You can select a column (click on the head) of the ALV, then "Control + F5" and a pop-up appears to insert a value or a range by which the filtration is going to be done.
But a I have problem with a concrete field. It doesn`t seem different on comparison with other fields (CHAR30), but I don`t know why it doesn`t work correctly as others.
Have you had any situation like this ??
Thanks & sorry for my bad english,
RubèHi Frank,
When you are entering 89012 and pressing enter the additional zeros are adding up because of the data type of VBELN We have standard conversion routine attached with this .So when ever u wrtie any text that routine will works.
Can you please check what data type are you using in the internal table that you are binding to the node?
Thanks and Regards,
NSingh
Edited by: Nsingh on Feb 17, 2012 4:52 AM -
ABAP Function for opening Adobe Reader directly
Hello Guys,
new issue
I am not very familiar with ABAP, is anybody able to tell me, which function do I have to use to start Adobe Reader after the user entered a couple of data within a SAPGUI menu?!
At the moment I am using the Print Preview, but there I am not allowed to edit textboxes etc.
Thanks a lot in advance
CarstenFP_JOB_OPEN
call the <generatd function module name>
FP_JOB_CLOSE.
pass the fillable propety of the docparams to 'X'.
Do refer the e-learning session. and there are numerous threads on this issue in this forum.
Thanks and Regards.
Anto. -
ABAP Function for Material Unit of measure check
Hi Gurus,
i need to find a FM, a sequence of FM or anything else that return the same list (in internal tables whould be great!) like when i try to change the UM on a material but there are some open items and i got "DISPLAY ERRORS".
i need this because using BAPI_MATERIAL_SAVEREPLICA i got only the message "The base unit of measure cannot be changed; choose "Display errors".
BTThis was my 1st try before coming here and found the function, but it retrieves informations from memory and the memory area is not filled when i use the BAPI.
Anyway i solved otherwise. -
ABAP function module for Customer Specific Status
I am looking for a standard ABAP function module that will return the customer specific status for a person.
Please let me know if any exists.
Thanks,
HariniCustomer specific status for a person .
Could you pleasee give more details...for what purpose you are trying to get the status of a person. so that it will be easy for everyone to search -
Hi Experts,
I'm trying to build a report out of the standard ABAP Function BAPI_AR_ACC_GETOPENITEMS (Function Group: 3007)
I'm able to create the connection on Information Design Tool, and I'm able to add the table to the Data Foundation
When I run the BAPI in SAP Logon, I'm only asked to fill 3 fields (company code, customer and date)
But when I try to make a query on IDT from the selected table (BAPI_AR_ACC_GETOPENITEMS.-EXPORT_CH_LINEITEMS) I'm asked to fill dozens of columns. And almost all of them are mandatory
I was told that this ABAP Function is somehow connected to a structure (sorry, I dont have a lot of experience in SAP ERP), and all those columns belong to that structure.
My question is, if I want to get some data from this ABAP function on IDT, do I have to fill all those mandatory import columns?
Is there a way to do that without filling all of that? I can't understand why if I go througt SE38 in SAP ERP I just have to fill 3 fields, and on IDT I have to fill dozens of mandatory columns.
Thanks in advance,
José QueirogaHello Jose,
based on the screenshot it looks like those are all input parameters - yes, but perhaps it is not the correct "export" item and you should be using the line item above.
That is something you wanna clarify with the person that knows those ABAP functions.
Also - ABAP Functions are perhaps not the best source for reporting, especially not for IDT.
Perhaps you wanna look at the option to use an classic InfoSet without any parameters
regards
Ingo Hilgefort, Visual BI -
ABAP Function to read long texts in HR Infotypes
Is there any standard ABAP function to read long texts in HR infotypes like ABAP function to read comments entered in infotype 19
HI ,
try this code
tables pcl1.
include rpc1tx00. " This include is explained on web page above
start-of-selection.
perform fill_key. perform get_data.end-of-selection.
form fill_key.
tx-key-pernr = p_pernr.
tx-key-infty = p_infty.
tx-key-subty = p_subty.
tx-key-objps = p_objps.
tx-key-sprps = p_sprps.
tx-key-endda = p_endda.
tx-key-begda = p_begda.
tx-key-seqnr = p_seqnr.
"OR
SELECT * INTO CORRESPONDING FIELDS OF wa_p0219
FROM pa0219
WHERE pernr = p_pernr
AND subty = p_subtyp
AND endda = '99991231'.
ENDSELECT.
MOVE-CORRESPONDING gs_p0219 TO tx-key.
MOVE '0219' TO tx-key-infty.
IF wa_p0219-itxex = 'X'.
MOVE-CORRESPONDING wa_p0219 TO tx-key.
endif.
endif
endform. " fill_key
form get_data.
import ptext from database pcl1(tx) id tx-key.
loop at ptext. "ptext is defined in above include
write: / ptext-line.
endloop.
endform. " get_data
Prabhudas
Maybe you are looking for
-
Hi, I'm trying to create a tree menu, When user click the links on left hand side, the content will be displayed on the right side of the page. I'm new to html db. Can anyone have some suggestion about this? Is there a how'to doc. or sample applicati
-
Loss of picture quality by enlarging on HD TV
I have my mac mini connected to my tv and have enlarged the display by switching it to 720p in settings. Will this now mean i am loosing picture quality?
-
Did a search, no luck! Canon D1250U USB Not recognized in OSX or Photoshop
Or Fireworks! What do I do!? I went to manufacture site. No Drivers for OSX! Any ideas? Not even sure where to find it in Preference Panel! Thanks!
-
PE 4 crashes when I try to edit a title
I was able to fix the crashes from adding transitions but now I can't edit a title at the very end of my project. I just defrag'd, cleaned up registry and uninstalled and re installed PE 4 and still it crashes....I tried restarting and opening up PE
-
Best Portable HD for MBP?
Appreciate recommendations for a reliable portable HD [ 500G ]. Thx, Steve