Upload PDF From WF To PA30
Upload PDF From WF To PA30
Upload PDF From WF To PA30
Business Requirement: Client needs to upload PDF(s) to Workflow at ‘user decision’ through ‘import’
button and after final approval of workflow that document needs to upload at PA30 repository of a
particular employee.
Pre-Requisite: Content Server should be configured through a Tcode – OAC0. Here it is ‘Z1’.
Function Modules:
SOLUTION :
There is a Workflow ‘WS90000019’ - upto 4 levels of approvals/rejections. After final approval the
Worklfow will execute the final step i.e. ‘Unlock the entry of Infotype’ which will run at background.
PS: This step unlocks the locked record of employee (Workflow executed through a BADI HRPAD00INFTY)
as well as uploads the document(s) attached to USER DECISION of Workflow.
1) Final Step ‘Unlock the entry of Infotype’ of WF where I have used ‘Z’ class method.
2) Class : ‘ZCL_WF_INFOTYPE’ Method : ‘UPDATE_INFOTYPE’.
7) With the updated Acrobat (PDF version), we need our data to be in char1024 rather than
char/RAW255. So, we need to use a class ‘ cl_rmps_general_functions’.
a. There are few methods which will use:
i. convert_255_to_1022: use this to convert RAW255(contents_hex) to
RAW1024.
ii. convert_1022_raw_to_xstring: use this to convert RAW1024 to xstring.
8) After getting ‘Re_tab’ from the above FM, we will make it compatible to
it_tbl1024(‘archivobject’) of FM (‘ARCHIVOBJECT_CREATE_TABLE’) .
TABLES
archivobject = it_tbl1024
Here,
EXPORTING PARAMETERS
Archiv_id -> Content server ID on Tcode OCA0.
Document_type -> Type of document i.e. PDF
Length -> length of document attached.
Compid -> document name/id
IMPORTING PARAMETERS
Archiv_doc_id -> Unique Document Id
9) After getting the ‘archiv_doc_id’ we will attach this document to repository of the employee
through FM ‘ARCHIV_CONNECTION_INSERT’. Object Id -> pernr.
10) Also, We can use the FM ‘ARCHIVOBJECT_DISPLAY’ to display the document we have uploaded.