03-25-2008 9:44 AM
Hi friends ,
i want to pick dmbtr value from bseg table in report.
where zuonr = invoice no.
Hkont = 6105410 to 6105500.
i use this select clause
SELECT bukrs belnr gjahr dmbtr
zuonr FROM bseg
INTO CORRESPONDING FIELDS OF TABLE i_bseg
FOR ALL ENTRIES IN i_vbtab
WHERE zuonr = i_vbtab-vbeln
and Hkont in ( '610547' , '6105500' ).
but there is error that zuonr = i_vbtab-vbeln lenght does not match.
is where clause used for hkont correct
03-25-2008 9:56 AM
Try like this...
data: zuonr like bseg-zuonr.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = i_vbtab-vbeln
importing
output = zuonr.
SELECT bukrs belnr gjahr dmbtr
zuonr FROM bseg
INTO CORRESPONDING FIELDS OF TABLE i_bseg
FOR ALL ENTRIES IN i_vbtab
WHERE zuonr = zuonr
and Hkont in ( '610547' , '6105500' ).
hope it will help u..
Regards
Sugumar G
03-25-2008 9:46 AM
hi,
SELECT bukrs belnr gjahr dmbtr
zuonr FROM bseg
INTO CORRESPONDING FIELDS OF TABLE i_bseg
FOR ALL ENTRIES IN i_vbtab
WHERE zuonr = i_vbtab-vbeln
and Hkont in ( '0000610547' , '0006105500' ).
Reward if helpful
Regards
Vodka.
03-25-2008 9:48 AM
Hi,
in your code the ZUONR(Assignment number) from BSEG table is of length 18. Whereas the VBELN is of length 10.
Thats why it shows the error.
Regards,
Sankar.
03-25-2008 9:50 AM
Hi,
Try this out.
Change the Data type of Vbeln as the type of zuonr in the table i_vbtab.
Regards,
Balakumar.G
Reward Points if helpful.
03-25-2008 9:52 AM
HI,
where clause(hkont) will not give u the desired result for that write the code like this.you have to use ranges if u use in it will check on only for those two values not for that range.
ranges:r_hkont for bseg-hkont.
r_hkont-sign = 'I'.
r_hkont-option = 'BT'.
r_hkont-low = '610547'.
r_hkont-high = '6105500'.
APPEND r_hkont.
SELECT bukrs belnr gjahr dmbtr
zuonr FROM bseg
INTO CORRESPONDING FIELDS OF TABLE i_bseg
FOR ALL ENTRIES IN i_vbtab
WHERE Hkont in r_hkont and zuonr = i_vbtab-vbeln.
and for the first error while decalring internal table i_vbtab declare the field vbeln is of length 18.
rgds,
bharat.
03-25-2008 9:55 AM
Hi,
Check the length for zuonr and i_vbtab-vbeln?
And the hkont values you are passing, that should be prefixed by 0000 leading zeros, otherwise your select statement will fail to retrieve the data.
Chnage the code as below:
SELECT bukrs belnr gjahr dmbtr
zuonr FROM bseg
INTO CORRESPONDING FIELDS OF TABLE i_bseg
FOR ALL ENTRIES IN i_vbtab
WHERE zuonr = i_vbtab-vbeln "Check the length
and Hkont in ( '0000610547' , '00006105500' ). "Changed the code here.
Thanks,
Sriram Ponna.
03-25-2008 11:00 AM
Hi
sriram.
in vbtab i had already define vbeln as bkpf-AWKEY.
here i had requirement where AWKEY = I_VBTAB-VBELN
now how to define it again as bseg-zuonr
03-25-2008 9:55 AM
Hi Guru
Whether u check u Declare data r not.
Data : zuonr like bseg-zuonr.
Reward Me Points
By
Pari
03-25-2008 9:56 AM
Try like this...
data: zuonr like bseg-zuonr.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = i_vbtab-vbeln
importing
output = zuonr.
SELECT bukrs belnr gjahr dmbtr
zuonr FROM bseg
INTO CORRESPONDING FIELDS OF TABLE i_bseg
FOR ALL ENTRIES IN i_vbtab
WHERE zuonr = zuonr
and Hkont in ( '610547' , '6105500' ).
hope it will help u..
Regards
Sugumar G
03-25-2008 9:58 AM
hi
declair as below
VBELN LIKE table_name- ZUONR
your problem will be solve.
03-25-2008 11:45 AM
Hi
in vbtab i had already define vbeln as bkpf-AWKEY.
here i had requirement where AWKEY = I_VBTAB-VBELN
now how to define it again as bseg-zuonr
03-25-2008 11:59 AM
Try Like this,
data:
wrk_zuonr type bseg-zuonr.
move i_vbtab-vbeln to wrk_zuonr.
SELECT bukrs belnr gjahr dmbtr
zuonr FROM bseg
INTO CORRESPONDING FIELDS OF TABLE i_bseg
FOR ALL ENTRIES IN i_vbtab
WHERE zuonr = wrk_zuonr
and Hkont in ( '610547' , '6105500' ).
03-26-2008 3:05 AM
Hi friends .
There is still a problem.
i had used.
data:zuonr type bseg-zuonr.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = i_vbtab-vbeln
importing
output = zuonr.
SELECT bukrs belnr gjahr dmbtr
zuonr FROM bseg
INTO CORRESPONDING FIELDS OF TABLE i_bseg
FOR ALL ENTRIES IN i_vbtab
WHERE zuonr = zuonr
and Hkont in ( '610547' , '6105500' ).
i had given all commas where required
but it says comma with out precending colon after select.
03-26-2008 3:15 AM
ZUONR is of length 18 and VBELN is of length 10.
And the first 10 characters of ZUONR are the VBELN. So change the program accordingly and select the data from BSEG.
Regards
Gopi
03-26-2008 3:28 AM
HI,
Just copy this query and replace it.
SELECT bukrs belnr gjahr dmbtr
zuonr FROM bseg
INTO CORRESPONDING FIELDS OF TABLE i_bseg
FOR ALL ENTRIES IN i_vbtab
WHERE zuonr = zuonr
and Hkont in ('0000610547','0006105500' ).
Reward if helpful
Regards
Vodka.