Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function module:RH_RELATION_DELETE

Former Member
0 Likes
580

Hi All,

I want to delete the relationship between position(S) and person(P).

I know the FM 'RH_RELATION_DELETE' can be used to for this purpose.

I tried execution it but desired output was not achieved and I received an exception ' NOT_FOUND'

If anyone of you have used it earlier please share ur knowledge regarding the same

I need to know what all params needs to pass for its successful execution.

Thank You,

Regards,

Rupesh

Edited by: Rupesh Mhatre on Jan 14, 2009 3:24 PM

Edited by: Rupesh Mhatre on Jan 14, 2009 3:28 PM

1 ACCEPTED SOLUTION
Read only

PedroGuarita
Active Contributor
0 Likes
516

  refresh objects.
  clear objects.
  move relation-plvar to objects-plvar.
  move relation-otype to objects-otype.
  move relation-objid to objects-objid.
  append objects.

  call function 'RH_READ_INFTY'
       exporting
            infty                = '1001'
            begda                = relation-begda
            endda                = relation-endda
       tables
            innnn                = local_p1001
            objects              = objects
       exceptions
            others               = 0.

  loop at local_p1001 where otype = relation-otype
                      and objid = relation-objid
                      and relat = relation-relat
                      and rsign = relation-rsign
                      and begda = relation-begda
                      and endda = relation-endda
                      and sobid = relation-sobid
                      and sclas = relation-sclas.
    relation = local_p1001.
    exit.
  endloop.

As you can see here, first he will get every record between the 2 dates (begda and endda) for the object given in parameters otype and objid. Then it's doing a loop for all of those and checking for otype, objid, relat, rsign, begda and endda (and here it's equal and not between), sobid and sclas. So basically you will need to fill all these fields with the exact values of the record you wish to delete.

2 REPLIES 2
Read only

PedroGuarita
Active Contributor
0 Likes
517

  refresh objects.
  clear objects.
  move relation-plvar to objects-plvar.
  move relation-otype to objects-otype.
  move relation-objid to objects-objid.
  append objects.

  call function 'RH_READ_INFTY'
       exporting
            infty                = '1001'
            begda                = relation-begda
            endda                = relation-endda
       tables
            innnn                = local_p1001
            objects              = objects
       exceptions
            others               = 0.

  loop at local_p1001 where otype = relation-otype
                      and objid = relation-objid
                      and relat = relation-relat
                      and rsign = relation-rsign
                      and begda = relation-begda
                      and endda = relation-endda
                      and sobid = relation-sobid
                      and sclas = relation-sclas.
    relation = local_p1001.
    exit.
  endloop.

As you can see here, first he will get every record between the 2 dates (begda and endda) for the object given in parameters otype and objid. Then it's doing a loop for all of those and checking for otype, objid, relat, rsign, begda and endda (and here it's equal and not between), sobid and sclas. So basically you will need to fill all these fields with the exact values of the record you wish to delete.

Read only

Former Member
0 Likes
516

answered