Skip to Content
0

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

Aug 24, 2017 at 05:27 AM

53

avatar image
Former Member

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...

shlp-01.jpg (299.4 kB)
shlp-02.jpg (66.9 kB)
shlp-03.jpg (139.4 kB)
shlp-04.jpg (79.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Sandra Rossi Aug 24, 2017 at 06:45 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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.
1