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

Enchancement Implementation Error At selection screen

Former Member
0 Likes
2,225

Hi, can implicit enhancement be done on selection screen? When I tried to add a parameter after first selection-screen block or inside the block, always get error message during activation. The standard program i try to enhance is report LSO_RHXBUCH0 (Bookings per Participant). I am sure there is no syntax error on the codes I wrote. The error message is "Between "DATA BEGIN OF' name" and "DATA END OF name" only data statements are allowed.

Here the code, see enhancement: ZIMP_BOOKING_PARTICIPANT

-v-Block 1-----v-

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.

PARAMETERS pchplvar LIKE pchdy-plvar NO-DISPLAY. "Planvariante

PARAMETERS pchotype LIKE pchdy-otype NO-DISPLAY. "Objekttyp

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS ptyp1 LIKE hrvpv-ptyp1 RADIOBUTTON GROUP xxx. "Objekttyp1

SELECTION-SCREEN COMMENT 4(22) ptxt1 FOR FIELD ptyp1.

SELECTION-SCREEN POSITION 27.

PARAMETERS ptyp2 LIKE hrvpv-ptyp2 RADIOBUTTON GROUP xxx. "Objekttyp2

SELECTION-SCREEN COMMENT 30(22) ptxt2 FOR FIELD ptyp2.

SELECTION-SCREEN POSITION 53.

PARAMETERS ptyp3 LIKE hrvpv-ptyp3 RADIOBUTTON GROUP xxx. "Objekttyp3

SELECTION-SCREEN COMMENT 56(22) ptxt3 FOR FIELD ptyp3.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS ptyp4 LIKE hrvpv-ptyp4 RADIOBUTTON GROUP xxx. "Objekttyp4

SELECTION-SCREEN COMMENT 4(22) ptxt4 FOR FIELD ptyp4.

SELECTION-SCREEN POSITION 27.

PARAMETERS ptyp5 LIKE hrvpv-ptyp5 RADIOBUTTON GROUP xxx. "Objekttyp5

SELECTION-SCREEN COMMENT 30(22) ptxt5 FOR FIELD ptyp5.

SELECTION-SCREEN POSITION 53.

PARAMETERS ptyp6 LIKE hrvpv-ptyp6 RADIOBUTTON GROUP xxx. "Objekttyp6

SELECTION-SCREEN COMMENT 56(20) ptxt6 FOR FIELD ptyp6.

SELECTION-SCREEN PUSHBUTTON 76(4) morepart USER-COMMAND more.

SELECTION-SCREEN END OF LINE.

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(3 ) Struct. %F4_MACO_TAB, End S

rhx-f4-objid-data.

SELECT-OPTIONS pchobjid FOR objec-realo NO INTERVALS. "Teilnehmer

PARAMETERS pchseark LIKE pchdy-seark. "Suchbegriff

PARAMETERS pchostat LIKE pchdy-ostat NO-DISPLAY. "Objektstatus

PARAMETERS pchistat LIKE pchdy-istat NO-DISPLAY. "Datenstatus

  • Strukturparameter

PARAMETERS pchwegid LIKE pchdy-wegid NO-DISPLAY.

PARAMETERS pchsvect LIKE pchdy-svect NO-DISPLAY.

PARAMETERS pchactiv LIKE pchdy-activ NO-DISPLAY.

PARAMETERS pchdepth LIKE pchdy-depth NO-DISPLAY.

PARAMETERS pchdymod LIKE t77s3-dymod NO-DISPLAY. "Dynp.variation

SELECTION-SCREEN END OF BLOCK b1.

--Block 1------

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

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


$$

ENHANCEMENT 1 ZIMP_BOOKING_PARTICIPANT. "active version

*SELECTION-SCREEN BEGIN OF BLOCK bb2.

PARAMETERS tpchdepth LIKE pchdy-depth NO-DISPLAY.

*SELECTION-SCREEN END OF BLOCK bb2.

ENDENHANCEMENT.

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


