Skip to Content
avatar image
Former Member

How to convert data for secondary infotype

Hi all,

Please let me know if it is possible to convert data from PRELP structure to secondary infotype.

My issue is when I create data in Infotype 0006, there is a secondary infotype 3366 to which the data should be stored. The screen fields for Infotype 3366 are present along with 0006, but the data is not getting stored in 3366. I have existing validation in user exit due to which the problem is happening. When screen data is converted to infotype data using  Method cl_hr_pnnnn_type_cast=>prelp_to_pnnnn, only the data of primary infotype (i.e 0006) is getting converted. When I use the same method to convert data to infotype 3366, the data is not getting converted. So is it possible to read data using Method cl_hr_pnnnn_type_cast=>prelp_to_pnnnn.

Thanks

Jayanth.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 09, 2015 at 12:00 PM

    Normally you would use this, for example, in the User Exit ZXPADU01. Here you would first test which infotype you are dealing with and then update as necessary. For example, below I test that we are working with infotype 0002, then make some amendments to it and update again i.e:

    if ipsyst-iinit = yes    and
       i001p-molga  = 'HU'   and
       innnn-infty  = '0002' and
      ipsyst-ioper = insert.

      call method cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
        exporting
          prelp = innnn
        importing
          pnnnn = ls_p0002.

      ls_p0002-natio = 'HU'.
      ls_p0002-gblnd = 'HU'.
      ls_p0002-knznm = '00'.
      ls_p0002-sprsl = 'W'.

      call method cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
        exporting
          pnnnn = ls_p0002
        importing
          prelp = innnn.
    endif.

    If you are working with infotype 0006, then the only way to read infotype 3366 would be to use a function e.g. HR_READ_INFOTYPE.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Glen,

      Thanks for your response.

      The data will not be available at this point in infotype 3366, so reading it will not help. Also the issue is the data is not getting stored in 3366.

      Thanks

      Jayanth