cancel
Showing results for 
Search instead for 
Did you mean: 

BODS to SAP - > IDOC

Former Member
0 Kudos

Hello Everyone,

I am triggering IDOC from BODS and its creating sales orders in SAP , For example if i have 1000 orders in BODS the expectation is that it tshould create 1000 sales orders in SAP. ( If all my records pass through successfuly )

Is there any way where i can get to know from BODS that which IDOC belong's to which orders i triggered from BODS ? The expectation here is to match the BODS data with the IDOC created.

Thanks,

AJ.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Arun,

Here's my take. Not a very elegant solution but you can try it out.

1) You can hijack one of the fields in the IDOC control record. In the generate IDOC section of your BODS job, you can use one of the unused fields in the EDIDC control record (E.g: SNDSAD - SADR sender) and populate it with your legacy sales order number.

2) Once you generate and execute your IDOCs, you can pull the EDIDC table which will give you the IDOC number and the Legacy Sales order number. All you need are the DOCNUM (Idoc Number Field) and SNDSAD - or whichever field you decide to use in the EDIDC table.

3) Using this, you should be able to link to the SAP Sales Order number. I hope you are populating the legacy sales order number in the reference field in VBAK.

-Chaitanya

former_member211387
Contributor
0 Kudos

This is definitely an approach I would recommend. If however you dont want to use EDIDC table fields for storing legacy data, then you can use the WE09 transaction to search IDoc by content in order to identify the IDocs.

But if you want to retrieve data in a table to correlate the IDoc number with the legacy ID then populating a field in EDIDC is a good option.

Raghu

Former Member
0 Kudos

Hi Chaitanya,

Thanks for your suggestion . I hope it would really work in my case .

Cheers,

AJ.

Former Member
0 Kudos

Hi,

I tried implementing this and worked like a charm and this is what i have done , Moved my legacy field to SNDLAD and i now can link the generated IDOC and Legacy records.

In some error cases , The records wont be posted may be due to some issues with my data but IDOC would be generated and i will show whats the error reason and respective IDOC. but what if my data is corrected and i re-processed the file and now i will have the issue now  due to same legacy key appended again in the EDIDC table. One for success record and another one for failure record.

Any idea how to get over this ?

Thanks,

Arun.

Former Member
0 Kudos

Arun,

When you run your Data Services job again with the corrected data, new IDOCs will be generated. In such cases, you will need to explicitly filter the IDOCS by Creation date and time to get the list of 'delta' IDOCs.

-Chaitanya

Answers (1)

Answers (1)

former_member211387
Contributor
0 Kudos

Hi,

One important thing to note is that the EDIDC table will fill up very fast as every IDoc loaded by anyone or any process in SAP gets recorded on this table. It is better to hence use options like MEssage Variants on your partner profile so that you can filter on the relevant message variant when looking for your IDocs. Even in case of Sales orders, there will be IDocs for Sales Orders from different channels. So it is better to define a message variant in the partner profile so that it can be used when generating IDocs which will prevent acidental processing of other IDocs that aren't creted by you.

The Column in EDIDC table that holds the message variant value is MESCOD. after defining it in the partner profile, make sure to mention this in your mapping for EDIDC.MESCOD column.

kind regards

Raghu

Former Member
0 Kudos

Hi Raghu,

Thanks for the point. So this one will help me to quickly filter out the records from EDIDC table . My end objective is to just show what records had created which IDOC and sales order.

Apart from Filtering i dont see any other benefit  out of it . Even for filtering i am not using ABAP data flow so that i have no choice other than pulling up the whole table in BODS.

May be you can throw some extra lights if you see any other value addtion apart from filtering in my case.

Thanks,

Arun.

Former Member
0 Kudos


Hi Arun,


As u mentioned,

                    " Even for filtering i am not using ABAP data flow so that i have no choice other than pulling up the whole table in BODS."


          In order to filter SAP data it is not mandatory to pull entire data into BODS. There is a function RFC_READ_TABLE. Just go through it where we can define required fields, where clause etcc.. Which will give the equivalent of an ABAP dataflow.


Thanks


Phaneendranadh K

Former Member
0 Kudos

      

former_member211387
Contributor
0 Kudos

Hi Arun,

Message Variant is useful for filtering in the EDIDC table as well as when processing using background jobs in SAP. in case of sales orders, I suspect the volumes will be high. In case of migrating data it is advisable to process the IDocs using Batch jobs in background at scheduled time slots. For such cases Message Variant will be handy.

It obviously depends on using EDIDC fields to store legacy sales order number. Message Variant is an additional element that can help with isolating IDocs between one job run and another.

But when downloading the data from SAP using BODS EDIDC dump may be required. However you can use sqvi to store a custom query in SAP and download the data accordingly into a flat file.

kind regards

Raghu

Former Member
0 Kudos

Thanks Raghu .

Former Member
0 Kudos

Hi Arun,

The base function \BODS\RFC_READ_TABLE and RFC_READ_TABLE seems to be similar . If we have issues with RFC_READ_TABLE then the same should be direct fetch of BODS.