$$

rhx-obeg-radios-define.

-Block 2 (Aufbereitungsoption)-----

*SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-RB3.

PARAMETER : tc LIKE pp0j-tc_disp NO-DISPLAY.

*SELECTION-SCREEN END OF BLOCK B3.

10 REPLIES 10
Read only

Former Member
0 Likes
1,518

Hi Mark,

Lets reanalyse our situation here

the error says : "Between "DATA BEGIN OF' name" and "DATA END OF name" only data statements are allowed.

it is a declaration error

this implies somewhere in the program there is a declaration statement but in the wrong format

Do this -> use the Find(binaculor) icon on top and search for Begin of name...select radio button :in the main program..if you find it..check the syntax of it....if you got no results...comment all the changes done by you and activate to see if the same error comes...if the error does not come....please revert back

Reward if helpful

Regards

Byju

Read only

0 Likes
1,518

Hi Byju,

There are quite a number of standard include programs which have "begin of" data declaration. They are all SAP standard include programs and shouldn't have syntax errors. At the enhancement option that I added the enchancement codes, it shows "Struct. $PCH_TEXTPOOL_KEY, End". The declaration of $PCH_TEXTPOOL_KEY found in include RHXMACRO. If you see the code below, the statement rhx-obeg-radios-define which refer to a definition in RHXMACRO is right after the enhancement I added..

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

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


$$

ENHANCEMENT 1 ZIMP_BOOKING_PARTICIPANT. "active version

*SELECTION-SCREEN BEGIN OF BLOCK bb2.

*PARAMETERS tpchdepth LIKE pchdy-depth NO-DISPLAY.

*SELECTION-SCREEN END OF BLOCK bb2.

ENDENHANCEMENT.

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


$$

rhx-obeg-radios-define.

=================================================================

//codes extracted from RHXMACRO

DEFINE RHX-OBEG-RADIOS-DEFINE.

RHX-INT-RADIOS-DEFINE.

  • Datatime

PARAMETERS:

PCHBEGDA LIKE PCHDY-BEGDA NO-DISPLAY.

PARAMETERS:

PCHENDDA LIKE PCHDY-ENDDA NO-DISPLAY.

SELECTION-SCREEN END OF BLOCK FRAME2.

RHX-INT-RADIO-DATA.

END-OF-DEFINITION.

$$**RHX-INT-RADIOS-DEFINE*******************************************

DEFINE RHX-INT-RADIOS-DEFINE.

SELECTION-SCREEN BEGIN OF BLOCK FRAME2 WITH FRAME TITLE $TX$ZTST.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : PCHZTR_D LIKE PCHDY-ZTR_D

RADIOBUTTON GROUP $ZTR.

SELECTION-SCREEN COMMENT 4(17) $TX$ZTRD FOR FIELD PCHZTR_D

MODIF ID $ZT.

SELECTION-SCREEN POSITION 23.

PARAMETERS : PCHZTR_A LIKE PCHDY-ZTR_A

RADIOBUTTON GROUP $ZTR.

SELECTION-SCREEN COMMENT 26(17) $TX$ZTRA FOR FIELD PCHZTR_A

MODIF ID $ZT.

SELECTION-SCREEN POSITION 49.

PARAMETERS : PCHZTR_Z LIKE PCHDY-ZTR_Z

RADIOBUTTON GROUP $ZTR MODIF ID $Z1.

SELECTION-SCREEN COMMENT 52(17) $TX$ZTRZ FOR FIELD PCHZTR_Z

MODIF ID $Z1.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : PCHZTR_M LIKE PCHDY-ZTR_M

RADIOBUTTON GROUP $ZTR.

SELECTION-SCREEN COMMENT 4(17) $TX$ZTRM FOR FIELD PCHZTR_M

MODIF ID $ZT.

SELECTION-SCREEN POSITION 23.

PARAMETERS : PCHZTR_P LIKE PCHDY-ZTR_P

