2009 Sep 04 9:58 AM
Hi experts,
i am retriving the data from the data base table and in where cluse im using the RANGE tables i difiened and appending the values of sign option low ,high to it.
i have defined as:
ranges:post for bsak-budat.
post-sign = post_dat-sign .
post-option = post_dat-option.
post-low = post_dat-low.
post-high = post_dat-high.
append post.
comp-sign = comp_code-sign .
comp-option = comp_code-option.
comp-low = comp_code-low.
comp-high = comp_code-high.
append comp.
vend-sign = vendor-sign .
vend-option = vendor-option .
vend-low = vendor-low.
vend-high = vendor-high .
append vend.
select bukrs gjahr belnr
xblnr lifnr wskto
skfbt waers wrbtr
wmwst augdt budat
bldat cpudt zfbdt
zterm zbd1t zbd2t
zbd3t zbd1p zbd2p
zlsch from bsak into corresponding fields of table g_bsak
where
budat in post and
bukrs in comp and
lifnr in vend .
but in select i am not getting any rows retrieval but entries are there in Table for same condition.
Plz help me how to code ranges values in select statement where condition and in anything wrong in my code mentioned above.
Mahesh
Edited by: mahesh s on Sep 4, 2009 10:59 AM
did u try the code which I have provided....
2009 Sep 04 10:08 AM
Hi,
What are the structures post_dat, comp_code and vendor and how are they getting populated?
Regards,
Nick
2009 Sep 04 10:10 AM
hi
i am filling them using select-option
and assigning them to ranges.
'plz help me
'
2009 Sep 04 10:12 AM
Hello Mahesh,
Then you donot have to move the SELECT-OPTION to RANGES.
select bukrs gjahr belnr
xblnr lifnr wskto
skfbt waers wrbtr
wmwst augdt budat
bldat cpudt zfbdt
zterm zbd1t zbd2t
zbd3t zbd1p zbd2p
zlsch from bsak into corresponding fields of table g_bsak
where
budat in post and
bukrs in comp and
lifnr in vend .Hope this is clear.
BR,
Suhas
2009 Sep 04 10:14 AM
Hi,
If post_dat, comp_code and vendor are select-options you don't need to move them into ranges. The problem is coming from the fact that you are not looping at the select-options to fill the ranges, but in truth you don't need to do this step at all.
select bukrs gjahr belnr
xblnr lifnr wskto
skfbt waers wrbtr
wmwst augdt budat
bldat cpudt zfbdt
zterm zbd1t zbd2t
zbd3t zbd1p zbd2p
zlsch from bsak into corresponding fields of table g_bsak
where
budat in post_dat and "Just use the selection options
bukrs in comp_code and "Just use the selection options
lifnr in vendor. "Just use the selection options
Regards,
Nick
2009 Sep 04 10:17 AM
Hi,
As per Suhas Saha Answer Select query :.it is working when all the fields list in internal table is same as BSAK fields list in order. If you change order in internal table fields which is not same as BSAK then it wont get the data into internal table.
2009 Sep 04 10:18 AM
hi,
actually i am using this code in FM so in fm i can not use select-option so taken the SELOPT structure and filling it in import parameter and
i am filling them using select-option
and assigning them to ranges.
how too loop the select-option to assign to ranges.
plz help
2009 Sep 04 10:21 AM
2009 Sep 04 10:22 AM
Hi,
Move the select-options data to ranges through this way.
loop at post_dat.
move-corresponding post_dat to post.
append post_dat.
clear post_dat.
endloop.
Same way populate for other ranges and use it in the select query
Regards,
Vikranth
2009 Sep 04 10:09 AM
Hello Mahesh,
What are post_dat, comp_code, vendor? Please clarify.
From your code i understand that post_dat, comp_code, vendor are (some kind of) range. Why do you want to move these values to post, comp, vend.
Please revert back.
BR,
Suhas
2009 Sep 04 10:12 AM
hi,
actuly i am using this code in FM so in fm i can not use select-option so taken the SELOPT structre and filling it in import parameter and
i am filling them using select-option
and assigning them to ranges.
plz help
2009 Sep 04 10:16 AM
hi,
actually i am using this code in FM so in fm i can not use select-option so taken the SELOPT structre and filling it in import parameter and
i am filling them using select-option
and assigning them to ranges.
plz help
2009 Sep 04 10:30 AM
Hi,
But even if you are using this in a function module you shouldn't need to fill the ranges tables. You're just passing data from one table with structure SELOPT to a differently named table with structure SELOPT, the SELECT statement will accept the original structures without filling ranges.
Regards,
Nick
2009 Sep 04 10:10 AM
Hi,
Can you please remove corresponding fields of in select statement and try again.
Edited by: MR Venkat on Sep 4, 2009 11:10 AM
2009 Sep 04 10:17 AM
Hi,
Thats true if you are using select-options to get the values then its not required for you to move into ranges...
but stil if you want to move them into ranges....
use the following code...
ranges:post for bsak-budat.
loop at post_dat.
move post_dat to post.
append post.
endloop.
loop at comp_code.
move comp_code to comp.
append comp.
endloop.
loop at vendor.
move vendor to vend.
append vend.
endloop.
select bukrs gjahr belnr
xblnr lifnr wskto
skfbt waers wrbtr
wmwst augdt budat
bldat cpudt zfbdt
zterm zbd1t zbd2t
zbd3t zbd1p zbd2p
zlsch from bsak into corresponding fields of table g_bsak
where
budat in post and
bukrs in comp and
lifnr in vend .Regards,
Siddarth
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |