08-22-2007 11:28 AM
Hi guys,
I need help about AT SELECTION SCREEN ON VALUE REQUEST FOR a.
Actually, I need this to be ON VALUE REQUEST FOR a and b, because I need to update both parameter with this single search help. Can anybody show me how to do this?
Thanks before.
08-22-2007 11:34 AM
Hi...Samanta...
This is the proper code that give u the Complete info on How to write the Logic:
REPORT zsel_f4help .
*---Report with selection screen and to display the list of
possible entries for field 'B' as per the value in field 'A'.
PARAMETERS: p_vbeln TYPE vbak-vbeln,
p_posnr TYPE vbap-posnr.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_posnr.
DATA: BEGIN OF help_item OCCURS 0,
posnr TYPE vbap-posnr,
matnr TYPE vbap-matnr,
arktx TYPE vbap-arktx,
END OF help_item.
DATA: dynfields TYPE TABLE OF dynpread WITH HEADER LINE.
dynfields-fieldname = 'P_VBELN'.
APPEND dynfields.
**Read the Values of the SCREEN FIELDs
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
translate_to_upper = 'X'
TABLES
dynpfields = dynfields
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.
**Find out the Value of P_VBELN
READ TABLE dynfields WITH KEY fieldname = 'P_VBELN'.
p_vbeln = dynfields-fieldvalue.
**Convert the Value into internal format
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = p_vbeln
IMPORTING
output = p_vbeln.
**Fetch the correponding itemnos from VBAP
SELECT posnr matnr arktx INTO TABLE help_item
FROM vbap
WHERE vbeln = p_vbeln.
**Generate the F4 help with internal table values
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'POSNR'
dynprofield = 'P_POSNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
TABLES
value_tab = help_item.
<b>Reward if Helpful</b>
08-22-2007 11:30 AM
Hi!
Have you tried
AT SELECTION SCREEN ON VALUE REQUEST FOR a.
...
AT SELECTION SCREEN ON VALUE REQUEST FOR b.
...
I've found it in the help:
Addition 3
... ON VALUE-REQUEST FOR psel_low_high
Effect
In this addition, the field psel_low_high iseither the name of a report parameter or of the form sel-LOW orsel-HIGH, where sel is the name of a selection criterion.The effect of this is twofold:
The possible entries pushbutton for F4 appears beside theappropriate field.
When the user activates this pushbutton or presses F4 for thefield, the event is executed. You can thus implement a self-programmedpossible entries routine for the input/output fields of the selectionscreen. If the program contains such an event and the user pressesF4, the system processes this rather than displaying the checktable or the fixed values of the Dictionary field - even if the reportparameter or the selection option with LIKE or FOR pointsto a Dictionary field. You can, for example, use the CALL SCREEN statement to display a selection list ofpossible values. The contents of the field psel_low_high at theend of this processing block are copied to the appropriate input/outputfield.
This addition is only allowed with report-specific parameters ( PARAMETERS ) or selection options (SELECT-OPTIONS). Fordatabase-specific parameters or selection options, you can achieve thesame effect by using the addition VALUE-REQUEST FOR ... with thekey word PARAMETERS or SELECT-OPTIONS in the includeDBxyzSEL (where xyz = name of logical database). In this case,you must program the possible entries in the database programSAPDBxyz.
Regards
Tamás
Message was edited by:
Tamás Nyisztor
08-22-2007 11:31 AM
Hi Samanta,
You cannot use AT SELECTION SCREEN ON VALUE REQUEST FOR a and b.
Instead what you can do is,
Write the code for search help in a sub-routine.
FORM Search_help.
ENDFORM.
Now,
AT SELECTION SCREEN ON VALUE REQUEST FOR a.
PERFORM Search_help.
AT SELECTION SCREEN ON VALUE REQUEST FOR b.
PERFORM Search_help.
Meaning, call the same sub-routine for both the events. This solves the purpose.
<b>Reward points for helpful answers.</b>
Best Regards,
Ram.
08-22-2007 11:32 AM
hi,
giv separately...
AT SELECTION SCREEN ON VALUE REQUEST FOR VAL1
...
AT SELECTION SCREEN ON VALUE REQUEST FOR VAL2.
With Regards,
S.Barani
08-22-2007 11:32 AM
Hi,
You could use
AT SELECTION SCREEN ON VALUE REQUEST FOR a. Get the values for a first. Then fetch the corresponding values for b. Then populate the b in the selection screen. So the effect is, when user clicks f4 he will select a and after he says continue he can see 2 values in a and b.
Thanks...
Preetham S
08-22-2007 11:34 AM
hi
u can do it separately for both fields as it does not allow for 2 fields simultaneously.
08-22-2007 11:34 AM
Hi...Samanta...
This is the proper code that give u the Complete info on How to write the Logic:
REPORT zsel_f4help .
*---Report with selection screen and to display the list of
possible entries for field 'B' as per the value in field 'A'.
PARAMETERS: p_vbeln TYPE vbak-vbeln,
p_posnr TYPE vbap-posnr.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_posnr.
DATA: BEGIN OF help_item OCCURS 0,
posnr TYPE vbap-posnr,
matnr TYPE vbap-matnr,
arktx TYPE vbap-arktx,
END OF help_item.
DATA: dynfields TYPE TABLE OF dynpread WITH HEADER LINE.
dynfields-fieldname = 'P_VBELN'.
APPEND dynfields.
**Read the Values of the SCREEN FIELDs
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
translate_to_upper = 'X'
TABLES
dynpfields = dynfields
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.
**Find out the Value of P_VBELN
READ TABLE dynfields WITH KEY fieldname = 'P_VBELN'.
p_vbeln = dynfields-fieldvalue.
**Convert the Value into internal format
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = p_vbeln
IMPORTING
output = p_vbeln.
**Fetch the correponding itemnos from VBAP
SELECT posnr matnr arktx INTO TABLE help_item
FROM vbap
WHERE vbeln = p_vbeln.
**Generate the F4 help with internal table values
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'POSNR'
dynprofield = 'P_POSNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
TABLES
value_tab = help_item.
<b>Reward if Helpful</b>