05-05-2011 1:57 AM
Hello,
We created a filter in ALE setup (BD64) for a Z message type for a partner in a our distribution model. The filter is based on COUNTRY / LAND1 of a custom segment (say, Z_MY_SGMNT), our requirement is system should process the data only for France and create the IDOCs. If the country is other than France, by pass/skip that row/record/segment/data and do nothing (obviously should not create any segment / IDOC), say
1) Say, I have 2 records(US & FR) in my itab and with these 2 records am creating 2 segments of same type of Z_MY_SGMNT
first Z_MY_SGMNT possess 'US' and second Z_MY_SGMNT possess 'FR', in this example, system is skipping the 1st row/record/segment/data (as its for 'US') and creating a successful IDOC with only one segment of type of Z_MY_SGMNT for FR, well.
2) If i have both records for 'US' in the above example, then am getting an error from MASTER_IDOC_DISTRIBUTE (pls. note SY-SUBRC still output as '0') saying
Distibution failed in MASTER_IDOC_DISTRIBUTE. Process aborted. Message no. YA308
Our expectation is that system sould not do any thing, just nothing.
Pls. let me know Why system is throwing an error message even though we setup an filter?
How we can handle this, because the SY-SUBRC from the above FM is '0'? we need just to do nothing (we do not want this error message)?
Thank you.
05-09-2011 8:07 AM
Hi Raju,
You can check the tables parameter COMMUNICATION_IDOC_CONTROL to check if any communication IDocs are created. If this is empty and sy-subrc = 0, you can conclude that processing did not have any error, maybe the IDoc filter took effect and did not generate any master Idoc.
From the documentation of function module:
In the table parameter COMMUNICATION_IDOC_CONTROL the header records for the communication IDocs created are retturned. You can tell whether processing was successful from the field STATUS.
Regards,
Shyam.
05-05-2011 5:21 AM
Hello,
For every country you need to maintain the 1 record yes ? , if you want to post multi records for same country
need to generate multiple idocs instead of populating multi records for same conutry.
Regards
Praveen
05-06-2011 1:01 AM
05-06-2011 5:30 AM
Hi Raju,
I could not find message class YA in my ECC system. Looks like a custom message class (starts with Y). Can you please check the program that is raising the message using this class (with number 308). Maybe the program raises error if there is no idoc generated (as both the records have US in your test case).
Also, share the piece of code where you call the MASTER_IDOC_DISTRIBUTE function module.
Regards,
Shyam
05-06-2011 4:01 PM
Yes, you are correct that this my own/custom message class, sm Sorry.
And you are correct that, the prog. is throwing this merror if there are not IDOCs got generated.
But, pls. let me know that How can i know that the IDOCs did not get generated at all BECAUSE of filter (all - 2 records/segments of my itab is of US, which is invalid for filter. Filter needs France - FR ), because, ths FM MASTER_IDOC_DISRTIBUTE is giving sy-subrc as '0' in this case.
Pls. let me know how i will know?
Thank you.
05-09-2011 8:07 AM
Hi Raju,
You can check the tables parameter COMMUNICATION_IDOC_CONTROL to check if any communication IDocs are created. If this is empty and sy-subrc = 0, you can conclude that processing did not have any error, maybe the IDoc filter took effect and did not generate any master Idoc.
From the documentation of function module:
In the table parameter COMMUNICATION_IDOC_CONTROL the header records for the communication IDocs created are retturned. You can tell whether processing was successful from the field STATUS.
Regards,
Shyam.