SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Made the binary relation between WF_DOC and BKPF



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> SAP Business Workflow
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sat Jan 31, 2009 7:28 pm    Post subject: Made the binary relation between WF_DOC and BKPF Reply with quote

Check out the gos documentation (look for references to table VRBINRELATION and function BINARY_RELATION_CREATE)
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVOBS/BCSRVOBS.pdf
and
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVGBT/BCSRVGBT_STRUCTURE.pdf
There are two tasks set this up:
Task 1: Create config for relation in table VRBINRELATION using SM34
Task 2: submit the the two objects with the OBJECT ROLES as required by function module BINARY_RELATION_CREATE and the RELATION TYPE you defined in task 1.

Dont forget to us the 'commit work' statement at the end.
eg my function module


Import parameters :
Value
OBJKEYA '15000510251202005' OBJCLSSA 'BKPF' BJCLSTYPA 'BO'
OBJKEYB '42EA7DD70630158CE1000000C0A8FB6EWF_FILE'
OBJCLSSB 'WF_DOC' OBJCLSTYPB 'BO'
RELTYP 'ZSUP'
(ZSUP is the relation type from VRBINRELATION)

Code:
FUNCTION z_create_binary_relation.
*"----------------------------------------------------------------------
*""Local interface:
*" IMPORTING
*" REFERENCE(OBJKEYA) LIKE SWEINSTCOU-OBJKEY
*" REFERENCE(OBJCLSSA) LIKE SWEINSTCOU-OBJTYPE
*" REFERENCE(OBJCLSTYPA) LIKE BAPIBDS01-CLASSTYPE
*" REFERENCE(OBJKEYB) LIKE SWEINSTCOU-OBJKEY
*" REFERENCE(OBJCLSSB) LIKE SWEINSTCOU-OBJTYPE
*" REFERENCE(OBJCLSTYPB) LIKE BAPIBDS01-CLASSTYPE
*" REFERENCE(RELTYP) LIKE VRBRELTYP-RELTYPE
*"----------------------------------------------------------------------

  DATA: objrole_a TYPE borident,
  objrole_b TYPE borident,
  reltype TYPE binreltyp,
  binarel TYPE gbinrel,
  binrel_attrib TYPE brelattr OCCURS 0.

  IF objclstypa = 'BO'.
    CALL FUNCTION 'SWO_OBJTYPE_EXIST'
      EXPORTING
        objtype           = objclssa
      EXCEPTIONS
        objtype_not_found = 1
        OTHERS            = 2.
    IF sy-subrc NE 0.
      EXIT.
      MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
  ENDIF.
  IF objclstypb = 'BO'.
    CALL FUNCTION 'SWO_OBJTYPE_EXIST'
      EXPORTING
        objtype           = objclssb
      EXCEPTIONS
        objtype_not_found = 1
        OTHERS            = 2.
    IF sy-subrc NE 0.
      EXIT.
      MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
  ENDIF.

  objrole_a-objkey = objkeya.
  objrole_a-objtype = objclssa.

  objrole_b-objkey = objkeyb.
  objrole_b-objtype = objclssb.

  CALL FUNCTION 'BINARY_RELATION_CREATE'
    EXPORTING
      obj_rolea      = objrole_a
      obj_roleb      = objrole_b
      relationtype   = reltyp
    IMPORTING
      binrel         = binarel
    TABLES
      binrel_attrib  = binrel_attrib
    EXCEPTIONS
      no_model       = 1
      internal_error = 2
      unknown        = 3
      OTHERS         = 4.
  IF sy-subrc NE 0.
    EXIT.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  COMMIT WORK.
ENDFUNCTION.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> SAP Business Workflow All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.