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

move...

I have report Fi , dot have output.

data: begin of ls_nalog,

POZ type BUZEI, "pozicija

KUNNR type KUNNR, " Kupac

BELNR type BELNR_D, " Broj dokumenta sap-a

BLDAT type BLDAT, " Datum dokumenta

DUG type ZDUG, " Duguje

POT type ZPOT, " Potrazuje

SAL type ZSAL, " Saldo

VAL type WAERS, " Valuta

AUGBL type AUGBL, " broj dokumenta veze

BROJ type XBLNR, " Broj

end of ls_nalog.

SELECTION-SCREEN: BEGIN OF BLOCK EKR1 WITH FRAME.

parameters: p_bukrs type knb1-bukrs DEFAULT 'ZS01'.

start-of-selection.

elect * from bkpf into table lt_bkpf

where bukrs = p_bukrs

and gjahr = gjahr

and budat = budat

and blart in s_blart.

loop at lt_bkpf into ls_bkpf.

select * from bseg into table lt_bseg

where belnr = bkpf-belnr

and gjahr = bkpf-gjahr.

endloop.

loop at lt_bseg into ls_bseg.

move ls_bseg-BUZEI to ls_nalog-poz.

move ls_bseg-lifnr to ls_nalog-dug.

move ls_bkpf-bldat to ls_nalog-bldat.

endloop.

***************************don have in otput ls_nalog nothing...

loop at lt_nalog into ls_nalog. " output screen.

WRITE: / ls_nalog-poz,

...

.

..

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 28, 2006 at 02:18 PM

    Check here....

    loop at lt_bseg into ls_bseg.

    move ls_bseg-BUZEI to <b>lt_nalog-poz</b>.

    move ls_bseg-lifnr to <b>lt_nalog-dug</b>.

    move ls_bkpf-bldat to <b>lt_nalog-bldat</b>.

    endloop.

    ur moving to wrong int'table...

    Also, before loop check whether the previous int'table is empty or not which will be good programming.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 28, 2006 at 02:29 PM

    Considering this <b>loop at lt_nalog into ls_nalog.</b>

    loop at lt_bseg into ls_bseg.

    move ls_bseg-BUZEI to ls_nalog-poz.

    move ls_bseg-lifnr to ls_nalog-dug.

    move ls_bkpf-bldat to ls_nalog-bldat.

    <b>* Append is missing here</b>

    <b>Append ls_nalog to lt_nalog.</b>

    endloop.

    if lt_nalog is a table with header line then you can use,

    loop at lt_bseg into ls_bseg.

    move ls_bseg-BUZEI to lt_nalog-poz.

    move ls_bseg-lifnr to lt_nalog-dug.

    move ls_bkpf-bldat to lt_nalog-bldat.

    <b>* Append is missing here</b>

    <b>Append lt_nalog.</b>

    endloop.

    Regards

    Kathirvel

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 28, 2006 at 05:10 PM

    Make the following change:

    select * from bseg into table lt_bseg
      where bukrs = bkpf-bukrs                     <===
        and belnr = bkpf-belnr
        and gjahr = bkpf-gjahr.
    

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 28, 2006 at 07:44 PM

    Hi

    Append statement solves your problem, but other things to be noted in your code is:

    loop at lt_bkpf into ls_bkpf.

    select * from bseg into table lt_bseg

    where belnr = bkpf-belnr

    and gjahr = bkpf-gjahr.

    endloop.

    1) In where condition, you should have ls_bkpf-belnr and ls_bkpf-gjahr.

    2) In the loop, the internal table will be refreshed everytime when the SELECT statement is executed. You need to add the line 'appending into table' or put the endloop at the end of report.

    Regards,

    Navneet

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 28, 2006 at 07:53 PM

    HI Nick,

    I have a suggestion for your FI report, I see you querying directly to BSEG table.

    BSEG is one of the heavy tables and should avoid querying BSEG directly.

    Instead of using BSEG table which is a cluster table, trying querying other tables like

    "I" stands for Open Items,

    BSIS = G/L

    BSIK = Vendor

    BSID = Customer

    "A" for Cleared Items

    BSAS = G/L

    BSAK = Vendor

    BSAD = Customer.

    Which is as good as querying BSEG, but runs a lot faster.

    Regards,

    -Venkat.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Venkat - so long as you use at least BUKRS, BELNR and GJAHR, there is nothing wrong with going directly against BSEG. The index tables quite often have many records for the keys you have (BUKRS and HKONT for BSIS, say). Querying these tables can therefore be much slower than querying BSEG directly.

      Try it out.

      Rob

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.