cancel
Showing results for 
Search instead for 
Did you mean: 

Decoupled class for Assurance sociale (FR) (CL_HRPA_INFOTYPE_0064)

antoine_foucault
Active Contributor
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

antoine_foucault
Active Contributor
0 Kudos

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.

2090148 - Basic pay and default contribution model defined with feature 06FC0 cannot be set in the i...

Nice weekend,

Antoine

Answers (1)

Answers (1)

antoine_foucault
Active Contributor
0 Kudos

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