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

macro mmpur_message

Former Member
0 Likes
1,496

Hi,

I am sendinf error message for Me21n.

I have to send the message for for each transaction.

I am using macro mmpur_message ,

the problem I am getting is it is giving error message for the first item and then it exit the loop , so not giving error for the second item and also even as there is error message in the app log but in status col it have warning sign.

i am just coping my code

LOOP AT tekpo.

  • Check whether the Plant is exists in the custome table zpo_werks_lgort

SELECT SINGLE *

FROM zpo_werks_lgort

WHERE zwerks EQ tekpo-werks.

IF sy-subrc NE 0.

  • If the Plant does not exists in the custome table

  • zpo_werks_lgort then exit the user-exit.

EXIT.

ELSE.

  • Populate Item table

DESCRIBE TABLE tekpo LINES sy-tfill.

IF tekpo-lgort IS INITIAL.

  • Populate Error message in application log by macro

  • when storage location is empty

  • mmpur_metafield '' .

mmpur_metafield mmmfd_item_userexit.

mmpur_message 'E' 'ZW' '026' tekpo-ebelp '' '' ''.

ELSE.

  • Read item table tekpo in order to get the first Item

CLEAR w_tekpo.

READ TABLE tekpo INTO w_tekpo INDEX 1.

IF sy-subrc EQ 0.

w_werks = w_tekpo-werks.

w_lgort = w_tekpo-lgort.

ENDIF. "sy-subrc eq 0.

IF NOT w_lgort EQ tekpo-lgort.

  • Populate Error message in application log by macro

  • when storage location is not same as 1st item

mmpur_metafield mmmfd_item_userexit.

mmpur_message 'E' 'ZW' '025' tekpo-ebelp '' '' ''.

ENDIF.

IF NOT w_werks EQ tekpo-werks.

  • Populate Error message in application log by macro

  • when plant is not same as 1st item

mmpur_metafield mmmfd_item_userexit.

mmpur_message 'E' 'ZW' '027' tekpo-ebelp '' '' ''.

ENDIF. "not w_werks eq tekpo-werks.

ENDIF. "tekpo-lgort is initia

ENDIF. "sy-subrc ne 0

could anybody pls guide me where I am wrong???

Hi,

I am sendinf error message for Me21n.

I have to send the message for for each transaction.

I am using macro mmpur_message ,

the problem I am getting is it is giving error message for the first item and then it exit the loop , so not giving error for the second item and also even as there is error message in the app log but in status col it have warning sign.

i am just coping my code

LOOP AT tekpo.

  • Check whether the Plant is exists in the custome table zpo_werks_lgort

SELECT SINGLE *

FROM zpo_werks_lgort

WHERE zwerks EQ tekpo-werks.

IF sy-subrc NE 0.

  • If the Plant does not exists in the custome table

  • zpo_werks_lgort then exit the user-exit.

EXIT.

ELSE.

  • Populate Item table

DESCRIBE TABLE tekpo LINES sy-tfill.

IF tekpo-lgort IS INITIAL.

  • Populate Error message in application log by macro

  • when storage location is empty

  • mmpur_metafield '' .

mmpur_metafield mmmfd_item_userexit.

mmpur_message 'E' 'ZW' '026' tekpo-ebelp '' '' ''.

ELSE.

  • Read item table tekpo in order to get the first Item

CLEAR w_tekpo.

READ TABLE tekpo INTO w_tekpo INDEX 1.

IF sy-subrc EQ 0.

w_werks = w_tekpo-werks.

w_lgort = w_tekpo-lgort.

ENDIF. "sy-subrc eq 0.

IF NOT w_lgort EQ tekpo-lgort.

  • Populate Error message in application log by macro

  • when storage location is not same as 1st item

mmpur_metafield mmmfd_item_userexit.

mmpur_message 'E' 'ZW' '025' tekpo-ebelp '' '' ''.

ENDIF.

IF NOT w_werks EQ tekpo-werks.

  • Populate Error message in application log by macro

  • when plant is not same as 1st item

mmpur_metafield mmmfd_item_userexit.

mmpur_message 'E' 'ZW' '027' tekpo-ebelp '' '' ''.

ENDIF. "not w_werks eq tekpo-werks.

ENDIF. "tekpo-lgort is initia

ENDIF. "sy-subrc ne 0

could anybody pls guide me where I am wrong???

1 REPLY 1
Read only

Former Member
0 Likes
658

just want to share my thought:

you are in the wrong userexit.