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: 

Search help for a field in table control based on another field value

Former Member
0 Kudos

Hi,

I want to attach the Search help for a field in table control based on another field value.

Please help me asap.

Will be highly rewarded for the perfect ones

2 REPLIES 2

ganesh_padala2
Explorer
0 Kudos

Hi,

Below is the code for what you want to do,

In my table control ZITAB i have two columns progname and zvariant, based on progname I have to get variants for that program when help is requested in variant field. basically use the FM 'DYNP_VALUES_READ' to get the value of other field.

below is the code, mail me if you find it difficult to understand

MODULE show_variants INPUT.

DATA: lt_field TYPE STANDARD TABLE OF dynpread,

lw_field TYPE dynpread.

DATA: f1 TYPE string.

FIELD-SYMBOLS: <lfs_field> TYPE dynpread.

GET CURSOR LINE sy-tfill.

REFRESH lt_field.

f1 = sy-tfill.

CONCATENATE 'ZITAB-PROGNAME(0' f1 ')' INTO

lw_field-fieldname.

CONDENSE lw_field-fieldname NO-GAPS.

APPEND lw_field TO lt_field.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-repid

dynumb = sy-dynnr

translate_to_upper = 'X'

TABLES

dynpfields = lt_field

EXCEPTIONS

OTHERS = 11.

IF sy-subrc EQ 0.

READ TABLE lt_field ASSIGNING <lfs_field> INDEX 1.

IF <lfs_field> IS ASSIGNED.

ZITAB-progname = <lfs_field>-fieldvalue.

UNASSIGN <lfs_field>.

ENDIF.

ENDIF.

CALL FUNCTION 'RS_VARIANT_CATALOG'

EXPORTING

report = ZITAB-progname

IMPORTING

sel_variant = ZITAB-zvariant

EXCEPTIONS

no_variants = 01

OTHERS = 02.

ENDMODULE. " show_variants INPUT

Former Member
0 Kudos

Closed