cancel
Showing results for 
Search instead for 
Did you mean: 

CONVERT PNNNN TO PRELP

Former Member
0 Kudos

I am using ECC 6.0 and I am trying to move the content of PNNNN infotype into PRELP using the class method as.

CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp_tab

EXPORTING

pnnnn_tab = <pxxxx>

IMPORTING

prelp_tab = t_pxxxx[].

but when I do this the t_pxxxx contains junk values which corresponds to the P type fields of PNNNN. We also download the file containing t_pxxxx but this is causing a problem as we are UPGRADING from 4.6 to ECC 6.0 and the junk special characters introduced are changing the format of the file.

sample code

FIELD-SYMBOLS: <pxxxx> TYPE table.

DATA: BEGIN OF t_pxxxx OCCURS 0.

INCLUDE STRUCTURE prelp.

DATA: END OF t_pxxxx.

CONCATENATE w_ityp '[]' INTO w_ityp.

ASSIGN (w_ityp) TO <pxxxx>. "eg <pxxxx> contains p0008[]"

CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp_tab

EXPORTING

pnnnn_tab = <pxxxx>

IMPORTING

prelp_tab = t_pxxxx[].

Edited by: Deepankar.B on Feb 1, 2011 12:18 PM

Edited by: Deepankar.B on Feb 1, 2011 12:19 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Usually I just use the following code:

call method cl_hr_pnnnn_type_cast=>pnnnn_to_prelp

exporting

pnnnn = w_0002

importing

prelp = innnn.

Where w_0002 has type p0002 and innn has type prelp...

If you're on ECC6.0 I would also recommend not using "DATA - BEGIN OF OCCURS" declarations anymore (these are obsolete). Declare internal tables with no header lines instead.

Hope it helps