cancel
Showing results for 
Search instead for 
Did you mean: 

How print a content document in SAP Folder Management (Records Management)

former_member185067
Participant
0 Kudos

Hi Gurus,

I am try to do function module that print a document of Records Management. I read other post and I copy a function module standar SRM_DOCUMENT_DISPLAY to ZSRM_DOCUMENT_DISPLAY with this code:


  1. FUNCTION ZSRM_DOCUMENT_DISPLAY .
  2. *"----------------------------------------------------------------------
  3. *"*"Interfase local
  4. *" IMPORTING
  5. *" VALUE(OBJECTID) TYPE BAPISRMDOC-GUID
  6. *" VALUE(DOCUMENTCLASS) TYPE BAPISRMDOC-DOCCLASS
  7. *" VALUE(VERSION) LIKE BAPISRMDOC-VERSION DEFAULT 0
  8. *" VALUE(VARIANT) LIKE BAPISRMDOC-VARIANT DEFAULT 0
  9. *" VALUE(MODIFY) TYPE BAPISRMDOC-BOOLEAN DEFAULT ' '
  10. *" VALUE(DOC_CONTEXT) TYPE BAPIDOCCONTEXT OPTIONAL
  11. *" EXCEPTIONS
  12. *" NOT_AUTHORIZED
  13. *" INTERNAL_ERROR
  14. *" PARAMETER_ERROR
  15. *" NOT_FOUND
  16. *"----------------------------------------------------------------------
  17. TYPE-POOLS: srmgs, srmif, RMPSD.
  18. CONSTANTS: c_0 TYPE c LENGTH 1 VALUE '0'.
  19. DATA: l_version TYPE bapisrmdoc-version,
  20. l_sps_id TYPE string,
  21. l_rms_id TYPE string,
  22. activity TYPE char32,
  23. lt_sp_poid TYPE srm_list_poid,
  24. l_sps_id_cast TYPE srmspsid,
  25. sp_document TYPE REF TO if_srm_sp_document,
  26. lif_sp_obj TYPE REF TO if_srm_sp_object,
  27. lif_poid TYPE REF TO if_srm_poid,
  28. ex_srm_framework TYPE REF TO cx_srm_framework,
  29. ex_cust TYPE REF TO cx_srm_customizing_error,
  30. ex_no_auth TYPE REF TO cx_srm_no_authorization,
  31. ex_srm TYPE REF TO cx_srm.
  32. DATA: print_handler TYPE REF TO cl_rmps_print_document,
  33. DOC TYPE REF TO CL_RMPS_SP_DOCUMENT,
  34. re_op_obj_id TYPE RMPS_OP_OBJ_ID,
  35. IM_PARENT_OP_OBJ_ID TYPE RMPS_OP_OBJ_ID,
  36. operation TYPE REF TO if_rmps_operation,
  37. operation_run TYPE REF TO if_rmps_operation_print,
  38. operation_run_2 TYPE REF TO if_rmps_operation_run,
  39. print_param TYPE string,
  40. print_parameters TYPE REF TO cl_srm_rf_value_set.
  41. TRY.
  42. l_version = version.
  43. PERFORM get_content_connection USING objectid documentclass l_version doc_context
  44. CHANGING sp_document.
  45. DOC ?= SP_DOCUMENT.
  46. print_handler = DOC->if_rmps_sp_document~get_print_handler( ).
  47. operation = print_handler->create_operation( im_recursive = if_srm=>false ).
  48. operation_run ?= operation.
  49. CALL METHOD operation_run->open_print_job( ).
  50. operation_run_2 = operation->create_run( ).
  51. operation_run_2->start( ).
  52. operation_run_2->end( ).
  53. CALL METHOD operation_run->close_print_job( ).
  54. ENDTRY.
  55. ENDFUNCTION.

And the code works well but only print the atributtes of the expedient not print the content.

Please anyway can me help?

Regards,

Accepted Solutions (0)

Answers (0)