cancel
Showing results for 
Search instead for 
Did you mean: 

Delete parameter with index unknow

Former Member
0 Kudos

Hi EM experts,

We have the following scenario:

-  from SAP we are sending the material as infoparameters with index to EM

-  In EM the activity PARAMETER_CHANGE is used to update them in the EH

-  if there is any update on those, we can update all the ones with the corresponding parameter name & index.

But now, if one material is deleted, how can we delete the info parameter in EM? The problem we are facing is that we can resent the parameters again and update the ones whith the parameter name and index known. So, imagine we had initially 5 materials (5 parameters with index from 1 to 5) and now one got deleted. The index from 1 to 4 are updated, but parameter with index 5 remains.

In summary, is there any way from SAP to delete the parameters with index unknown.

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

former_member190756
Active Contributor
0 Kudos

Hello Iñigo,

you can also delete parameters in the Control Parameter extractor:

Structure:

/SAPTRX/BAPI_TRK_CONTROL_DATA

has a field action with the following possible values:

S Set (create)

C Change

D Delete 

M Check

You have to check in the extractor if the material was deleted and then mark it with D and it gets deleted.

Best regards,

Steffen

Former Member
0 Kudos

Thanks Steffen,

We tried that, but the problem we found is that the parameters which have an index can olny be deleted if the index is provided in that structure.

Example:

Parameter code for material 1 - index 1

Parameter code for material 2 - index 2

Parameter code for material 3 - index 3

Parameter code for material 4 - index 4

Parameter code for material 5 - index 5

If we now removed one material, we dont know in SAP which index it was. We can resend all  4 with a C, but the index 5 remains.

Thanks and regards,

Iñigo

Berthold_vH
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Iñigo,

I did the same as Kevin mention but we used the line item number as index value (assuming you have a scenario like sales order or delivery tracking). Just to give you anohter idea what to use.

Best regards

Berthold

former_member190756
Active Contributor
0 Kudos

As Berthold and Kevin said you should use either material number or line item number to identify the parameter to be deleted.

Best regards,

Steffen

Answers (1)

Answers (1)

former_member583013
Active Contributor
0 Kudos

What we have done at times is use the material number as the index value (It's 10 in length and Numeric in type). That way you know what the index is and can delete the parameter using an event message as apposed to running through the AOT logic again as Steffen suggested.

Former Member
0 Kudos

Hi all,

First of all, thanks for your ideas. What we did finally was to
completely update the indexed parameters every time one item was deleted. In
other words:

  

1.- From the function module which detects the events (event data
extractor), we detect that a line (material) in the delivery was deleted. This
mean that we have to go on with the next steps.

2.- With the appropriate track id and EM-RFC name, we call the BAPI /SAPTRX/EH_INFO_GET_DATA
in order to retrieve the current parameters existing in EM for this track id.

3.- Once retrieved the parameters, in the table ct_trackparameters, we
add a line with the action ‘D’ for all the indexed parameters (this will delete
all of them).

4.- Finally, we add a line with the action ‘S’ with the actual values of
the indexed parameters.

This ensures that we have in EM the appropriate materials when an item
is deleted.