Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Archive a .pdf file and later link it with FI document using Barcode

nathalie_michel
Participant
0 Kudos

Dear all,

Context of my probem : I receive via an RFC function a .pdf (binary) and some others data I must store on specifics tables, these data will be used later by an other program to generate a FI document. the .pdf must be archived. My idea is to use a Barcode to link the archive file with the FI document (I've heard that it's possible but I don't know how to do)

I use these functions

  * Get Customizing information from transaction OAC3
  call function 'ARCHIV_METAINFO_GET'

  *   Put file from application server into archive (Via RFC, I receive the binary data in table (char1024))
CALL FUNCTION 'SCMS_AO_TABLE_CREATE'

If I've well-understood, after that, my table is saved in our archiving server.

Then I tried to use function 'ARCHIV_CONNECTION_INSERT', I understood that this function make the link beween Sap Document and the archive file. the problem is that we need the Object_id which is normally based on the FI doc.number, which in my case doesn't exist yet !!

   call function 'ARCHIV_CONNECTION_INSERT'
    exporting
      ARCHIV_ID             

      ARC_DOC_ID          

      AR_OBJECT           

      MANDANT            

      OBJECT_ID             ==> is normally for FI doc : Company code + Doc.Number + year

      SAP_OBJECT        

      DOC_TYPE            

      BARCODE              


Please could you advice on this topic?

Thanks

Nat

1 ACCEPTED SOLUTION

FredericGirod
Active Contributor
0 Kudos

Hi Nat,

you create your PDF into the Archive

you create a link to the barcode

when the barcode is link to FI, you delete the link to the barcode and you create a new link to the FI document

http://help.sap.com/saphelp_erp60_sp/helpdata/en/46/c4317ffc4b11d195650000e82deb58/frameset.htm

regards

Fred

4 REPLIES 4

FredericGirod
Active Contributor
0 Kudos

Hi Nat,

you create your PDF into the Archive

you create a link to the barcode

when the barcode is link to FI, you delete the link to the barcode and you create a new link to the FI document

http://help.sap.com/saphelp_erp60_sp/helpdata/en/46/c4317ffc4b11d195650000e82deb58/frameset.htm

regards

Fred

0 Kudos

Hi Fred,

Thank for your answer, which is helpful but not complete for me to finish my program. Each info I get, we always have to give the object_ID and I don't know what to fill in!

Create the PDF to Archive, I'm able to do it.

Then which function I should use to create a link to the barcode?

I've understood that we can create the archive file with a barcode (Doc + Barcode) and then the link is done booking the FI document, because at the time we book the FI document, we enter the (Doc + Barcode) = nothingelse to do via program.

Nat

0 Kudos

Hi Nathalie,

I can't help you better (I'm in Holliday), but have a look to the table SGOSATTR (you could modify the menu of the GOS thru this table). In this table you will find witch class is used for witch line of the GOS menu (the GOS menu is the link you could find in the upper left corner to put document, workflow, barcode ..)

The problem with the link in GOS or Archivlink, there is several method to store object, when you go in Solution Manager & KW you lost your mind

maybe try this one

It's to read object link to the QC55 trans.

      MOVE : it_qcpr-certno TO is_object-instid ,

             'BUS2117'      TO is_object-typeid ,

             'BO'           TO is_object-catid .

      APPEND is_object TO it_objects.

* Alimentation de la clef.

  MOVE : 'I'          TO is_role-sign ,
         'EQ'         TO is_role-option ,
         'GOSAPPLOBJ' TO is_role-low.
  APPEND is_role TO it_roles.
  MOVE : 'I'          TO is_relation-sign ,
         'EQ'         TO is_relation-option ,
         'ATTA'       TO is_relation-low .
  APPEND is_relation TO it_relations.
  MOVE : 'BIN' TO w_file_type.

*   Extraction des liens.

  TRY.
      CALL METHOD cl_binary_relation=>read_links_of_objects
        EXPORTING
          it_objects          = it_objects
          it_role_options     = it_roles
          it_relation_options = it_relations
        IMPORTING
          et_links_a          = it_link.
    CATCH cx_obl_model_error.
    CATCH cx_obl_parameter_error.
    CATCH cx_obl_internal_error.
  ENDTRY.

You could find all the object in SWO1

For the barcode, in your place, I will do an SQL trace in the barcode creation, see when SAP read the good tables (SOO...) put a break point.

Start again, and look the stack (call stack).

You will find witch class / method or function is used by SAP to create ...

regards

Fred

sasmita_mekap
Advisor
Advisor
0 Kudos

Hello Nathalie,

Ideally in barcode scenarios, a document with barcode is scanned and stored in the content repository in electronic format via a scanner/scan client, and the scan client software takes care of storing the document and creating the entries in the relevant barcode tables if needed.

Before I proceed on the reply, I would like to explain the general barcode functionality:

As per the standard Archivelink barcode functionality, if an application document is posted with a barcode and if there is an entry found in the BDS_BAR_EX table for an application document with the corresponding barcode, then a link entry will be created in the ArchiveLink link table (Link table is the one configured for the corresponding repository and Document Type in OAC3 example TOA01,TOA02 etc table where the ArchiveLink entry will be created) and it will delete the entry from BDS_BAR_EX table (unless the hold extnl flag is enabled in OAC5 to retain the entries) .

If not found in the BDS_BAR_EX, then an entry will be created in BDS_BAR_IN table so that in future when you scan an external physical document with same barcode, it will search for the same barcode in the BDS_BAR_IN and if it finds there, it will match the barcodes and create an ArchiveLink entry in the link table and delete the entry from the  BDS_BAR_IN table (unless the Hold R/3 flag is enabled in OAC5 to retain the entry ).

If the same barcode entry is not present in BDS_BAR_IN table while scanning the external physical document, then an external barcode entry  should get created in BDS_BAR_EX table so that in future it can be used  when an application document is posted with the same barcode.
 
This is how ArchiveLink barcode scenario works.


Now coming to your scenario:

You are storing the document something differently, because you do not use a scanner to scan any barcode document or so, and you are passing the file content to be stored directly to the content server.
So, ideally your scenario is not matching the usual standard barcode scenario.

Hmm, 🙂 You can do one thing...
- Once you store the document in the content repository, you have the Document ID right. So, after storing the document successfully, you can create a corresponding barcode entry in BDS_BAR_EX with some unique barcode.
Check function module BDS_BARCODE_CREATE_VIA_RFC if it can be used. Because this is the one which scan clients usually use.
- And also customize in OAC5 transaction or SPRO customizing for the corresponding application business object,etc and activate the barcode entry.
- Now, once you go to the application transaction and you have the object ID for the FI document, then you can use the GOS menu "Enter barcode" from the application transaction and post the same barcode in the barcode pop-up which will create link entry in the link table TOAxx once the barcode is matched with the BDS_BAR_EX entry.
Again here if you do not have any application transaction, then the backend function module used for "Enter barcode" scenario is ALINK_BARCODE_GLOBAL. Just check once if you can use that for your scenario.

Hope this way it helps you.

Thanks and Regards,

Sasmita