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: 

Disappear 'MANDT' field space in search help exit 'RECORD_TAB'

former_member359347
Discoverer
0 Kudos

I created search help 'ZMATNR'.
Basic secection process is database veiw 'ZMVMM0010'.
I added search help exit 'ZFMMM_SHLP_EXIT_MATNR'.
And I checked "RECORD_TAB" data on 'DISP' step.
Because I need to check the result.

At first, there was no problem.

This is "RESULT_TAB" data


The string start with three space character because I used 'ZMVMM0010' view.

This is usual.

But when I search one more time, "RECORD_TAB[]" was unusual.

↑ Search one more time.

This is "RESULT_TAB" data

3 space characters of "MANDT" are disappeared!!!

Is this search help bug?
I try to find "RECORD_TAB" readable FM, but I can't.

I resolve this situation as follow.

...

  IF CALLCONTROL-STEP EQ 'DISP'.
...

*   FILTERING THE RESULT
    LOOP AT RECORD_TAB.

*     CHECK FIRST SPACE
      IF RECORD_TAB-STRING(3) IS NOT INITIAL.

        RECORD_TAB-STRING = `   ` && RECORD_TAB-STRING.

      ENDIF.

      LS_LINE = RECORD_TAB-STRING.

      ...

      IF LS_LINE-SPOUT NET EQ 'BLABLABLA'.

        DELETE RECORD_TAB.

        CONTINUE.

      ENDIF.
   
    ENDLOOP.

    RETURN.

  ENDIF.

But I want to resolve this problem more clearly.
If there is the way to read "RECORD_TAB", I want to know.

Give me a hand plz...

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos

F4UT_PARAMETER_VALUE_GET (two usages: one is for reading RECORD_TAB, cf function module documentation)

2 REPLIES 2

Sandra_Rossi
Active Contributor
0 Kudos

F4UT_PARAMETER_VALUE_GET (two usages: one is for reading RECORD_TAB, cf function module documentation)

Thank you for your advise.

My objective was result filtering.
I resolve as follow.

  ...
  DATA : BEGIN OF LT_FILTER OCCURS 0,
           MTART TYPE MTART,   " TARGET TO FILTER 1
           SPOUT TYPE ZMSPECT, " TARGET TO FILTER 2
         END OF LT_FILTER.
  ...
  IF CALLCONTROL-STEP EQ 'DISP'.    
  ...
*   LOAD DATA TO FILTER 1
    CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET'
     EXPORTING
       PARAMETER         = 'MTART'
       FIELDNAME         = 'MTART'
     TABLES
       SHLP_TAB          = SHLP_TAB
       RECORD_TAB        = RECORD_TAB
       RESULTS_TAB       = LT_FILTER
     CHANGING
       SHLP              = SHLP
       CALLCONTROL       = CALLCONTROL.

*   LOAD DATA TO FILTER 2
    CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET'
     EXPORTING
       PARAMETER         = 'SPOUT'
       FIELDNAME         = 'SPOUT'
     TABLES
       SHLP_TAB          = SHLP_TAB
       RECORD_TAB        = RECORD_TAB
       RESULTS_TAB       = LT_FILTER
     CHANGING
       SHLP              = SHLP
       CALLCONTROL       = CALLCONTROL.

*   FILTERING
    LOOP AT LT_FILTER.
LV_TABIX = SY-TABIX.
* CHECK ONE IF LT_FILTER-SPOUT NE 'BLABLABAL'.
DELETE RECORD_TAB INDEX LV_TABIX.
DELETE LT_FILTER INDEX LV_TABIX.
CONTINUE. ENDIF. * CHECK TWO READ TABLE LT_MTART WITH KEY TABLE_LINE = LT_FILTER-MTART BINARY SEARCH. IF SY-SUBRC NE 0.
DELETE RECORD_TAB INDEX LV_TABIX.
DELETE LT_FILTER INDEX LV_TABIX. CONTINUE. ENDIF. ENDLOOP. RETURN. ENDIF.