on 11-15-2007 1:01 PM
Hi Guys,
Can you please look into the below code and tell me why data is not fetching from ANLA table even though there are 20 records?
This is the program
TABLES: anla.
TYPES: BEGIN OF ty_anla,
bukrs TYPE bukrs,
anln1 TYPE anln1,
anln2 TYPE anln2,
anlkl TYPE anlkl,
ord43 TYPE ord43,
ord44 TYPE ord44,
anlue TYPE anlue,
END OF ty_anla.
DATA: git_anla TYPE TABLE OF ty_anla.
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME.
SELECT-OPTIONS: s_anln1 FOR anla-anln1,
s_anln2 FOR anla-anln2.
PARAMETERS: p_anlkl TYPE anla-anlkl,
p_bukrs TYPE anla-bukrs OBLIGATORY,
p_ord43 TYPE anla-ord43 ,
p_ord44 TYPE anla-ord44 ,
p_anlue TYPE anla-anlue .
SELECTION-SCREEN: END OF BLOCK b1.
SELECT bukrs anln1 anln2 anlkl ord43 ord44 anlue
FROM anla INTO TABLE git_anla
WHERE bukrs = p_bukrs
AND anln1 IN s_anln1
AND anln2 IN s_anln2
AND anlkl = p_anlkl
AND ord43 = p_ord43
AND ord44 = p_ord44
AND anlue = p_anlue.
Thanks in advance,
Satish
hi Satish,
what do you enter on the selection screen? Is that combination really exists in table ANLA?
ec
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, that is the problem: if there are paramters on the selection screen and you don't give any value, the system wants to select the fields from ANLA without any value as well. For example you don't give any value for p_ord43 and the system tries to select the lines from anla where ord43 is empty.
Define these parameters as select option (and change the WHERE clause accordingly) or make them mandatory.
codeTABLES: anla.
TYPES: BEGIN OF ty_anla,
bukrs TYPE bukrs,
anln1 TYPE anln1,
anln2 TYPE anln2,
anlkl TYPE anlkl,
ord43 TYPE ord43,
ord44 TYPE ord44,
anlue TYPE anlue,
END OF ty_anla.
DATA: git_anla TYPE TABLE OF ty_anla.
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME.
SELECT-OPTIONS: s_anln1 FOR anla-anln1,
s_anln2 FOR anla-anln2.
PARAMETERS: p_anlkl TYPE anla-anlkl,
p_bukrs TYPE anla-bukrs OBLIGATORY,
p_ord43 TYPE anla-ord43 ,
p_ord44 TYPE anla-ord44 ,
p_anlue TYPE anla-anlue .
SELECTION-SCREEN: END OF BLOCK b1.
SELECT bukrs anln1 anln2 anlkl ord43 ord44 anlue
FROM anla INTO TABLE git_anla
WHERE bukrs = p_bukrs
AND anln1 IN s_anln1
AND anln2 IN s_anln2
AND anlkl = p_anlkl
AND ord43 = p_ord43
AND ord44 = p_ord44
AND anlue = p_anlue.[/code]
Satish can you please say what was the change in the above code that worked. Thanks
Cause the field ANLKL (ASSET CLASS) Allways has value into ANLA
if you left the P_ANLKL blank you will never get records.
changed the P_ANLKL as select-option or maked obligatory
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
better use sel-options for anla-anlue
A.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use start-of-selection before select stmt.(just a try)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi satish,
I tried this and works fien for me.
But one thing , pass company code with 4 chars e.g for 1 -->0001
Rgds,
Sandeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
8 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.