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: 

Implicit enhancement of a DATA statement

0 Kudos
329

At the end of a DATA declaration there's an implicit enhancement point where you can insert extra fields, however I haven't been able to find any documentation or working example, and the most obvious way to do it doesn't work.

E.g. to enhance the following declaration:

DATA: BEGIN OF i_glpca OCCURS 0.

INCLUDE STRUCTURE rpca2.

DATA: racct_ktext LIKE rpcak-ktext,

psppp LIKE prps-posid,

END OF i_glpca.

I would just insert more fields before the END OF i_glpca:

DATA: BEGIN OF i_glpca OCCURS 0.

INCLUDE STRUCTURE rpca2.

DATA: racct_ktext LIKE rpcak-ktext,

psppp LIKE prps-posid,

""""""*""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1 ) Struct. I_GLPCA, End S

$$-Start: (1 )----


$$

ENHANCEMENT 5 Z_ENH_RCOPCA02. "inactive version

  • variables used when looking up profit center descriptions

old_rprctr LIKE glpca-rprctr, " @@

old_rprctr_ktext LIKE cepct-ktext, " @@

ENDENHANCEMENT.

$$-End: (1 )----


$$

END OF i_glpca.

However this gives the error "Comma without preceding colon". So how to enhance a DATA declaration?

2 REPLIES 2

0 Kudos
66

I found it myself; the enhancement has to contain DATA statements that are valid by themselves rather than a fragment that fits inside the DATA statement we're enhancing.

So a working example is (taken from enhancing RCOPCA02):

DATA: BEGIN OF i_glpca OCCURS 0.

INCLUDE STRUCTURE rpca2.

DATA: racct_ktext LIKE rpcak-ktext,

psppp LIKE prps-posid,

""""""*""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1 ) ENHANCEMENT 7 Z_ENH_RCOPCA02. "active version

DATA rprctr_ktext LIKE cepct-ktext. " @@

DATA eprctr_ktext LIKE cepct-ktext. " @@

ENDENHANCEMENT.

$$-End: (1 )----


$$

END OF i_glpca.

0 Kudos
66

Hi Fillip

I have created an implicit enhancement in a Z package. A composite enhancement imp in a Z package. Assigned my simple enhancement to the composite enhancement in SE80.

Now when I introduce my code in the Enhancement and save : it gives me an error saying object must not be edited. (An Exception of class CX_ENH_MOD_NOT_ALLOWED). When I try to activate it it says Operation failed.

You have any idea what I might be doing worng?

Thanks

Sameer