Skip to Content
author's profile photo Former Member
Former Member

REPORT

Hi

In the below prg the fields matnr,belnr,menge of bsim table is not executed

TYPES : BEGIN OF TY_BSIS,

BUKRS TYPE BSIS-BUKRS, "COMPANY CODE

HKONT TYPE BSIS-HKONT, "GENERAL LEDGER ACCOUNT

GJAHR TYPE BSIS-GJAHR, "FISCAL YEAR

BELNR TYPE BSIS-BELNR, "ACCOUNTING DOCUMENT NO

BUDAT TYPE BSIS-BUDAT, "POSTING DATE IN THEDOCUMENT

BLART TYPE BSIS-BLART, "DOCUMENT TYPE

SHKZG TYPE BSIS-SHKZG, "DEBIT/CREDIT INDICATOR

DMBTR TYPE BSIS-DMBTR, "AMOUNT IN LOCAL CURRENCY

KOSTL TYPE BSIS-KOSTL, "COST CENTER

END OF TY_BSIS,

BEGIN OF TY_BSIM,

MATNR TYPE BSIM-MATNR,

BELNR TYPE BSIM-BELNR,

GJAHR TYPE BSIM-GJAHR,

MENGE TYPE BSIM-MENGE,

END OF TY_BSIM,

BEGIN OF TY_FINAL,

BUKRS TYPE BSIS-BUKRS,

HKONT TYPE BSIS-HKONT,

GJAHR TYPE BSIS-GJAHR,

dmbtr type bsis-dmbtr,

BELNR TYPE BSIM-BELNR,

shkzg type bsis-shkzg,

KOSTL TYPE BSIS-KOSTL,

MATNR TYPE BSIM-MATNR,

MENGE TYPE BSIM-MENGE,

budat type bsim-budat,

blart type bsim-blart,

END OF TY_FINAL.

*DATA: W_BSIS TYPE TY_BSIS,

  • W_BSIM TYPE TY_BSIM,

  • W_FINAL TYPE TY_FINAL,

**********SELECT OPTIONS**********

data: it_BSIm type standard table of TY_BSIm with header line.

DATA: it_bsis TYPE STANDARD TABLE OF ty_bsis WITH HEADER LINE ,

it_final TYPE STANDARD TABLE OF ty_final WITH HEADER LINE,

w_bsis type ty_bsis,

w_bsim type ty_bsim,

w_final type ty_final.

**********SELECT OPTIONS**********

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS: S_ACCNT FOR w_bsis-hkont,

S_CODE FOR W_BSIS-BUKRS,

S_FYEAR FOR W_

S_DCTYPE FOR W_BSIS-BLART,

S_PSDT FOR W_BSIS-BUDAT.

SELECTION-SCREEN END OF BLOCK B1 .

**********SELECT OPTIONS**********

select * from bsis into corresponding fields of table it_bsis where

hkont in s_accnt and

bukrs in s_code .

if it_bsis[] is not initial .

select * from bsim into corresponding fields of table it_bsim

where belnr = W_bsis-belnr .

endif.

LOOP AT IT_BSIS INTO W_BSIS.

READ TABLE IT_BSIS INTO W_BSIS WITH KEY BELNR = W_BSIS-BELNR.

W_FINAL-BUKRS = W_BSIS-BUKRS.

W_FINAL-HKONT = W_BSIS-HKONT.

W_FINAL-GJAHR = W_BSIS-GJAHR.

W_FINAL-BELNR = W_BSIS-BELNR.

W_FINAL-SHKZG = W_BSIS-SHKZG.

W_FINAL-DMBTR = W_BSIS-DMBTR.

READ TABLE IT_BSIM INTO W_BSIM WITH KEY BELNR = W_BSIS-BELNR .

W_FINAL-MATNR = W_BSIM-MATNR.

W_FINAL-BELNR = W_BSIM-BELNR.

W_FINAL-GJAHR = W_BSIM-GJAHR.

W_FINAL-MENGE = W_BSIM-MENGE.

APPEND W_FINAL TO IT_FINAL.

ENDLOOP.

loop at it_final INTO W_FINAL.

write : /

W_final-hkont,

W_final-gjahr,

W_final-dmbtr,

W_final-belnr,

W_final-shkzg,

W_final-KOSTL,

W_final-matnr,

W_final-menge,

W_final-budat.

ENDLOOP.

please solve the problem .

with regards

lalitha .

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 29, 2007 at 04:13 PM

    The problem is here;

    if it_bsis[] is not initial .

    select * from bsim into corresponding fields of table it_bsim

    where belnr = W_bsis-belnr .

    endif.

    w_bsis at this point is stilll initial

    You would be better to use

    if it_bsis[] is not initial .

    select * from bsim into corresponding fields of table it_bsim

    for all entries in table it_bsis

    where bsim-belnr = it_bsis-belnr .

    endif.

    (this is psudo-code, you'll need to check the syntax before you use it).

    Regards,

    Nick

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 07:22 AM

    you write types statment before it.

    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.