01-08-2014 9:28 AM
Hi all!
I have a little problem with a field that is informed in my report:
SELECT-OPTIONS: s_bukrs FOR t001-bukrs MATCHCODE OBJECT zbukrs,
s_hbkid FOR t012k-hbkid NO INTERVALS,
First of all, I inform bukrs field on screen. Eg. 1000
Afterwards,In order to enter the hbkid field, I have a matchcode that must be opened with all the values that applies with the bukrs previously selected (1000 in this case).
But, the bukrs is not registed, unless I press Enter or F8 on my select:
SELECT bukrs hbkid
FROM t012k
INTO ls_bank
WHERE bukrs in s_bukrs. ---> This value is empty, unless I press Enter or F8
As you can see, I need that my matchcode displays all values according with the bukrs selected without pressing Enter previously.
Can anyone help me to solve this issue please?
Thanks in advance!
Mario.
01-08-2014 9:35 AM
HI mario ,
You can use the FM
write this FM inside the POV of s_bukrs field.
For displaying the search help use FM F4IF_INT_TABLE_VALUE_REQUEST .
01-08-2014 9:35 AM
HI mario ,
You can use the FM
write this FM inside the POV of s_bukrs field.
For displaying the search help use FM F4IF_INT_TABLE_VALUE_REQUEST .
01-08-2014 9:37 AM
Please read function module DYNPRO_READ_VALUE to get values of select option before the select
01-08-2014 9:40 AM
01-08-2014 9:43 AM
Hi there,
You have to use AT SELECTION Event for value request.
Try this code it will solve our need.
TABLES: t001, t012k.
TYPES : BEGIN OF ty_f4hbkid,
bukrs TYPE bukrs,
hbkid TYPE hbkid,
END OF ty_f4hbkid.
DATA: lt_iscr TYPE TABLE OF dynpread ,
ls_iscr TYPE dynpread ,
lt_ireturn TYPE TABLE OF ddshretval,
ls_ireturn TYPE ddshretval,
v_repid LIKE sy-repid,
v_dynnr LIKE sy-dynnr.
DATA: lt_f4hbkid TYPE STANDARD TABLE OF ty_f4hbkid.
SELECT-OPTIONS: s_bukrs FOR t001-bukrs , "MATCHCODE OBJECT zbukrs,
s_hbkid FOR t012k-hbkid NO INTERVALS.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_hbkid-low.
*Here reading the select option it bit tricky better you use Parameter for Bukrs
CLEAR lt_iscr.
ls_iscr-fieldname = 'S_BUKRS-LOW'.
APPEND ls_iscr TO lt_iscr.
v_repid = sy-repid.
v_dynnr = sy-dynnr.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = v_repid
dynumb = v_dynnr
TABLES
dynpfields = lt_iscr
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.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
READ TABLE lt_iscr INTO ls_iscr WITH KEY fieldname = 'S_BUKRS-LOW'.
IF sy-subrc EQ 0.
SELECT bukrs hbkid
FROM t012k
INTO CORRESPONDING FIELDS OF TABLE lt_f4hbkid
WHERE bukrs = ls_iscr-fieldvalue.
ENDIF.
** Calling F4 help function module to assign that retrieved value for that select option pernr
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'HBKID'
dynpprog = sy-repid " Program name
dynpnr = sy-dynnr " Screen number
dynprofield = 'S_HBKID' " F4 help need field
value_org = 'S'
TABLES
value_tab = lt_f4hbkid " F4 help values
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
01-08-2014 9:57 AM
Hi Mario,
Please add some little bit modification what done in Rakesh.
TABLES: t001, t012k.
TYPES : BEGIN OF ty_f4hbkid,
bukrs TYPE bukrs,
hbkid TYPE hbkid,
END OF ty_f4hbkid.
DATA: lt_f4hbkid TYPE STANDARD TABLE OF ty_f4hbkid.
SELECT-OPTIONS: s_bukrs FOR t001-bukrs , "MATCHCODE OBJECT zbukrs,
s_hbkid FOR t012k-hbkid NO INTERVALS.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_hbkid-low.
Perform fetch_data.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_hbkid-high.
Perform fetch_data.
form fetch_data.
SELECT bukrs hbkid
FROM t012k
INTO CORRESPONDING FIELDS OF TABLE lt_f4hbkid
WHERE bukrs IN s_bukrs.
** Calling F4 help function module to assign that retrieved value for that select option pernr
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'PERNR'
dynpprog = sy-repid " Program name
dynpnr = sy-dynnr " Screen number
dynprofield = 'S_PERNR' " F4 help need field
value_org = 'S'
TABLES
value_tab = lt_f4hbkid " F4 help values
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
endform.
01-10-2014 9:25 AM
Thanks guys!
I've solved this issue by FM dynp_values_read
Regards and thanks again!
Mario