‎2007 Dec 17 7:53 AM
When my dubugger goes on this line..it gives me Runtime error'
'OBJECTS_OBJREF_NOT_ASSIGNED_NO'
CX_SY_REF_IS_INITIAL
Code :
CALL METHOD determine_budget_values->determine_budget_values
EXPORTING
plvar = '.:'
butyp = 'BU'
begda = '20060101' "'01.01.2006'
endda = '20061231' "'31.12.2006'
kcurr = 'X'
budot = 'BU'
budid = '50012433' "objektid
oldam = 1000
oldcu = 'USD'
oldno = 10
oldsu = 'USD'
IMPORTING
NEWAM = newam
NEWCU = newcu.
NEWNO =
NEWSU =
Thanx in advance....Its very urgent..
‎2007 Dec 17 11:29 AM
You've probably got somewhere in your code a declaration like:
DATA: determine_budget_values TYPE REF TO someclass.
But you've not instantiated the class, using either CREATE or a static factory method on the class (or superclass of the class).
matt
‎2007 Dec 18 9:34 AM
Thanks a lott...for u r rhelp///
but one thing i would like to know after executing properly this method....will my HRP1520 will get those new values of budget of i will have to code it in Method ..specifically.
i m sending code for Method...
method IF_EX_HRECM00_BDG0001~DETERMINE_BUDGET_VALUES.
DATA: BEGIN OF fs_budgets ,
objid(8) TYPE n , " Object Id
flag TYPE c , " Monetary/Non Monetary
newam TYPE CHAR22 , " Budgeted Amount,
newcu TYPE CHAR05 , " Currency Key,
END OF fs_budgets ,
t_budgets LIKE TABLE OF fs_budgets.
DATA: w_sobid TYPE hrp1001-sobid , " Org. Unit
w_file TYPE rlgrap-filename . " File Name
DATA: t_orgunit TYPE hap_t_hrsobid , " Id of Org. unit
t_suborgunits TYPE hap_t_hrsobid , " Ids of Sub Org Units
fs_orgunit LIKE LINE OF t_orgunit. " Work Area of orgunit
REFRESH: t_orgunit,
t_suborgunits.
CLEAR : fs_orgunit..
***********************************************************************
The Budget values are stored in the file 'BUDGETS' on the App Server*
This data will be read from the App Server *
***********************************************************************
w_file = 'BUDGETS'.
OPEN DATASET w_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
***********************************************************************
Fetching the corresponding Org Unit for the Budget Id *
***********************************************************************
SELECT sobid " Org. Unit
FROM hrp1001
INTO w_sobid
WHERE plvar EQ '01'
AND otype EQ 'BU'
AND objid EQ budid
AND rsign EQ 'B'
AND relat EQ '300'
AND istat EQ '1'
AND begda LE endda
AND endda GE begda.
ENDSELECT. " SELECT sobid
IF sy-subrc EQ 0.
fs_orgunit-plvar = '01'.
fs_orgunit-otype = 'O'.
fs_orgunit-sobid = w_sobid.
APPEND fs_orgunit TO t_orgunit.
CLEAR fs_orgunit.
***********************************************************************
Fetching the Sub Org units for a given Org unit *
***********************************************************************
CALL FUNCTION 'HRHAP_SEL_OBJECTS_OF_EVAL_PATH'
EXPORTING
T_OBJECTS_BASE = t_orgunit
EVALUATION_PATH = 'ORGEH'
FROM_DATE = begda
TO_DATE = endda
IMPORTING
T_OBJECTS = t_suborgunits.
ENDIF. " IF sy-subrc EQ 0.
CLEAR newam.
***********************************************************************
Accumulating the budget values of all the Sub org units for a given *
Org unit and populating the fields 'newam' and 'newcu'. *
***********************************************************************
LOOP AT t_suborgunits INTO fs_orgunit.
CLOSE DATASET w_file.
OPEN DATASET w_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
DO.
READ DATASET w_file INTO fs_budgets.
IF sy-subrc EQ 0.
IF fs_budgets-objid EQ fs_orgunit-sobid.
ADD fs_budgets-newam TO newam.
newcu = fs_budgets-newcu.
EXIT.
ENDIF.
ELSE.
EXIT.
ENDIF. " IF sy-subrc EQ 0.
ENDDO. " DO
ENDLOOP. " LOOP AT t_suborgunits
***********************************************************************
Giving default values for the Budget Amount and Currency if they are*
containing Initial values *
***********************************************************************
IF newam IS INITIAL.
newam = 0.
ENDIF. " IF newam IS INITIAL.
IF newcu IS INITIAL.
newcu = 'USD'.
ENDIF. " IF newcu IS INITIAL.
CLOSE DATASET w_file.
endmethod.
After this code will i require to code anything specific to get this newam(new amount) uploaded to HRP1520 infotype or automatically it will upload if i write above mentioned code only...
Please revert......thanx a lot
‎2007 Dec 18 2:31 PM
I've no idea. You should really post this as a seperate question - probably in ABAP General or HR. Your initial question was a ABAP Objects specific question. Your new one is HR specific.
matt