Skip to Content

Reports display

Hi,

i create an alv report but i am not get data from DB table into my internal table plz tell me where i am do mistake in this programm

TYPES: BEGIN OF gty_output,

vbeln TYPE vbrk-vbeln, " Billing Document

fkart TYPE vbrk-fkart, " Billing Type

vkorg TYPE vbrk-vkorg, " Sales area

vtweg TYPE vbrk-vtweg, " Distribution Channel

kalsm TYPE vbrk-kalsm, " Pricing Procedure

knumv TYPE vbrk-knumv, " Document Condition

bukrs TYPE vbrk-bukrs, " Company Code

kunrg TYPE vbrk-kunrg, " Payer

spart TYPE vbrk-spart, " Division

vbund TYPE vbrk-vbund, " Company ID of Trading Partner

fkimg TYPE vbrp-fkimg, " Invoiced Quantity

matnr TYPE vbrp-matnr, " Material Number

kvgr3 TYPE vbrp-kvgr3, " Customer group

END OF gty_output.

  • Billing Document Header Data

TYPES: BEGIN OF gty_vbrp,

vbeln TYPE vbrp-vbeln, " Billing Document

fkimg TYPE vbrp-fkimg, " Invoiced Quantity

matnr TYPE vbrp-matnr, " Material Number

kvgr3 TYPE vbrp-kvgr3, " Customer group

END OF gty_vbrp.

CONSTANTS: c_sa TYPE char4 VALUE 'SD02'.

  • Distribution Channel

CONSTANTS: c_vt TYPE char2 VALUE 'AI'.

  • Pricing Procedure

CONSTANTS: c_ct TYPE char6 VALUE 'ZMP001'.

  • Company Code

CONSTANTS: c_cd TYPE char4 VALUE '8614'.

  • Division

CONSTANTS: c_dv TYPE char2 VALUE 'AG'.

SELECT-OPTIONS: s_matnr FOR gv_matnr,

  • Refrence Document Number

s_vbeln FOR gv_vbeln,

  • Customer

s_kunrg FOR gv_kunrg,

  • Transaction Partner

s_vbund FOR gv_vbund,

  • Posting Date

s_budat FOR gv_budat,

  • Customer group 3

s_kvgr3 FOR gv_kvgr3.

PARAMETERS: p_fkimg TYPE fkimg.

SELECTION-SCREEN END OF BLOCK blk.

FORM get_data CHANGING ch_it_output TYPE gta_output

ch_wa_output TYPE gty_output

ch_it_vbrp TYPE gta_vbrp

ch_wa_vbrp TYPE gty_vbrp.

SELECT vbeln

fkart

vkorg

vtweg

kalsm

knumv

bukrs

kunrg

spart

vbund

INTO TABLE ch_it_output

FROM vbrk

WHERE vbeln IN s_vbeln AND

fkart = c_bt AND

vkorg = c_sa AND

vtweg = c_vt AND

kalsm = c_ct AND

bukrs = c_cd AND

kunrg IN s_kunrg AND

spart = c_dv AND

vbund IN s_vbund.

IF sy-subrc = 0.

SORT ch_it_output[] BY vbeln.

DELETE ADJACENT DUPLICATES FROM ch_it_output[] COMPARING vbeln.

ENDIF.

IF NOT ch_it_output[] IS INITIAL.

SELECT vbeln

fkimg

matnr

kvgr3

INTO TABLE ch_it_vbrp

FROM vbrp

FOR ALL ENTRIES IN ch_it_output

WHERE vbeln = ch_it_output-vbeln AND

fkimg = p_fkimg AND

matnr IN s_matnr AND

kvgr3 IN s_kvgr3.

IF sy-subrc = 0.

SORT ch_it_vbrp[] BY vbeln.

DELETE ADJACENT DUPLICATES FROM ch_it_vbrp[] COMPARING vbeln.

ENDIF.

LOOP AT ch_it_output INTO ch_wa_output.

READ TABLE ch_it_vbrp INTO ch_wa_vbrp WITH KEY vbeln = ch_wa_output-vbeln

BINARY SEARCH.

IF sy-subrc = 0.

MOVE: ch_wa_vbrp-fkimg TO ch_wa_output-fkimg.

MOVE: ch_wa_vbrp-matnr TO ch_wa_output-matnr.

MOVE: ch_wa_vbrp-kvgr3 TO ch_wa_output-kvgr3.

MODIFY ch_it_output FROM ch_wa_output

TRANSPORTING fkimg matnr kvgr3

WHERE vbeln = ch_wa_vbrp-vbeln.

CLEAR: ch_wa_vbrp.

ENDIF.

CLEAR: ch_wa_output.

ENDLOOP.

endform.

Thanks,

jayant.

plz tell me where is mistake in this code i am not get data in table ch_it_vbrp.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2008 at 09:18 AM

    Did you try checking manually at the table level? If not go to the table VBRP and look up the entries in the table with exactly the same selection criteria that you are using in the report. There might be no relevant data for the provided selection criteria in the table.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2008 at 09:20 AM

    Hi,

    Just keep break point at the second select statement and go into debugging mode and check it.

    i think there is no data .

    Hope it helps you.

    Regards

    Manjari.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2008 at 09:26 AM

    dont use 'into table'

    use 'into corresponding fields of table'

    you have to use 'into table' only if you are going to select all fields

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.