‎2007 Nov 26 6:38 PM
Hi,
I have created a select option for project number filed. Now in internal table i have all the projects. I want to display only those project, which user has entered in select option. What is the optimized way to do that, in which i can get all include, exclude, lt, eq,bw, gt, operators. Or if lt, gt, operator are not possible, how can i display only those project which comes into the range. e.g if use has entered 40005 to 40009. How can i loop on this select option to delete irrelavant data.
Thanks,
Message was edited by:
Sal Khan
‎2007 Nov 26 7:03 PM
May be this way.
First select all project related to select option value.
select * from proj into table i_proj where pspnr in s_pspnr.
then
if sy-subrc eq 0.
loop at i_proj.
v_tabix = sy-tabix.
read table i_your_proj_num_int_table with key pspnr = i_proj-pspnr.
if sy-subrc ne 0.
delete i_proj index v_tabix.
endif.
endloop.
endif.
" After this i_proj contains the valid project numbers
a®
‎2007 Nov 26 6:57 PM
Hi,
You can not loop on Select Option, first you need to pass those Project values to an internal table and can do Loop on that internal table.
Regards,
Satish
‎2007 Nov 26 7:00 PM
‎2007 Nov 26 7:05 PM
You have to delete unwanted projects from the internal table.
Like:
DETELE ITAB WHERE NOT PROJ_NO IN S_PROJNO.After this statement you will have only those projects in table ITAB which user had entered on the selection screen.
Regards,
Naimesh Patel
‎2007 Nov 26 7:06 PM
Types: Begin of ty_proj,
pspnr type proj-pspnr.
end of ty_proj.
Data: IT_PROJ TYPE TABLE OF TY_PROJ,
WA_PROJ TYPE TY_PROJ.
In the selection screen you will provide low and high values, so in your program fetch only those projects from PROJ Table.
Select-options: s_pspnr for proj-pspnr.
Select PSPNR from PROJ into TABLE IT_PROJ where PSPNR in S_PSPNR.
Now you have data in IT_PROJ.
Reward Points if this helps,
Satish
‎2007 Nov 26 8:30 PM
Patel,
In operator is not working in delete query. My query is
delete itab where not projn1 in s_proj.
This is not working, infact it's deleting all the records from internal table.
Pls suggest....
Message was edited by:
Sal Khan
‎2007 Nov 26 8:44 PM
Hi,
Try this
Data: r_projno type range of <dbfield>.
r_projno-sign = 'E'.
r_projno-option = 'BT'.
r_projno-low = s_proj-low.
r_projno-high = s_proj-high.
Delete itab where projn1 in r_projno.Regards,
Satish
‎2007 Nov 26 7:03 PM
May be this way.
First select all project related to select option value.
select * from proj into table i_proj where pspnr in s_pspnr.
then
if sy-subrc eq 0.
loop at i_proj.
v_tabix = sy-tabix.
read table i_your_proj_num_int_table with key pspnr = i_proj-pspnr.
if sy-subrc ne 0.
delete i_proj index v_tabix.
endif.
endloop.
endif.
" After this i_proj contains the valid project numbers
a®
‎2007 Nov 26 7:04 PM
Hi try this,
let s_1 has user entered project ids and let itab has all the project IDS.
select-options:s_1 for tab-field no-extension.
loop at s_1-low
loop at itab where itab-field = s_1-low.
itab1-field = itab-field..
append itab1.
endloop.
endloop.
‎2007 Nov 27 4:31 AM
Hi,
One way to display only selected projects is u can write code as select-options: so_filed for lf_field no-intervals.or no-extensions a parameter type of option will appear in the output screen then giv f4 functionality to it and thn give only tht values u want llike proj1, proj4 only into tht opiotns thn only those enterd projects only will be displayed.
try this for exact syntax check n saplibrary it will surely work.