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

Type corresponding to UNIT in ABAP program

Former Member
0 Likes
3,569

Hi gurus,

I have a field in table MSEG called meins and its datatype is UNIT and length is 3.Can you please suggest how should be type declaration corresponding to UNIT length 3 in ABAP program.I am facing problem because i have declared a constant of type string length 3 and when i am trying to move data from that constant to IDOC segment feild (MEINS having dataelement as MEINS, i.e. type UNIT 3). It is giving some numeric convertion exception.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,925

You can declare a constant of type unit as well

Data X type unit.

OR

data x type meins.

5 REPLIES 5
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,925

check the domain for UNIT and use the same.

Read only

Former Member
0 Likes
1,926

You can declare a constant of type unit as well

Data X type unit.

OR

data x type meins.

Read only

Former Member
0 Likes
1,925

u can either use the data element used in the field of the table or the table field ref for declaring ur data type/const.

constants: gc_meins type MEINS value '<>'.

or

constants: gc_meins type MSEG-MEINS value '<>'.

Read only

Former Member
0 Likes
1,925

Hi,

Check what is the data type of the IDoc field to which you are moving the data to and declare it as the same.

If it is character, consider unpack statment before moving it.

regards,

Advait

Read only

Former Member
0 Likes
1,925

Hi,

Use a variable of type 'MEINS'.

Regards,

Ankur Parab