2010 Sep 15 10:25 AM
hi all,
i have created a report in which there are Parameters.There is a Parameter when im executing the report it is not working.When i execute the report it gives me all the data instead of given me the selected data which is being define in parameters.Following are tho code for parametrs:
SELECT-OPTION
s_submi FOR ekko-submi,
FORM get_data .
SELECT DISTINCT submi BSTYP ebeln lifnr
FROM ekko
INTO CORRESPONDING FIELDS OF TABLE gi_ekko
WHERE ekorg eq p_ekorg
AND ebeln IN s_ebeln
AND ekko~lifnr IN s_lifnr
AND submi in s_submi
AND spras = 'E'.
ENDFORM.
FORM orgdata.
READ TABLE gi_ekko WITH KEY ebeln = gi_ekko-ebeln.
MOVE gi_ekko-ebeln to gi_main-ebeln.
MOVE gi_ekko-ekorg to gi_main-ekorg.
MOVE gi_ekko-BSTYP to gi_main-BSTYP.
MOVE gi_ekko-submi to gi_main-submi.
ENDFORM.Thanks.
2010 Sep 15 11:09 AM
types : begin of w_ekko ,
SUBMI type ekko-submi ,
bstyp type ekko-bstyp ,
ebeln type ekko-ebeln ,
lifnr type ekko-lifnr ,
end of w_ekko .
data : it_ekko type standard table of w_ekko with header line .
parameter : p_ekorg type ekko-ekorg .
select-options : s_lifnr for ekko-lifnr ,
s_ebeln for ekko-ebeln ,
s_submi for ekko-submi .
select ebeln submi lifnr bstyp
from ekko into corresponding fields of table it_ekko .
where lifnr in s_lifnr
and ebeln in s_ebeln .
and submi in s_submi
and ekorg = p_ekorg
AND spras = 'EN'.
But see that when you are using EQ in where condition , value should be passed otherwise no data will be selected
now you can use this and filter data according to your requirment .
allways use naming conventions which can be understood easily .
Regards
Deepak.
Edited by: Deepak Dhamat on Sep 15, 2010 12:29 PM
types : begin of w_ekko ,
SUBMI type ekko-submi ,
bstyp type ekko-bstyp ,
ebeln type ekko-ebeln ,
lifnr type ekko-lifnr ,
end of w_ekko .
data : it_ekko type standard table of w_ekko with header line .
parameter : p_ekorg type ekko-ekorg .
select-options : s_lifnr for ekko-lifnr ,
s_ebeln for ekko-ebeln ,
s_submi for ekko-submi .
select ebeln submi lifnr bstyp
from ekko into corresponding fields of table it_ekko .
where lifnr in s_lifnr
and ebeln in s_ebeln .
and submi in s_submi
and ekorg = p_ekorg
AND spras = 'EN'.
But see that when you are using EQ in where condition , value should be passed otherwise no data will be selected
now you can use this and filter data according to your requirment .
allways use naming conventions which can be understood easily .
Regards
Deepak.
Edited by: Deepak Dhamat on Sep 15, 2010 12:29 PM
2010 Sep 15 10:31 AM
Hi
Its very tough to find out here without knowing the input your select query is trying to hit EKKO.
If you want to cross verify if the select query is returning correct values, just go to EKKO table & input the values you are passing in the where clause.
Regards
Abhii
2010 Sep 15 10:32 AM
Hi Are you sure that data you are entering into parameters has value in Database table EKKO.To check this go to SE11 enter table name as EKKO ,pass EKORG(Purchase Org) and check you have any entries for the entered EKORG.
2010 Sep 15 10:41 AM
Can you also post how you declare your p_ekorg parameter.
Also, in your read statement "READ TABLE gi_ekko WITH KEY ebeln = gi_ekko-ebeln.", notice that you're reading table gi_ekko using that same table as your where condition (gi_ekko-ebeln). Do some debugging first in yor coding.
2010 Sep 15 10:54 AM
Hi,
First check whether the data you are inputing through the selection screen is perfectly storing in that parameter by putting break-point in your program.
If it is filling correctly in all the input fields then You should cosider the conversion routines before fetching the data from the table.
For eg. Ebeln Field is having a conversion routine - ALPHA (Check the domain).
Regards,
Debi
2010 Sep 15 10:59 AM
Dear friend,
Please first press F1 on Select-options and read its properties.
Basically Select-options will fetch all vlaues from table if nothing is entered in Selection screen.
But for Parameters, when nothing is entered in Selection screen, it will consider space as a value for fetching values from table.
Thanks...
2010 Sep 15 11:09 AM
types : begin of w_ekko ,
SUBMI type ekko-submi ,
bstyp type ekko-bstyp ,
ebeln type ekko-ebeln ,
lifnr type ekko-lifnr ,
end of w_ekko .
data : it_ekko type standard table of w_ekko with header line .
parameter : p_ekorg type ekko-ekorg .
select-options : s_lifnr for ekko-lifnr ,
s_ebeln for ekko-ebeln ,
s_submi for ekko-submi .
select ebeln submi lifnr bstyp
from ekko into corresponding fields of table it_ekko .
where lifnr in s_lifnr
and ebeln in s_ebeln .
and submi in s_submi
and ekorg = p_ekorg
AND spras = 'EN'.
But see that when you are using EQ in where condition , value should be passed otherwise no data will be selected
now you can use this and filter data according to your requirment .
allways use naming conventions which can be understood easily .
Regards
Deepak.
Edited by: Deepak Dhamat on Sep 15, 2010 12:29 PM
2010 Sep 15 11:45 AM
hi deepak,
i have tried ur coding which you have sent me but it is not working.
do you hjave any other suggestion.
Thanks.
2010 Sep 15 12:08 PM
hi ,
First tell me
1) how you have declared your parameter .
2) what you want from ekko
3) what you want to do using that ekko table .
Can you paste Complete Code " but see that there is limitaion to paste code in SDN "
so tell your probelm Preciesly and clearly .
Regards
Deepak.
2010 Sep 18 11:43 AM
hi,
This is my coding for EKKO table:
SELECT DISTINCT submi BSTYP ebeln lifnr MAX( bedat )
FROM ekko
INTO CORRESPONDING FIELDS OF TABLE gi_ekko
WHERE ekorg eq p_ekorg
AND ebeln IN s_ebeln
AND submi in s_submi
and ekorg eq p_ekorg
AND spras = 'E'
GROUP BY submi BSTYP ebeln lifnr bedat.This is for Parameters:
PARAMETERS:
p_ekorg type ekko-ekorg.
SELECT-OPTIONS:
s_ebeln FOR ekko-ebeln,
s_submi FOR ekko-submi,
s_lifnr FOR ekko-lifnr,
s_anfnr FOR ekpo-anfnr,
s_matnr FOR ekpo-matnr.Im using EKKO table because i want to display EBELN, LIFNR only frm EKKO table.
Thanks,
Edited by: sapabappk on Sep 18, 2010 1:30 PM
2010 Sep 15 11:24 AM
Hi
As you are selecting distinct values, so may be possible for your conditions there is no data in table EKKO.
So First check in debiggung if you are getting the data in GI_EKKO table or not?
In Form orgdata.
always check your table is initial or not before reading the table and use binary search in READ Table statment.
I hope you hae defined your table with headerline.
1. Instead of EKKO~lifnr you can write only lifnr.
2. write SPRAS = 'EN', instead of E.
I hope this will work for you.
Thanks
Lalit Gupta
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |