‎2006 Nov 27 6:43 AM
hi,
we have selection screen for 5 fields, in selection screen if we provide 1 and 5 ,we have to get remaining three records. how?
thanks in advance.
‎2006 Nov 27 6:46 AM
TABLES ztable.
SELECT-OPTIONS s_fld LIKE ztable-fld.
"In the select-option if you provide the input 1 and 5
SELECT *
FROM ztable
WHERE fld<b> NOT IN </b>s_fld.Regards
Wenceslaus
‎2006 Nov 27 6:46 AM
use select statments to extract the data based on the 2 fields u supply
‎2006 Nov 27 6:46 AM
TABLES ztable.
SELECT-OPTIONS s_fld LIKE ztable-fld.
"In the select-option if you provide the input 1 and 5
SELECT *
FROM ztable
WHERE fld<b> NOT IN </b>s_fld.Regards
Wenceslaus
‎2006 Nov 27 6:49 AM
Hi Surendra,
make use of the Function module: 'DYNP_VALUES_UPDATE'
Sample code attached-
&----
*& Form Company_Code_Currency
&----
Get Currency based on the entry made into the Company Code
----
FORM company_code_currency . "S4M1MR
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'BUKRS'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_BUKRS'
value_org = 'S'
TABLES
value_tab = gi_ccode
return_tab = return_tab
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.
READ TABLE return_tab INTO gw_return_tab INDEX sy-tabix.
READ TABLE gi_ccode INTO gw_ccode WITH
KEY bukrs = gw_return_tab-fieldval.
tab_update-fieldname = 'P_BUKRS'.
tab_update-fieldvalue = gw_ccode-bukrs.
APPEND tab_update.
tab_update-fieldname = 'P_WAERS'.
tab_update-fieldvalue = gw_ccode-waers.
APPEND tab_update.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = tab_update
EXCEPTIONS
OTHERS = 8.
CLEAR tab_update[].
ENDFORM. " Company_Code_Currency "S4M1MR
-Mohan
*Reward if helpful*
‎2006 Nov 27 6:50 AM
HI
select-option:s_rec for ztable-rec.
if u provide 1and 5 u have to get ramainng three recodrs between them.
select * from ztable
where rec between s_rec-low and se_rec-high.
Rgds,
Sunil.K