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

FM Object Exists

Former Member
0 Likes
1,076

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
Read only

Former Member
0 Likes
1,022

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
Read only

Former Member
0 Likes
1,022

Hi,

Please explain your requirement in detail..

Thanks,

Naren

Read only

0 Likes
1,022

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

Read only

Former Member
0 Likes
1,023

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

Read only

0 Likes
1,022

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

Read only

0 Likes
1,022

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?

Read only

Former Member
0 Likes
1,022

Also check BAPI_PDOTYPES_GETDETAILEDLIST