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

Problem with FOR ALL ENTRIES

Hi All,

I have an internal table where i have populated Billing Document header and item level data. Now i have a field in the same internal table "material Desc" which is empty. I have material number data in the same internal table.

Now i have used for all entries syntax to get the material description against available material number as follows.

SELECT MAKTX FROM MAKT

INTO I_VBRK-MAKTX

FOR ALL ENTRIES IN I_VBRK

WHERE MATNR = I_VBRK-MATNR.

After execution of this syntax, the internal table is populating with required Material Description. But the other fields like Billing Document Number, Business Areas etc data are getting deleted.

How to resolve this issue?

Regards

Pavan

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 09:36 AM

    Hi Use INTO CORRESPONDING FIELDS OF I_VBRK

    awrd points if useful

    bhupal

    Add a comment
    10|10000 characters needed characters exceeded

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

    Hi,

    Try this.

    LOOP AT I_VBRK.

    SELECT MAKTX FROM MAKT INTO I_VBRK-MAKTX

    WHERE MATNR = I_VBRK-MATNR.

    MODIFY I_VBRK TRANSPORING MAKTX.

    ENDLOOP.

    Rewards points if helpful.

    Regards,

    Srinivas Ch

    Add a comment
    10|10000 characters needed characters exceeded

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

    Hi friend, make sure that your internal table has required fields. and use " into corresponding fields of" . It solves ur problem

    Add a comment
    10|10000 characters needed characters exceeded

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

    Hi,

    The structure of i_vbrk_maktx should have all the required fields.

    regards,

    kavitha

    Add a comment
    10|10000 characters needed characters exceeded

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

    Hi,

    Do like this

    Types: Begin of ty_MAKT,

    matnr type makt-matnr,

    maktx type makt-maktx,

    end of ty_makt.

    Data: I_MAKT type table of ty_makt,

    wa_makt type ty_makt.

    SELECT MAKTX FROM MAKT

    INTO I_MAKT

    FOR ALL ENTRIES IN I_VBRK

    WHERE MATNR = I_VBRK-MATNR.

    Sort I_MAKT by matnr.

    In the loop of I_VBRK,

    READ TABLE I_MAKT into WA_MAKT with key matnr = i_VBRK-matnr binary search.

    if sy-subrc = 0.

    move wa_makt-maktx to itab-maktx.

    append itab.

    clear itab.

    endif.

    Regards,

    Satish

    Add a comment
    10|10000 characters needed characters exceeded

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

    hi,

    Dont keep the select statement in the loop it is the performance issue.

    so select maktx into one internal table according to the material

    then keep the loop to first internal table and use modify key word to modify the interanl table itself.

    modify internal table index sy-tabix from work area trasporting maktx.

    modify should be inside the loop.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 10:08 AM

    Hi Pavan,

    Just try by modifying your query as follows:

    SELECT MAKTX FROM MAKT

    INTO CORRESPONDING FIELDS OF I_VBRK-MAKTX

    FOR ALL ENTRIES IN I_VBRK

    WHERE MATNR = I_VBRK-MATNR.

    This clause will checks the internal table for a similar field type as that of the selected field and updates only that field.

    Hence your problem will be solved.

    Reward if useful.

    Regards,

    Shiny

    Add a comment
    10|10000 characters needed characters exceeded

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

    Answered...

    Thanks.... 😊

    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.