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

abap

i have selected labst from mard based on matnr and charg from mchb based on for all entries in it_mard.and looping both internal tabels is it correct

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Oct 24, 2006 at 10:22 AM

    Hi Rakhee,

    Is your Code something similar to this?

    select matnr

    werks

    lgort

    labst

    from mard

    into table it_mard

    where matnr in s_matnr.

    if not it_mard[] is initial.

    select matnr

    werks

    lgort

    charg

    from MCHB

    into table it_mchb

    for all entries in it_mard

    where matnr = it_mard-matnr

    and werks = it_mard-werks

    and lgort = it_mard-lgort.

    endif.

    loop at it_mchb.

    move-corrsponding it_mchb to it_final.

    read table it_mard with key matnr = it_mchb-matnr

    werks = it_mchb-werks

    lgort = it_mchb-lgort.

    if sy-subrc = 0.

    move-corresponding it_mard to it_final.

    append it_final.

    clear it_final.

    endif.

    endloop.

    Regards,

    ravi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 24, 2006 at 10:12 AM

    Yes it is correct...if you refer to my code in your earlier post you can replace the code in second select to get the data from MARD..the rest can remain the same to give you the percentage.

    Please note to reward points for all helpful answers...

    Thanks and Regards

    Anurag

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 24, 2006 at 10:16 AM

    Hi,

    YOu can write lik e below also,

    SELECT MARDMATNR MARDLABST MCHB~CHARG

    INTO TABLE IT_MARD_MCHB

    FROM MARD INNER JOIN MCHB

    ON MARDMATNR = MCHBMATNR AND

    MARDWERKS = MCHBWERKS AND

    MARDLGORT = MCHBLGORT.

    Thanks,

    Ramakrishna

    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.