Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Common program code

former_member194669
Active Contributor
0 Likes
502

Hi,

I am working in a Unicode enviornment. Here is my situation i have a lot of programs where in which we have coded like this way.


data: v_strcuture(80) type c.

types: begin of t_temp.
       matnr like mara-matnr,  " CHAR field
       matkx like makt-maktx,  " CHAR field 
       breit like mara-breit.  " QUAN field
types: end of t_temp.

data: wa_temp type t_temp.

move v_strcuture to wa_temp.

In unicode the above said move statement will not work. For correcting these kind of errors i lam looking for COMMON program code to convert v_structure into wa_temp.

and vice versa ie from wa_temp to v_structure.

For example:

function module with 2 import parameters as V_STRUCTURE & WA_TEMP, and importing tables is contents of V_STRUCTURE and changing table (as output) will be WA_TEMP like that.

and also from WA_TEMP to V_STRUCTURE.

If anybody done this kind of requirement please give some hint

a®

3 REPLIES 3
Read only

Former Member
0 Likes
477

You might take a look at class CL_HR_PNNNN_TYPE_CAST, methods PRELP_TO_PNNNN and PNNNN_TO_PRELP.

These move HR data from a PRELP structure (which has several long CHAR type fields) into individual infotype structures which all have different individual field layouts.

Have not got a system to check at present, but it seems like these methods do what you want and could be basis of a custom class.

Andrew

Read only

0 Likes
477

Andrew,

This is what i am looking for.

Thanks for your reply

a®

Read only

former_member194669
Active Contributor
0 Likes
477

Issue Solved