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

stop IDOC processing

Former Member
0 Likes
2,081

Hi friends,

I am using 'INPUT_IDOC_MATMAS01' as my inbound function module. I want to add one condition at the starting of this function module, if this condition turns true then IDOC_STATUS-STATUS shoud be set to '68' and then IDOC should be generated and then control should exit the function module. I am not able to do so. Even when I use 'exit' keyword, the code is getting run somewhere and hence IDOC is generated with '68' and '53'(Success) as well. I dont want to do further processing once that condition gets true.

Please guide.

Thanks,

Gaurav

3 REPLIES 3
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,007

if you add one EXIT statement at the beginning of INPUT_IDOC_MATMAS01, it means the IDoc won't be processed.

If you placed your EXIT in a loop, it exits the loop, but doesn't exit the FM.

Make sure this FM is really called. You may use an SQL trace (ST05) to identify the ABAP code which updates the EDIDC table (containing the status).

Note that 68 status is reserved to IDocs created by WE19 test tool for inbound file test.

Paste your code if you need further assistance (no more than 2500 characters, as usually, please)

Read only

0 Likes
1,007

Hi sandra,

below is the code used in the enhancement portion of the function module.

IF  ERROR_FLAG = 'C'.
      IDOC_STATUS-STATUS = '68'.       "ERROR!
      IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
      IDOC_STATUS-MSGTY = 'E'.
      IDOC_STATUS-MSGV1 = 'NO PROCESSING'.
      APPEND IDOC_STATUS.
     EXIT
ENDIF.

Thanks,

Gaurav

Read only

0 Likes
1,007

Hi Sandra,

I am adding 'exit' at the begining of the code which i have done in an enhancement option available at the begining of the function module.

idoc_status-docnum = idoc_contrl-docnum.
      idoc_status-status = '68'.
      idoc_status-msgv1 = 'No need to process'.
      append idoc_status.
      exit.

Thanks,

Gaurav