‎2007 Dec 17 3:34 AM
Current scenario i have an input textbox attached to an input help. A user needs to find a particular table, but do not know the exact name. The user only knows that the table starts with 'PA'. So, we need to filter all the tables that start with 'PA' for e.g. 'PA0001' and return it to the user for selection.
The problem now is that i cannot retrieve the input string given by the user for e.g. 'PA'.
Does anyone knows how to solve this problem?
‎2007 Dec 17 3:36 AM
HI,
Select * from ZTABLE where name CP 'PA%'.
Best regards,
Prashant
‎2007 Dec 17 3:36 AM
HI,
Select * from ZTABLE where name CP 'PA%'.
Best regards,
Prashant
‎2007 Dec 17 3:42 AM
Thanks!
i have this codes in my program too but the problem now is that i could not retrieve what the user has input. My input textbox is always empty even though the user has already input a string.
‎2007 Dec 17 3:47 AM
‎2007 Dec 17 3:59 AM
This is my codes. The string 'PA' is not hard coded. We need to read what the user input in the textbox. For example it can be PA, PB, PC or any other input.
REPORT ZMEIHUI_METADATA.
&----
*& Global Declaration
&----
DATA: IO_TABLEA(40) TYPE C,
IO_TABLEB(40) TYPE C,
VALUE(40) TYPE C,
VALUE2(100) TYPE C,
PROGNAME TYPE SY-REPID,
DYNNUM TYPE SY-DYNNR.
&----
*& Processing Blocks called by the Runtime environment
&----
START-OF-SELECTION.
CALL SCREEN 8000.
----
MODULE STATUS_8000 OUTPUT
----
*
----
MODULE STATUS_8000 OUTPUT.
SET PF-STATUS 'UI'.
SET TITLEBAR 'TITLE'.
ENDMODULE. "STATUS_8000 OUTPUT
----
MODULE USER_COMMAND_8000 INPUT
----
*
----
MODULE USER_COMMAND_8000 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE PROGRAM. "need to change to the previous screen!!!"
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'EXECUTE'.
" PERFORM VALIDATE_REQUIRED_FIELD.
ENDCASE.
ENDMODULE. "USER_COMMAND_8000 INPUT
----
MODULE F4_INPUT INPUT
----
MODULE F4_INPUT INPUT.
TYPES: BEGIN OF VALUES,
TABNAME TYPE DD02T-TABNAME,
DDTEXT TYPE DD02T-DDTEXT,
END OF VALUES.
DATA: F4_VALUES TYPE TABLE OF VALUES.
PROGNAME = SY-REPID.
DYNNUM = SY-DYNNR.
VALUE = IO_TABLEA.
CONCATENATE VALUE '%' INTO VALUE2.
SELECT DISTINCT TABNAME DDTEXT FROM DD02T
INTO TABLE F4_VALUES WHERE TABNAME LIKE VALUE2.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'IO_TABLEA'
DYNPPROG = PROGNAME
DYNPNR = DYNNUM
DYNPROFIELD = 'IO_TABLEA'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = F4_VALUES.
ENDMODULE. "F4_INPUT INPUT
‎2007 Dec 17 3:48 AM
Hi,
Use the FM.
select * from ztable into table i_f4help
where name CP 'PA' .
Call function 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = <Fieldname>(in selection screen)
value_org ='S'
TABLES
value_tab = i_f4help
Populate the values aptly. You will be able to capture the input.
Thanks,
Kasiraman R