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

F4IF_SHLP_EXIT_EXAMPLE

Former Member
0 Likes
862

Hello everyone...

I have used this FM to delete duplicate enteries in report problem is there that string havig spaces or . disffrence are not deleted..

Is their any other function module to create Search Help with unique enteries.

For Ex..

Abhishek Kokk
Abhishek  Kokk

As their is space diffrence in both string duplicate enteries are not deleted in search help.

Thnx in advance..

Edited by: Thomas Zloch on Jun 1, 2010 11:33 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
768

Hi,

You can also try this FM 'F4IF_INT_TABLE_VALUE_REQUEST'.

Remove dulplicate entries from value table.

Sort value table by particular field and then Delete adjacent duplidate....

Example.

SELECT SINGLE lgnum lgtyp

FROM lein

INTO (lv_lgnum , lv_lgtyp)

WHERE lenum = gv_hu_num.

SELECT lgpla

FROM lagp

INTO TABLE lt_bin

WHERE lgnum = lv_lgnum

AND lgtyp = lv_lgtyp

AND kzler = 'X'. "Empty BIN

IF lt_bin IS NOT INITIAL.

wa_field_tab-tabname = 'LAGP'.

wa_field_tab-fieldname = 'LGPLA'.

APPEND wa_field_tab TO lt_field_tab.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'LGPLA'

dynpprog = sy-repid

dynpnr = '9020'

value_org = 'C'

TABLES

value_tab = lt_bin

field_tab = lt_field_tab

return_tab = lt_return_tab

EXCEPTIONS

parameter_error = 1

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

IF sy-subrc = 0 AND lt_return_tab IS NOT INITIAL.

READ TABLE lt_return_tab INTO wa_return_tab INDEX 1.

gv_nlpla = wa_return_tab-fieldval.

ENDIF.

ELSE.

MESSAGE i042(z_axi). "'No BIN Available' TYPE 'I'.

ENDIF.

Ashutosh.

Hello everyone...

I have used this FM to delete duplicate enteries in report problem is there that string havig spaces or . disffrence are not deleted..

Is their any other function module to create Search Help with unique enteries.

For Ex..

Abhishek Kokk
Abhishek  Kokk

As their is space diffrence in both string duplicate enteries are not deleted in search help.

Thnx in advance..

Edited by: Thomas Zloch on Jun 1, 2010 11:33 AM

3 REPLIES 3
Read only

Former Member
0 Likes
769

Hi,

You can also try this FM 'F4IF_INT_TABLE_VALUE_REQUEST'.

Remove dulplicate entries from value table.

Sort value table by particular field and then Delete adjacent duplidate....

Example.

SELECT SINGLE lgnum lgtyp

FROM lein

INTO (lv_lgnum , lv_lgtyp)

WHERE lenum = gv_hu_num.

SELECT lgpla

FROM lagp

INTO TABLE lt_bin

WHERE lgnum = lv_lgnum

AND lgtyp = lv_lgtyp

AND kzler = 'X'. "Empty BIN

IF lt_bin IS NOT INITIAL.

wa_field_tab-tabname = 'LAGP'.

wa_field_tab-fieldname = 'LGPLA'.

APPEND wa_field_tab TO lt_field_tab.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'LGPLA'

dynpprog = sy-repid

dynpnr = '9020'

value_org = 'C'

TABLES

value_tab = lt_bin

field_tab = lt_field_tab

return_tab = lt_return_tab

EXCEPTIONS

parameter_error = 1

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

IF sy-subrc = 0 AND lt_return_tab IS NOT INITIAL.

READ TABLE lt_return_tab INTO wa_return_tab INDEX 1.

gv_nlpla = wa_return_tab-fieldval.

ENDIF.

ELSE.

MESSAGE i042(z_axi). "'No BIN Available' TYPE 'I'.

ENDIF.

Ashutosh.

Read only

0 Likes
768

Thnx for ur quick reply but i am not able to understand how can i get unique values.

Read only

0 Likes
768

Hi,

Unique value for what .

Lets say you stored all data in a internal table.

sort the table from key fields then delete duplicate entries.

and finally pass the table into FM.

You probably have same text with different space .

Now I will take you example to explain this.

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

DATA : gt_data TYPE TABLE OF string,

gs_data TYPE string,

lt_data TYPE TABLE OF string,

ls_data TYPE string.

gs_data = 'Abhishek Kokk'.

APPEND gs_data TO gt_data.

gs_data = 'Abhishek Kokk'.

APPEND gs_data TO gt_data.

gs_data = 'Abhishek Kokk'.

APPEND gs_data TO gt_data.

gs_data = 'Abhishek Kokk'.

APPEND gs_data TO gt_data.

gs_data = 'Abhishek Kokk'.

APPEND gs_data TO gt_data.

LOOP AT gt_data INTO gs_data.

SPLIT gs_data AT space INTO TABLE lt_data.

CLEAR gs_data.

LOOP AT lt_data INTO ls_data.

IF ls_data IS NOT INITIAL.

CONDENSE ls_data NO-GAPS.

TRANSLATE ls_data TO UPPER CASE.

IF gs_data IS NOT INITIAL.

CONCATENATE gs_data ls_data INTO gs_data SEPARATED BY space.

ELSE.

gs_data = ls_data.

ENDIF.

ENDIF.

ENDLOOP.

MODIFY gt_data FROM gs_data.

ENDLOOP.

DELETE ADJACENT DUPLICATES FROM gt_data.

IF sy-subrc EQ 0.

ENDIF.

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

Hope this will solve you problem.

Ashutosh.