on 10-22-2014 5:15 PM
Hi gurus,
I have just posted a SAP OSS note for wrong coding in method SPECIFIC_INITIAL_COMPUTATIONS of class CL_HRPA_INFOTYPE_0064.
It seems there is an error in the logic syntax in found at line 139 (index = sy-index - 1.) where an index value is being evaluated from sy-index value in a loop statement evaluating a
standard table in order to build names of variables (ORGxx and COTxx to be exact).
Inconsistent code within context:
LOOP AT tab_default_model
INTO wa_default_model
FROM 2.
* Build names of variables ORGxx and COTxx.
index = sy-index - 1.
* Add leading zero.
UNPACK index TO index.
CONCATENATE c_generic_org index INTO organization.
CONCATENATE c_generic_cot index INTO contribution.
ASSIGN COMPONENT organization OF STRUCTURE <p0064> TO <organ>.
ASSIGN COMPONENT contribution OF STRUCTURE <p0064> TO <contrib>.
<organ> = wa_default_model-value1.
<contrib> = wa_default_model-value2.
ENDLOOP.
Now I think sy-index value has no relation to a table line in a loop statement. The LOOP AT statement sets system field sy-tabix to the table index of the current table line therefore leaving sy-index to its original value.
Is my original analysis wrong?
In my current case, value ended up equal to 0 causing a runtime error after trying to give a value to <organ> where there is no evaluation of success after instruction ASSIGN COMPONENT.
While reviewing standard code I also have found inconsistencies in reading infotype 0008 (with abap_false specified as subtype!!!) in the same method.
CALL METHOD a_read_infotype->read_single
EXPORTING
tclas = tclas
pernr = <p0064>-pernr
infty = '0008'
subty = space
objps = space
sprps = if_hrpa_read_infotype=>unlocked
begda = default_begda
endda = high_date
mode = if_hrpa_read_infotype=>first_intersecting_record
no_auth_check = true
IMPORTING
pnnnn = p0008
data_exists = data_exists.
I fill coding is a bit poor so I am wondering how many clients are using this class out there in a productive environment? I also wonder if I have to expect the same code quality in other standard object (international and country specific) belonging to the decoupled infotype framework.
I have made a client copy of CL_HRPA_INFOTYPE_0064 class with the correct abap coding to solve my issue while SAP replies.
Cheers.
Hello gurus,
A last update before the weekend, finally after much talking about that sy-index in a loop syntax and about that subtype = space line SAP finally will published a correction note.
Nice weekend,
Antoine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello gurus,
So I have written an OSS message last week for this; and although it's been quite difficult to deal with first level it seems my message has reached HCM devloppement support France yes it's possible.
I will update this threads accordingly.
Best,
Antoine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
104 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.