2012 Jul 05 7:30 AM
Hi,
I have two select options. 1) iblnr 2) ivnum
also on selection screen I have two radio buttons 1) inventory 2) ware house
when user selects inventory radio btn it will only display iblnr field for input and hide ivnum and when user selects warehouse only ivnum is displayed and hides iblnr.
I am hiding one of this field for input using at selection screen output event.
I am also providing F4 help for both this fields using 'F4IF_INT_TABLE_VALUE_REQUEST' using at selection screen on value request event.
Now when i execute program and press F4 for iblnr or ivnum it will provide search help. but after getting search help if i cancel and select other radio button program is generating error.
basically the problem is after pressing F4 if i change radio button it will generate error.
how to solve this?
Thanks,
Harshal
2012 Jul 05 7:33 AM
Hi,
Can you please copy paste you code and describe in more detail the error ?
Hi,
I have two select options. 1) iblnr 2) ivnum
also on selection screen I have two radio buttons 1) inventory 2) ware house
when user selects inventory radio btn it will only display iblnr field for input and hide ivnum and when user selects warehouse only ivnum is displayed and hides iblnr.
I am hiding one of this field for input using at selection screen output event.
I am also providing F4 help for both this fields using 'F4IF_INT_TABLE_VALUE_REQUEST' using at selection screen on value request event.
Now when i execute program and press F4 for iblnr or ivnum it will provide search help. but after getting search help if i cancel and select other radio button program is generating error.
basically the problem is after pressing F4 if i change radio button it will generate error.
how to solve this?
Thanks,
Harshal
2012 Jul 05 7:33 AM
Hi,
Can you please copy paste you code and describe in more detail the error ?
2012 Jul 05 8:28 AM
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS : r_im RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND flg,
r_wm RADIOBUTTON GROUP rad1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
SELECT-OPTIONS : s_iblnr FOR ikpf-iblnr MODIF ID sib,
s_ivnum FOR link-ivnum MODIF ID siv.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN OUTPUT.
IF r_im = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'SIB'.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'SIV'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF r_wm = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'SIV'.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'SIB'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_iblnr-low.
gs_dynpread-fieldname = 'S_IBLNR-LOW'.
APPEND gs_dynpread TO gt_dynpread.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = gt_dynpread.
IF sy-subrc = 0.
READ TABLE gt_dynpread INTO gs_dynpread WITH KEY fieldname = 'S_IBLNR-LOW'.
s_iblnr-low = gs_dynpread-fieldvalue.
ENDIF.
select iblnr from ikpf into table gt_ikpf.
PERFORM f4_help TABLES gt_ikpf using'S_IBLNR-LOW' 'IBLNR'.
CLEAR : gs_dynpread, gt_dynpread,
gs_ret, gt_ret.
FORM f4_help TABLES tab_name CHANGING l_dynprofield
field_name.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ''
retfield = field_name
* PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = l_dynprofield
value_org = 'S'
TABLES
value_tab = tab_name
return_tab = gt_ret.
IF sy-subrc = 0.
READ TABLE gt_ret INTO gs_ret INDEX 1.
l_dynprofield = gs_ret-fieldval.
ENDIF.
clear : tab_name, field_name.
ENDFORM.
2012 Jul 05 9:20 AM
Hi Harshal ,
The problem is with ur at selection-screen output event.
Change it to at selection screen.
You have declared radio button with default value x.
So in Before output its set as x.
So u r getting f4 help properly .
So After that if you select another radio button also its reading for first radio button only so you are getting error.
Please change it to AT SELECTION - SCREEN.
Regards,
Ramya R
2012 Jul 05 4:33 PM
2012 Jul 05 5:25 PM
Hi Harshal,
If you debug the code you will come to know that error is coming at below statement.
l_dynprofield = gs_ret-fieldval.
In perform routine you are passing the values IBLNR to l_dynprofield.you should pass s_iblnr-low instead of iblnr. Please try this.
L_dynprofield contains IBLNR and as per the logic it will try to store gs_ret-fieldval value.
As you have not written any code for second radiobutton . you will not get any error for that. but you will get error for r_im radiobutton.
Please try my solution once and let me know if you require any further help. grant some reward points if it helps.
2012 Jul 05 6:52 PM
Hi gaurav,
Thanks for the help.
What you have said is somewhat correct.
I have removed below lines from form.
READ TABLE gt_ret INTO gs_ret INDEX 1.
l_dynprofield = gs_ret-fieldval
and now its working perfectly..
thanks.
2012 Jul 05 6:56 PM
I haven't tried the thing you provided I have posted the solution in comment below.
BTW thanks for the help.
Still I will try your suggestion and let you know.
thanks
2012 Jul 05 8:22 AM
Hi Harshal,
If you give
If radio1 = x.
F4 help.
else.
f4 help.
endif.
Change it to seperate if condition.
regards,
Ramya R
2012 Jul 05 8:29 AM
I am unable to understand you. you mean to say in at selection screen output event where I am hiding the slect options field i need to call the function for f4 help?
2012 Jul 05 8:55 AM
2012 Jul 05 5:28 PM
Hi Harshal,
If you debug the code you will come to know that error is coming at below statement.
l_dynprofield = gs_ret-fieldval.
In perform routine you are passing the values IBLNR to l_dynprofield.you should pass s_iblnr-low instead of iblnr. Please try this.
L_dynprofield contains IBLNR and as per the logic it will try to store gs_ret-fieldval value.
As you have not written any code for second radiobutton . you will not get any error for that. but you will get error for r_im radiobutton.
Please try my solution once and let me know if you require any further help. grant some reward points if it helps.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |