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

Loop at

Hi guys,

I have to search partner who have sales contract.

In order to do that i have a Partner number (id) and tables and... ABAP !

With "id" i have to find sales contract. The method is the following one :

in table CRMD_PARTNER, PARTNER_NO = "id".

But many records exist with PARTNER_NO = "id" with an interesting field : guid with is the number of object (sales contract, opportunity, ...).

(for example :

guid g1 ... partner_no "id"

guid g2 ... partner_no "id"

guid g3 ... partner_no "id"

guid g4 ... partner_no "id"

)

So i have to look at CRMD_LINK with GUID_SET = guid if the object is an sales contract.

So my problem is toi use "LOOP AT" in order to verify for each object if one of them is a sales contract.

Points will be assigned...

Best cheers,

Vince.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 10:45 AM

    I create an internal table itab :

    TYPES : begin of wat,

    gwaf type crmd_partner-guid,

    end of wat.

    DATA : wa type wat.

    DATA : itab like table of wa.

    i try to put into itab all entries from CRMD_PARTNER where partner_no = "id" with :

    select guid

    into corresponding fields of table itab

    from crmd_partner

    where partner_no = 'id'.

    I don't understand why, but itab contains the good number of records but "itab-gwaf" is allways empty !!!

    for example :

    in CRMD_PARTNER :

    guid g1 ... partner_no "id"

    guid g2 ... partner_no "id"

    guid g3 ... partner_no "id"

    guid g4 ... partner_no "id"

    and in my itab after the "SELECT" :

    gwaf 00000000

    gwaf 00000000

    gwaf 00000000

    gwaf 00000000

    do you know why ?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 09:44 AM

    data: begin of wa,

    pno type crmd_partner-partner_no,

    end of wa.

    data: itab like table of wa.

    SELECT p~partner_no

    INTO CORRESPONDING FIELDS OF TABLE itab

    FROM ( crmd_partner AS p

    INNER JOIN crmd_link AS s ON pguid = sguid_set)

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 22, 2007 at 09:45 AM

    According to my understanding u hav an internal table with fileds partner id, guid etc...

    n der can b same partner ids repeating with diff guid value..

    u want to select row with guid = sales oredr.

    if this is the case u can use the following code format

    sort itab by partner id.

    loop at itab into wa1_itab.

    at new partner id.

    loop at itab into wa2_itab where partnet id = wa1_itab-parner id.

    if wa2_itab-guid = sales oredr.

    move to another itab3.

    endif.

    endloop.

    endat.

    endloop.

    hop this wil help u

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 09:53 AM

    Hi Vince,

    Create an internal table (ITAB) with Fields Partner ID, GUID, GUID_SET.

    Move all the entries in table CRMD_PARTNER for all the partner IDs to ITAB.

    Select on CRMD_LINK for all entries in ITAB into ITAB2 (same strcuture of ITAB).

    ITAB2 will hold your sales contracts.

    Hope it helps.

    Lokesh

    Message was edited by:

    Lokesh Aggarwal

    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.