Skip to Content
author's profile photo
Former Member

select statement?

hi,

my requirement is like below.

1)i have internal table it_mat_plant.

2)select plant type from zpalnt table for the it_mat_plant-werks.

3)if plant type = 'External mfg" then delete record other wise step 4.

4) select matnr mtart from MARA table into it_mara where matnr = it_mat_plant-matnr.

please tell me how to code this requirement.

please give me sample code

thanks

satish

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Posted on Sep 28, 2007 at 03:12 AM

    Hi,

    Use the below code for ref...

    SELECT plant type

    FROM zplant

    INTO TABLE it_zplant

    FOR ALL ENTRIES IN it_mat_plant

    WHERE werks = it_mat_plant-werks.

    IF sy-subrc = 0.

    DELETE it_zplant WHERE plant_type = 'External mfg'.

    ENDIF.

    SELECT matnr mtart

    FROM mara

    INTO TABLE it_mara

    FOR ALL ENTRIES IN it_mat_plant

    WHERE matnr = it_mat_plant-matnr.

    reward if helpful,

    Karthik

    Message was edited by:

    Karthik

    Add comment
    10|10000 characters needed characters exceeded