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: 

Type corresponding to UNIT in ABAP program

Former Member
0 Kudos
2,343

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

Former Member
0 Kudos
699

You can declare a constant of type unit as well

Data X type unit.

OR

data x type meins.

5 REPLIES 5

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos
699

check the domain for UNIT and use the same.

Former Member
0 Kudos
700

You can declare a constant of type unit as well

Data X type unit.

OR

data x type meins.

Former Member
0 Kudos
699

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 '<>'.

Former Member
0 Kudos
699

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

former_member555112
Active Contributor
0 Kudos
699

Hi,

Use a variable of type 'MEINS'.

Regards,

Ankur Parab