Skip to Content
avatar image
Former Member

Fetching decription from table HRT1002

This is related to learning and development.

How can description(text) be fetched from table HRT1002 which one gets by passing TABNR?

TABNR i got from table HRP1002 subty (002,003,004) by passing object id of the business event.

I need to fetch that text in a subroutine pool and pass it to sap script to be displayed there.

That text is very large.

Response will be appreciated.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Oct 11, 2007 at 02:31 PM

    Please see if function module HR_READ_FOREIGN_OBJECT_TEXT will work for you. This is what we generally use to get text from the HRP tables.

    - April King

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2007 at 02:49 PM

    Hi Mohit

    CALL FUNCTION 'RH_READ_HRP1002'

    EXPORTING

    ACT_PLVAR = my_obj-plvar

    ACT_OTYPE = my_obj-otype

    ACT_OBJID = my_obj-objid

    ACT_SUBTY = '0120'

    ACT_LANGU = 'E'

    ACT_BEGDA = gk_par_tab-begda

    ACT_ENDDA = gk_par_tab-endda

    TABLES

    ACT_P1002 = itab

    EXCEPTIONS

    NO_DATA_FOUND = 1

    OTHERS = 2.

    IF SY-SUBRC <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    read table itab with key subty = '0003'. " reading the first two lines of notes

    IF SY-SUBRC = 0.

    SELECT * INTO wa_1002 FROM HRT1002

    WHERE TABNR = itab-tabnr.

    IF wa_1002-TABSEQNR = '000001'.

    tline1 = wa_1002-tline.

    ELSEIF wa_1002-TABSEQNR = '000002'.

    tline2 = wa_1002-tline.

    EXIT.

    ENDIF.

    Clear:wa_1002.

    ENDSELECT.

    Pass the appropriate subty ( whether general text, notes etc ) to the above mentioned fm. then get the tabnr and in second step query hrt1002 as mentioned above. Myself have used it. I have the same requirement.

    Reward points, if helpful

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thanks 4 d response but the problem is that i am using standard driver program so i cant do anything with write form.

      Anything i can do is only in subroutine pool and script which i copied from a standard one.

      One solution i see is that a standard text needs to be created(using a method or fm) for the text fetched and then included in script..is this approach correct n if so how can one proceed with it?

      Message was edited by:

      mohit chopra