User decision UWL comments added to Adobe HCM form comments in a workflow
Dave Weston
Dave.Weston at clockwork.ca
Wed Nov 19 10:11:12 EST 2008
Thanks Jocelyn. Yeah I figured as much. I have created some test code (and I stress dirty test code) as follows in case other folks need it.
Cheers
Dave
PARAMETERS: doc_id TYPE sofolenti1-doc_id,
iv_guid TYPE asr_guid.
DATA: lt_content TYPE TABLE OF solisti1,
wa_content TYPE solisti1.
CALL FUNCTION 'SO_DOCUMENT_READ_API1'
EXPORTING
document_id = doc_id
* FILTER = 'X '
* IMPORTING
* DOCUMENT_DATA =
TABLES
* OBJECT_HEADER =
object_content = lt_content
* OBJECT_PARA =
* OBJECT_PARB =
* ATTACHMENT_LIST =
* RECEIVER_LIST =
* CONTENTS_HEX =
* EXCEPTIONS
* DOCUMENT_ID_NOT_EXIST = 1
* OPERATION_NO_AUTHORIZATION = 2
* X_ERROR = 3
* OTHERS = 4.
.
TYPES: BEGIN OF t_text,
line TYPE tdline,
END OF t_text.
DATA: ref_process TYPE REF TO if_hrasr00_process, " The process object that corresponds to this process
ref_ex TYPE REF TO cx_root, " Exception reference
l_msg TYPE string, " Error message
lt_guids TYPE scmg_tt_case_guid, " Step GUIDs belonging to this process
wa_proc_query TYPE hrasr00process_query_attr, " Process query string
wa_proc_attr TYPE hrasr00process_attr, " Attributes of the process
lt_head TYPE STANDARD TABLE OF bapinoteheader, " Header info about the comments
lt_notes TYPE STANDARD TABLE OF bapinote, " Comments
lt_notes_db TYPE hrasr00_note_tab, " Comments from DB (non-formated)
lt_all_text TYPE STANDARD TABLE OF t_text, " Formatted comments
lt_text_tmp TYPE STANDARD TABLE OF t_text,
wa_text TYPE tdline. " work area
DATA: lt_comment_lines_temp TYPE zhr_wf_char72_ttype,
comment_lines TYPE zhr_wf_char72_ttype.
FIELD-SYMBOLS: <fs_note> LIKE LINE OF lt_notes,
<fs_note_db> LIKE LINE OF lt_notes_db,
<fs_guid> LIKE LINE OF lt_guids,
<fs_text> LIKE LINE OF lt_all_text.
* Create a process object for this guid
TRY.
CALL METHOD cl_hrasr00_process=>get
EXPORTING
process_guid = iv_guid
IMPORTING
instance = ref_process
* no_authority =
.
CATCH cx_hrasr00_process_object INTO ref_ex .
l_msg = ref_ex->get_text( ).
EXIT.
ENDTRY.
* Get the general attributes so we can determine the steps assigned to this
* process
TRY.
CALL METHOD ref_process->get_general_attributes
IMPORTING
process_attributes = wa_proc_attr.
CATCH cx_hrasr00_process_object INTO ref_ex .
l_msg = ref_ex->get_text( ).
EXIT.
ENDTRY.
MOVE-CORRESPONDING wa_proc_attr TO wa_proc_query.
* Get all the step guids for this process, the comments entered in the forms are
* stored against the steps
TRY.
CALL METHOD cl_hrasr00_step=>if_hrasr00_step~find_step_guids_by_attr
EXPORTING
process_query_attr = wa_proc_query
IMPORTING
step_guids = lt_guids.
CATCH cx_hrasr00_process_object INTO ref_ex .
l_msg = ref_ex->get_text( ).
EXIT.
ENDTRY.
* For each step guid get the comments
LOOP AT lt_guids ASSIGNING <fs_guid>.
CALL FUNCTION 'BAPI_CASE_GETNOTES'
EXPORTING
guid = <fs_guid>
TABLES
note_headers = lt_head
note_contents = lt_notes.
LOOP AT lt_notes ASSIGNING <fs_note>.
DATA: lt_case_note_ids TYPE TABLE OF bapinoteid,
wa_case_note_ids TYPE bapinoteid,
lt_case_notes TYPE TABLE OF bapinote,
wa_case_notes TYPE bapinote,
wa_head TYPE bapinoteheader.
LOOP AT lt_head INTO wa_head.
wa_case_note_ids-elem_no = 1.
wa_case_note_ids-tdid = wa_head-tdid.
INSERT wa_case_note_ids INTO TABLE lt_case_note_ids.
EXIT.
ENDLOOP.
LOOP AT lt_content INTO wa_content.
wa_case_notes-elem_no = 1.
wa_case_notes-tdformat = '*'.
wa_case_notes-tdline = wa_content-line+5.
INSERT wa_case_notes INTO TABLE lt_case_notes.
ENDLOOP.
CALL FUNCTION 'BAPI_CASE_ADDNOTES'
EXPORTING
guid = <fs_guid>
* IMPORTING
* RETURN =
TABLES
case_note_ids = lt_case_note_ids
case_notes = lt_case_notes.
EXIT.
ENDLOOP.
CLEAR: lt_notes, lt_head.
________________________________
From: sap-wug-bounces at mit.edu on behalf of Dart, Jocelyn
Sent: Tue 11/18/2008 5:20 PM
To: SAP Workflow Users' Group
Subject: RE: [LIKELY JUNK]User decision UWL comments added to Adobe HCM formcomments in aworkflow
Ok Dave, Sorry but it's code-it-yourself time with that because the comments are held as a string field in the XML. You could add it to an ordinary table type field using the Export task, but if you really want to use the comments you'll need to take a look at the ABAP Class CL_HRASR00_WF_COMPONENTS method DATAMAPPING which imports/exports fields - and create your own version to work with the string type comments fields.
Regards,
Jocelyn
________________________________
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of Dave Weston
Sent: Wednesday, 19 November 2008 6:05 AM
To: sap-wug at mit.edu
Subject: [LIKELY JUNK]User decision UWL comments added to Adobe HCM form comments in aworkflow
Hi folks,
Was wondering if anyone working with the workflows with Adobe HCM forms has taken the comments from a user decision in the UWL (object SOFM) and added them to the comments of an HCM form in an Adobe process ? If they have, would they mind sharing how they did it and any development details ?
In the meantime I will look at creating a method to read the SAP Office stuff and calling another HCM form process method to add it to the Adobe form comments.....somehow !!
Thanks
Dave
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 18294 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20081119/0fe96c38/attachment.bin
More information about the SAP-WUG
mailing list