‎2011 Feb 14 9:10 PM
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
‎2011 Feb 14 9:44 PM
when you raise exception, are you passing error message? Something like this,
MESSAGE EXXX RAISING DATA_NOT_RELEVANT_FOR_SENDING
‎2011 Feb 14 9:44 PM
when you raise exception, are you passing error message? Something like this,
MESSAGE EXXX RAISING DATA_NOT_RELEVANT_FOR_SENDING
‎2011 Feb 15 3:57 PM
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
‎2011 Feb 15 4:19 PM
Put a breakpoint in NAST_PROTOCOL_UPDATE and see how this FM is getting executed?
‎2011 Feb 15 6:26 PM
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
‎2011 Feb 15 7:01 PM
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.
‎2011 Feb 15 7:21 PM
‎2011 Feb 16 4:20 PM
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
‎2011 Feb 15 5:37 AM