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

Dynamic values in selection screen

Former Member
0 Likes
1,750

Hi all

I need to do one task in which I have to display 2 selection screen fields e.g IDNUMBER and CITY.Whenever user selects a value from the search help of IDNUMBER OR CITY fields I have to display tha other values which are in the search help along with these IDNUMBER and CITY values.For e.g in search help if we have 0001 nnnn ttt if we selct the IDNUMBER as 0001 then I need to display nnn and ttt on the selection screen in the same row of IDNUMBER by giving space.Please tellme how to do this.

Thank You.

Regards

Giri.

7 REPLIES 7
Read only

Former Member
0 Likes
1,019

Hi Giri,

For the selectoption which u r going to select add a USERCOMMAND

so when ever u select the one record in the search help the user command will triger. so that u can handile it AT SELECTION SCREEN event.

Regards,

Sunil

Read only

0 Likes
1,019

Hi Sunil

Will you please explain to me indetail.

Thank You.

Regards

Giri.

Read only

Former Member
0 Likes
1,019

Hi,

In the AT SELECTION-SCREEN event, you will get the IDNUMBER values which is selected from the Search help, if you have the other value then move that to CITY and update the Selection scrren with that value. if you do not get the City value then write a simple select to get the correct value and move it to the selection screen field CITY and update the Selection screen using 'DYNP_VALUES_UPDATE'

Regards

Sudheer

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,019

Hi,

You want to display the otehr fields value's in a seperate input filed or label or in the same input filed as the IDNUMBER. I mean you want to append IDNUMBER and other fields seperated by space and then show it on to the IDNUMBER FIELD?.

If this is the case then first you need to see if IDNUMBER field can hold data of length which is equal to the combined lenght of all the fileds, if this is possible then you can take the other values into corresponding fields and then in PBO append them on to the IDNUMBER field.

If you just want to display them using a LABEL then you just need to add labels to the screen and assign then the type of the fileds that are exported from the search help.

Regards,

Sesh

Read only

Former Member
0 Likes
1,019

Use the at-selection event and search help exit.

You acn take of following sample code:-

*attach search help to field1

at selection-screen on value-request for filed1.

perform f_search_help1 changing field1.

at selection-screen on value-request for field2.

perform f_search_help2 changing field2.

&----


*& Form f_search_help1

&----


  • text

----


FORM f_search_help1 CHANGING P_FIELD1.

*Search help data declaration

FIELD-SYMBOLS: <retval> TYPE ddshretval.

*Data declaration to hold return value and pass field name.

DATA: l_return_tab TYPE TABLE OF ddshretval INITIAL SIZE 1.

*internal table to hold the values

DATA: begin of l_ITAB occurs 0,

***include field

end of l_prodh.

*Populate internal table

select fields

from tables into your i_ITAB internal table.

*call search help function module.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'FIELD1'

value_org = 'S'

TABLES

value_tab = l_ITAB

return_tab = l_return_tab

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

*if successful only then pass the value

IF sy-subrc = 0.

READ TABLE l_RETURN_TAB INDEX 1 ASSIGNING <retval>.

IF sy-subrc = 0.

P_FIELD1 = <retval>-fieldval.

ENDIF.

ENDIF.

ENDFORM.

Read only

Former Member
0 Likes
1,019

Hi Giri,

The process will be like this.

If you know how to use the FM F4IF_INT_TABLE_VALUE_REQUEST then

the process to display the search help with the values depending on the value in other field is if you have idnumber then make aselect statement which selects the values of city based on idnumber.

now place this values in the internal table.

Now AT SELECTION SCREEN ON VALUE REQUEST FOR CITY.

PASS THE VALUES OF INTERNAL TABLE TO F4IF_INT_TABLE_VALUE_REQUEST. NOW YOU WILL BE ABLE TO DIAPLSY THE VALUES OF CITY BASED ON IDNUMBER

BR,

RAVI

Read only

Former Member
0 Likes
1,019

Hi giri,

here a short example:

TABLES: MARA.

*

PARAMETERS: P_MTART LIKE MARA-MTART.

PARAMETERS: P_MATNR LIKE MARA-MATNR.

*

DATA: DYNFIELDS TYPE TABLE OF DYNPREAD WITH HEADER LINE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MTART.

P_MATNR = '592'. "here your own matchcode

P_MTART = 'KAUF'.

*

DYNFIELDS-FIELDNAME = 'P_MTART'.

dynfields-FIELDVALUE = p_mtart.

APPEND DYNFIELDS.

DYNFIELDS-FIELDNAME = 'P_MATNR'.

dynfields-FIELDVALUE = p_matnr.

APPEND DYNFIELDS.

*

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

DYNAME = SY-REPID

DYNUMB = SY-DYNNR

TABLES

DYNPFIELDS = DYNFIELDS.

*

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.

P_MATNR = '400'. "here your own matchcode

P_MTART = 'DIEN'.

*

DYNFIELDS-FIELDNAME = 'P_MTART'.

dynfields-FIELDVALUE = p_mtart.

APPEND DYNFIELDS.

DYNFIELDS-FIELDNAME = 'P_MATNR'.

dynfields-FIELDVALUE = p_matnr.

APPEND DYNFIELDS.

*

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

DYNAME = SY-REPID

DYNUMB = SY-DYNNR

TABLES

DYNPFIELDS = DYNFIELDS.

*

regards, Dieter