cancel
Showing results for 
Search instead for 
Did you mean: 

Print records in MDM based on lookup in qualifier table using Java API

Former Member
0 Kudos

Hello,

I need some input (preferably code sample) of how to fetch non-qualified and qualified record data from MDM

non-qualifier : country (lookup)

qualifier: date

I want all main table records where the country is not null

I guess I need a free form search with picklist?

Thank you

Best Regards

Olof

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Olof,

Please refer similar thread as given below:

Working with Qualified Look-ups:

http://help.sap.com/saphelp_mdm550/helpdata/en/46/2b62d0f2b54f07e10000000a114a6b/content.htm

Refer page 4 and 5,

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b2119f-be37-2c10-7ea1-9e9a90371...

Hope this helps...

Regards,

Mandeep Saini

Former Member
0 Kudos

Hi Mandeep,

thank you for the reply, I've read the links you sent, but still not able to get it right

This below gives no records in return. I wan't all records that have the qualifier and non-qualifer.

Thanks.

// the main table, hard-coded
		TableSchema tableSchema = schema.getTableSchema("Products");
		
		Search objSearch = new Search(tableSchema.getTable().getId());
	
	  // Qualified lookup field 
	  	 FieldId qualifiedLookupField = getFieldID("Products", "reg_countries_test");
	  	  
	  	  
//		Gets the schema of the qualified table
		TableSchema qualifiedTableSchema = getSchema().getTableSchema("reg_countries");
		
		//Gets the lookup value of the corresponding value
		SearchConstraint searchConstraint = null;
		
		SearchDimension searchDimension = new QualifierSearchDimension(qualifiedTableSchema.getFieldId("Registered_Country"),qualifiedLookupField);


// I Wan't all records that have qualifier / non-qualifier


		searchConstraint = new BooleanSearchConstraint(false);
		SearchParameter searchParameter = new SearchParameter(searchDimension, searchConstraint);

		objSearch.addSearchItem(searchParameter);
		
		ResultDefinition resultDef = new ResultDefinition(tableSchema.getTable().getId());
		resultDef.setSelectFields(tableSchema.getFieldIds());

		RetrieveLimitedRecordsCommand limitingCommand = null;
		try {
		limitingCommand = new RetrieveLimitedRecordsCommand(getConnections());
		limitingCommand.setResultDefinition(resultDef);
		limitingCommand.setSearch(objSearch);
		limitingCommand.setSession(getRepositorySession());


		
		limitingCommand.execute();

		} catch (SessionException e) {


		} catch (CommandException ce) {
			
		
		}