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

Collect logic needed

itdetail_

BUDAT PERIOD SAKNR AUFNR BLART DMBTR

19960329|199603|0000461100|12-6925-0203|VC | 1000.00

19960424|199604|0000461100|12-6925-0203|VC | 16534.00

19960627|199606|0000461100|12-5757-0403|IG | 65.79

I need to collect Collect DMBTR field using AUFNR and BLART

Ho to do this?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 09, 2008 at 08:35 AM

    hello kumar-

    The best way of performing collect statement is upload itab with workarea.

    types:begin of ty_collect,

    aufnr type aufnr,

    blart type blart,

    end of ty_collect.

    data:it_collect type table of ty_collect,

    wa_collect type ty_collect.

    loop at itab into wa_collect. ****Here itab is the internal table with data

    coollect wa_collect into it_collect. ***it_collect is the new internal table

    endloop.

    Cheers,

    ~Srini...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 09, 2008 at 07:05 AM

    Hi,

    see this example

    DATA: BEGIN OF seats, 
            carrid   TYPE sflight-carrid, 
            connid   TYPE sflight-connid, 
            seatsocc TYPE sflight-seatsocc, 
          END OF seats. 
    
    DATA seats_tab LIKE HASHED TABLE OF seats 
                   WITH UNIQUE KEY carrid connid. 
    
    SELECT carrid connid seatsocc 
           FROM sflight 
           INTO seats. 
      COLLECT seats INTO seats_tab. 
    ENDSELECT. 
    

    rgds,

    bharat.

    Add a comment
    10|10000 characters needed characters exceeded

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

    any one help me pls

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 09, 2008 at 07:34 AM

    you will need to collect into a separate table, which only has the fields AUFNR, BLART and DMBTR.

    See also the ABAP help for the statement "COLLECT".

    Greetings

    Thomas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 09, 2008 at 08:22 AM

    Hi,

    Refer to the following code:

    SELECT RFAREA RBUKRS RPRCTR RACCT RYEAR HSLVT HSL01 HSL02 HSL03 HSL04 HSL05

    HSL06 HSL07 HSL08 HSL09 HSL10 HSL11 HSL12 KSLVT KSL01 KSL02 KSL03

    KSL04 KSL05 KSL06 KSL07 KSL08 KSL09 KSL10 KSL11 KSL12 FROM GLPCT

    APPENDING TABLE INT_GLPCT WHERE RLDNR = '8A' AND RRCTY = '0'

    AND RVERS = '000' AND KOKRS = '1000'

    AND RBUKRS IN S_COMP AND RYEAR = P_YEAR

    AND RPRCTR IN S_PROFIT AND RACCT IN S_ACCT

    AND RFAREA IN S_COST.

    LOOP AT INT_GLPCT.

    MOVE-CORRESPONDING INT_GLPCT TO INT_GLPCT_COLLECT.

    COLLECT INT_GLPCT_COLLECT.

    ENDLOOP.

    Hope this helps.

    Reward if helpful.

    Regards,

    Sipra

    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.