Agnostic Guides
...
Developers Guide
Class/Method Plug-In’s
Publisher: Triggering Storing and Linking
4min
in your custom code or enhancements (primarily in the "processing" or appropriate form of your z version of the message output), add code that calls the “publish message” method of the “/dflow/cl publishing” the example below shows the retrieval of the spool id as well as various other input parameters like the filename (used for the document that will be stored in the content management system) so that the call to the “publish message” method can be made calls to the method can also be made using the sap otf table or by passing in the pdf as a string instead of using the spool id adjustments will need to be made for the particular message output program/function module that is getting docuflow functionality added to it consult with an abap developer for assistance in gathering the correct information so that a call to the “publish message” can be made successfully example ensure the user has selected to print the document (ie not fax/edi/etc) if finaa nacha = 1 "print “ define the variables we need to make the call to publisher data lo publishing type ref to /dflow/cl publishing data lv object id type /dflow/cl publishing=>gt object id data lv arc doc id type /dflow/cl publishing=>gt id data lv filename type file table filename data lv document linked type abap bool data lv document stored type abap bool data lv message type string “ get an instance of the publisher object lo publishing = /dflow/cl publishing=>get instance( ) " set filename (format the filename to how you would like) concatenate bkorm konto bkorm bukrs into lv filename separated by ' ' “ determine the sap object id for this particular object lv object id+0(10) = bkorm konto "customer number lv object id+10(4) = bkorm bukrs "company code “ try to make the call to the publisher method and catch any exceptions “ in this example the sap object type and document type are hard coded try call method lo publishing >publish message exporting iv spool id = itcpp tdspoolid it otf = iv pdf xstring = iv filename = lv filename iv sap object = 'knb1' iv ar object = 'zcrmpubl01' iv object id = lv object id importing ev arc doc id = lv arc doc id ev error = lv error ev document stored = lv document stored ev document linked = lv document linked et return = lt return catch /dflow/cx common lv message = lo error >get text( ) lv error = abap true message lv message type 'i' endtry read table lt return into ls return with key type = 'e' if sy subrc eq 0 move 'ztc' to syst msgid, 'e' to syst msgty, '018' to syst msgno, ls return message(50) to syst msgv1, ls return message+50(50) to syst msgv2, ls return message+100(50) to syst msgv3, ls return message+150(50) to syst msgv4 perform protocol update move '/dflow/zdocuflow' to syst msgid, 'e' to syst msgty, '001' to syst msgno, 'docuflow storage connection error contact admin' to syst msgv1 perform protocol update move c rc01 to g subrc else move '/dflow/zdocuflow' to syst msgid, 's' to syst msgty, '001' to syst msgno, 'docuflow storage success' to syst msgv1 perform protocol update endif endif