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: 

How to check whether a table has a particular field/column or not?

kumarniti4
Product and Topic Expert
Product and Topic Expert
0 Kudos

There is a scenario where I need to check whether the given field exists in the table or not, please suggest ways of checking this.

Thanks.

1 ACCEPTED SOLUTION

former_member226519
Active Contributor

Use funtion module DDIF_FIELDINFO_GET

4 REPLIES 4

sanilbhandari
Product and Topic Expert
Product and Topic Expert

Hello kumarniti4

The below blog should help you

https://blogs.sap.com/2014/01/13/how-to-find-table-name-for-a-field-which-is-shown-structure-name-on...

Thanks & Regards

Sanil Bhandari

Sanil Bhandari

former_member226519
Active Contributor

Use funtion module DDIF_FIELDINFO_GET

Sandra_Rossi
Active Contributor

Use the official ABAP Run Time Type Services.

The most basic one to check column SPFLI-CARRID:

CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME( 
  exporting  p_name            = |\\TYPE=SPFLI\\TYPE=CARRID|
  exceptions type_not_existing = 1 ).

ricky_shaw
Contributor
0 Kudos

We can use cntrl+F to fine it right?