on 10-11-2007 3:21 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mohit,
Using the call function you will get the value of TABNR and using the TABNR value , in the table hrt1002 you will have the seqnr value will vary from 0001 to 0007 (eg., this denotes that you will have seven lines of notes ) .
Loop the tabnr for that objectid and you can get all the lines of notes .
Regards
Gajalakshmi
Hi Mohit ,
In the programming, u will loop it and append it in a table .
1. Give an element in the form , call it in your program using the function write_form , before that mention the loop .
2.So , dynamically the tlines will be picked provided u use correct queries.
3. Write the select statement , loop, call the function , give enough space for the window to write all the tlines .
Still you have a problem , reply . All the best .
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.