on 05-05-2009 6:27 AM
Hi All,
I am trying out IDOC to File scenario and facing a problem due to repetition of segments in IDOC.
Requirement is to repeat the field in output file base on the segment occurance.
i am trying to map the record set of target file structure to the most repeating segmetn in the Souce IDOC so that i can get the repetion.
Is there any way to identify which segments repeats the most of times?
can we map a segment to target record set in where in we count all the segment occurance and get the most repeating segment and map it to target in udf itself.
is there any direct function whcih can be used in UDF to map one segment to a recordset?
Regards,
Anika
Hi all ,
I want to get the count and repeat the record set in the target structure based on the maxium count.
I am trying to write a UDF which gives the maximum repeating nodes count.I can get the count easily ,but how to map the segmetn with max count to the target data set do that it repeats.
Presently wht i did is lk i mapped one to one IDOC to file , when IDOC is triggerd (it triggered with say 10 details) ,only once the record in file is repeating.actually the file shd contain 10 records.
Regards,
Anika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. use the wiki logic on each repeating node
2. that will give you the counts for each repeating node
3. now write a node with each count as input
4. check which is the maximum
5. then use a logic as below
assume that max_occurance variable contains the maximum repeating nodes count
then
for(int i = 0; i < max_occurance; i++)
{
result.addValue("");
}
use that UDFs output and it will create that many occurances on the target side
I am trying to write a UDF which gives the maximum repeating nodes count.I can get the count
easily ,but how to map the segmetn with max count to the target data set do that it repeats.
have you checked the diagram in wiki....here i have applied the logic for two source nodes....you can extend the same for the nodes which you think will repeat...you need to identify them from your IDOC....also you may need to change the context of the source node to get the desired number of repeatitions...
Regards,
Abhishek.
HI,
Even you can go to WE31 transaction and give the segment name it will show how many times that segment maximum can occur.
Even you can see in occurences of IDOC structure for particular segment also.
Regards,
Chandra.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
no udf needed in this case....just check this diagram:
SDN --> WIKI --> Process Integration --> Attachments --> Serach For diagram with name Count and comment Count Logic..
Regards
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/countofRecords-%2527Countontheeasiestway+through%2527
you can always get the count of any node as mentioned above
You can use this logic and then create your own
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.