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 in table control

Former Member
0 Kudos
1,592

HI,

i am trying to add a search help for a field in table control.

i need a dynamic value in the next field based on the selected value.

like... in table control i have matnr and maktx ..

when i select matnr ...i need maktx also in the same line.. but i am getting in last line...

how can i control the position of the cursor.

after selecting a value when i press enter or any clcik on screen leads to delete values in screen. let me know if anybody come across this issue.

Regards

Giri

1 ACCEPTED SOLUTION

Former Member
0 Kudos
177

Hi,

Two ways to do this.

<b> If you have already defined search help for that filed you can use attaching search help in the Screen attributes in SE51.</b>

<b>Second way is programitically you can do thos.</b>

in the Flow logic call:

  • Value Request

PROCESS ON VALUE-REQUEST.

Field dt_members-PERNR :

MODULE DISPLAY_PERNR.

REFRESH: dt_fields, dt_contents.

dt_fields-tabname = 'PA0001'.

dt_fields-fieldname = 'PERNR'.

dt_fields-selectflag = c_x.

APPEND dt_fields.

CLEAR dt_fields.

dt_fields-tabname = 'PA0001'.

dt_fields-fieldname = 'ENAME'.

APPEND dt_fields.

CLEAR dt_fields.

CLEAR dt_contents.

  • Select from PA0001

SELECT pernr

ename

INTO TABLE dt_contents

FROM pa0001.

IF sy-subrc = 0.

SORT dt_contents BY pernr.

DELETE ADJACENT DUPLICATES FROM dt_contents

COMPARING pernr.

  • Give F4 help

CALL FUNCTION 'HELP_VALUES_GET_NO_DD_NAME'

EXPORTING

selectfield = 'PERNR'

titel = 'Member PERNR'(028)

IMPORTING

ind = dg_ind

TABLES

fields = dt_fields

full_table = dt_contents

EXCEPTIONS

full_table_empty = 1

no_tablestructure_given = 2

no_tablefields_in_dictionary = 3

more_then_one_selectfield = 4

no_selectfield = 5

OTHERS = 6.

IF sy-subrc EQ 0.

READ TABLE dt_contents INDEX dg_ind transporting pernr.

dt_members-pernr = dt_contents-pernr.

ENDIF.

ELSE.

MESSAGE s999 WITH 'No Help Values Found for Primary Contact ID'(012).

ENDIF.

Please reward if useful

4 REPLIES 4

Former Member
0 Kudos
177

In your process after Input, you should loop the internal table that you are using for your table control, so you can trigger the module for where the matnr value was changed/input.

PAI

loop at itab_control.

field itab_control-matnr

module display_maktx on request.

endloop.

-


module display_maktx.

" Do a look up on makt using current line matnr.

perform get_maktx using itab_control-matnr

changing itab_control-maktx.

" modify current line in table control loop.

modify itab-control index tab_control-current_line.

endmodule.

This should give you an idea on an approach for you to use. Also, if you need to find out the current line in a table control, in your module you can use "GET CURSOR LINE LV_LINE", (where lv_line is of type n(2)).

However if you use the module in a table control loop as shown above, then you are operating on the updated row so you don't need to figure out what row you are on since you can refer to the "current_line" of the table control.

Former Member
0 Kudos
178

Hi,

Two ways to do this.

<b> If you have already defined search help for that filed you can use attaching search help in the Screen attributes in SE51.</b>

<b>Second way is programitically you can do thos.</b>

in the Flow logic call:

  • Value Request

PROCESS ON VALUE-REQUEST.

Field dt_members-PERNR :

MODULE DISPLAY_PERNR.

REFRESH: dt_fields, dt_contents.

dt_fields-tabname = 'PA0001'.

dt_fields-fieldname = 'PERNR'.

dt_fields-selectflag = c_x.

APPEND dt_fields.

CLEAR dt_fields.

dt_fields-tabname = 'PA0001'.

dt_fields-fieldname = 'ENAME'.

APPEND dt_fields.

CLEAR dt_fields.

CLEAR dt_contents.

  • Select from PA0001

SELECT pernr

ename

INTO TABLE dt_contents

FROM pa0001.

IF sy-subrc = 0.

SORT dt_contents BY pernr.

DELETE ADJACENT DUPLICATES FROM dt_contents

COMPARING pernr.

  • Give F4 help

CALL FUNCTION 'HELP_VALUES_GET_NO_DD_NAME'

EXPORTING

selectfield = 'PERNR'

titel = 'Member PERNR'(028)

IMPORTING

ind = dg_ind

TABLES

fields = dt_fields

full_table = dt_contents

EXCEPTIONS

full_table_empty = 1

no_tablestructure_given = 2

no_tablefields_in_dictionary = 3

more_then_one_selectfield = 4

no_selectfield = 5

OTHERS = 6.

IF sy-subrc EQ 0.

READ TABLE dt_contents INDEX dg_ind transporting pernr.

dt_members-pernr = dt_contents-pernr.

ENDIF.

ELSE.

MESSAGE s999 WITH 'No Help Values Found for Primary Contact ID'(012).

ENDIF.

Please reward if useful

Former Member
0 Kudos
177

hi

<b>to control the cursor position</b>

At PBO Event

SET CURSOR FIELD <f> LINE <lin> [OFFSET <off>].

(For setting Cursor Position on Table Control row)

<b>Using the optional addition OFFSET, you can enter the offset of the cursor in the field as described under Setting the Cursor Position</b>

regards

ravish

<b>plz reward points if helpful</b>

Former Member
0 Kudos
177

hi

<b>to control the cursor position</b>

At PBO Event

SET CURSOR FIELD <f> LINE <lin> [OFFSET <off>].

(For setting Cursor Position on Table Control row)

<b>Using the optional addition OFFSET, you can enter the offset of the cursor in the field as described under Setting the Cursor Position</b>

regards

ravish

<b>plz reward points if helpful</b>