RADIOBUTTON GROUP $ZTR.

SELECTION-SCREEN COMMENT 26(17) $TX$ZTRP FOR FIELD PCHZTR_P

MODIF ID $ZT.

SELECTION-SCREEN PUSHBUTTON 49(30) $PS$ZTST

USER-COMMAND $STT MODIF ID $Z3.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : PCHZTR_Y LIKE PCHDY-ZTR_Y

RADIOBUTTON GROUP $ZTR.

SELECTION-SCREEN COMMENT 4(17) $TX$ZTRY FOR FIELD PCHZTR_Y

MODIF ID $ZT.

SELECTION-SCREEN POSITION 23.

PARAMETERS : PCHZTR_F LIKE PCHDY-ZTR_F

RADIOBUTTON GROUP $ZTR.

SELECTION-SCREEN COMMENT 26(17) $TX$ZTRF FOR FIELD PCHZTR_F

MODIF ID $ZT.

SELECTION-SCREEN PUSHBUTTON 49(30) $PS$ZTRZ

USER-COMMAND $ZTZ MODIF ID $Z2.

SELECTION-SCREEN END OF LINE.

  • Objecttime

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(30) $PA$OBEG FOR FIELD PCHOBEG

MODIF ID $ZO.

SELECTION-SCREEN POSITION POS_LOW.

PARAMETERS:

PCHOBEG LIKE PCHDY-OBEG MODIF ID $ZO.

SELECTION-SCREEN COMMENT 45(5) $PA$OEND FOR FIELD PCHOEND

MODIF ID $ZE.

PARAMETERS:

PCHOEND LIKE PCHDY-OEND MODIF ID $ZE.

SELECTION-SCREEN PUSHBUTTON 63(16) $PS$PZTR

USER-COMMAND $ZTR MODIF ID $ZR.

SELECTION-SCREEN END OF LINE.

  • pchtimed

PARAMETERS :

PCHTIMED LIKE PCHDY-TIMED NO-DISPLAY.

END-OF-DEFINITION.

DEFINE RHX-INT-RADIO-DATA.

DATA : $TIMED_FIRST_PBO VALUE '1'.

TABLES : SSCRFIELDS, T77MT.

DATA : BEGIN OF $PCH_TEXTPOOL OCCURS 1.

INCLUDE STRUCTURE TEXTPOOL.

DATA : END OF $PCH_TEXTPOOL.

DATA : $PCH_TEXTPOOL_LINES TYPE I.

DATA : BEGIN OF $PCH_TEXTPOOL_KEY,

ID LIKE TEXTPOOL-ID,

KEY LIKE TEXTPOOL-KEY,

END OF $PCH_TEXTPOOL_KEY.

DATA : $KEYDATE$(1) TYPE N.

DATA : $DAYNUM$ LIKE SCAL-INDICATOR.

DATA : $TXTID$ LIKE T77MT-TXTID.

END-OF-DEFINITION.

Read only

0 Likes
1,518

Hi Mark,

Even after commenting your code is the error still coming?

if so it necessarily doesn't mean SAP has to do syntax declaration error...some other programmers may also have tried the coding in any of the includes or the program and saved with syntax errors

Also in the error you must be getting a specific structure name for the error " data begin of name" syntax not correct..etc....eg:data begin of struct...you have to search for "data begin of struct" as a whole and not just the ABAP keywords "data begin of"

Your commented code seems fine..i believe the error was existing before you came in....just check for the entire statement in the search criterion and let me know if it works out

Also if you have 100 includes and atleasat one include has error ....and you try to activate a program using it...error will come ....

Regards

Byju

Read only

Former Member
0 Likes
1,518

Hi,

I think at that place, you have option for creating two type of enhancement implementation viz. declaration or code.

However declaration can be data declaration only. It can not be selection screen parameter.

That's why you got the message "Between "DATA BEGIN OF' name" and "DATA END OF name" only data statements are allowed.

G@urav.

Read only

0 Likes
1,518

