Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Report

Former Member
0 Kudos

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

7 REPLIES 7

Former Member
0 Kudos

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

Former Member
0 Kudos

Reported !!!

Use a more meaningful subject line in future.

Regards

Karthik D

Former Member
0 Kudos

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.

Former Member
0 Kudos

Are you looping at itab2 and inserting a value into itab2? If so you need to MODIFY itab2 TRANSPORTING dmbtr1.

matt
Active Contributor
0 Kudos

Please use a meaningful subject in future

Former Member
0 Kudos

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

Former Member
0 Kudos

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