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: 

how to clear Select options if value of another field is changed

Former Member
0 Kudos

hi all,

I have a requirement that in selection screen there is a parameter input if some value is provided to this field, f4 help for another select option field will be populated with respect to the parameter input and i have designed like that, i have a problem that if the user changes the parameter value i want to clear the previously selected value in the select options

P1 ='INPUT1'

S1 ='f4 help dependin on INPUT1'

P1 = 'INPUT2'

S1='Old input must be changed'

Regard's

Girija

15 REPLIES 15

Former Member
0 Kudos

Hi,

Refersh the select-option inside an if conditions. AT AT-SELECTION-SCREEN Event.

0 Kudos

Hi,

I ve put refresh and even call th FM DYNP_VALUES_UPDATE by passing null for the field value buts its not working can anyone help

former_member184578
Active Contributor
0 Kudos

Hi.,

I think u have use the function module F4IF_INT_TABLE_VALUE_REQUEST to set F4 hlep for select options.,

in at selection screen event .,

cleat itab. " internal table to display when press f4.

populate itab based on input1.

now pass this itab to FM.

hope this helps u.,

reply if u need some more clarifications.,

Thanks & Regards,

Kiran

0 Kudos

Hi,

No.. I have some FM built for that. I am not using the FM F4IF_INT_TABLE_VALUE_REQUEST .

I have one more button in selection screen for clearing all the input field in which i ve specified as refresh selct-option1 it workd there but not in event AT Selection screen for Value request.

Regard's

Girija

Edited by: Girija R on May 26, 2011 8:07 AM

0 Kudos

Is it a module pool program?

0 Kudos

No executable program i mean Report

0 Kudos

Hi,

You need to change thef4 help for second selct option if the value of 1st one is changed. You will have to refersh the table thats populated to this F4 help.Now ideally in AT selection screen event you can check it ,and populate the internal table again.

COuld you please paste your code here, so we can understand your issue better.

0 Kudos

SELECTION-SCREEN BEGIN OF BLOCK invoice WITH FRAME .

SELECT-OPTIONS: s_cmpnyc FOR lv_company MATCHCODE OBJECT /xlso/h_get_company NO INTERVALS,

s_lerner FOR lv_learner NO INTERVALS,

s_saleor FOR lv_salesorder NO INTERVALS.

PARAMETER : p_objtyp TYPE otype.

SELECT-OPTIONS: s_crstyp FOR lv_coursetype NO INTERVALS, " F4 help depends on P_OBJTYP field

s_time FOR lv_timeframe NO-EXTENSION,

s_delmet FOR lv_deliverymet NO INTERVALS.

SELECTION-SCREEN: PUSHBUTTON /2(10) but1 USER-COMMAND search,

PUSHBUTTON 15(10) but2 USER-COMMAND clear.

SELECTION-SCREEN END OF BLOCK invoice.

INITIALIZATION.

but1 = 'SEARCH'.

but2 = 'CLEAR'.

AT SELECTION-SCREEN OUTPUT.

SET TITLEBAR 'INVOICE_SCREEN'.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_objtyp.

DATA : lv_otype TYPE otype,

lt_dynpread TYPE TABLE OF dynpread,

ls_dynpread TYPE dynpread.

REFRESH s_crstyp.

CLEAR s_crstyp.

CLEAR lt_dynpread.

ls_dynpread-fieldname = 's_crstyp-low'.

ls_dynpread-fieldvalue = ' '.

APPEND ls_dynpread TO lt_dynpread.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = space

dynumb = space "Screen number

TABLES

dynpfields = lt_dynpread

EXCEPTIONS

OTHERS = 0.

CALL FUNCTION 'ASK_OTYPE' " this gives F4 help for Object type

EXPORTING

d_otype = lv_otype

IMPORTING

otype = lv_otype.

p_objtyp = lv_otype.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_crstyp-low.

DATA : lc_plvar TYPE plvar VALUE '01',

lv_objec TYPE objec,

lv_otype TYPE otype.

IF p_objtyp IS NOT INITIAL.

lv_otype = p_objtyp.

CALL FUNCTION 'RH_OBJID_REQUEST " this gives F4 help according to object type selected

EXPORTING

plvar = lc_plvar

otype = lv_otype

seark = '*'

IMPORTING

sel_object = lv_objec.

s_crstyp-low = lv_objec-objid.

ELSE.

MESSAGE i043(/xlso/msg_bo).

ENDIF.

my requirement is that once user has entered the input in both the fields if he wants to change the objectype den i want to field Coursetype

0 Kudos

Hi,

BAsically you are fectching object ID On the basis of objecttype. Now do one thing. Pass the value of this otype to a variable.Now In AT selection screen event check the value of this variable with the current value in the sel screen parameter.

IF they are not same, then refresh the Select option for objid here & call the F4 help code block again over here.

0 Kudos

hi, I used

on change of p_objtyp.

refresh s_crstyp.

endon.

still its not getting refreshed

0 Kudos

where are youchecking on change of?

0 Kudos

I am checking it in event

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_objtyp.

0 Kudos

Try this,

temp = p_objtyp.

AT SELECTION-SCREEN.

IF p_objtyp nE temp.

REFRESH s_crstyp.

CLEAR s_crstyp.

ENDIF.

It will only effect when user press enter after changing parameter.

0 Kudos

Hi,

I am giving just an idea, if it gives reference to the table

1. Define one user define strcture having fields otype & coursetype.

2. Define search help for with otype & coursetype fields with importing fields otype & exporting value coursetype.

3. Attach search help created in step 2 to the structure created in step1.

4. Used these strcture fields in your program.

Note: This logic work only in case of ecc6.0 or higher version, not for 4.7.

0 Kudos

ok i wil check... thanks to all.