‎2008 Feb 27 2:45 PM
I need to develop a program that takes in two position numbers and delimits the vacancy record for the first position and creates a vacancy record for the second position. I am trying to use the SAP standard functions RH_CUT_INFTY and RH_INSERT_INFTY respectively but I seem to keep getting errors when the functions try to run. Is there some reason I can't get these classes to work for it1007.
Here is the main parts of the code that I have tried:
CALL FUNCTION 'RH_READ_INFTY'
EXPORTING
plvar = '01'
otype = c_plans
objid = plans_filled
infty = c_1007
begda = effective_date
endda = effective_date
TABLES
innnn = l_p1007_old
EXCEPTIONS
all_infty_with_subty = 1
nothing_found = 2
no_objects = 3
wrong_condition = 4
wrong_parameters = 5
OTHERS = 6.
*Delimit 1007 table:
CALL FUNCTION 'RH_CUT_INFTY'
EXPORTING
gdate = effective_date
histo = ' '
vtask = 'B'
TABLES
innnn = l_p1007_old
EXCEPTIONS
error_during_cut = 1
no_authorization = 2
gdate_before_begda = 3
cut_of_timco_one = 4
corr_exit = 5
OTHERS = 6.
*Create Vacancy
ls_p1007-vacan = 'X'.
ls_p1007-begda = effective_date.
ls_p1007-status = '0'.
ls_p1007-objid = plans_vacan.
ls_p1007-otype = c_plans.
ls_p1007-plvar = '01'.
ls_p1007-istat = '1'.
ls_p1007-endda = '99991231'.
ls_p1007-infty = '1007'.
APPEND ls_p1007 TO l_p1007_new.
**Insert new record
CALL FUNCTION 'RH_INSERT_INFTY'
EXPORTING
fcode = 'INSE'
vtask = 'B'
TABLES
innnn = l_p1007_new
EXCEPTIONS
no_authorization = 1
error_during_insert = 2
repid_form_initial = 3
corr_exit = 4
begda_greater_endda = 5
OTHERS = 6.
‎2008 Feb 27 2:57 PM