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.
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.