Application Development 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: 

FM Object Exists

Former Member
0 Kudos
193

Hi guys,

Is there a function module that checks if a PD (O, S, C) object exists based on its short text?

Thanks,

~Mark

1 ACCEPTED SOLUTION

Former Member
0 Kudos
139

I couldn't find any function modules that seemed to fit what you're looking for. I haven't tried this, but I wonder if you might be able to do a select directly from the table. Something along these lines perhaps:

SELECT objid INTO wa_objid FROM HRP1000 WHERE STEXT CS 'insert special wording here'.

ws_found = 'X'.

ENDSELECT.

This would search for whatever string of special wording you put between the apostrophes. I haven't worked much with infotype 1000, so I'm not sure if this is possible. But maybe it will help

- April King

6 REPLIES 6

Former Member
0 Kudos
139

Hi,

Please explain your requirement in detail..

Thanks,

Naren

0 Kudos
139

Hi Naren,

I am creating PD objects and using special names in the short text of these objects. I want to check if I am not recreating an existing object by checking the short text as I dont have any other way of testing it.

I hope it makes sense

Thanks,

~Mark

Former Member
0 Kudos
140

I couldn't find any function modules that seemed to fit what you're looking for. I haven't tried this, but I wonder if you might be able to do a select directly from the table. Something along these lines perhaps:

SELECT objid INTO wa_objid FROM HRP1000 WHERE STEXT CS 'insert special wording here'.

ws_found = 'X'.

ENDSELECT.

This would search for whatever string of special wording you put between the apostrophes. I haven't worked much with infotype 1000, so I'm not sure if this is possible. But maybe it will help

- April King

0 Kudos
139

I would agree with April.. a small correction to the SELECT though..

data: w_text(4) value 'TEST',

w_objid type objid.

SELECT objid INTO wa_objid up to 1 rows

FROM HRP1000 WHERE STEXT like w_text.

ENDSELECT.

if sy-subrc eq 0 .

  • Object laredy exists.

endif.

~Suresh

0 Kudos
139

Are you looking for something like RH_GET_OTYPE_TEXT which gives you the text of a object type that you can compare with your text?

Former Member
0 Kudos
139

Also check BAPI_PDOTYPES_GETDETAILEDLIST