cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Actions - Delete other infotype record

Former Member
0 Kudos

Hi,

I add a Delete infotype record at Dynamic Actions as below:

Infty Action No Maintain Func Name

0008 08 305 I DEL,0007,,,(P0008-BEGDA),(P0008-ENDDA)/D

However, it did not follow the P0008-Begda and P0008-Endda. For example, if IT0007 has two records but IT0008 has three records and user is delete the third record of IT0008 where the IT0007 does not has the same begda and ennda. However, the dynamic action still will delete one of the IT0007 record that is not same date with IT0008. Is it because the DEL,0007,,,(P0008-BEGDA),(P0008-ENDDA)/D

is not correct? Please suggest how to make it work. Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I think the system will behave in this manner only, there seems to be no problem with your configuration.

"(P0008-BEGDA),(P0008-ENDDA)" is usually used to create a new record and not delete an existing one.

My suggestion - Write a couple of lines of your own code and call it in the dynamic action.

Regards

Lincoln

Answers (3)

Answers (3)

kmoore007
Active Contributor
0 Kudos

My guess is that your code will delete all it0007's which are in the date range of p0008-begda and p0008-endda. Is this what is happening?

Former Member
0 Kudos

Hi Likim

AS Sarika Suggested U can use the USEREXIT.

But If U still want to do it by Dymanic Action U can write a custom subrouting in which U can determine the dates((P0008-BEGDA),(P0008-ENDDA)) dynamically.

Hope this helps U.

If not do write back.

Award points if helpful.

Former Member
0 Kudos

Hi,

Instead of dynamic action, write a User exit using CMOD enhancement PBAS0001(PA: Pers.Admin./Recruitment: Default values and checks).

Here you can write your own code & logic. First check IT0007 record & take the begin/enddate & then check for corresponding record in IT0008, if exist for the begin/enddate, then delete the IT0008 record. You can use FM "HR_INFOTYPE_OPERATION" to delete the record fin IT0008.

Hope this will help you.

Thanks,

Sarika.

ElsaM
Explorer
0 Kudos

Hi Sarika,

I'm not sure you can use HR_INFOTYPE_OPERATION within enhancement PBAS0001.

Have you tried this successfully?

We have a similar requirement, in that we must delete multiple records and it is not possible to predict how many records will need to be deleted, so dynamic actions are not very efficient.

Ideally, we would specify a BEGDA and ENDDA which may include multiple records and all of them would be deleted. But I don't think that is possible (haven't tried yet).

Thanks,

Elsa