cancel
Showing results for 
Search instead for 
Did you mean: 

Problem running MBO (Web Services) with Objective-C

Former Member
0 Kudos

We want to run a web service that has the following data:

Input: ZDUET3_STRUCTURE

Output: CRMACTIVITY_ID : STRING

The structure contains:

ZDUET3_STRUCTURE:

-- PROCESS_TYPE

-- APPROVER

-- REQUESTOR

-- DESCRIPTION

-- NOTES

We want to be online, so that the user fills the input data and run the Web Services to obtain the output data. Note that the output data does not correspond to the input data.

1) We have created an MBO by this Web Service and have created a personalization key "PKInput" type ZDUET3_STRUCTURE, no default value, and Storage Client. In option "Attributes ->Load Parameters" of the MBO, we have chosen for the input, our personalization key "PKInput". That way when the user presses the button, save the data that he has completed on our "Personalization Key PKInput".

2) We have deployed the project with message-based.

3) We generated code for Objective-C project.

4) From our code, we connect to the server-sup perfectly where our MBO.

5) The problem comes when we run the MBO and the data. Include code:



DuetMBO_PersonalizationParameters *pp = [DuetMBO_DuetMBODB getPersonalizationParameters];

DuetMBO_ZDUET3_STRUCTURE *input = [DuetMBO_ZDUET3_STRUCTURE getInstance];

input.PROCESS_TYPE = @"ZIT1";
input.APPROVER = @"DUET";
input.REQUESTOR = @"USER01";
input.DESCRIPTION = @"Activity01";
input.NOTES = @"Activity02";	

pp.EstructuraInput = input;

MBOLog(@"ProcessType= %@, Description= %@, Notes= %@", 
    pp.EstructuraInput.PROCESS_TYPE , pp.EstructuraInput.DESCRIPTION, pp.EstructuraInput.NOTES);
	
[pp save];
		
while ([DuetMBO_DuetMBODB hasPendingOperations]) {
	[NSThread sleepForTimeInterval:0.2];
}
	

DuetMBO_DUETMBO1 *activity = nil;
SUPObjectList *result = nil;
MBOLog(@"--- Activity ---");
result = [DuetMBO_DUETMBO1 findAll];

if (result) {
	int long = result.length;
	if (long > 0) {
		activity = [result item:0];
		if (activity) {
			MBOLog(@"Nº Activity: %@", 
				   activity.CRMACTIVITY_ID_LOCAL);
		}		
	}
}

6) Performing debugger in hasPendingOperations not for any time.The variable "result" is always "0". The Web Service does not run.

What is wrong? Is it ok to complete the input of an MBO with personalization parameters or is by synchronization parameters? We have chosen to personalization parameters, because we do not filter data to the mobile, we want to return everything that contains the server-sup.

I appreciate your help.

Regards,

Luis.

Accepted Solutions (0)

Answers (1)

Answers (1)

Herwig
Explorer
0 Kudos

Hello Luis,

I guess your "main" problem is the missing statement

 [pp submitPending]; 

after the save-statement.

Besides that, you should check your settings for synchronization parameters. I'm not sure, if a structure can be used as a parameter.

And last, I had problems to get an update process working, if the webservice responsible for the update (or create) didn't return the same structure, which correspond to the structure of the MBO ( which would be ZDUET3_STRUCTURE in your case). The updated data should be part of that structure (CRMACTIVITY_ID in your case).

Best regards, Herwig

Former Member
0 Kudos

Hello Herwig,

I have included the code that tells me, but still not working.

In another project we do not use MBO "Personalization keys" because the input matched the output data, we combine "Synchronization Paramters" with "Load Parameters" as follows:

1) We create 3 parameters in the "Synchronization" with "mapped to" its corresponding output attribute.

2) Choose "Query Limiting" for the 3 parameters.

3) In tab "Attributes-> Load Paramters" we chose for each input parameter, the corresponding "Synchronization Parameters"

4) To fill the input parameters, we do fill the parameters of the "Synchronization Parameters"

 
MBO_GETPRODUCTSynchronizationParameters *sp = [MBO_GETPRODUCT getSynchronizationParameters];
sp.product = @"0001";
[sp save];
while ([MBO_MBODB hasPendingOperations])
    [NSThread sleepForTimeInterval:0.2];

...
..
result = [DuetMBO_DUETMBO1 findAll];
..
...

5) In this way we get to run the Web Service MBO perfectly and get the output.

In short in all these tests, I have some doubts:

1 - What allows the use of the personalization keys?

2 - What is the difference between Synchronization Parameters and Personalization Keys, if we want to get all the unfiltered data?

3 - Why not work correctly personalization keys to load parameters?

4 - What is the use "to Propagate Attribute" option?

We recognize that there are two types of consumption of MBOs (Web Services or BAPIs):

a) MBO consumption where inputs data entry are also found in the output.

Solution: Execution by combining "Synchronization Parameters" to "Load Parameters"

b) MBO consumption where data entry is not found in the output.

Solution: How to complete this type of consumption?

Thank you very much for your help,

Luis.

Herwig
Explorer
0 Kudos

Hello Luis,

Do you know the article on

[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0872173-7cd4-2d10-f5b1-ea8666d2337c?quicklink=index&overridelayout=true]

It might have some helpfull answers for you.

Best regards,

Herwig

Former Member
0 Kudos

Hello Herwig,

First thanks for the document. Explains very well the difference between "Load Parameters" and "Synchronization Parameters".

My problem comes when I try to make the point 3.1 of the document. I explain in detail:

Where it says: "Click on Add button to create the parameter and map this parameter to the ProjectID", we can not do it, because where you select the "Mapped to" I do not have the attribute. In short, the web service I want to consume, not available in the output, this input parameter.

What should I do? Add new attributes to the MBO and fill with containing the input parameter to do "Mapped to"?

I do not know if I explained well ...

Regards,

Luis.

Former Member
0 Kudos

Hi Herwig, and anyone else who might help me:

I have created my question that I had earlier posted here at the following thread, so that I can assign points if it gets resolved. Quite similar to this issue, but mbo is reading a bapi; and issue might be with the introduction of a second personalization key.