11-12-2007 12:09 PM
Hello,
on a screen, I have to provide an F4-Help for the possible payers available for a certain customer. The customer number can be set in another field of the same screen (zkb_0200-kunre from DataDictionary).
In PROCESS ON VALUE REQUEST I have:
FIELD zkb_0200-kunrg MODULE f4_kunrg.
In the Module f4_kunrg I try to access the number of the selected customer by accessing zkb_0200-kunre. But the variable does not hold the value shown on the screen, instead it is empty.
In the Module f4_kunrg I have:
PERFORM select_regulierer USING zkb_0200-kunre.
How can I access the KUNRE information shown on the screen in order to select the right payers for the selected customer?
Thanks a lot. Obviously, points will be rewareded.
Manuel
11-12-2007 2:50 PM
You can use the FM DYNP_VALUES_READ to read the values of the other field in the PROCESS ON VALUE REQUEST ...
DATA: BEGIN OF DYNPFIELDS OCCURS 1.
INCLUDE STRUCTURE DYNPREAD.
DATA: END OF DYNPFIELDS.
CLEAR DYNPFIELDS.
REFRESH DYNPFIELDS.
DYNPFIELDS-FIELDNAME = 'ZKB_0200-KUNRE'.
APPEND DYNPFIELDS.
DYNNR = SY-DYNNR.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG " << your prog name
DYNUMB = SY-DYNNR " << your screen number
TABLES
DYNPFIELDS = DYNPFIELDS
EXCEPTIONS
OTHERS = 4.
IF SY-SUBRC = 0.
READ TABLE DYNPFIELDS INDEX 1.
l_KUNNR = DYNPFIELDS-FIELDVALUE.
ENDIF.
Regards,
Naimesh Patel
11-12-2007 1:24 PM
Hi
TYPES : BEGIN OF ST_OBJID_SH,
OTYPE TYPE HRP1000-OTYPE,
OBJID TYPE HRP1000-OBJID,
END OF ST_OBJID_SH.
DATA : IT_OBJID_SH TYPE STANDARD TABLE OF ST_OBJID_SH.
DATA : WA_OBJID_SH TYPE ST_OBJID_SH.
***********SELECTION SCREEN DESIGN***********************
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
*SELECT-OPTIONS : S_OTYPE FOR HRP1001-OTYPE NO INTERVALS .
SELECT-OPTIONS : S_OBJID FOR HRP1001-OBJID NO INTERVALS .
SELECT-OPTIONS : DATE FOR SY-DATUM NO-EXTENSION OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
**********END OF SELECTION SCREEN DESIGN*****************
*********VALIDATION FOR SCREEN FIELDS********************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_OBJID-LOW.
IF S_OBJID IS NOT INITIAL.
SELECT OTYPE OBJID FROM HRP1000
INTO TABLE IT_OBJID_SH
WHERE OTYPE = 'D'.
IF SY-SUBRC EQ 0.
SEARCH HELP FOR QUALIFICATION.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'OBJID'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'S_OBJID'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT_OBJID_SH
FIELD_TAB =
RETURN_TAB = RETURN_TAB
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
.
11-12-2007 2:44 PM
F4IF_INT_TABLE_VALUE_REQUEST helps alot! Thanks. But, if I activate the row:
SELECT-OPTIONS : S_OTYPE FOR HRP1001-OTYPE NO INTERVALS .
and use the SQL statement
SELECT OTYPE OBJID FROM HRP1000
INTO TABLE IT_OBJID_SH
WHERE OTYPE = S_OTYPE-low.
S_OTYPE is only available if I add a value in the F4-Help of S_OTYPE and press F8 in order to confirm. How can I program the same behaviour without using a Select-Options field (in a Dynpro)?
Thanks, Manuel
11-12-2007 2:50 PM
You can use the FM DYNP_VALUES_READ to read the values of the other field in the PROCESS ON VALUE REQUEST ...
DATA: BEGIN OF DYNPFIELDS OCCURS 1.
INCLUDE STRUCTURE DYNPREAD.
DATA: END OF DYNPFIELDS.
CLEAR DYNPFIELDS.
REFRESH DYNPFIELDS.
DYNPFIELDS-FIELDNAME = 'ZKB_0200-KUNRE'.
APPEND DYNPFIELDS.
DYNNR = SY-DYNNR.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG " << your prog name
DYNUMB = SY-DYNNR " << your screen number
TABLES
DYNPFIELDS = DYNPFIELDS
EXCEPTIONS
OTHERS = 4.
IF SY-SUBRC = 0.
READ TABLE DYNPFIELDS INDEX 1.
l_KUNNR = DYNPFIELDS-FIELDVALUE.
ENDIF.
Regards,
Naimesh Patel