Application Development 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: 

Func module fields to Work Area Fields - different data types

Former Member
0 Kudos

func module will give DIVISIONID and DIVISION_TEXT values which are to be populated to Work Area

where Func modules fields and Work area fields are of NUMC and CHAR types ..

i want to pass the func module field values to Work Area.

How can i do tht ??

CALL FUNCTION 'Z_GET_DIVISION'

EXPORTING

PERNUM = t_pernr

BEGDA = e_begda

ENDDA = e_endda

IMPORTING

  • BASEORGUNIT_ID =

  • BASEORGUNIT_TEXT =

  • BASEORGUNIT_ABBR =

DIVISION_ID = wa_divs-division

DIVISION_TEXT = wa_divs-division_text.

  • DIVISION_ABBR =

  • CP_POSITION =

  • CP_PERNR =

  • TABLES

  • IT_0002 =

  • EXCEPTIONS

  • NOPERNRFOUND = 1

  • NOCPDATA = 2

  • OTHERS = 3

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

clear: wa_divs-division,wa_divs-division_text.

ENDIF.

        • CALL METHOD zcl_tem_int=>get_employee_division

        • EXPORTING

        • i_pernr = t_pernr

        • i_begda = e_begda

        • i_endda = e_endda

        • RECEIVING

        • r_division = wa_divs.

it_data-auth_org_id = wa_divs-division.

it_data-auth_org_name = wa_divs-division_text.

ENDIF.

Here

Wa_divs- Division is Char- 17 and DIVISIONID in Function Module is NUMC 8

and i have pass the value of DIVISIONID (NUMC) From Functionmodule to a Work Area defined as CHAR.

Wa_divs-Division_text is Char 40 and DIVISION_TEXT in FM is CHAR 25

and i have to pass the value of DIVISION_TEXT- Char(40) from Func module to a Work Area defined as CHAR (25)

so please let me know how can i convert the func module output to Work Area input which are in NUMC and Char formats respectively...?????

So how to match the above two fields .???

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Are you getting data type mismatch error in this?

If yes, then try using temporary variables which will be of type work area. Take values from your function module into these variables and then assign these variable to your work area.

Try out this and let me know if it works.

Thanks,

Archana

4 REPLIES 4

Former Member
0 Kudos

Hi,

Are you getting data type mismatch error in this?

If yes, then try using temporary variables which will be of type work area. Take values from your function module into these variables and then assign these variable to your work area.

Try out this and let me know if it works.

Thanks,

Archana

raymond_giuseppi
Active Contributor
0 Kudos

Are you sure to use the "good" FM to get data, the types mismatch, so simple MOVE between the fields of your work area and temporary field passed to the FM may not be able to map the data coorrectly.

Actually NUMC 8 -> CHAR 17 looks like the result of a conversion exit, check in ddic, if there is a conversion-exit or a like-relation to convert field values between you work area and the FM parameters.

Regards,

Raymond

0 Kudos

There is no corresponding Func Module...to convert from NUM to CHAR ..

asi have searched in DDIC ...

0 Kudos

as v have create the Temp variables of Func modules Field types or LIKE

then catch the Variables values to Work area..

thus solved the prob.