07-07-2008 9:44 AM
Hi,
I am using FM F4IF_INT_TABLE_VALUE_REQUEST to create search help on one select option.
I have two selection Criteria : Parameter : Company Code(p_BUKRS) for bsis-bukrs and
Select option : business Place(s_BUPLA) for bsis-bupla
First i am selecting the company code from search help(F4) of p_bukrs suppose p_bukrs i selected is 1000.
Now in the search help of s_bupla i want only those business place that are in company code 1000.
But instead of getting only perticular those records ( business places in the complany code 1000) i am getting all the business places.
I m selecting bupla for perticular bukrs from the tabe j_1bbranch. that i ma using in FM F4IF_INT_TABLE_VALUE_REQUEST .
After selecting complany code in p_bukrs if i m hitting ENTER then its working fine.
Then search help for s_bukrs will give only required data ,not all.
But i don't want to hit ENTER. Without pressing enter cann't I get the desired search help data.
07-07-2008 9:47 AM
Hi,
Develop your code in the event..
AT SELECTION-SCREEN ON VALUE-REQUEST FOR Field <F1>.
Regards,
Bujji
07-07-2008 9:48 AM
HI Friend,
Use the FM 'DYNP_VALUES_READ' for getting current company code entered by the user without pressing enter.
Regards
Krishnendu
07-07-2008 9:48 AM
07-07-2008 9:57 AM
Hi,
This is the solution for your problem:
Check out the FM : DYNP_VALUES_READ .
With Regards,
Wajid Hussain P.
07-07-2008 10:05 AM
Hi Pramila,
Try to execute the following code which I have written for Tables SPFLI & SFLIGHT.
*"Table declarations...................................................
TABLES :
spfli, " Flight Schedule
sflight. " Flight
*"Selection screen elements............................................
PARAMETERS :
p_carrid LIKE spfli-carrid, " Accepts Carrier ID
p_connid LIKE spfli-connid, " Accepts Connection ID
p_fldate LIKE sflight-fldate. " Accepts Flight Date
*" Type declarations...................................................
*"--------------------------------------------------------------------*
* Type declaration of the structure to hold data from tables SPFLI *
* and SFLIGHT *
*"--------------------------------------------------------------------*
TYPES :
BEGIN OF type_s_flight,
carrid LIKE spfli-carrid, " Carrier ID
connid LIKE spfli-connid, " Connection ID
fldate LIKE sflight-fldate, " Flight Date
END OF type_s_flight.
*" Data declarations...................................................
*"--------------------------------------------------------------------*
* Work variables *
*"--------------------------------------------------------------------*
DATA:
progname LIKE sy-repid, " Holds Current Program Name
dynnum LIKE sy-dynnr, " Holds the Screen Number
progname1 LIKE d020s-prog, " Holds Current Program Name
dynnum1 LIKE d020s-dnum. " Holds the Screen Number
*"--------------------------------------------------------------------*
* Structure to Hold Flight Data *
*"--------------------------------------------------------------------*
DATA :
fs_flight TYPE type_s_flight.
*"--------------------------------------------------------------------*
* Internal Tbale to Hold Fields of the current screen (with values) *
*"--------------------------------------------------------------------*
DATA :
dynpro_values TYPE
STANDARD TABLE
OF dynpread.
*"--------------------------------------------------------------------*
* Structure to Hold Fields of the current screen (with values) *
*"--------------------------------------------------------------------*
DATA :
field_value LIKE LINE OF dynpro_values.
*"--------------------------------------------------------------------*
* Internal Table to Hold Flight Data *
*"--------------------------------------------------------------------*
DATA :
t_flight LIKE
STANDARD TABLE
OF fs_flight.
*"--------------------------------------------------------------------*
* Internal Table to Hold Interface Structure Search Help<->Help System*
* Declared to Hold Carrier ID *
*"--------------------------------------------------------------------*
DATA :
t_return LIKE
STANDARD TABLE
OF ddshretval
WITH HEADER LINE.
*"--------------------------------------------------------------------*
* Internal Table to Hold Interface Structure Search Help<->Help System*
* Declared to Hold Connection ID *
*"--------------------------------------------------------------------*
DATA :
t_return1 LIKE
STANDARD TABLE
OF ddshretval
WITH HEADER LINE.
*"--------------------------------------------------------------------*
* Internal Table to Hold Interface Structure Search Help<->Help System*
* Declared to Hold Flight Date *
*"--------------------------------------------------------------------*
DATA :
t_return2 LIKE
STANDARD TABLE
OF ddshretval
WITH HEADER LINE.
*"--------------------------------------------------------------------*
* Internal Table to Hold Carrier ID and Connection ID Values *
*"--------------------------------------------------------------------*
DATA :
BEGIN OF t_connid OCCURS 0,
carrid LIKE spfli-carrid, " Carrier ID
connid LIKE spfli-connid, " Connection ID
END OF t_connid.
INITIALIZATION.
P_CARRID = 'AA'.
AT SELECTION-SCREEN OUTPUT.
P_CONNID = 0017.
*---------------------------------------------------------------------*
*" AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_carrid. *
*---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_carrid.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'SPFLI'
fieldname = 'CARRID'
TABLES
return_tab = t_return.
p_carrid = t_return-fieldval.
*---------------------------------------------------------------------*
*" AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_connid. *
*---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_connid.
SELECT carrid " Carrier ID
connid " Connection ID
FROM spfli
INTO CORRESPONDING FIELDS OF TABLE t_connid
WHERE carrid = p_carrid. " field_value-fieldvalue.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CONNID'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'P_CONNID'
value_org = 'S'
TABLES
value_tab = t_connid
return_tab = t_return1.
p_connid = t_return1-fieldval.
*---------------------------------------------------------------------*
*" AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fldate. *
*---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fldate.
progname = sy-repid.
dynnum = sy-dynnr.
progname1 = sy-repid.
dynnum1 = sy-dynnr.
CLEAR: field_value, dynpro_values.
field_value-fieldname = 'P_CONNID'.
APPEND field_value TO dynpro_values.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = progname1
dynumb = dynnum1
translate_to_upper = 'X'
TABLES
dynpfields = dynpro_values.
READ TABLE dynpro_values INDEX 1 INTO field_value.
SELECT carrid " Carrier ID
connid " Connection ID
fldate " Fldate
FROM sflight
INTO CORRESPONDING FIELDS OF TABLE t_flight
WHERE carrid = p_carrid
AND connid = p_connid. " field_value-fieldvalue.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'FLDATE'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'P_FLDATE'
value_org = 'S'
TABLES
value_tab = t_flight
return_tab = t_return2.
START-OF-SELECTION.
LOOP AT t_flight INTO fs_flight WHERE carrid = p_carrid
AND connid = p_connid
AND fldate = p_fldate.
WRITE 😕 fs_flight-carrid,
fs_flight-connid,
fs_flight-fldate.
ENDLOOP. " LOOP AT T_FLIGHT...
AT SELECTION-SCREEN ON HELP-REQUEST FOR p_carrid.
CALL FUNCTION 'HELP_OBJECT_SHOW_FOR_FIELD'
EXPORTING
doklangu = sy-langu
doktitle = text-002
called_for_tab = 'SPFLI'
called_for_field = 'CARRID'.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
AT SELECTION-SCREEN ON HELP-REQUEST FOR p_CONNID.
CALL FUNCTION 'HELP_OBJECT_SHOW_FOR_FIELD'
EXPORTING
doklangu = sy-langu
doktitle = text-002
called_for_tab = 'SPFLI'
called_for_field = 'CONNID'.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Swapna.
07-08-2008 7:52 AM
Hi Friend,
If the problem is solved, please give points to appreciate others.
Regards
Krishnendu