06-17-2009 1:37 PM
Please use a meaningful subject in future
Hi,
I m picking the data from BSEG table, but not coming...
When i m inserting Document Type, Fiscal year, Line Item ID & Tax Type in BSEG table...it is giving my required output...
But when i executing my report, fatching that data from BSEG....not giving any output...
My Query is: -
SELECT SINGLE dmbtr FROM bseg INTO itab2-dmbtr1 WHERE belnr = itab2-belnr AND gjahr = itab2-gjahr AND buzid = 'T' AND mwart = 'V'.
Please help me...
Edited by: Matt on Jun 17, 2009 5:02 PM
06-17-2009 1:40 PM
Corresponding to your BELNR is there one entry or more than one entry in BSEG table and whats the value of DMBTR in the first entry... And also what is itab2 is it a table or structure and how u have fetched data for belnr and gjahr.....?
Edited by: vijetasap on Jun 17, 2009 2:40 PM
06-17-2009 1:42 PM
Reported !!!
Use a more meaningful subject line in future.
Regards
Karthik D
06-17-2009 1:54 PM
If you are not getting any output, it means that there are no records matching your criteria. I was able to get one record using below code.
DATA itab TYPE bseg.
itab-belnr = 0100000280.
itab-gjahr = 1995.
SELECT SINGLE dmbtr FROM bseg INTO itab-dmbtr WHERE belnr = itab-belnr AND gjahr = itab-gjahr AND buzid = 'T' AND mwart = 'V'.
WRITE:/ itab-belnr, itab-gjahr, itab-buzid, itab-mwart, itab-dmbtr.
So pick one particular record from bseg table, with buzid = T and mwart = V, then try to test your code against same selection criteria.
06-17-2009 1:58 PM
Are you looping at itab2 and inserting a value into itab2? If so you need to MODIFY itab2 TRANSPORTING dmbtr1.
06-17-2009 4:02 PM
06-17-2009 4:07 PM
Hi,
check this..
Loop at itab2. "check this is there
SELECT SINGLE dmbtr FROM bseg INTO itab2-dmbtr1
WHERE belnr = itab2-belnr
AND gjahr = itab2-gjahr
AND buzid = 'T'
AND mwart = 'V'.
endloop. "check this
" or if no LOOP at itab2 is not necessary try belwo way..
SELECT SINGLE dmbtr FROM bseg INTO itab2-dmbtr1
for all entries of itab2 "Add this
WHERE belnr = itab2-belnr
AND gjahr = itab2-gjahr
AND buzid = 'T'
AND mwart = 'V'.
else.
check in debuggiing any values are comming to itab2-dmbtr1 itab2-belnr itab2-gjahr ..
Regards,
Prabhudas
06-17-2009 6:13 PM
Hi,
Just format BELNR before using into select statement.
Means if belnr is 100 then you should pass 0000000100. You can directly use FM for converting it to internal format. Just go to data element (I hope BELNR_D) and see conversion exit name and use. Before using select statement loop into itab and convert all belnr to internal format.
LOOP AT it_data INTO wa_data.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' -
Check exact fm name once again..in
EXPORTING -
BELNR_D data element....
input = wa_data-belnr
IMPORTING
output = wa_data-belnr.
IF sy-subrc = 0.
MODIFY it_data FROM wa_data TRANSPORTING belnr.
ENDIF.
ENDLOOP
Your problemshould get resolved.
Regards,
Anil Salekar