‎2008 Apr 22 7:16 AM
Hi all,
I have a question..
what is the difference between using this function module HR_READ_FOREIGN_OBJECT_TEXT and directly looking into the database for text of various object types.
for example..
For position text, i made a look up to table t528t. but the text was only 25 characters. ie., it allowed only 25 characters and rejected above that.. so the text was incomplete.
but then using the function module HR_READ_FOREIGN_OBJECT_TEXT, gave me the full text.
can't i produce the same result of the FM, just by looking into the table.
Please give me your suggestions:
why there hits a difference..
if i could make the same o/p of FM, how?
thankx in advance..
‎2008 Apr 22 9:23 AM
Hi Naveena,
I Checked the function module source code and found the following code.
Actually the text which u r expecting is come from HRP1000 table . If you dont find from that table .It is getting the text from t528t table.
Regards,
Venkat.O
call function 'RH_READ_OBJECT'
exporting
plvar = plvar
otype = otype
objid = objid
istat = status
begda = text_date
endda = text_date
langu = langu
check_stru_auth = '' "STRO NOTE 566275
importing
short = short_text
stext = object_text
exceptions
not_found = 1
others = 2.
*
if sy-subrc eq 1. "no text found in PD
case otype.
when 'O '.
perform re527x using objid text_date langu
changing pa_text subrc.
when 'C '.
perform re513s using objid text_date langu
changing pa_text subrc.
when 'S '.
perform re528t using objid text_date langu
changing pa_text subrc.
when 'A '. "XWSN318919
clear: pa_text, subrc. "XWSN318919
endcase.
‎2008 Apr 22 8:32 AM
Hi,
To be short using as mush as possible standard function module avoids rewriting and duplicating coding in several programs it can be very annoying when you want to maintain the code after a support package or LCP for example.
For the rest you are free to do what ever you want if you want to produce the same result of FM its your choice.
Regards
‎2008 Apr 22 9:23 AM
Hi Naveena,
I Checked the function module source code and found the following code.
Actually the text which u r expecting is come from HRP1000 table . If you dont find from that table .It is getting the text from t528t table.
Regards,
Venkat.O
call function 'RH_READ_OBJECT'
exporting
plvar = plvar
otype = otype
objid = objid
istat = status
begda = text_date
endda = text_date
langu = langu
check_stru_auth = '' "STRO NOTE 566275
importing
short = short_text
stext = object_text
exceptions
not_found = 1
others = 2.
*
if sy-subrc eq 1. "no text found in PD
case otype.
when 'O '.
perform re527x using objid text_date langu
changing pa_text subrc.
when 'C '.
perform re513s using objid text_date langu
changing pa_text subrc.
when 'S '.
perform re528t using objid text_date langu
changing pa_text subrc.
when 'A '. "XWSN318919
clear: pa_text, subrc. "XWSN318919
endcase.
‎2008 Apr 22 10:35 AM
Hi,
Read the Text form HRP1000 file STEXT.
Regards,
Vamshidhar .
‎2010 Aug 02 10:49 AM
hi,
by using the above FM i am not getting the text plz help me . my code is as follows.......
&----
*& Report Z_EXPERIENCE_LETTER
*&
&----
*&
*&
&----
REPORT Z_EXPERIENCE_LETTER.
TABLES : PERNR,PA0001,PA0002,P1000,T528T.
INFOTYPES : 0000,
0001,
0002.
TYPES : BEGIN OF ZEXP,
PERNR TYPE PERNR_D,
VORNA TYPE VORNA,
NACHN TYPE NACHN,
BTRTL TYPE BTRTL,
PLANS TYPE PLANS,
ORGEH TYPE ORGEH,
BEGDA TYPE BEGDA,
ENDDA TYPE ENDDA,
PERSK TYPE PERSK,
END OF ZEXP.
DATA : IT_OUTPUT TYPE ZEXP_LINE,
WA_OUTPUT TYPE ZEXP_LINE.
DATA : FMN TYPE RS38L_FNAM.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001 .
SELECTION-SCREEN SKIP.
PARAMETERS p_cc(40) type c OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
GET PERNR.
END-OF-SELECTION.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZHR_EXPERIANCE_LETTER'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FMN
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION FMN
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
VORNA = P0002-VORNA
NACHN = P0002-NACHN
BTRTL = P0001-BTRTL
PLANS = P0001-PLANS
ORGEH = P0001-ORGEH
BEGDA = P0000-BEGDA
ENDDA = P0000-ENDDA
PERSK = P0001-PERSK
P_CC = P_CC
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
PERNR =
TABLES
IT_OUTPUT = IT_OUTPUT
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'HR_READ_FOREIGN_OBJECT_TEXT'
EXPORTING
OTYPE = 'S'
OBJID = '50000094'
COSTCENTER =
CONTROLLINGAREA =
STATUS = '1'
BEGDA = '20100721'
ENDDA = '99991231'
REFERENCE_DATE = SY-DATUM
LANGU = 'E'
IMPORTING
SHORT_TEXT =
OBJECT_TEXT =
COSTCENTER_NAME =
INTEGRATION_ACTIVE =
RETURN =
EXCEPTIONS
NOTHING_FOUND = 1
WRONG_OBJECTTYPE = 2
MISSING_COSTCENTER_DATA = 3
MISSING_OBJECT_ID = 4
OTHERS = 5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.