converting text file to idoc procedure in Data services

Hi ,

I would like to know the feasibilty in Data services XI R3.1 to convert
a flat file ( which contain employee details ) into idoc format .

Would appreciate any help in this regard asap .

@Werner,

am waiting hopefuly that you will be the first person to respond me with proper docuemnt / link :slight_smile:

Regards,
Rani


rani_cts (BOB member since 2008-06-05)

It is rather simple:

You drag the file, query and IDOC to the dataflow, connect the three and then the Query will have the entire IDOC schema but without mappings. Now the task is to fill the schema with values, from clauses etc. And that will be the tricky part if you have never done that before.
You will need a wide range of all the techniques shown here
https://wiki.sdn.sap.com/wiki/display/BOBJ/The+Nested+Relational+Data+Model+NRDM

(Am I omnipresent in the forum? :blue: )

:mrgreen:


Werner Daehn :de: (BOB member since 2004-12-17)

hi werner,

thnx :-)… that works for me…i did the mapping which invovles data from one SQL server source table to Idoc named ’ HRSM_A01’

but when i try to validate the job ,i get the error

" Idoc for file <IDOC HRSM_A01(DS_extarct_R3.) not defined> "

Coudl you let me know resolution for this ? thnx in advacne


rani_cts (BOB member since 2008-06-05)

to add to this,

am little confused as how this job would run . Since this is a batch job , i understand there is no need for any access server.

against which system configurtaion should i run …becasue we are not having any target database …

how to send this idoc to R/3 server ? Plz help…


rani_cts (BOB member since 2008-06-05)

i tried runnign the job against system configuration poinitng to the R/3 datastore where i hav idoc but the job aborted …

any help is highly appreciated …any other mode to run the job?

(12.1) 05-26-11 16:25:22 (E) (16952:1512) R3C-244002: |Dataflow idoc
IDoc target: Cannot open test-mode file <>.
(12.1) 05-26-11 16:25:22 (E) (10392:21432) R3C-244002: |Dataflow idoc
IDoc target: Cannot open test-mode file <>.


rani_cts (BOB member since 2008-06-05)

When you dragged in the IDOC, is it possible you picked “file” instead of “message”? There are four selection options shown I believe.


Werner Daehn :de: (BOB member since 2004-12-17)

exactly…that was the mistake which i identified and corrected it aftr which job also ran fine :)…thnx werner…


rani_cts (BOB member since 2008-06-05)

hi werner,

Am able to run the job sucessfully ( loading from SQL server table ‘emp’ which has one record into HRSM_A01 idoc ).

But job aborts with following message when i try to load 2 records from source table emp into same idoc .

not sure what am missing here.plz help.

note that am loading data from emp only to segment ’ E1P0002’ of HRSM_A01 idoc.Dono why its throwing error in segemnt E1P0000.

Also in from clause of all schema of 'HRSM_A01’Idoc, i have provided EMP.

(12.1) 05-27-11 09:47:45 (E) (15156:22268) R3C-244005: |Dataflow idoc|Loader HRSM_A01
IDoc target tried to generate IDoc <HRSM_A01> from NRDM data: <
IDoc Error: Message: Adding this segment exceeds maximum allowed number of repetition E1P0000
IDoc Type: HRSM_A01
Release: 700
IDoc Number:
Segment Name: Not Applicable
Segment Type: E1P0000
Field Name: Not Applicable
>. Please check your input data.


rani_cts (BOB member since 2008-06-05)

You need to add a row_gen transform and use that in the from clause of this schema. See the “additional schema level” in the NRDM link I posted above.


Werner Daehn :de: (BOB member since 2004-12-17)

thnx werner… now job is able to process multiple data…

Now am trying to use idoc as mesage source and load it into a SQL server table.

  1. drag and drop the idoc as ‘Idoc message source’
  2. place query next to it
  3. use template table as target

Here am not able to map columns from input schema to output schema but can copy&paste … really weird :frowning:
and while trying to validate the job , it shows the attached error …

  1. wat to map in from schema ? tried to map schema name from input idoc but no luck…drag n drop not working
  2. why cannot parse the columns ?
    error.JPG

rani_cts (BOB member since 2008-06-05)

Basically, you have to drag each root schema from input to output of the query and then remove columns, rightclick&unnest a schema etc.


Werner Daehn :de: (BOB member since 2004-12-17)

thnx werner for the quick reply…

am able to drag the input now to output schema in query …but how to map it to target table / file ? nothing is getting mapped from Query to output… tired of Idocs :nonod:


rani_cts (BOB member since 2008-06-05)

hi werner,

i was trying with batch jobs to load from idoc message source to table.

aftre going thru lot of SAP WIKI links , i understood that idoc messgae source can only be used a source in real time jobs. ( i started my idoc exercise with idoc target g

but wat is confusing is idoc files…what is the difference b/w idoc file and idoc message ?


rani_cts (BOB member since 2008-06-05)

You can exchange IDOCs with SAP via two ways, either online meaning you connect via RFC to the SAP system and get it right away (=message). Or you work with files, first copy and then use them.

In short, you will always want to use IDOC messages.


Werner Daehn :de: (BOB member since 2004-12-17)

thnx for the explanation werner .

but when i use idoc as message source , i can copy & paste the columns from schema to query , why am i not able to map the columns from Query to Target ?


rani_cts (BOB member since 2008-06-05)

Because of the unnest. The only way you can unnest a schema is by dragging the input schema to the output and say unnest.


Werner Daehn :de: (BOB member since 2004-12-17)

No luck…aftr unnesting also same issue…but i can copy & paste the columns to target… wondering why drag&drop is still not wroking :?

when i try to validate the job , it shows following error:

From : Input schema are not specified for <Query_1>
Invlaid mapping expression for column <Query1:PERNR >

I tried to drag the segment ‘E1HRM_ITYP’ of HRSM_A01 idoc ( which have target columns ) inthe FROM cluase of Query but unalbe to drag it… :hb:


rani_cts (BOB member since 2008-06-05)