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: 

URGENT: Matchcode - RECORD_TAB clears itself (search help exit)

Former Member
0 Kudos

Hi,

For my matchcode, i have to do the following inside the search help exit (only following section is changed):

IF CALLCONTROL-STEP = 'DISP'.

CLEAR: RECORD_TAB.

REFRESH: RECORD_TAB.

DATA: I_KNVV TYPE STANDARD TABLE OF KNVV WITH HEADER LINE.

SELECT * INTO TABLE I_KNVV FROM KNVV

WHERE EIKTO <> SPACE

AND EIKTO <> '0'.

SORT I_KNVV BY EIKTO.

delete adjacent duplicates from I_KNVV comparing EIKTO.

LOOP AT I_KNVV.

RECORD_TAB-STRING = I_KNVV-EIKTO.

APPEND RECORD_TAB.

ENDLOOP.

EXIT.

ENDIF.

ENDFUNCTION.

-


However, after it loops, it goes into include LSDH4F02 in program SAPLSDH4 and starting at line 534, it deletes all of the entries from record_tab (rather, it overwrites them with blank values!)

How do i make this work, since record_tab is filled correctly.

Thanks,

John

1 REPLY 1

Former Member
0 Kudos

You need to add extra code in your search help exit.

You can see my search help exit and do compare.

if you do not understand ,paste ur email id ,i will send you screen shot's about search help exit.

FUNCTION Z_F4_EXIT_PROJECT.

*"----


""Local interface:

*" TABLES

*" SHLP_TAB TYPE SHLP_DESCR_TAB_T

*" RECORD_TAB STRUCTURE SEAHLPRES

*" CHANGING

*" VALUE(SHLP) TYPE SHLP_DESCR_T

*" VALUE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL

*"----


  • Author : Seshu Maramreddy (Wipro Technologies)

  • Date : 15 April 2003

  • Transport: DV3K905213

  • Text : This function module provides an exit for the search help

  • on the Project field in the Engineering Test Request

  • application (transactions ZQAU, ZQEM, ZQTR, and ZQTRPP).

  • See the standard SAP function module F4IF_SHLP_EXIT_EXAMPLE

  • for a detailed explanation of how search help exit function

  • modules work.

----


  • Changes *

----


  • Date | Pgmr | Description *

----


  • | | *

----


      • Possible events are SELONE, PRESEL1, PRESEL, SELECT, DISP, and

  • RETURN; we only want to process the SELECT event

CHECK CALLCONTROL-STEP <> 'SELONE'

AND CALLCONTROL-STEP <> 'PRESEL1'

AND CALLCONTROL-STEP <> 'PRESEL'

AND CALLCONTROL-STEP <> 'DISP'

AND CALLCONTROL-STEP <> 'RETURN'.

REFRESH: R_AUFNR,

R_KTEXT.

      • Populate ranges with the information entered by the user in the

  • search help data selection screen

LOOP AT SHLP-SELOPT INTO SELOPT.

CASE SELOPT-SHLPFIELD.

WHEN C_SHLPFIELD_KO.

KOKRS = SELOPT-LOW.

WHEN C_SHLPFIELD_TL.

MOVE-CORRESPONDING SELOPT TO R_KTEXT.

APPEND R_KTEXT.

WHEN C_SHLPFIELD_TR.

MOVE-CORRESPONDING SELOPT TO R_AUFNR.

APPEND R_AUFNR.

ENDCASE.

ENDLOOP.

CALL FUNCTION 'Z_GET_ENG_PROJECTS'

EXPORTING

I_KOKRS = KOKRS

TABLES

T_SETVALUES = T_SETVALUES.

REFRESH RECORD_TAB.

DELETE T_SETVALUES WHERE NOT FROM IN R_AUFNR.

LOOP AT T_SETVALUES.

CLEAR RECORD_TAB.

RECORD_TAB-STRING(12) = T_SETVALUES-FROM.

      • Get the description of the current engineering order

SELECT SINGLE KTEXT FROM AUFK

INTO RECORD_TAB-STRING+12(40)

WHERE AUFNR = T_SETVALUES-FROM.

CHECK RECORD_TAB-STRING+12(40) IN R_KTEXT.

APPEND RECORD_TAB.

ENDLOOP.

READ TABLE RECORD_TAB INDEX 1.

IF SY-SUBRC = 0.

CALLCONTROL-STEP = 'DISP'.

ELSE.

CALLCONTROL-STEP = 'PRESEL'.

MESSAGE S802(DH).

EXIT.

ENDIF.

MAXRECORDS = CALLCONTROL-MAXRECORDS.

PERFORM CHECK_MAXRECORDS TABLES RECORD_TAB.

ENDFUNCTION.

FORM CHECK_MAXRECORDS TABLES P_RECORDTAB STRUCTURE SEAHLPRES.

CHECK MAXRECORDS > 0.

DESCRIBE TABLE P_RECORDTAB LINES RECORDS.

CHECK RECORDS > MAXRECORDS.

MESSAGE S803(DH) WITH MAXRECORDS.

ADD 1 TO MAXRECORDS.

DELETE P_RECORDTAB FROM MAXRECORDS.

ENDFORM. " CHECK_MAXRECORDS

Thanks

Seshu