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: 

Need help in declaring the data type

Former Member
0 Kudos

Hi all,

Currently in my program..we have used a data type INT2.

The data type INT2 can hold only 5 characters at a time...with no commas in between and left Justified.

Now I got a problem that..the variable which is declard with INT2 was getting populated with more than 5 charaters.

So it gettin dump.

Now I need to change the data type of that variable.

I tried declaring with INT4..or Char...all these data types are nt left justified and also have commas in between.

Please suggest a data type..which can hold morethan 5 characters..left justified n no commas in between.

Thanks in advance

Regards,

Priya

8 REPLIES 8

former_member386202
Active Contributor
0 Kudos

Hi,

Declare that field as a CHAR Type and the use condense.

Data : lv_fd type char10.

lv_fd = 'abcdefghi'.

Condense lv_fd.

Regards,

Prashant

Former Member
0 Kudos

ever thought of declaring one yourself which fits your needs?

BTW in SE11 when searching for data elements (Leave the field blank for this pls), you got a little "+" in your search help, which will expand the fields for which you can search, maybe you can find one which fits your needs.

former_member182485
Active Contributor
0 Kudos

Hi,

You can declear CHAR and use the statment SHIFT LEFT DELETING LEADING ' ' .

Regards

Bikas

Former Member
0 Kudos

hi,

CHECK THE BELOW CODING...

parameter: test type int4.

DATA: char TYPE char20.

char = test.

WRITE:/ 'BEFORE CONDENSE  ', char.

CONDENSE char.

WRITE:/ 'AFTER CONDENSE   ', char.

Regards,

Sakthi.

Former Member
0 Kudos

Istead create a data type according to your need

Former Member
0 Kudos

I hardly recommend to use a numeric data type if you are calculating with it. dont care about notation, left justified and stuff.

For output purposes it makes sense to make use of a char variable. you can the use statement "WRITE TO" to get your value into your char variable in desired way. therefor press F1 on write to staement and read the docu.

vijayakumarub
Explorer
0 Kudos

Hi,

Try using type p decimals 0.

Regards,

Vijay

Former Member
0 Kudos

Hi All,

Thanks a lot for your replies.

The problem..I cant declare the variable as CHAR and manipulate it as required..because the variable which Im using in my program is called from a zstructure..

If I wanna modify it in the structure...then I need to change all the programs..which I cant.

So request you to help me...is there any data type..which would replace INT2 with more than 5 characters in it and also no cammas in between and should be left justified.

Thanks in advance!

Regards,

Priya