Hi,

No error if I commented my code. The syntax error message doesn't specify what structure is that. When I first created the enhancement, no options like "declaration" or "code" available for me to choose. But if I created enchancement in other places of the program (start of a form or end of a form), I can see the options "declaration" or "code".

Thanks for quick reply.

Read only

Former Member
0 Likes
1,518

Hi,

Implicit enhancement of the report which is present at the top is for declaring your own data types are variables.

And the error you are getting is very much expected.

If you want to enhance selection screen then look for the explicit enhancement provided by SAP to add more fields if you dont find that means you can achieve this.

Reward points if you find it helpful.

Regards,

Prasanna

Read only

Former Member
0 Likes
1,518

Hi Mark,

i have tried and replicated your problem..i believe those implementations cannot be used..but there is one which can be )

do one thing,write your code in the implementation at the bottom in the implementation after "INCLUDE rhscmfor."

it comes on the screen at the bottom..maybe not the right location you want but you have it on the screen

see my test code below...p_test is coming on the selection screen at the bottom when executing the report...so hope that solves it

*----


*

  • Unterprogramme für Reports die nach Ttypen ausgewertet werden

INCLUDE rhscmfor.

*----


*

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$SE:(6 ) Include RHXBUCH0, End S

$$-Start: (6 )----

-


$$

ENHANCEMENT 1 ZTEST_CODE. "active version

parameters : p_test type c.

ENDENHANCEMENT.

$$-End: (6 )----

-


$$

reward if helpful

Regards

Byju

Read only

0 Likes
1,518

Hi Byju,

It works when I put the code at the bottom. But I encounter another problem when I tried to change the selection text for the parameter as the AT SELECTION-SCREEN OUTPUT is located at the top of the code, so I cannot refer the parameter AT SELECTION-SCREEN OUTPUT.

//syntax error where ptxt1 unknown

AT SELECTION-SCREEN OUTPUT.

ptxt1 = 'Active Employee'.

//ptxt1 declared here

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS p_active AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN COMMENT 4(22) ptxt1 FOR FIELD p_active.

SELECTION-SCREEN POSITION 27.

SELECTION-SCREEN end OF LINE.

Any Idea?

Read only

0 Likes
1,518

Hi mark,

do the following

first :create a data element and give it the text u need....

eg: ZZDIR' is dataelement in sell and you gave it text "directory"

in the code do the following

data:

int_dtel type rsseldtel occurs 0,

wa_dtel type rsseldtel.

wa_dtel-name = 'P_DIR'. "field for which u need the text change

wa_dtel-kind = 'P'. "p for parameters/s for select options

wa_dtel-datenelment = 'ZZDIR'. "give the name of data elememtfrom which the text has to be displayed

append wa_dtel to int_dtel.

*********************************************

then on calling the following your parameter/select option field will have required text of that data element

you can do it for more than one parameter/selection-screen by appending it to the internal table

call function 'SELECTION_TEXTS_MODIFY_DTEL'

exporting

program = sy-repid

tables

sel_dtel = int_dtel

exceptions

program_not_found = 1

program_cannot_be_generated = 2

others = 3.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

now "directory" will be name of the selection parameter on the screen

this will modify the name of the field in the selection screen

Reward if helpful please

Regards

Byju

Read only

0 Likes
1,518

Hi Byju,

Your method on changing selection texts should be applied at AT SELECTION-SCREEN OUTPUT, right?

My problem is finally solved when I change the text at INITIALIZATION.

PARAMETERS p_active AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN COMMENT 4(22) ptxt1 FOR FIELD p_active.

SELECTION-SCREEN POSITION 27.

INITIALIZATION.

ptxt1 = 'Active Employees'.

I am quite surprise that there can be two INITIALIZATION in the same program. The original program has already had INITIALIZATION.

Anyway, the function module 'SELECTION_TEXTS_MODIFY_DTEL' you recommend is very useful also. Good to learn that.

Thanks your help!