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

initializing a field in search help

Former Member
0 Likes
614

I have a selection screen with some select options, first being the LOGICAL SYSTEM

the second one has a search help

This search help has three parameters logical system, storage location and description.

The requirement is to initialize the search help parameter logical system with value entered for the first parameter on the selection screen.

Pl let me know how to handle this

Thanx in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
524

Here is one way (but it has a downside):

Define the Logical system field within your search help so that it contains a "Default value" that is the ID of a GET parameter. Assign the same GET parameter ID to the selection screen parameter for logical system. After the user enters a logical system in the first selection screen parameter, the search help will get its default from the GET parameter ID value.

The downside to this solution is that the user must press Enter (or some other function) prior to selecting the drop-down (F4) on the second parameter. Otherwise a newly entered logical system value will not be transferred to the GET parameter ID. If the user does not press Enter, then the previous GET parameter ID value will be displayed in the search help instead of the newly entered one.

The might be a more elegant solution, but I figured I'd pass this along for you to try out.

Regards,

James G.

Here is one way (but it has a downside):

Define the Logical system field within your search help so that it contains a "Default value" that is the ID of a GET parameter. Assign the same GET parameter ID to the selection screen parameter for logical system. After the user enters a logical system in the first selection screen parameter, the search help will get its default from the GET parameter ID value.

The downside to this solution is that the user must press Enter (or some other function) prior to selecting the drop-down (F4) on the second parameter. Otherwise a newly entered logical system value will not be transferred to the GET parameter ID. If the user does not press Enter, then the previous GET parameter ID value will be displayed in the search help instead of the newly entered one.

The might be a more elegant solution, but I figured I'd pass this along for you to try out.

Regards,

James G.

2 REPLIES 2
Read only

Former Member
0 Likes
525

Here is one way (but it has a downside):

Define the Logical system field within your search help so that it contains a "Default value" that is the ID of a GET parameter. Assign the same GET parameter ID to the selection screen parameter for logical system. After the user enters a logical system in the first selection screen parameter, the search help will get its default from the GET parameter ID value.

The downside to this solution is that the user must press Enter (or some other function) prior to selecting the drop-down (F4) on the second parameter. Otherwise a newly entered logical system value will not be transferred to the GET parameter ID. If the user does not press Enter, then the previous GET parameter ID value will be displayed in the search help instead of the newly entered one.

The might be a more elegant solution, but I figured I'd pass this along for you to try out.

Regards,

James G.

Read only

Laxmana_Appana_
Active Contributor
0 Likes
524

Hi

This can be done using search help exit.

declare the search help exit FM in search help, in that exit read the contents of the screen field and pass the values into search help fields.

sample code :

P_CUST is the selection screen parameter

ZOFFRCONT is search help field

FUNCTION z_test_shelp_exit.

*"----


""Local interface:

*" TABLES

*" SHLP_TAB TYPE SHLP_DESCT

*" RECORD_TAB STRUCTURE SEAHLPRES

*" CHANGING

*" VALUE(SHLP) TYPE SHLP_DESCR

*" VALUE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL

*"----


DATA : ws_flag(1) TYPE c,

ws_rec(1) TYPE c.

DATA : i_dynpfields TYPE dynpread OCCURS 0 WITH HEADER LINE.

DATA : ws_data TYPE ddshiface,

i_data TYPE ddshifaces.

ws_flag = 'X'.

ws_rec = 'X'.

IF ws_flag = 'X'.

i_dynpfields-fieldname = 'P_CUST'.

APPEND i_dynpfields.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-cprog

dynumb = '1000'

TABLES

dynpfields = i_dynpfields

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

invalid_parameter = 7

undefind_error = 8

double_conversion = 9

stepl_not_found = 10

OTHERS = 11.

READ TABLE i_dynpfields WITH KEY fieldname = 'P_CUST'.

ws_data-shlpfield = 'ZCUSTOMER'.

ws_data-valfield = 'G_SIMFIELDS-FIELDNAME'.

ws_data-value = i_dynpfields-fieldvalue.

APPEND ws_data TO i_data.

ws_data-shlpfield = 'ZOFFRCONT'.

ws_data-valfield = 'P_CONT'.

ws_data-f4field = 'X'.

APPEND ws_data TO i_data.

LOOP AT shlp_tab.

IF ws_rec = 'X'.

shlp_tab-interface[] = i_data[].

APPEND shlp_tab.

ws_rec = ' '.

ENDIF.

ENDLOOP.

DELETE shlp_tab INDEX 1.

ws_flag = ' '.

ENDIF.

ENDFUNCTION.

still you have problem , copy your code , i will check.

Please Dont forget to reward points if answer is helpful to you.