Hi,,
I am creating a custom report.
I have 2 parameters PLANT AND SERIAL NUMBER. I have a custom table and their I am keeping the serial number respect to plant.
My requirement is : I am entering plant and when I am pressing F4 on serial number, the serial numbers saved with repect to plant should come by pup up and user will select the number. Below is the code....
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : P_PLANT TYPE WERKS_D,"Z45A_CHALLAN-PLANT,
P_SRNO TYPE Z45A_CHALLAN-SRNO.
SELECTION-SCREEN : END OF BLOCK B1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_SRNO.
PERFORM GET_SRNO_F4.
FORM GET_SRNO_F4 .
IF GT_DELETE IS INITIAL.
DATA : RETURN_TAB TYPE TABLE OF DDSHRETVAL WITH HEADER LINE.
REFRESH : GT_DELETE.
SELECT RGP_NO PLANT ZYEAR SRNO
FROM Z45A_CHALLAN
INTO TABLE GT_DELETE
WHERE PLANT = P_PLANT.
IF SY-SUBRC IS INITIAL .
SORT GT_DELETE.
DELETE ADJACENT DUPLICATES FROM GT_DELETE COMPARING ALL FIELDS.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
RETFIELD = 'SRNO'
* PVALKEY = ' '
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_SRNO'
* 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 = GT_DELETE
* FIELD_TAB =
RETURN_TAB = RETURN_TAB
* DYNPFLD_MAPPING =
* EXCEPTIONS
* PARAMETER_ERROR = 1
* NO_VALUES_FOUND = 2
* OTHERS = 3
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ELSE .
LOOP AT RETURN_TAB.
P_SRNO = RETURN_TAB-FIELDVAL.
ENDLOOP.
ENDIF.
ENDIF.
ENDFORM. " GET_SRNO_F4
ISSUE IS :
I am entering plant and serial number manually and doing f8 (without pressing f4 help on serial number and also not pressing press ENTER), then I am getting my plant in p_plant while checking in debug.
But when i am enter the plant and press f4 on serial number without pressing ENTER, I am not getting my p_plant value . Checked in debug.
if press ENTER after entering plant and then doing f4 ,then I am getting the p_plant value. while check in debug.
Could you please suggest why this happens and how i ll resolved the same ????
Thanks..