on ‎2005 Sep 09 11:32 AM
Hi!
I m passing values from my ABAP prog to my event container and from there to my workflow and ultimately to my workitem text.
Now my problem is - my ABAP prog. is passing junk characters along with the actual value to my event container parameters while setting event parameters thru
swc_set_ELEMENT ev_container 'EVENT_PARAMETER' VALUE.
How to prevent these junk chars from being passed?
Request clarification before answering.
Hi Sudipto Barman,
I'm not sure but it looks like there is a problem with the Macros, though nothing apparently.
Try this: The data type of containers is an internal table of type SWCONT just populate this manually and pass it to INPUT_CONTAINER in the function call.
And remeber to trim the charecter fields using condense no-gaps wherever necessary.
Good luck,
Arun N
91 9443167531
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you declare and fill the Container as below (see my earlier reply above)?
DATA:
ev_container like swr_cont occurs 0 with header line.
ev_container-element = 'TPLNR'.
ev_container-value = LTPLNR.
append ev_container.
ev_container-element = 'PLTXT'.
ev_container-value = LPLTXT.
append ev_container.
Cheers,
Ramki Maley.
Hi Ramki!!!
Thanks a lot. But still my prob persists.
Actually what's happ'ng is:
ev_container is of type SWCONT. Now fields of SWCONT r ELEMENT, TAB_INDEX, ELEMLENGTH, TYPE and VALUE. So the data being passed to WF workitem is with these values i.e.
if actual value to be passed is 'RAMKI'.
it is passing 000000010CRAMKI.
Cud anyone guide me on solving this?
Thanks n Regards,
Sudipto.
Sudipto,
Let me know if you have done the following:
Defined the Event parameters for the object in SWO1.
Defined the WF container elements with same properties with the Import & Export boxes checked.
Defined Event Parameter to WF Container Element binding on the WF template.
Triggered the Event with the correct parameter names using the WAPI as described in my previous reply above. Once again if you are using the WAPI you must fill the container parameter as specified. The WAPI converts the simple Internal table to SWCONT format and passes it to WF.
If you are then trying to access the container element in an Object method or a check/receiver FM, you then use the container macro SWC_GET_ELEMENT to read the value.
Cheers,
Ramki Maley.
Hi Ramki!
Thnx.
Actually my Workflow is just receiving the values from the event parameters and populating the same in a send mail task.
Event parameters r getting values from the screen in my ABAP prog. which is actually triggering my event.
Now I m getting those xtra values of SWCONT table passed to my event parameters in my workitem.
And Ramki this is why, in another WORKFLOW, I m unable to use the EXPRESSION for agent assignment as my workflow cont. element has userid + SWCONT xtra values.
Dont know how to get rid of those xtra values? Cud u plz. help?
Thanks and Regards,
Sudipto.
Hi Ramki!
Actually I m facing the same prob. for 2 of my WFs.i.e. extra values (values of SWCONT fields) being passed by my ABAP prog. For the 2nd, m attaching the code herewith.
*********************************************************
REPORT ZISU_WF_NSC_COM1.
include <cntn01>. "This include is needed for container definition.
DATA: DATE(10) TYPE C, CUST_NAME(20) TYPE C, ADD1(20) TYPE C, ADD2(20)
TYPE C, ADD3(20) TYPE C, CITY(20) TYPE C, PIN(20) TYPE C, COMMENTS(20)
TYPE
C.
DATA: MAX_TAB TYPE ZCUSTOMER1-SRNO.
*DATA: CUST(120) TYPE C.
DATA:OK_CODE TYPE SY-UCOMM,
SAVE_OK TYPE OK_CODE.
DATA: WA LIKE ZCUSTOMER1.
EVENT RELATED DECLARATIONS----
data: event_Creator like swhactor, "HOlds event creator's login id
jeventid like SWEDUMEVID-EVTID, "Return parameter given Event ID
inforec type swc_object, " Business Object(BO) reference
reqkey like SWEINSTCOU-OBJKEY, "Key Field of BO
ev_container type SWCONT occurs 0 with header line.
EVENT RELATED DECLARATIONS----
Call screen 101.
MODULE USER_COMMAND_0101 INPUT.
OK_CODE = SY-UCOMM.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SY-UCOMM.
WHEN 'SUB'.
SELECT MAX( SRNO ) INTO MAX_TAB FROM ZCUSTOMER1.
WA-SRNO = MAX_TAB + 1.
WA-CUST_DATE = DATE.
WA-NAME = CUST_NAME.
WA-ADD1 = ADD1.
WA-ADD2 = ADD2.
WA-ADD3 = ADD3.
WA-CITY = CITY.
WA-PIN = PIN.
WA-COMMENTS = COMMENTS.
INSERT ZCUSTOMER1 FROM WA.
event_creator-otype = 'US'. "US stands for SAP User
event_creator-objid = sy-uname.
SWC_CREATE_CONTAINER ev_container.
swc_set_ELEMENT ev_container 'CUST_DATE' DATE. "Set event
"Container
ev_container-element = 'CUST_NAME'.
ev_container-value = CUST_NAME.
append ev_container.
ev_container-element = 'ADD1'.
ev_container-value = ADD1.
append ev_container.
ev_container-element = 'ADD2'.
ev_container-value = CUST_NAME.
append ev_container.
ev_container-element = 'ADD3'.
ev_container-value = ADD3.
append ev_container.
ev_container-element = 'COMMENTS'.
ev_container-value = COMMENTS.
append ev_container.
ev_container-element = 'CITY'.
ev_container-value = CITY.
append ev_container.
ev_container-element = 'PIN'.
ev_container-value = PIN.
append ev_container.
*
swc_set_ELEMENT ev_container 'CUST_NAME' CUST_NAME.
swc_set_ELEMENT ev_container 'ADD1' ADD1.
swc_set_ELEMENT ev_container 'ADD2' ADD2.
swc_set_ELEMENT ev_container 'ADD3' ADD3.
swc_set_ELEMENT ev_container 'COMMENTS' COMMENTS.
swc_set_ELEMENT ev_container 'CITY' CITY.
swc_set_ELEMENT ev_container 'PIN' PIN.
swc_GET_ELEMENT ev_container 'FORM' FORM.
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
OBJECT_TYPE = 'ZKNA1'
OBJECT_KEY = 'CustomerNo'
EVENT = 'PROCESSSTARTED'
COMMIT_WORK = 'X'
EVENT_LANGUAGE = SY-LANGU
LANGUAGE = SY-LANGU
USER = SY-UNAME
IFS_XML_CONTAINER =
IMPORTING
RETURN_CODE =
EVENT_ID =
TABLES
INPUT_CONTAINER = ev_container.
MESSAGE_LINES =
MESSAGE_STRUCT =
LEAVE TO LIST-PROCESSING.
WRITE:'DONE'.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE.
*********************************************************
Cud u help me on this?
Hi,
Please see the lines I commented in italics, my additions in bold.
EVENT RELATED DECLARATIONS----
data: event_Creator like swhactor, "HOlds event creator's login id
jeventid like SWEDUMEVID-EVTID, "Return parameter given Event ID
inforec type swc_object, " Business Object(BO) reference
reqkey like SWEINSTCOU-OBJKEY, "Key Field of BO
<i>*** ev_container type SWCONT occurs 0 with header line.</i>
<b>ev_container like swr_cont occurs 0 with header line.</b>
EVENT RELATED DECLARATIONS----
event_creator-otype = 'US'. "US stands for SAP User
event_creator-objid = sy-uname.
<b>* DO NOT USE MACRO. Container parameter is an internal table.</b>
<i>*** SWC_CREATE_CONTAINER ev_container.</i>
<b>* Use append statement </b>
<i>*** swc_set_ELEMENT ev_container 'CUST_DATE' DATE. "Set event
"Container
</i>
ev_container-element = 'CUST_NAME'.
ev_container-value = CUST_NAME.
append ev_container.
This should solve both of your problems.
Cheers,
Ramki Maley.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.