cancel
Showing results for 
Search instead for 
Did you mean: 

No key field found for creation of DataSource - Classification Datasource

alberto_rosado
Explorer
0 Kudos
639

Hello,

While trying to create a clasiffication datasource based on 0PLANT_ATTR, when i assign a characteristic and push the DataSource button, i get the following message:

No key field found for creation of DataSource

Diagnosis

During generation of a classification or configuration DataSource, only those key fields for the object table (field "Obj.Tabelle") that are already present in the basis DataSource transferred to the extract structure. This is the case when none of the key fields of the object table were found in the structure of the basis DataSource.

System response

A DataSource cannot be created without key fields. The action was cancelled.

Procedure

Check whether you have selected the correct basis DataSource and object table. For more information, please see SAP Note 569849.

Do you know what can be the problem?

Thank you and regards

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Alberto,

plants are a special case. The key which is used for the classification

of plants (object type BETR) is not the same as the key which is used in

datasource 0PLANT_ATTR.

BETR has key LOCNR (Site). That's a customer related to a plant. The

customer number will be extracted in field LOCNR.

0PLANT_ATTR extracts the plant in its key field WERKS.

Transaction CTBW and the generic extraction program for classifications

don't know the relationship between LOCNR and WERKS. So they cannot map

them.

I do recommend a solution which would add the mapping between

LOCNR and WERKS:

1. Create please the classification datasource as intended, but use

datasource 0RT_LOC_MGR_ATTR as basis datasource. It's the only

datasource of the content where LOCNR is a key field. So

0RT_LOC_MGR_ATTR is used as a dummy here, to allow transaction CTBW to

create the classification datasource. It's not necessary to extract

data with datasource 0RT_LOC_MGR_ATTR.

2. Extend please the extract structure of the created classification

datasource. Add please field WERKS using component type WERKS_D. Make

this field visible.

3. Fill field WERKS in the extractor user exit EXIT_SAPLRSAP_002. WERKS

can be read from table KNA1 by using the customer number extracted to

LOCNR to select on field KNA1-KUNNR.

4. Transaction CTBW_META on the BW system isn't able to append the

characteristics from the classification datasource to infosource

0PLANT, because the keys are different. So create please a new info

source with CTBW_META. This allows CTBW_META to create the info objects

for the characteristics used in the classification datasource.

5. Add please the characteristics used in the classification datasource

to infosource 0PLANT manually. You will find the info object names of

the characteristics by looking up the characteristic datasources which

are assigned to the classification datasource in transaction CTBW. From

these names you can derive the info object names:

1CL_A... -> C_A...

6. Disconnect the infosource which has been created with CTBW_META from

the classification datasource.

7. Connect please the classification datasource to infosource 0PLANT

Use following info object:

info object field

0PLANT WERKS

The info object names for the characteristics are explained in step 5.

8. Add an infopackage to infosource 0PLANT for the classification

datasource.

Now the extraction of classifications of sites should work.

Best regards,

Rolf

P.S. I saw the system messed it up and doesn't display any new and empty lines. Sorry, I hope you still can read it.

Edited by: Rolf Doersam on Mar 26, 2010 6:56 PM

Former Member
0 Kudos

Hi,

As rightly mentioned in the OSS

Reason

During the generation of a classification or configuration DataSource, only those key fields that simultaneously exist in the Basis DataSource are copied from the object table (field "Obj.Table" in transaction CTBW) to the extract structure. In certain cases, however, the same object may have different field names in the object table and in the structure of a Basis DataSource. During mapping the object is not clearly identified, and as a result no key field is copied to the extract structure of the classification / configuration DataSource.

Solution

Implement the source code corrections. Thanks to a newly-created subroutine, such special cases are taken into account when a DataSource is generated. Otherwise the system refers the user to missing key fields in the extract structure, via an error message.

Caution! The message texts must be implemented manually.

Go to transaction SM31 -> Table/View: T100 -> press the button "Maintain" -> Confirm the next information message by pressing ENTER -> Message class: CLBW -> Press the button "Change"-> On the tab page "Messages", enter the following text in the line for message 004 (overwrite if necessary): "No key field found for creating the DataSource" -> Save the entry -> Now select line 004 -> Press the button "Long text" in the lower menu bar -> Enter the following texts under the headings:

"CAUSE":

When you generate a classification or configuration DataSource, only those fields that simultaneously exist in the Basis DataSource are copied from the object table (field "Obj.table") to the extract structure.This is the case if none of the key fields of the object table was found in the structure of the Basis DataSource.

"SYSTEM_RESPONSE":

A DataSource without key fields cannot be created. The action was cancelled.

"WHAT_TO_DO":

Check whether you have selected the correct Basis DataSource and object table. For further information, see note 569849.

-> Save the long text.

-Vikram

alberto_rosado
Explorer
0 Kudos

I appreciate your answer.

The note does not give relevant information to me.

It is just telling me to change the message or some correction code instructions which are already done in my ECC system, as i have last PI and PI-A packages installed.

Regards

alberto_rosado
Explorer
0 Kudos

This datasource is based on the Obj.Table BETR which is sctructure and not a table with keys...

Might this be related to my problem?

Regards