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

Implicit Enhancement for Data Declaration

former_member188001
Active Participant
0 Likes
4,290

Hello all,

I want to add one more field at the data declaration level.

I am following below steps :

1) I went to report and clicked on 'Enhance' button.

2) Then I went to Edit->Enhance Operations->Show Implicit Enhancement Options

3) Then I went to the Data Declaration section and right clicked and choose 'Enhancement Implementation'->Create.

4) Then I declared my variable.

5) When I checked the syntax, it gave me error.

Below is the piece of code.


data:   begin of austab occurs 100,
           ikone TYPE c,
           lgtyp like lagp-lgtyp,
           lgpla like lagp-lgpla,
           kreuz type c,               "ind. to be invented
           kzpmi type c,               "ind. Plus Minus Initial
           idatu like lagp-idatu,
           werks like lqua-werks,
           matnr like lqua-matnr,
           charg like lqua-charg,
           flg_aktiv  type c,          "ind.
           nidat like lagp-idatu,      "New Inventory date
           ttext(25)   type c,         "Textfield
           sperr type c,               "ind. blocked due to transfer
           kzmmq type c,               "ind. bin with several quants
           iverz(1)   type c,
           linno like sy-linno,
           pagno like sy-pagno,
           lqnum like lqua-lqnum,                           "new
           lgnum like lqua-lgnum,                           "new
           plpos like lqua-plpos,                           "new
""""""""*""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1 ) Struct. AUSTAB, End                                                                                S
*$*$-Start: (1 )--------------------------------------------------------------------------------$*$*
ENHANCEMENT 3  CYCLE_COUNTING.    "inactive version
           abcin type abcin,
ENDENHANCEMENT.
*$*$-End:   (1 )--------------------------------------------------------------------------------$*$*
        end of austab.

The error I am getting is "Comma without preceding colon (after ABCIN ?).

Please help me out in solving this .

Thanks,

Salil

Code Formatted by: Alvaro Tejada Galindo on Jan 14, 2010 5:44 PM

12 REPLIES 12
Read only

Former Member
0 Likes
2,454

Which is the program you are trying to enhance and how is ABCIN declared? Can you try declaring something of type CHAR and see once if you still are getting error?

Read only

0 Likes
2,454

I am trying to declare this in report RLINV060

Read only

0 Likes
2,454

I tried declaring it using CHAR, but still the error remains the same.

Read only

0 Likes
2,454

I have found these steps for Implicit Enhancements. Can you check if oyu have followed the same way?

Prerequisite:

1. Create Composite Enhancement Implementation in your own package (In SE80 open your package, right-click and select Create -> Composite Enhancement Implementation)

2. Giive a name and description for the Composite Enhancement Implementation

Implementation:

1. Open the development object (SAP standard program) you want to enhance in ABAP editor.

2. Click the "Enhance" button (the spiral Icon). The Change Enhancements editor opens up.

3. Chose the menu path Edit -> Enhancement Operations -> Show Implicit Enhancement Options. The implicit enh options are shown in the code with comments such as """""""""""""""""$"$SE:(1 ) I"

4. Highlight the entire line of the Implicit Enhancement Options.Right-click to select the contaxt menu path Enhancement Implementation -> Create

5. In the popup screen enter a (Simple) enhancement name and description. Assign this to a composite enhancement.

6. On clicking the enter button on the popup screen the code ENHANCEMENT and ENDENHANCEMENT gets inserted. You can add your code there.

Also check this link if it helps -

http://help.sap.com/saphelp_nw2004s/helpdata/en/94/9cdc40132a8531e10000000a1550b0/frameset.htm

/people/thomas.weiss/blog/2006/05/03/source-code-enhancements--part-5-of-the-series-on-the-new-enhancement-framework

/people/thomas.weiss/blog/2006/03/15/the-new-enhancement-framework-part-2--what-else-you-need-to-know-before-building-an-enhancement

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/thenewEnhancementFrameworkandthenewkernel-basedBAdI&

ashish

Read only

Former Member
0 Likes
2,454

Hello,

Regarding the following:

ENHANCEMENT 3 CYCLE_COUNTING. "inactive version

abcin type abcin,

ENDENHANCEMENT.

My guess is that abcin in not defined as a type.

I searched for abcin in RLINV060 in our system and did not find it.

Also once you get past the syntax error remember to activate the enhancement.

Regards

Greg Kern

Read only

former_member188001
Active Participant
0 Likes
2,454

solved the problem on my own

Read only

Former Member
0 Likes
2,454

Would have been nice if you told us how you solved it, I have the exact same question

Read only

0 Likes
2,454

Hi,

Can you please advice what you did to resolve this? I have the same issue now.

Regards,

Kumar.

Read only

0 Likes
2,454

Hi,

Can you please advice what you did to resolve this? I have the same issue now.

Regards,

Kumar.

Read only

0 Likes
2,454

I have resolved this by putting all the required fields into a structure (SE11) and the include the structure before the End of Types. as follows.

TYPES: BEGIN OF STANDARD_SAP_STRUC.

TYPES: box TYPE c, -> SAP FIELD

stunr LIKE ek08bn-stunr, -> SAP FIELD

zaehk LIKE ek08bn-zaehk, -> SAP FIELD

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Typ MRM_ARSEG, End S

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


$$

ENHANCEMENT 1 Z_TEST_ENHANCEMENT. "active version

*

INCLUDE STRUCTURE YKMRM_STRUC. --> THIS IS MY NEW STRUCTURE WHICH CONTAINS MY ADDITIONAL FIELDS

ENDENHANCEMENT.

END OF STANDARD_SAP_STRUC

Edited by: Kumar Kasavaraju on Jan 15, 2010 12:04 AM

Read only

Former Member
0 Likes
2,454

Correct process is to use :

ENHANCEMENT 1

data: field type data_type,

field2 type data_type2.

ENDENHANCEMENT

This is because the enhancement is not actually where it looks to be, but rather off in another program that is co-compiled.

Read only

Former Member
0 Likes
2,454

Thank you for this discussion.

The trick to avoid the syntax error is to start the enhancement with a data: statement.

Best regards,

Michael