2007 Jun 20 7:06 PM
Folks,
I haev selection screen and on selection screen user may give more than one selection parameters.I have to serach database acordingly.For that i have written query like this
select * from ZNSLVWHDIMMD_LCL
into corresponding fields of table IT_VIEW
WHERE SALESRLNO = Stru_Cn_Selcrtr-ca_slsrl
and CREATEDBY = Stru_Cn_Selcrtr-ca_crtby
and STARTDATE = Stru_Cn_Selcrtr-ca_validfrm
and ENDDATE = Stru_Cn_Selcrtr-ca_validto
and STATUS = Stru_Cn_Selcrtr-ca_status
and BRANDID = Stru_Cn_Selcrtr-ca_brand
and MODELNO = Stru_Cn_Selcrtr-ca_model.
Now the problem is that it does not work when user gives only one parameter say
"SALESRLNO" = 0000000002 .When i checked sy-subrc,it is 4 means no data in table.but there is a data in table with SALESRLNO = 0000000002>how to solve this.
Folks,
I haev selection screen and on selection screen user may give more than one selection parameters.I have to serach database acordingly.For that i have written query like this
select * from ZNSLVWHDIMMD_LCL
into corresponding fields of table IT_VIEW
WHERE SALESRLNO = Stru_Cn_Selcrtr-ca_slsrl
and CREATEDBY = Stru_Cn_Selcrtr-ca_crtby
and STARTDATE = Stru_Cn_Selcrtr-ca_validfrm
and ENDDATE = Stru_Cn_Selcrtr-ca_validto
and STATUS = Stru_Cn_Selcrtr-ca_status
and BRANDID = Stru_Cn_Selcrtr-ca_brand
and MODELNO = Stru_Cn_Selcrtr-ca_model.
Now the problem is that it does not work when user gives only one parameter say
"SALESRLNO" = 0000000002 .When i checked sy-subrc,it is 4 means no data in table.but there is a data in table with SALESRLNO = 0000000002>how to solve this.
2007 Jun 20 7:15 PM
before passing the user entry to the select query
use the conversion exit input FM ie
CONVERSION_EXIT_ALPHA_INPUT
not sure hweather it ll work, it ll be better for all if u paste the complete code.
Thank-You
2007 Jun 20 7:26 PM
if Stru_Cn_Selcrtr-ca_slsrl is initial and Stru_Cn_Selcrtr-ca_crtby is initial
and Stru_Cn_Selcrtr-ca_validfrm is initial and Stru_Cn_Selcrtr-ca_validto is initial
and Stru_Cn_Selcrtr-ca_status is initial and Stru_Cn_Selcrtr-ca_brand is initial
and Stru_Cn_Selcrtr-ca_model is initial.
select * from ZNSLVWHDIMMD_LCL
into corresponding fields of table IT_VIEW.
ELSE.
**If any of these are given then select data accordingly.
select * from ZNSLVWHDIMMD_LCL
into corresponding fields of table IT_VIEW
WHERE SALESRLNO = Stru_Cn_Selcrtr-ca_slsrl
and CREATEDBY = Stru_Cn_Selcrtr-ca_crtby
and STARTDATE = Stru_Cn_Selcrtr-ca_validfrm
and ENDDATE = Stru_Cn_Selcrtr-ca_validto
and STATUS = Stru_Cn_Selcrtr-ca_status
and BRANDID = Stru_Cn_Selcrtr-ca_brand
and MODELNO = Stru_Cn_Selcrtr-ca_model.
endif.
This is the code ...and my data type in dictionary is string..for table ZNSLVWHDIMMD_LCL
2007 Jun 20 8:01 PM
I think you would be better off using SELECT-OPTIONS rather than PARAMETERS.
Rob
2007 Jun 20 8:03 PM
yaa i just figured that out..but i m using ABAP-OO.I cant use select option.
2007 Jun 20 8:14 PM
You can't use Select-Options because your using 00 ABAP??? Why??? First time I hear that -:O
Greetings,
Blag.
2007 Jun 20 8:26 PM
Means i have to build up internal table from parameters i cant use slect option on selection screen.thats wat i means.
2007 Jun 20 9:02 PM
PROBLEM SOLVED ..BY MAKING INTERNAL TABLE HAVING STRUCTURE LIKE SELECT STATEMENT.THANX DUDES FOE ANSWER THOUGH.
2007 Jun 20 9:04 PM
Its problem of parameter on selection screen so make internal table as select-option so system will select desired data.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |