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

Replace 'raise' with message

Former Member
0 Likes
621

Hello!

Replace 'raise' with message is the warning which I get. What has to be

done ?

Regards

sas

  CALL FUNCTION '/BMW/STD_IFF_SNR_ZU_AG'
       EXPORTING
            werk       = iff_daten-werk
            sachnummer = iff_daten-sachnummer
            ai         = iff_daten-ai
       IMPORTING
            snr_zu_ag  = ila_iff_snr_ls
       EXCEPTIONS
            not_found  = 1
            OTHERS     = 2.

  IF sy-subrc = 0.
    snr_zu_ag_lf = 'X'.
  ELSE.
    snr_zu_ag_lf = ' '.
  ENDIF.

* Wurde keine Zuordnung gefunden, lesen Kunde aus zfs5zwv_abst
  IF snr_zu_ag_lf = ' '.
    SELECT SINGLE debitor
      FROM /BMW/STD_ZFS5ZWV
      INTO lv_kunnr_lf
     WHERE bmwwerk = iff_daten-werk.
    IF sy-subrc <> 0.
      RAISE kunnr_not_found.
      EXIT.
    ENDIF.
  ELSE.
    lv_kunnr_lf = ila_iff_snr_ls-auftraggeber.
  ENDIF.

  IF lv_kunnr_lf IS INITIAL.
    RAISE kunnr_not_found.
    EXIT.
  ENDIF.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
575

hi sas,

if it's <b>function module</b> then it dont accept <b>message</b>, you should replace with <b>raise</b> keyword.

if it's report then u should write like this,

message e001 (ZMEGCLA).

ZMEGCLA this should be message class which u should create in se91,

e001 by double click on this text u can enter text like'custmoer not avbl'.

then save and activate.

reward points if useful,

regards,

seshu.

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
575

Is all of this code being called within a function module or method?

Regards,

Rich Heilman

Read only

Former Member
0 Likes
576

hi sas,

if it's <b>function module</b> then it dont accept <b>message</b>, you should replace with <b>raise</b> keyword.

if it's report then u should write like this,

message e001 (ZMEGCLA).

ZMEGCLA this should be message class which u should create in se91,

e001 by double click on this text u can enter text like'custmoer not avbl'.

then save and activate.

reward points if useful,

regards,

seshu.

Read only

Former Member
0 Likes
575

Hi

Based on the Program Create a Message class ZA using SE91 (not for fun module) and

add/create a message 000 with 4 Place holders in it like &&&& and

then write

IF snr_zu_ag_lf = ' '.

SELECT SINGLE debitor

FROM /BMW/STD_ZFS5ZWV

INTO lv_kunnr_lf

WHERE bmwwerk = iff_daten-werk.

IF sy-subrc <> 0.

<b> message i000(za) with 'Customer Not found'.</b>

EXIT.

ENDIF.

ELSE.

lv_kunnr_lf = ila_iff_snr_ls-auftraggeber.

ENDIF.

IF lv_kunnr_lf IS INITIAL.

<b>message i000(za) with 'Customer Not found'.</b>

EXIT.

ENDIF.

Reward points for useful Answers

Regards

Anji

Message was edited by:

Anji Reddy Vangala

Read only

Former Member
0 Likes
575

Hi,

Go to SE91. Create a message class(for example:zwarn) and add a message number to it(example: W01)

Now replace raise in your program with<b>

MESSAGE W01.</b>

Hope it solves.

Regards

Aneesh.