
Prerequisites: Basic Knowledge on Workflow and Generic Object Services
Summary: In this Scenario we are using Business Object for Inbound Delivery (BUS2015). We have created a Subtype of the Object to include a few Events and Methods. The Requirement here is to fetch the GOS Attachments for Inbound Delivery in ECC and add the Attachment in the User Decision Step of workflow.
Process
BEGIN_METHOD CREATEATTACHMENT CHANGING CONTAINER.
DATA: ls_lpor TYPE sibflporb,
lt_conn TYPE TABLE OF bdn_con,
ls_conn TYPE bdn_con.
TYPES :BEGIN OF ty_conn,
LOIO_ID TYPE BDS_DOCID,
END of ty_conn.
DATA: lt_conn1 type standard table of ty_conn,
ls_conn1 type ty_conn.
* Constants
CONSTANTS : lc_x TYPE char1 VALUE 'X',
lc_bus2015 TYPE bds_clsnam VALUE 'BUS2015',
lc_clstype TYPE char2 VALUE 'BO',
lc_e TYPE char1 VALUE 'E',
lc_t TYPE char1 VALUE 'T',
lc_b TYPE char1 VALUE 'B'.
*--Attachments
DATA:ATTLIST TYPE SWC_OBJECT OCCURS 0.
DATA:ATT TYPE SWC_OBJECT.
DATA:BEGIN OF SOFMKEY,
KEY TYPE SWO_TYPEID,
END OF SOFMKEY.
DATA:l_delivery type vbeln.
SWC_GET_ELEMENT CONTAINER 'Delivery' l_delivery.
if OBJECT-KEY-DELIVERY is NOT initial.
MOVE OBJECT-KEY-DELIVERY TO ls_lpor-instid.
else.
MOVE l_DELIVERY TO ls_lpor-instid.
endif.
ls_lpor-typeid = lc_bus2015.
ls_lpor-catid = lc_clstype.
CALL FUNCTION 'BDS_ALL_CONNECTIONS_GET'
EXPORTING
classname = lc_bus2015
classtype = lc_clstype
objkey = ls_lpor-instid
all = lc_x
no_gos_docs = ''
TABLES
all_connections = lt_conn
EXCEPTIONS
no_objects_found = 1
error_kpro = 2
internal_error = 3
not_authorized = 4
OTHERS = 5.
loop at lt_conn into ls_conn.
move ls_conn-LOIO_ID to SOFMKEY-key.
SWC_CREATE_OBJECT ATT 'SOFM' SOFMKEY.
* Insert object reference into multiline object reference
APPEND ATT TO ATTLIST.
clear ls_conn.
endloop.
SWC_SET_TABLE CONTAINER 'ATTLIST' ATTLIST.
END_METHOD
Testing the Workflow using SWUS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
13 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |