on 09-15-2009 7:04 AM
Hi All
I want to send data from a flat file to SAP(file to idoc)
My flat file structure is
id,name,number,city
2,R1,234,SD
2,R2,457,MD
3,R4,789,HG
3,R6,235.HG
The Field 'id' will change..after every change in 'id' ,seperate idoc should be created.
I have checked the following thread.
In the above thread ,it is asked to map v.no with remove context and use SPLIT BY VALUE on value change then do the mapping accordingly ,you can create 3 idocs for the same.
I'm confused about how to do these mappings.
Please explain the mapping in detail.
Please help
Regards
Reema
Hi Reema,
When you set recordsets per message to 1, As per your example the File content conversion will take only one record at a time
So first it will take 2,R1,234,SD
then 2,R2,457,MD
then 3,R4,789,HG
then 3,R6,235.HG
So during first record message mapping the source xml would look like
<root>
-<id>2</id>
-<name>R1</name>
-<number>234</number>
-<city>SD</city>
</root>
now from this source you need to make one idoc.
But i think recordset per message might not be helpful in your case, because as per your first post you need to create an IDoc for each id change. Here when file adapter picks and send one record to PI, you will not be able to decide on whether the next id is same or different
So net result is if you change mapping (and also use recordset per message) then you will not be able to handle the condition of 1 idoc per id.
and if you want to handle that, you cannot see individual messages in MONI.
You need to choose
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if your source data type is like
MT_Source
Record 0-unbounded
id ----1
name -----1
number -----1
city -------1
then in the sender file communication channel you have to specify file content conversion parameters as
Parameter name parametervalue
Document Name MT_Source
Recordset Structure Record,*
choose + to add more parameters
Name Value
Record.fieldSeparator ,
Record.fieldNames id,name,number,city
Record.endSeparator 'nl'
then do the maping
as
id ---->removeContext---->SplitByValue(Value change)---->Target Idoc
map according to your requirement for other fields
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I have done the mapping and configuration as per Kubra Fatima's instructions.
I've done the mapping as
id -
>removeContext-->SplitByValue(Value change)-->idoc
But i'm not getting the desired result.
i want different idocs based on field id.
But still it is creating 1 message in moni and 1 idoc containg all the records. Records with 'id' 2 & 3 are coming in single idoc.
i need seperate idoc for different 'id' values.
Please Help
Regards
Reema
Hi All
Now its working fine .
Used the mapping as id-->Remove context->splitbyvalue(valuechange)------Idoc & other nodes
Multiple idocs are generating based on field 'id'.
In Sxmb_moni there are multiple idocs one after another within one message. But in R3 they will post as separate IDOCs.
But I want Seperate messages in Sxmb_moni for all idocs.
The content conversion parameters are given as per kubra fatima's Reply.
What should i do to have seperate messages in Moni for each idoc?
Regards
Reema
Hi Reema,
By using this method you are reading the flat file completely and hence the records are also read as a single unit.
You can use the option of Recordsetpermessage in the File content conversion of your File sender channel. But doing sio there will be slight changes in your mapping.
If you requirement is to see individual messages in MONI and also post idoc for each record, then i will suggest you to use the recordsetpermessage option.
Check this link http://help.sap.com/saphelp_nw04/helpdata/EN/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
Regards
Suraj
Hi Reema,
>>What change i need to do in mapping for this ?
You need to do a message mapping keeping the fact that only one record will be coming to PI and hence as per you requirement you need to make one IDoc. Hope you understood how the mapping should be now.
Paste here the source XML structure and the parameters you are using in file content Conversion. It will be helpful in identifying the problem
Regards
Suraj
hi,
/people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
http://www.sdn.sap.com/irj/scn/weblogs/blog=/pub/wlg/14425
Check out these weblogs
Cheers,
Divya
Edited by: Divya Vidyanandan Prabhu on Sep 15, 2009 8:18 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi reema,
As your data should create two idocs as it have two ids
when you receive the XML file after content conversion for your data you will have four XML instances (occurences) for which two idocs have to be created..
so to implenement this you need to put the condition at the idoc root node level..
so go to idoc/node level and implement the below
id > removeContext> SpliyByValue(ValueChange) -->idoc/node
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Follow these steps.................
1)First change the occurence of IDOC (by default 0..1) as specified in the thread.
2)Map your root node using remove context and use SPLIT BY VALUE( if you double click split by value you can see "value change" option ...use this otpion ) to the IDOC.
3)Then do the remaining mappin ,It will create different idocs whenver id change .
Regards,
Sekhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.