Skip to Content
Former Member
Apr 13, 2018 at 12:21 PM

Create two change requests, with result of the first as input in the second.

241 Views Last edit Apr 16, 2018 at 10:14 AM 2 rev


I am new to MDG and trying to create business partners using the API class cl_usmd_gov_api.

The requirement is to first create a business partner (entry in table BUT000). This works fine. The second step is to add this partner as a contact person (CP) partner to an existing (main) partner. This also works fine if I do it after the CP partner is created. But I want to combine the two.

The problem is that to update the main partner I need the resulting CP partner number of the first step. The solution up to now have been to create a change request for step one, start the workflow, then wait in a loop until table usmd120c is updated with status OK. Once the table gets updated with the status OK (if it happens within 30 seconds), we use the created CP number and use it in step 2. But this fails too often, as it may take several minutes for the first step to even start.

So the second step should do this:

Fill the fields KUNN2 = lv_new_cp and CPF_DEFPA = lv_new_cp of BP_CPGEN of the main partner, where lv_new_cp is the result of the first step.

In the first step I use the method create_entity_tmp_key to get a temporary key. I thought this could be used when updating the main partner, but as the temp key is not numeric (ex: $8574), this does not work.

The best solution would be to somehow chain/queue the change requests and use the API to get the created CP partner number. I searched the forums and tried to find any documentation, but found nothing relevant.

If any of you have an idea of how this could be done I would really appreciate it.

Thanks in advance.