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

search help

Former Member
0 Likes
316

i have few date details in my internal table.Now want to display this data as a search help using a FM.

DATA: BEGIN OF it_h OCCURS 0.

INCLUDE STRUCTURE p0028.

DAta : END OF it_h.

DATA: BEGIN OF field_tab OCCURS 10.

INCLUDE STRUCTURE help_value.

DATA: END OF field_tab.

DATA: helpfield(30).

DATA : so_DATE LIKE PA0028-EXDAT.

*PA0000-pernr = PA0000-pernr.

IF FLAG = 'HG'.

SELECT exdat into it_h-exdat

FROM pa0028

WHERE pernr eq PA0000-pernr

and sprps = ''.

append it_h.

endselect.

CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'

EXPORTING

fieldname = 'EXDAT'

tabname = 'PA0028'

title_in_values_list = 'Select a value'

IMPORTING

select_value = so_DATE

select_value = PA0028-EXDAT

TABLES

fields = field_tab

valuetab = it_h

EXCEPTIONS

field_not_in_ddic = 01

more_then_one_selectfield = 02

no_selectfield = 03.

ENDIF.

Now in my module pool screen where i'll define this it_h.

I have values in it_h.Now at screen level where this shuld be dinfine.

My screen field name is PA0028-EXDAT.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
289

Hi,

if it_lifnr[] is initial.

    select * from lfa1 where "lifnr = itabh-lifnr AND
                             ktokk in ('LIEF','PLNT','BEMP','EMPL','HR','CUST').
      if sy-subrc eq 0.
        move lfa1-lifnr to it_lifnr-lifnr.
        move lfa1-name1 to it_lifnr-name1.
      else.
        clear : it_lifnr-lifnr,it_lifnr-name1.
      endif.
      append it_lifnr.
    endselect.
    sort it_lifnr by lifnr.

  endif.

  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
      retfield        = 'LIFNR'
      dynpprog        = sy-repid
      dynpnr          = sy-dynnr
      dynprofield     = 'ITABH-LIFNR'
      window_title    = 'Vendor Account Number'
      value_org       = 'S'
    tables
      value_tab       = it_lifnr
    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.

Regards,

V.Balaji

Reward if Usefull...

i have few date details in my internal table.Now want to display this data as a search help using a FM.

DATA: BEGIN OF it_h OCCURS 0.

INCLUDE STRUCTURE p0028.

DAta : END OF it_h.

DATA: BEGIN OF field_tab OCCURS 10.

INCLUDE STRUCTURE help_value.

DATA: END OF field_tab.

DATA: helpfield(30).

DATA : so_DATE LIKE PA0028-EXDAT.

*PA0000-pernr = PA0000-pernr.

IF FLAG = 'HG'.

SELECT exdat into it_h-exdat

FROM pa0028

WHERE pernr eq PA0000-pernr

and sprps = ''.

append it_h.

endselect.

CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'

EXPORTING

fieldname = 'EXDAT'

tabname = 'PA0028'

title_in_values_list = 'Select a value'

IMPORTING

select_value = so_DATE

select_value = PA0028-EXDAT

TABLES

fields = field_tab

valuetab = it_h

EXCEPTIONS

field_not_in_ddic = 01

more_then_one_selectfield = 02

no_selectfield = 03.

ENDIF.

Now in my module pool screen where i'll define this it_h.

I have values in it_h.Now at screen level where this shuld be dinfine.

My screen field name is PA0028-EXDAT.

1 REPLY 1
Read only

Former Member
0 Likes
290

Hi,

if it_lifnr[] is initial.

    select * from lfa1 where "lifnr = itabh-lifnr AND
                             ktokk in ('LIEF','PLNT','BEMP','EMPL','HR','CUST').
      if sy-subrc eq 0.
        move lfa1-lifnr to it_lifnr-lifnr.
        move lfa1-name1 to it_lifnr-name1.
      else.
        clear : it_lifnr-lifnr,it_lifnr-name1.
      endif.
      append it_lifnr.
    endselect.
    sort it_lifnr by lifnr.

  endif.

  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
      retfield        = 'LIFNR'
      dynpprog        = sy-repid
      dynpnr          = sy-dynnr
      dynprofield     = 'ITABH-LIFNR'
      window_title    = 'Vendor Account Number'
      value_org       = 'S'
    tables
      value_tab       = it_lifnr
    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.

Regards,

V.Balaji

Reward if Usefull...