Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

problem with report events

Former Member
0 Likes
480

HI ,

iam having 2 parameters on a selection screen.

parameters : plant like mara-plant ,

matnr like mara-matnr..

now i will enter some material no in matnr parameter , then i next step it has to check automatically that material exist in that palnt or not . if exits means the process will be continued , if not it has to show an error that material does not exist in that plant ..

Thans & Regards

Latha murthy

HI ,

iam having 2 parameters on a selection screen.

parameters : plant like mara-plant ,

matnr like mara-matnr..

now i will enter some material no in matnr parameter , then i next step it has to check automatically that material exist in that palnt or not . if exits means the process will be continued , if not it has to show an error that material does not exist in that plant ..

Thans & Regards

Latha murthy

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
440

You may do your validations in the AT SELECTION-SCREEN event.



report zrich_0001 .

data: xmarc type marc.

parameters: p_matnr type mara-matnr,
            p_werks type marc-werks.

at selection-screen.

  clear xmarc.
  select single * into xmarc from marc
            where matnr = p_matnr
              and werks = p_werks.
  if sy-subrc  <> 0.
    message e001(00) with 'Material is not extended to plant'.
  endif.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
440

Hi

TABLES: MARA, MARC, T001W.

PARAMETERS: P_MATNR LIKE MCHA-MATNR,
            P_PLANT LIKE MCHA-WERKS.

AT SELECTION-SCREEN ON P_MATNR.
  SELECT SINGLE * FROM MARA WHERE MATNR = P_MATNR.
  IF SY-SUBRC <> 0.
    MESSAGE E208(00) WITH 'No material'.
  ENDIF.

AT SELECTION-SCREEN ON P_PLANT.
  SELECT SINGLE * FROM T001W WHERE WERKS = P_PLANT.
  IF SY-SUBRC <> 0.
    MESSAGE E208(00) WITH 'No plant'.
  ENDIF.

AT SELECTION-SCREEN.
  SELECT SINGLE * FROM MARC WHERE MATNR = P_MATNR
                              AND WERKS = P_PLANT.
  IF SY-SUBRC <> 0.
    MESSAGE E208(00) WITH 'No plant'.
  ENDIF.

If you use MCHA table the system'll show all plant of the material chosen automatically.

Max

Read only

Former Member
0 Likes
440

Thans for ur suggestion .