Skip to Content
0
Former Member
Sep 03, 2007 at 11:21 AM

why no return value of seach help enhancement

16 Views

hi experts!

i have write some coding about seach help using function module,But there is not any reture value.What can I do to solve such problem.

TYPES: BEGIN OF st_lfa1,

lifnr LIKE lfa1-lifnr,

bukrs LIKE lfb1-bukrs,

END OF st_lfa1.

DATA: it_lfa1 TYPE STANDARD TABLE OF st_lfa1,

wa_lfa1 TYPE st_lfa1.

DATA: v_tabix LIKE sy-tabix.

RANGES: r_kunnr FOR lfa1-kunnr,

r_lifnr FOR lfa1-lifnr,

r_bukrs FOR lfb1-bukrs.

DATA: rc TYPE i,

wa_selopt TYPE ddshselopt.

FREE: r_lifnr,r_bukrs.

LOOP AT shlp-selopt INTO wa_selopt.

CASE wa_selopt-shlpfield.

WHEN 'LIFNR'.

r_lifnr-sign = wa_selopt-sign.

r_lifnr-option = wa_selopt-option.

r_lifnr-low = wa_selopt-low.

r_lifnr-high = wa_selopt-high.

APPEND r_lifnr.

CLEAR r_lifnr.

WHEN 'BUKRS'.

r_bukrs-sign = wa_selopt-sign.

r_bukrs-option = wa_selopt-option.

r_bukrs-low = wa_selopt-low.

r_bukrs-high = wa_selopt-high.

APPEND r_bukrs.

CLEAR r_bukrs.

WHEN OTHERS.

MESSAGE wa_selopt-shlpfield TYPE 'I'.

ENDCASE.

ENDLOOP.

CASE callcontrol-step.

WHEN 'SELECT'.

SELECT lfa1lifnr lfb1bukrs

INTO TABLE it_lfa1

FROM lfa1 INNER JOIN lfb1

ON lfa1lifnr = lfb1lifnr

WHERE lfa1~lifnr IN r_lifnr AND

lfb1~bukrs IN r_bukrs.

CHECK sy-subrc = 0.

DELETE ADJACENT DUPLICATES FROM it_lfa1.

LOOP AT it_lfa1 INTO wa_lfa1.

v_tabix = sy-tabix.

SELECT SINGLE lifnr FROM lfb1

INTO wa_lfa1-lifnr

WHERE lifnr = wa_lfa1-lifnr.

MOVE wa_lfa1 TO record_tab-string.

APPEND record_tab.

CLEAR record_tab.

MODIFY it_lfa1 FROM wa_lfa1 INDEX v_tabix.

CLEAR wa_lfa1.

ENDLOOP.

rc = 0.

IF rc = 0.

callcontrol-step = 'DISP'.

ELSE.

callcontrol-step = 'EXIT'.

ENDIF.

EXIT. "Don't process STEP DISP additionally in this call.

WHEN 'SELONE'.

MESSAGE cc TYPE 'I'.

WHEN 'RETURN'.

WHEN 'DISP'.

  • MESSAGE cc TYPE 'I'.

WHEN 'PRESEL1'.

  • MESSAGE dd TYPE 'I'.

WHEN OTHERS.

  • MESSAGE ee TYPE 'I'.

ENDCASE.