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

IDOC Error Logic Issue

Former Member
0 Likes
2,025

Hello friends, For an outbound Delivery IDOC in the user Exit I need to check a condition where the IDOC is created and then if everything looks good in my codition the IDOC needs to be generated and in the delivery the status should change to Green from Yellow. This piece works fine

However if the condition is not fulfilled the Status should remain Yellow Color and no IDOC should be generated.

Below is what I do.

This is how my Outbound IDOC FM is called. withhing the function module if my condition is not fulfilled, I raise an exception and pass a 'sy-subrc = ,01, - data not relevent.

By doing so the IDOC is not created, how ever the status turns to green and a pop message with processed sucessfully is shown. I dont want the status to be green. It should still remain Yellow or turn RED.

Any IDEA.

Thanks,

Rajeev


 CALL FUNCTION TEDE1-ROUTID
           EXPORTING
                CONTROL_RECORD_IN      = EDIDC
                OBJECT                 = NAST
           IMPORTING
                CONTROL_RECORD_OUT     = EDIDC
                OBJECT_TYPE            = HELP_OBJECT_TYPE
           TABLES
                INT_EDIDD              = INT_EDIDD
           EXCEPTIONS
                DATA_NOT_RELEVANT_FOR_SENDING = 01
                OTHERS                 = 04.

Edited by: Rajeev_D on Feb 14, 2011 10:10 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,882

when you raise exception, are you passing error message? Something like this,

MESSAGE EXXX RAISING DATA_NOT_RELEVANT_FOR_SENDING

8 REPLIES 8
Read only

Former Member
0 Likes
1,883

when you raise exception, are you passing error message? Something like this,

MESSAGE EXXX RAISING DATA_NOT_RELEVANT_FOR_SENDING

Read only

0 Likes
1,882

HI Kris I have done exactly the same as you did, but unoftunately the status at the delivery output turns green indication a succesful. however the IDOC is not created.

Thanks,

Rajeev

Read only

0 Likes
1,882

Put a breakpoint in NAST_PROTOCOL_UPDATE and see how this FM is getting executed?

Read only

0 Likes
1,882

Thanks Kris,

I have a break point at NAST_PROTOCOL_UPDATE and this FM is triggered even before my exit is triggered where i have the error message.

Thanks

Read only

0 Likes
1,882

It's not an issue with NAST_PROTOCOL_UPDATE or the message type though. That function only logs messages; it does not set the status of the output processing. Follow the EDI_PROCESSING code in RSNASTED and you'll see how the code flips the return code value to '0' if the value is '1'. That basically means it processed successfuly but there was no need to send an IDOC. You need to force a different exception which would be caught by 'OTHERS' and log a message if you want the status to go to red. You can't really keep it at yellow without a hack.

Read only

0 Likes
1,882

Thank you Brad for pointing it out...

Rajiv, Please check out the following threads; As Brad pointed out , you would probably need to create a custom Z Program or go with the option of supressing your output via requirements (when condition is not satisfied)

Read only

0 Likes
1,882

Thanks BRAD...changing the exception to OTHERS fixes it all...

just Curios for my Understanding when is the IDOC generated?

if I want the IDOC to be generated with status Fail what do I need to do?

Thanks,

Rajeev

Read only

Former Member
0 Likes
1,882

Hi Rajeev,

Do as kris suggested.