2010 May 14 10:07 AM
Hi frnds,
In below code i want to hard code plant PALM.
IF plant is PALM then only if condition will fire other wise it raise a below mentiond message
I am taking that PALM value from the screen.
PALM Plant Validation
if wa_table-plant_palm is not initial.
select single matnr werks from marc into wa_marc where matnr eq wa_table-material
and werks eq wa_table-plant_palm.
if sy-subrc eq 0.
select single matnr werks from marc into wa_marc where matnr eq wa_table-component
and werks eq wa_table-plant_palm.
if sy-subrc <> 0.
message 'Component does not exit in this plant' type 'E'.
endif.
else.
message 'Material does not exit in this plant' type 'E'.
endif.
endif.
Edited by: Rakhi@abap on May 14, 2010 11:08 AM
2010 May 14 10:12 AM
hi,
Here my understanding is if plant is PALM then only your if condition sgould work. If its the erquirement, then declare a constant t hold the value PALM, and use it in the same IF condition.
constants: c_palm(4) VALUE 'PALM'.
IF wa_table-plant_palm is not initialAND wa_table-plant_palm EQ c_palm.
your code
ENDIF.
2010 May 14 10:12 AM
hi,
Here my understanding is if plant is PALM then only your if condition sgould work. If its the erquirement, then declare a constant t hold the value PALM, and use it in the same IF condition.
constants: c_palm(4) VALUE 'PALM'.
IF wa_table-plant_palm is not initialAND wa_table-plant_palm EQ c_palm.
your code
ENDIF.
2010 May 14 3:03 PM
2010 May 14 1:25 PM