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

At selection-screen on value-request, at selection-screen on

former_member125661
Contributor
0 Likes
899

I have 2 selection-screen options :

s_region and

s_state .

Here Region would mean North,South,East,West

I have At selection-screen on value request for both of these selection options.

But when I click F4 for s_state, I want to capture the selection made by user on s_region so that I only query for states under region. For eg: if South was chosen, I only want to bring up states in South Region.

I have both at selection-screen on and at selection-screen on value-request. But when I type South for s_region and press F4 for s_state, the internal table s_region[] is not filled in 'At selection-screen on value request for s_state-low . This is because at selection-screen on value-request is called before at selection-screen on - event. Only at selection-screen on s_region populates s_region.

How would I get around it ? I want to access entries in s_region during on selection-screen on value request for s_state, (without me having to hit enter key after first selection).

1 ACCEPTED SOLUTION
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
669

check FM : DYNP_VALUES_READ and 'DYNP_VALUES_UPDATE'

I have 2 selection-screen options :

s_region and

s_state .

Here Region would mean North,South,East,West

I have At selection-screen on value request for both of these selection options.

But when I click F4 for s_state, I want to capture the selection made by user on s_region so that I only query for states under region. For eg: if South was chosen, I only want to bring up states in South Region.

I have both at selection-screen on and at selection-screen on value-request. But when I type South for s_region and press F4 for s_state, the internal table s_region[] is not filled in 'At selection-screen on value request for s_state-low . This is because at selection-screen on value-request is called before at selection-screen on - event. Only at selection-screen on s_region populates s_region.

How would I get around it ? I want to access entries in s_region during on selection-screen on value request for s_state, (without me having to hit enter key after first selection).

3 REPLIES 3
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
670

check FM : DYNP_VALUES_READ and 'DYNP_VALUES_UPDATE'

Read only

Former Member
0 Likes
669

Hi Shareen,

Check this online help link, it has a nice example

[Input Help in Dialog Modules|http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/content.htm]

Regards

Abhii

Read only

Former Member
0 Likes
669

Shareen,

The best option would be to use 'DYNP_VALUES_READ' FM.

For eg: You've S_Region and S_state as two Selection-option fields.

After user selecting the Region, when click F4 in S_state, use this.

Data: I_SCR_FIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE.

At selection-screen on value-request for s_state-low.

Perform: Get_state.

At selection-screen on value-request for s_state-high.

Perform: Get_state.

FORM GET_STATE .

move 'S_REGION-LOW' to I_SCR_FIELDS-fieldname.

append I_SCR_FIELDS.

move 'S_REGION-HIGH' to I_SCR_FIELDS-fieldname.

append I_SCR_FIELDS.

*--- Get the screen values

call function 'DYNP_VALUES_READ'

exporting

dyname = Sy-cprog

dynumb = Sy-dynnr

tables

dynpfields = I_SCR_FIELDS

exceptions

invalid_abapworkarea = 04

invalid_dynprofield = 08

invalid_dynproname = 12

invalid_dynpronummer = 16

invalid_request = 20

no_fielddescription = 24

undefind_error = 28.

*

*----Read the return value-

Read table I_SCR_FIELDS index 1.

*----Or you can read table I_SCR_FIELDS with the key, depends on your req.

I_SCR_FIELDS-FIELDVALUE will have the value for the region.

Once you have the Region value, you can build the logic to get the relevant states.

ENDFORM. " GET_STATE

Hope this helps.

Best Regards,

Gopakumar

Sr.SAP Tech.Lead