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: 

Link between the 2 tables VBAK and SOOD

Former Member
0 Kudos

Hello Gurus,
I'm developing an ALV report showing different information of sales documents.
In one of the columns, I need to show an icon when there are attached documents to the sales document.
When clicking on this icon a pop-up is open showing the list of the available attached documents.

I found that all the attached documents are stored in the table SOOD, but I can't find the link between these attached documents and the original Sales document stored in VBAK table

Any help would be appreciated.
Regards,
Driss

7 REPLIES 7

FredericGirod
Active Contributor
0 Kudos

Hi,

depends of your configuration.

could you check the table TOA01 ? 

to get quickly the list of document link, you will have to used this method :

  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.


regards

Fred

0 Kudos

Hi Frédéric,
Thank you for your reply,
How can I use cl_binary_relation=>read_links_of_objects
What can i put in it_objects          = it_objects ?

Regarsd,
Driss


0 Kudos

Here an example for the transaction QC55

  DATA :  it_objects   TYPE sibflporbt,

          it_link_a    TYPE obl_t_link ,

          it_roles     TYPE obl_t_rolt ,

          it_relations TYPE obl_t_relt ,


* Vérifie si activation recherche QC55.

  IF w_qc55 EQ 'X'.
    IF w_flag_deriv EQ 'X'.
      SELECT certno
             INTO TABLE it_qcpr
             FROM qcpr
             WHERE matnr EQ is_shadow-matnr
             AND   werks EQ is_shadow-werks
             AND   charg EQ is_shadow-charg.
    ELSE.
      SELECT certno
             INTO TABLE it_qcpr
             FROM qcpr
             WHERE matnr EQ g_cert-vbdpl-matnr
             AND   werks EQ g_cert-vbdpl-werks
             AND   charg EQ g_cert-vbdpl-charg.
    ENDIF.
    LOOP AT it_qcpr.
      MOVE : it_qcpr-certno TO is_object-instid ,
             'BUS2117'      TO is_object-typeid ,
             'BO'           TO is_object-catid .
      APPEND is_object TO it_objects.
    ENDLOOP.
  ENDIF.

* Création 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.

I think instead of BUS2117 your value is 'VBAK'

regards

Fred

0 Kudos

Hi Frédéric,
Thanks a lot for your help, but unfortunatelly it didn't work for me.
I really need the link table between VBAK and SOOD.

Regards,
Driss

0 Kudos

Forget to link directly this table, there is a lot of tables with a very complex melting-pot

did you try to make an SQL trace to have the tables / and the key ? 

regards

Fred

(did you have a content server, or something link to your ArchivLink ? )

Jelena
Active Contributor
0 Kudos

Frederic is right - forget about the tables. You might want to read a bit more about Generic Object Services (GOS), there are lots of posts on SCN.

I worked with these a bit in the past, but it was usually saving attachments, not reading. Reading would be very similar though, the main part we need to understand is the concept itself (generic relationship).

Here are some old posts that might be useful, search for 'GOS attachment' to find more:

http://scn.sap.com/message/1187839#1187839

http://scn.sap.com/thread/2041869

The older posts might direct you to use the function modules, but the methods could be used as well, as mentioned by Frederic.

You can find the right BUS... number and get other clues if you use SQL Trace and open the attachment in VA03.

nabheetscn
Active Contributor
0 Kudos

Hi Azmi

You can create the button in the column of an ALV. Once user press this button call function module

GOS_ATTACHMENT_LIST_POPUP. Pass to it VBAK as business object(check in SWO1 for sales order) and pass IP_MODE as display one. It will show the list of attachments

Nabheet