cancel
Showing results for 
Search instead for 
Did you mean: 

How to use table dependencies?

AntonPierhagen
Active Participant
0 Kudos

hi all

I have got a question.

I have made 2 additional fields for the transaction CBIH82 ( for creating an incident ).

Those 2 fields are equipment and equipment description.

The idea for these 2 fields is that the description fields show the description of the chosen equipment.

So, when a user chooses an equipment, the first field is filled with an equipment number and via this number the

description which belongs to it should be retrieved from the master data.

But so far i had not seen a method to accomplish this. There is a solution which is ' object dependencies'

When you use this, you can set a value in another field with help of the value of fields which has this object dependency

But not do any thing wth tables or so.

I have searched for user exits, but also did not find any thing. And i have not got another good idea.

So, do you have a good idea? How to do this?

Kind regards,

Anton Pierhagen

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Anton,

If you refer to the "Check Table" option under "Values" please consider this (From the F1 Help):

"Check table

Name of a table that contains the allowed values for the characteristic.

This table can have exactly one key field. Tables that do not conform to this specification are not accepted. This can can also contain a client.

If you want to check values using a table that does not conform to this specification, you can use a function module to define the check table."

If you want to use a function module (like it is done for the phrases in EH&S TR CG02) please read the F1 Help for the field "Function".

An example check function is C14K_PHRASECHARACT_CHECK.

In general to have two chracteristics - one containing the key, the other the description for the key is a bit tricky and I think you would need work with global variable in the functions assigned to the both characteristics.

Wouldn't it be OK to just display the description and a have a good search help?

Greets

Mark

AntonPierhagen
Active Participant
0 Kudos

Hi Mark

Thank y ou for reminding! I really appreciate it, sorry for the late reply.

We had thought about that, but in our scenario, when field A is changed we would like to have someting that triggers a function module? or other logic to change the value in field B.

Field A is a number refer to an object and Field B is the description of that object.

For field A a search help is available. And we also learned about object independencies. So when a value has changed in a field, it can be transported to field B. And also set a specific value in B, which is customized, unfortunately not in a table or user exit or something like that.

We had in mind that when the value of field A has changed, the value ( number of the object ) is transported with object depency to field B ( the description of the object) .

And when the dependency is ready with transporting an enhancement point? or an user exit in field B (the description of the field) will find the description of the object with the transported number ( of the object).

But that last part we cannot find, so do you have any suggestions?

nirajsikligar
Active Contributor
0 Kudos

Hello Anton,

I think you can try to use the functionlity called Object Dependencies for Characteristics / Characteristics value.

You can define a precondition for a characteristic to determine when a characteristic appears on the characteristic value assignment screen. For example, you can define that characteristic for field B only appears if a specific characterisc B is selected.

Further information on this topic can be found at :

http://help.sap.com/saphelp_erp60_sp/helpdata/en/24/4766a0416711d189ec0000e81ddfac/frameset.htm

See topic: Object Dependencies for Characteristics / Characteristics value under Object Dependencies in Classification.

Regards,

Niraj

Former Member
0 Kudos

Hello Nirja,

Object dependencies are not support within EH&S!

I would highly advise not to use it...

Greets

Mark

AntonPierhagen
Active Participant
0 Kudos

Hi Mark

But do you know another method to fill another (characheristic) field with the help of another (characteristic) field?

Former Member
0 Kudos

Hi Anton,

Yes, this should be possible with the help of function modules you can assign to the characteristic.

Make sure you read the data from the EH&S buffers and not directly from the database - otherwise you will not get the changed data...

Greets

Mark

AntonPierhagen
Active Participant
0 Kudos

What is the EH&S buffer?

Can i also set data into the EH&S buffer? So when the number is changed that i change the value of the other field which has the description of the object via the EH&S buffer?

Former Member
0 Kudos

Hello Anton,

Within EH&S all data is first written to the EH&S buffers.

Only once you hit save the data from the buffer is written to the DB with either SQL INSERT, UPDATE or DELETE statements and then committed.

This is the reason why all EH&S APIs have *_SAVE_TO_DB Functionmodule.

What you are trying to do is not that esay to implement I think.

I still do not understand why you need to display the key and the description in two different characteristics....

Greets

Mark

AntonPierhagen
Active Participant
0 Kudos

We don;t use one field because the description is 60 characters long and the number is 10. A character field can only contain 30 characters. So it won't fit. That's why we put it in 2 fields. Or do you know another method? That the field can contain more then 30 characters?

And how do you read data from the EH&S buffer in a custom abap program?

Former Member
0 Kudos

Hello Anton,

No, there's no way to get around the 30 Chars for characteristics, that I'm aware of.

Are you familiar with the EH&S Phrase assignment in CG02?

Phrase can be more then 30 Chars. Only the first 30 chars are displayed - but when you hit the F4 key - you are able to see all the text.

You could do the same with a custom F4 Help for your characteristic.

To read the data from the EH&S Buffer the API might work - but watch for unexpected side affects. Or you could use the buffer FMs directly..

The easiest way to solve your issue is in my opinion the custom F4 Help for the characteristic in question - as the second characteristic your envision can onyl display 30 chars - so you would need to have two characteristics...

Kind regards

Mark

AntonPierhagen
Active Participant
0 Kudos

Hi Mark

Thank you for your quick answer! Do you know documentation about this? reading data from the SAP buffer or EH&S buffer?

We have thought about the idea of using the phrases but as we known them there are only usable with there own text.

So that if we made one phrase it will always retrieve it's own default value.

We have about 10.000 equipments and to create 10.000 phrases... is not an option. But thanks for your idea!

Maybe that buffers will help..

Former Member
0 Kudos

Hi Anton,

I was not suggesting to use phrases - to keep them in sync with your equipment would be a night mare

I was thinking about using the same idea as the phrases:

Display the first 30 Chars of the equipment on the screen - and if the user hit the F4 key display the full text of the equipment description and the technical key of the equipment ....

Greets

Mark

nirajsikligar
Active Contributor
0 Kudos

Hello Anton,

From where you are fetching the the equipment no. and its description?

If those are maintained in equipment master in PM module, then I think there is no need to create new fields for it.

In CBIH82 for the Incident / Accidnet log entry, under Damage section, there are standard fields available to fetch the details of equipment and its description.

Regards,

Niraj

AntonPierhagen
Active Participant
0 Kudos

hi!

That's true on the first tabpage, there are equipment fields. But at my implementation we cannot use those, because we don't use the machine part of the SAP module.

We have made a few additional tabpages with characters and classes. Within one of those pages we made a field for equipmentnumber. And below that field we created a field for equipment description.

We would like to use those additional fields for saving the equipmentnumber and description.

And so, via the equipmentnumber finding the description

AntonPierhagen
Active Participant
0 Kudos

And also we want to set more then 1 equipment on a incident. And if you use it on the first tabpage, you can only set one equipment on one notification