‎2008 Jul 17 12:42 PM
hi,
can anyone tell me whats wrong in this code:
SELECT bukrs
lifnr
augdt
augbl
gjahr
belnr
budat
bldat
blart
wrbtr
zterm
zbd1t
zbd2t
zbd1p
zbd2p
INTO TABLE i_bsak
FROM bsak
WHERE lifnr EQ p_lifnr
AND augdt IN s_date
AND augbl EQ 'RE'
AND gjahr EQ p_gjahr.
it is not fetching any data. sy-subrc is 4. Though
there is one record meeting the selection criteria enterd in the selection screen.
‎2008 Jul 17 12:45 PM
shouldn't AUGBL be a document number???
whts an 'RE' doing in a augbl field? Just Curious.
pk
‎2008 Jul 17 12:44 PM
Hi,
Check the sequenec of fields selected and fields in i_bsak
internal table.
when both the sequence are same, then only it will fetch.
revert back if any issues.
regards,
Naveen
‎2008 Jul 17 12:45 PM
hi,
just check order of the internal table fields with database table fields.
‎2008 Jul 17 12:45 PM
shouldn't AUGBL be a document number???
whts an 'RE' doing in a augbl field? Just Curious.
pk
‎2008 Jul 17 12:46 PM
Hi,
1>Check the where condition.
2> check the data wheather it realy can be fetched
Otherwise there is no reason .
Regards,
anirban
‎2008 Jul 17 12:46 PM
Hi Poonam Naik ,
Try to use 'corresponding fields of table',,,,,,
that may be solve ur probelm,,,,
Hope it is helps.
Regards,
T.Durai murugan.
‎2008 Jul 17 12:46 PM
Hi,
In BSAK, AUGBL is an Clearing Document Number, it is of 10 characters lenght.
Please check that the clearing document number is properly given or not, you can see that i made bold in your select query.
SELECT bukrs
lifnr
augdt
augbl
gjahr
belnr
budat
bldat
blart
wrbtr
zterm
zbd1t
zbd2t
zbd1p
zbd2p
INTO TABLE i_bsak
FROM bsak
WHERE lifnr EQ p_lifnr
AND augdt IN s_date
AND augbl EQ 'RE'
AND gjahr EQ p_gjahr.
‎2008 Jul 17 12:47 PM
Hi,
is this line correct: AND augbl EQ 'RE' ???
Its a BELNR!!
Look via se16 / se16n into BSAK to find as you need.
Regards, Dieter
‎2008 Jul 17 12:47 PM
hi Poonam,
check the value of p_lifnr at runtime. If you have a vendor, whose number is 123, than it is stored in the database: 0000000123 (because of the conversion exit on the domain behind). So p_lifnr has to have the value with the leading zeros.
hope this helps
ec
‎2008 Jul 17 12:50 PM
hi Poonam,
i am not very sure but you can try something like:
WHERE lifnr EQ p_lifnr
AND augbl EQ 'RE'
AND gjahr EQ p_gjahr
OR augdt IN s_date.
With luck,
Pritam.
‎2008 Jul 17 12:55 PM
As Deiter said...
check clearing doc no ..
normally its char of 10.
check that..
Regards..
Raj Mummidi
Edited by: Raju Mummidi on Jul 17, 2008 1:56 PM
‎2008 Jul 18 7:10 AM
hi Poonam,
The problem is in the where condition only.without
declaring AUGBL field as either Parameter or select-options
where will you validate the value 'RE'.So please check it out
to solve the problem.