I would like to send IDOC from Data Services into SAP via Batch Job.
I have imported IDOC MATMAS03 in Data Services, drag-and-drop this in the Data Flow as IDOC Message Target.
I then drap-and-drop the MARA table (SAP Material Master Table) in the DAta Flow, and create the Query Tranformation with IDOC.
In the Query Transformation, I only mapped some fields from MARA Table to the IDOC.
When I click the Validate, I receive a list error message where system expect me to map all the fields in IDOC.
Is this correct? Have you done this before?
Please share your experience, thank you.
Thanks for you info, appreciate it.
BTW, not sure exactly what you mean. So are you saying that it is OK for me to mapped only 1 ro 2 fields to the IDOC via Query?
Please help, we’re in the mids to prove this product (DI)…
Your help is appreciated.
The MATMAS IDOC contains two sub-schemas. 1 row of type EDI_DC40 and a row of type E1MARAM and its sub-schemas.
Now you need to go to SAP docs and figure out what the mandatory and optional columns are. The EDI_DC40 is a mandatory schema but within not all columns need to be mapped - you can either map them to null or do not load the column at all.
Same with the IDOC payload, the E1MARAM. The IDOC needs to contain some material data, some attributes are required other optional.
Where you might get stuck easily is the NRDM or in other words “How do I tell DI that the first schema is one row big” (by “make current” in the output pane of the query and modify the from clause to contain a source table that contains one row only e.g. Row_Gen Transform as source.) The root schema’s from clause will likely be the material master table, the from clause of the other schemas might come from 1 Row_Gen row as well. That’s described in the NRDM chapter I posted above.
Really appreciate your input.
OK, in that case, I will just try to make all the fieds to NULL. So how can we do that in DI?
Example, in the Schema out EDI_DC40 -> MANDT, how can I make NULL to this field?
Please advice, thank you.
Thanks for your help, but were still not able to prove the DI can send IDOC back to R/3.
I have created the Datastore (SAP R/3) and imported table MARA, as well as IDOC MATMAS03. All looks good.
In DS Designer, created Project and Batch Job for this. In the Data Flow, I drag-and-drop the MARA table as source, and drag-and-drop IDOC MATMAS03 by choosing Make IDOC message target. I then double-click on the IDOC and specify the required parameters: Partner Number, Partner type, Message type.
Then insert the Query Transformation and linked between MARA and MATMAS03.
In the Query mapping, I mapped NULL to all the fields in EDI_DC40 as it is mandatory schema (as mentioned). Then in E1MARAM, I drap-and-drop the following fields from MARA and mapped it to the fields in E1MARAM:
MSGFN
MATNR
ERSDA
ERNAM
LAEDA
AENAM
PSTAT
LVORM
MTART
MBRSH
MATKL
Click SAVE.
When I click on Validate, I hits the following error:
[Query:Query]
BODI-1111193: FROM: The input schemas are not specified for <Query.EDI_DC40>
[Query:Query]
BODI-1111193: FROM: The input schemas are not specified for <Query.E1MARAM>
What is wrong?
Need your advice urgently, as were in the mid to prove the DI and IDOC before implementation.
In your dataflow add a row_generation transform and connect it to the query together with the mara table.
In the query, select the from tab.
How many IDOCs do you want to create? As many as there are MARA record. So edit the from so that MARA is the only input listed.
Now, in the query output pane rightclick the EDI_DC40 schema and “make current”. The from clause for this schema is empty - that is not allowed and hence your error. How many rows should that EDI_DC40 have? That’s simple, just one. So drag from the input the row_gen schema into the from clause.
And finally you “make current” the E1MARAM. How many records should that have per IDOC? One as well. So Row_Gen is the from for this schema also.
Now all schemas have a from clause and the error message will be gone. When you execute the flow SAP will complain that mandatory fields are not mapped, e.g. I guess the Text schemas for the different languages is mandatory I guess.
Really appreciate your help and support. Following your steps, I can now execute the Batch Job and IDOC is generated
in SAP R/3. I can see a list of IDOC in WE02 failed with following error:
The segment E1MAKTM has the attribute ‘Mandatory’ in the syntax description of the basic type MATMAS03
(customer enhancement ). However, the segment is missing in the IDoc. The segment number logged in the status record
identifies the item before which the segment is missing.
I guess this is because I delete the segment E1MAKTM, I will try to put it back and let you know the result.
On the question on “how many IDOC generated?”. Yes, I only want to generate 3 IDOC from the MARA table, how should I
achieve this? Better still if I can put in the condition like select only Material Number = 999999?
Next question in my mind is how can send IDOC from SAP into DS via Batch Job?
Based on my current setting as following:
Defined Datastore and connect to R/3
Imported MATMAS03 IDOC.
Drag and drop the MATMAS03 IDOC (Make IDOC message source) in Data Flow.
then what else need to be done if I want IDOC send from SAP into DS, then will be save into table template in DS?
Please advice.
DI will not work without your support Thanks!
Ha, I am sooo good. MAKT contains the Material description information for different languages - no material can be loaded without a name. yes, add the schema again, specify the from clause etc.
If you want to load just a set of materials, you simply add a query with a where clause between the source table and the query you do the nesting.
Yes, I saw your blog on Receiving IDOCs. But this is via Real-Time Job. What I am doing here is Batch Job.
Does it mean that we must use Real-Time Job, only then we can receive IDOC into DI?
Please advice, thank you.