cancel
Showing results for 
Search instead for 
Did you mean: 

Fetching type 4 entity data from type 1

Former Member
0 Kudos

Hi

I have a requirement where I have to fetch the value of Type 4 entity from Type 1 at feeder class level.

Please suggest some sample code or classes or methods to use for the same.

Regards

Preeti Goyal

Accepted Solutions (1)

Accepted Solutions (1)

benjamin_allsopp
Active Participant
0 Kudos

In the GET_DATA method of the feeder -

  • Create a Local Object of Type ref to  if_usmd_model_ext.

  • Using this Local Object execute method   read_entity_data_all with filter values of:
    • i_crequest       =  (the CR you're in)
    • i_fieldname    =  (your main type 1 entity).

  • You can then read the importing parameter  et_entity_data with key USMD_ENTITY_CONT = (your type 4). Your data for this entity will be found in R_T_DATA.
Former Member
0 Kudos

Hi Benjamin

Thanks for replying.

I am able to fetch the data now for those entities for which data has been entered on the screen.

But my requirement is to set some default values initially when the screen is loaded.

I need to set the data when the screen is loaded.

Can you guide how can we do that?

Regards

Preeti Goyal

benjamin_allsopp
Active Participant
0 Kudos

What you are looking for is derivations.

You can do this either with BRF+ or with coding.

MDGIMG -> General Settings -> Data Quality and Search

and from there you can go:

  • None Coding BRF+ method - Validations and Enrichments -> Define Validation and Derivation Rules  Should be pretty intuitive from there
  • Coding method - Business Add Ins -> Define Validations/Derivations 
    • From there you need to code in the IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY method. The method will loop round each entity (parameter id_entitytype) and the data already there/ready to manipulate will be found in CT_DATA


any further issues please refer to the below documentation:

http://a248.g.akamai.net/n/248/420835/a34446888a65ddfb0b9e060de1953439ab92e39fc3c84e06b77a1b5f441ddb...


Sections 6-9 will be of interest to you.

Former Member
0 Kudos

Hi Benjamin

Thanks for this information.

Can't we set the value of an attribute at feeder class level?

Is there any method provided to do it?

Regards

Preeti Goyal

benjamin_allsopp
Active Participant
0 Kudos

Why is it so important to do it in the feeder class?

SAP have delivered a standard and robust way of defaulting data - which will not only default the value before the screen is output but will adapt to any data changes made if required and configured/coded.

I've never tried to default anything within the feeder class but in the get data method the parameter that holds the data (e.g. cs_data in forms) is a changing parameter so you could try changing the data to whatever you want to default in get data and see what happens!

Answers (0)