‎2008 Apr 10 10:18 AM
Dear all,
pls provide the solution for the below.
i declared two parameters like below:
data: p_mawerk like qmel-mawerk obligatory,
p_workct like crhd-arbpl obligatory.
i need to provide the F4 help for the p_workct based on the p_mawerk.
first i entered some value for p_mawerk.
then if i am trying to read the some other table based on p_mawerk, but the value is null for p_mawerk.
can you pls provide the solution.
Regards
Venkat
‎2008 Apr 10 11:05 AM
You can use at selection-screen for this purpose.
at selection-screen-output.
if p_mawerk is not initial.
<populate value for p_workct>
endif.
‎2008 Apr 10 11:25 AM
Hi,
first:
you don´t declare parameters with DATA but with SELECT-OPTIONS or PARAMETERS.
second:
the system recognizes the value in P_MAWERK till you press , which is certainly a handycapp in selection screens.
documentation for AT SELECTION-SCREEN:
With the events for the field and input help, no data is transported between the selection screen and the ABAP program. As with general screens, suitable function modules must be used for these. The parameters and selection criteria changed for the input help are transported to the selection screen.
‎2008 Apr 10 11:35 AM
sorry sorry. due to hurry i did this mistake that, instead of using parameters i used data:
Dear all,
pls provide the solution for the below.
i declared two parameters like below:
parameters: p_mawerk like qmel-mawerk obligatory,
p_workct like crhd-arbpl obligatory.
i need to provide the F4 help for the p_workct based on the p_mawerk.
first i entered some value for p_mawerk.
then if i am trying to read the some other table based on p_mawerk, but the value is null for p_mawerk.
can you pls provide the solution.
Regards
Venkat
‎2008 Apr 10 12:28 PM
hi,
Pls check this it may help you out
at selection-screen on value-request for p_mawerk .
progname = sy-repid.
dynnum = sy-dynnr.
*The field value that is to be fetched from Selection-screen is passed to the internal table below.
field_value-fieldname = 'p_mawerk'.
append field_value to dynpro_values.
*This function module is used to read the Fiscal year from the selection screen
and to get the Document numbers only related to that fiscal year.
call function 'DYNP_VALUES_READ'
exporting
dyname = progname
dynumb = dynnum
translate_to_upper = 'X'
tables
dynpfields = dynpro_values
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.
read table dynpro_values index 1 into field_value.
select the values for the second parameter using the value in the first parameter using query into values_tab.
declare vaues_tab as you require in the search help parameters
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = ''
dynpprog = progname
dynpnr = dynnum
dynprofield = 'p_workct' (Give in CAPS)
value_org = 'S'
window_title = ' '
tables
value_tab = values_tab.
Regards,
Soumya.
‎2008 Apr 10 2:31 PM
hi,
i think the following will be useful.
parameters: p_mawerk like qmel-mawerk obligatory,
p_workct like crhd-arbpl obligatory.
DATA: BEGIN OF VALUES,
mawerk type tablename-mawerk,
workct TYPE tablename-workct,
END OF VALUES.
DATA: DINPRO_VALUES TYPE TABLE OF DYNPREAD,
VALUE_TAB LIKE TABLE OF VALUES,
FIELD_VALUE LIKE LINE OF DINPRO_VALUES.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_workct.
FIELD_VALUE-FIELDNAME = 'MAWERK'.
APPEND FIELD_VALUE TO DINPRO_VALUES.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-REPID
DYNUMB = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = DINPRO_VALUES.
READ TABLE DINPRO_VALUES INDEX 1 INTO FIELD_VALUE.
VALUES-MAwerk = FIELD_VALUE-FIELDVALUE.
select mawerk workct from table name into table value_tab where mawerk eq FIELD_VALUE-FIELDVALUE.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'WORKCT'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_WORKCT'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = VALUE_TAB.
then write select query to be printed in the output.