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: 

ABAP-command to check wheather a field in existing in a spec.table/structur

Former Member
0 Kudos
929

Hello together,

we have a tool to do corrections to CO-PA-transaction data.

Because we have different structures for different operating concerns (and therefore different dynpros for those different operating concerns) we now want to dynamize this tool.

The idea is to have one dynpro with the maximum number of CO-PA-fields and to control via a functional-module which vields are existing for one operating concern and those are not existing for that operating concern to change the attributes to non-changeable.

Is there any command in ABAP to check if one field (e.g. one valuefield) is contained in one table-structure (e.g. table-structure CE1xxxx) ?

Kind regards

Udo

1 ACCEPTED SOLUTION

GauthamV
Active Contributor
0 Kudos
106

Use this function module.read the documentation in SE37.

DDIF_FIELDINFO_GET

2 REPLIES 2

GauthamV
Active Contributor
0 Kudos
107

Use this function module.read the documentation in SE37.

DDIF_FIELDINFO_GET

Peranandam
Contributor
0 Kudos
106

*--Verfy infoobject exit or not

call function 'DDIF_FIELDINFO_GET'

exporting

tabname = KNA1 <--here you pass structure

tables

DFIES_TAB = <itab> <--get list of fields in the table

exceptions

not_found = 1

internal_error = 2

others = 3.

if sy-subrc <> 0.

message text-005 type 'E' .

endif.

loop at <itab> assigning <field>.

*here you validate wether field is available in the structure or not

assign component 'SIGNCH' of structure <field> to <f_sign>.

if sy-subrc ne 0.

message 'SIGNCH field is not available in table KNA1' type 'E' .

endif.

endloop.

Regards,

Peranandam