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

Data element data type check

0 Likes
4,360

Hello everyone,

I want to check a data element is a bool type or not,

for example:

     data element: "ZSHOPPING_BOOK_SALED" and it's domain is "BOOLE"( the data type of "BOOLE" is char 1). And now I want to check whether      the "ZSHOPPING_BOOK_SALED" is a bool type or not.

Due to there have no 'bool' data type in ABAP  program, so I want to know is there any standard class methods or function modules that has realized  this function.

Thank you very much.

1 ACCEPTED SOLUTION
Read only

former_member620069
Participant
0 Likes
2,989

Hi,

Take data type CHAR with length 1.

and fix value ranges with  'X' and ' '.

BR,

Srini.

10 REPLIES 10
Read only

matt
Active Contributor
0 Likes
2,989

RTTI?

Read only

0 Likes
2,989

Hi Matthew,

It's not a RTTI, the data element type is static. thank you very much.

Best Regards,

Peng.

Read only

matt
Active Contributor
0 Likes
2,989

Then the answer to your question question is trivial.

Use values abap_true, abap_false and type abap_bool. You may need to use type pool ABAP, but later kernel versions include this automatically. If you're using web dynpro, then the correct type is wdy_boolean

Read only

former_member620069
Participant
0 Likes
2,990

Hi,

Take data type CHAR with length 1.

and fix value ranges with  'X' and ' '.

BR,

Srini.

Read only

0 Likes
2,989

Hi Srin,

It's a great idea, and very helpful, thank you.

BR,

Peng.

Read only

Former Member
0 Likes
2,989

You can use standard data element BOOLEAN.

Read only

ipravir
Active Contributor
0 Likes
2,989

Hi Peng,

You can do the join query on DD01L (Domain Table ) and DD04L(Data Element Table ) table based on the DATA Element ans check the Domain, Lenght and data type.

Based on that, if it's CHAR1 data type or CHAR data type with 1 Lenght. Then it could be the Boolean.

Regards.

Praveer

Read only

0 Likes
2,989

Hi Praveer,

It's a good idea, and very technical. But I think it's a little complicated, however thank you very much.

Regards,

Peng.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,988

Well first identify boolean domain -> domain type CHAR length 1, with resticted values list ('X',  ' ') and only those. Then check if the domain  of required field is in the list.

Regards,

Raymond

Read only

0 Likes
2,988

Hi Raymond,

Thank you for your great help, it's very useful. And now I have several solutions from all of your enthusiasm help.

Regards,

Peng.