08-21-2012 9:49 AM
Is it possible?
The problem I am facing is this:
I have two fields and the second is a key to look values for second.
The first field is binded to a module process on value request. The module, write the value choosen (from hand-made help) onto dynpro fields, but value, is still not "propagated" to the variable program. I need to hit enter to propagate to check it and use it.
The problem is that user:
1) click on first field input help and choose a value
2) then click on second field input help without hit enter... the second help will not works because in the report first field is not still valorized.
Can anybody help me ?
regards
Gabriele
08-21-2012 9:59 AM
Hi
You can manage the search help of second field manually (by the event ON VALUE-REQUEST, just as for the first one): you can use fm F4IF_FIELD_VALUE_REQUES in order to call the search help of second field.
Before calling F4IF_FIELD_VALUE_REQUES you can call the fm DYNP_VALUES_READ in order to read the value of the first field.
Max
08-21-2012 9:59 AM
Hi
You can manage the search help of second field manually (by the event ON VALUE-REQUEST, just as for the first one): you can use fm F4IF_FIELD_VALUE_REQUES in order to call the search help of second field.
Before calling F4IF_FIELD_VALUE_REQUES you can call the fm DYNP_VALUES_READ in order to read the value of the first field.
Max
08-21-2012 10:28 AM
Thanks for your reply.
I knew this way, but the problem is a bit harder:
When I choose a value from first field, also a description must be set (the description of first field) .. and also for the second field, a description should be set when choosing a values (without hit enter).
summarizing:
using DYNPRO_STRING_READ I can read first field while processing on value request for second field (bypassing the problem of value not propagated from dynpro to report). But from modules on values-request, if I set values in the program (descriptions), I cannot see them on dynpro untill I hit enter (and trigger a PAI). It's the dual problem of the one intially posted. Triggering PAI from on value request module, is a solution for both problem.
A patch could be another function that WRITE values on dynpro ... like a DYNPRO_STRING_WRITE ... but I cannot find anything. Do you know a function like this ?
thank you
Gabriele
08-21-2012 10:30 AM
08-21-2012 10:31 AM
08-21-2012 10:35 AM
Read SAP online documentation at Input Help in Dialog Modules (You will get information on many FMs like F4IF_FIELD_VALUE_REQUEST, F4IF_INT_TABLE_VALUE_REQUEST, DYNP_VALUES_READ and DYNP_VALUES_UPDATE.)
Regards,
Raymond
08-21-2012 11:56 AM
Thanks you Max and Raymond
I solved with alternative thinking .. if is not possible to call PAI or trigger automatically, then I simulate a "Hit Enter".
Instead of reading / updating dynpro values (that means many structures for the calls) I used these few lines to simulate an enter pressed and so a PAI is automatically triggered:
CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
EXPORTING
functioncode = '/00'
EXCEPTIONS
function_not_supported = 1.
Thank you
08-21-2012 12:15 PM
Try this code.
DYNP_VALUES_READ fm will read the current values of screen.
So that u can provide input for second field corresponding to first field value.
Reply if u still have issues.
DATA : IT_DYNPFIELDS TYPE TABLE OF DYNPREAD,
WA_FIELDS TYPE DYNPREAD.
TYPES: BEGIN OF TY_VALUES ,
BLAND TYPE T005S-BLAND,
BEZEI TYPE T005U-BEZEI,
END OF TY_VALUES.
DATA : IT_VALUES TYPE TABLE OF TY_VALUES,
WA_VALUES TYPE TY_VALUES.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-REPID
DYNUMB = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
REQUEST = 'A'
* PERFORM_CONVERSION_EXITS = ' '
* PERFORM_INPUT_CONVERSION = ' '
* DETERMINE_LOOP_INDEX = ' '
* START_SEARCH_IN_CURRENT_SCREEN = ' '
* START_SEARCH_IN_MAIN_SCREEN = ' '
* START_SEARCH_IN_STACKED_SCREEN = ' '
* START_SEARCH_ON_SCR_STACKPOS = ' '
* SEARCH_OWN_SUBSCREENS_FIRST = ' '
* SEARCHPATH_OF_SUBSCREEN_AREAS = ' '
TABLES
DYNPFIELDS = IT_DYNPFIELDS
* 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.
IF SY-SUBRC EQ 0.
READ TABLE IT_DYNPFIELDS INTO WA_FIELDS WITH KEY FIELDNAME = 'COUNTRY' .
IF SY-SUBRC EQ 0.
"SELECT bland FROM T005S INTO CORRESPONDING FIELDS OF TABLE IT_VALUES WHERE LAND1 EQ WA_FIELDS-FIELDVALUE.
SELECT bland BEZEI FROM T005U INTO CORRESPONDING FIELDS OF TABLE IT_VALUES WHERE LAND1 EQ WA_FIELDS-FIELDVALUE and spras eq sy-langu.
ENDIF.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
RETFIELD = 'STATE'
* PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'STATE '
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* CALLBACK_METHOD =
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
VALUE_TAB = IT_VALUES
* FIELD_TAB =
* RETURN_TAB =
* DYNPFLD_MAPPING =
* EXCEPTIONS
* PARAMETER_ERROR = 1
* NO_VALUES_FOUND = 2
* OTHERS = 3
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
Regards,
Ravivarma.