Read Workflow container
Hi,
I am using SAP_WAPI_READ_CONTAINER to read the container. In the container i have a structure and the result of this function module gives the list of container elements, but the structure as structure names and not as field names.
EX: 'Personal' structure of type P0002, gives output with element name P0002 and not with the field names of P0002.
Is there any way to get output like that?
Thanks,
Sri
You must find your structure in SIMPLE_CONTAINER you have to put code to get data ..
Example :
CALL FUNCTION 'SAP_WAPI_READ_CONTAINER'
EXPORTING
WORKITEM_ID = L_WI_ID
TABLES
SIMPLE_CONTAINER = LT_CONTAINER
EXCEPTIONS
OTHERS = 1.
READ TABLE LT_CONTAINER WITH KEY ELEMENT = '_WI_OBJECT_ID'.
IF SY-SUBRC EQ 0.
MOVE LT_CONTAINER-VALUE TO LS_POR.
SELECT SINGLE * FROM SWXFORMABS
WHERE FORMNUMBER = LS_POR-OBJKEY.
IF SY-SUBRC EQ 0.
SWXFORMABS-PROCSTATE = L_INPUT.
IF SY-SUBRC EQ 0.
EXPORT L_PREPROCESSED TO MEMORY ID 'PREPROC'.
L_OKAY = 'X'.
ENDIF.
ENDIF.
ENDIF
Regards,
Gurprit Bhatia
Similar Messages
-
Hi,
I want to read workflow container using workflow number, not using task or work item id.
Most of the function modules or class-methods which returns container does it based on work item id.
Let me know if you have any solution.
Thanks,
AravindI didnt have a look into the FM browser.
But logically speaking, by specifying the WF number you cannot read the container.
Evry wf will be asscociated with an instance which is nothing but workitem id.
hence you have to use workitem id to read the particular container.
Eg :SAP_WAPI_READ_CONTAINER -
Error in reading workflow container data and populate it in web dynpro pdf
Hi,
Please advise on the following issue.
I have an adobe interactive form built inside a webdynpro java application, on a RFC call this form is sent as an xstring and the BAPI triggers a workflow in the backend. At any point of time, on passing a workitem id, a custom function module returns the form data that exists in the workflow as an xstring back to webdynpro java, intenally this custom FM iterates through the internal table binary contents for IT_SOLIX_TAB and produces an xstring format out of this binary content. This xstring is passed back to the webdynpro java application so that the contents can be displayed in a pdf.
I assume that since the data source context structure which has to be populated with this wf container form data is exactly the same as the one which generated this pdf in webdynpro java before the workflow trigger, the WDINTERACTIVEFORMHELPER.transer.... method should be sufficient to re-populate the wd java based pdf with wf container data.
But I am unable to do this as I am getting "PDFDocument processor failed to process input pdf request" at this step. Though I can see that the RFC is returning the binary data
Versions : ALD 8.1, CE 7.1 SP5 NWDS, Adobe reader 9
Awaiting your inputs.
Thanks
LishaHi Hari,
Why do you use a FM to read the container? You couldn't use bindings? Or are you reading the container of the workflow in a separate program?
Are you sure the container element is filled when the workflow is started? If so how is it filled, in the event binding?
Regards,
Martin -
Read Workflow Container Elements attributes
Hi,
I am using a F.M <b>'RH_GET_TASK_ATTRIBUTES'</b> to get the attributes of the <b>Workflow container</b> elements.
But the above F.M does not show the element attributes that I create inside the Workflow Builer under <b>Workflow Container Block</b> and I dont select either Import or Export Properties.
Is there any F.M that reads ALL Workflow Container elements.If you want to clear a single element, use a container operation and assign it to space. If you need to clear an internal table, create another internal table container element that is always empty. Then, inside the container operation assign the empty table to the table you want to clear.
Basically, you are doing this:
container_element = space. OR container_element = ' '.
container_internal_table[ ] = container_empty_internal_table[ ]. -
Error in reading workflow container data and populate it in web dynpro pd
Hi,
Please advise on the following issue.
I have an adobe interactive form built inside a webdynpro java application, on a RFC call this form is sent as an xstring and the BAPI triggers a workflow in the backend. At any point of time, on passing a workitem id, a custom function module returns the form data that exists in the workflow as an xstring back to webdynpro java. This xstring is passed back to the webdynpro java application so that the contents can be displayed in a pdf.
I assume that since the data source context structure which has to be populated with this wf container form data is exactly the same as the one which generated this pdf in webdynpro java before the workflow trigger, the WDINTERACTIVEFORMHELPER.transer.... method should be sufficient to re-populate the wd java based pdf with wf container data.
But I am unable to do this as I am getting "PDFDocument processor failed to process input pdf request" at this step. Though I can see that the RFC is returning the binary data
Versions : ALD 8.1, CE 7.1 SP5 NWDS, Adobe reader 9
Awaiting your inputs.
Thanks
LishaHi Hari,
Why do you use a FM to read the container? You couldn't use bindings? Or are you reading the container of the workflow in a separate program?
Are you sure the container element is filled when the workflow is started? If so how is it filled, in the event binding?
Regards,
Martin -
How to trigger workflow from WDA and read workflow container into WDAscreen
Dear Expert,
Please suggest the solution for the following requirement:
1. Create 1 leave request from WDA and submit for approval
2. When User press "submit" button in WDA screen, workflow will be triggered for processing approval .
3. When 1 request is sent to approver, he logon into portal and access to UWL to process task himself.
4. After he press approval link, the system will call WDA screen to process approval ( this screen will contain full information of requester.)
5. After finishing process, the result will return workflow and end of process.
Please send simple example for step 1 and one for get data from workflow into WDA screen at step4
Any help would be appreciated
Thanks and best regards,
DucTV.Hi,
I am not sure for what reasons you are developing a application but SAP has its own standard workflow process for applying leave from ESS portal..
1. AS soon as you click on the submit button of the applicaiton then you need to trigger a workflow right in that case you make sure that you need to pass some data to the workflow container I hope you might be using either SAP_WAPI_CREATE_EVENT or SAP_WAPI_START_WORKFLOW to start the workflow in both the function module you have to fill this table in Order to pass the values from ABAP program to workflow container.
The answer to your question is it depends on the type of the work item ID you are passing to the SAP_WAPI_READ_CONTAINER if you are passing a top work item ID then you will have workflow container in LT_CONTAINER if you are passing any of the child or dependent work item ids of the top work item id then you have that respective task container value.
2. You can make use of the any foreground activity or a decision step, it depends on how you want to get back the result, if you use a foreground activity step then in that case you have to populate the result back to the task container and if let say you are using a decision step then in that case you do not have to populate the result there will be standard container element _RESULT in the decision step it will be filled.
Make sure if you are expecting some work item in UWL and as soon as you click on the work item your application should open then configure in SWFVISU transaction and maintain DTD in UWL any portal consultant can perform this steps in few seconds.
3. When the workflow is started then the work item which you are able to get back is the one which helps to identify dependent work item ids it is the TOP or PARENT work item ID.
Regards
Pavan -
Upload file in Web Dynpro and add to Workflow container as SOFM object
Hi!
I have a Web Dynpro for ABAP application that should send attachments of uploaded files to a workflow container. I have already managed to do this, and it works fine for TXT files, but when I try to attach a WORD (.DOC) file the file looks corrput when I open it from the SAP inbox.
When uploading files in Web Dynpro it is as an XSTRING. I have tried out the following alternatives regarding convertion of the XSTRING before it is inserted in the SOFM object:
1) Convert from XSTRING to STRING using codepage 4110.
Then it is split into a string table of 255 chars
2) Convert from XSTRING to STRING using codepage 4102
Then it is split into a string table of 255 chars
3) Convert from XSTRING to BINARY format
I use function module 'SWL_SOFM_CREATE_WITH_TABLE'
and then swf_create_object lr_sofm 'SOFM' ls_sofm_key.
before I call some macros to fill the container.
Anyone else who have tried to do this with success? I'm greatful for any help.
Regards, TineHi,
I had the same problem in the last days and finally I got a quite simple solution:
I had a look at the FM SWL_SOFM_CREATE_WITH_TABLE an noticed that it calls another FM (SO_DOCUMENT_INSERT_API1) which has a tables parameter for HEX data and is actually able to create a SOFM object from HEX data.
I simply copied SWL_SOFM_CREATE_WITH_TABLE as a customer FM and applied a few changes to make it accept HEX data:
First I added a new table parameter in the interface which gets the HEX data from the calling application (uploaded data using BIN format):
OBJECT_CONTENT_HEX LIKE SOLIX
Here is the code of the FM (I marked all additional and changed lines with a comment):
function z_test_sofm_create_with_table .
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(NOTE_TITLE) LIKE SODOCCHGI1-OBJ_DESCR OPTIONAL
*" VALUE(DOCUMENT_TYPE) LIKE SOODK-OBJTP DEFAULT SPACE
*" EXPORTING
*" VALUE(SOFM_KEY) LIKE SWOTOBJID-OBJKEY
*" TABLES
*" NOTE_TEXT STRUCTURE SOLISTI1 OPTIONAL
*" OBJECT_CONTENT_HEX STRUCTURE SOLIX OPTIONAL
*" EXCEPTIONS
*" ERROR_SOFM_CREATION
data: region like sofd-folrg.
data: folder_id like soodk.
data: l_folder_id like soobjinfi1-object_id.
data: document_data like sodocchgi1.
data: document_info like sofolenti1.
data: object_content like solisti1 occurs 0 with header line.
data: lines like sy-tabix.
*- set default
if document_type is initial.
document_type = 'RAW'.
endif.
*- create office object
*-- get dark folder
region = 'B'.
call function 'SO_FOLDER_ROOT_ID_GET'
exporting
region = region
importing
folder_id = folder_id
exceptions
communication_failure = 1
owner_not_exist = 2
system_failure = 3
x_error = 4
others = 5.
if sy-subrc ne 0.
message e696(wl) "<== Add message class
raising error_sofm_creation.
endif.
*- get description
if note_title is initial.
read table note_text index 1.
note_title = note_text.
endif.
*-- create office document
document_data-obj_name = 'ATTACHMENT'.
document_data-obj_descr = note_title.
document_data-obj_langu = sy-langu.
object_content[] = note_text[].
describe table object_content lines lines.
document_data-doc_size = ( lines - 1 ) * 255 + strlen( object_content ).
if object_content[] is initial. "<== insert
describe table object_content_hex lines lines. "<== insert
document_data-doc_size = lines * 255. "<== insert
endif. "<== insert
l_folder_id = folder_id.
call function 'SO_DOCUMENT_INSERT_API1'
exporting
folder_id = l_folder_id
document_data = document_data
document_type = document_type
importing
document_info = document_info
tables
object_content = object_content
contents_hex = object_content_hex " <== Insert line
exceptions
folder_not_exist = 1
document_type_not_exist = 2
operation_no_authorization = 3
parameter_error = 4
x_error = 5
enqueue_error = 6
others = 7.
if sy-subrc ne 0.
message e696(wl) "<== Add message class
raising error_sofm_creation.
endif.
*- set export parameter
sofm_key = document_info-doc_id.
endfunction.
The returned SOFM key I added to a container element. The element refers to event parameter of type OBJ_RECORD in my ABAP OO Class
Using this function I was able to raise an event by using Method cl_swf_evt_event=>raise
that invoked a workitem containing an Excel-File i had uploaded as binary file and passed to the FM z_test_sofm_create_with_table as document type 'XLS'.
In the woritem preview when clicking on the attachment the file was opened directly in Excel.
Actually the new lines for calculation the file size is not yet quite correct. At first glance it does not seem to cause any trouble, but I will stll check that. In FM SO_OBJECT_INSERT the size is again checked and calculated if initial, so leaving size initial might also be an option.
I hope this helps anyone having a similar issue.
Greetings,
Michael Gulitz -
Adding Word attachment to a SOFM object and then to Workflow container
Hi!
I have a Web Dynpro for ABAP application that should send attachments of uploaded files to a workflow container. I have already managed to do this, and it works fine for TXT files, but when I try to attach a WORD (.DOC) file the file looks corrput when I open it from the SAP inbox.
When uploading files in Web Dynpro it is as an XSTRING. I have tried out the following alternatives regarding convertion of the XSTRING before it is inserted in the SOFM object:
1) Convert from XSTRING to STRING using codepage 4110.
Then it is split into a string table of 255 chars
2) Convert from XSTRING to STRING using codepage 4102
Then it is split into a string table of 255 chars
3) Convert from XSTRING to BINARY format
I use function module 'SWL_SOFM_CREATE_WITH_TABLE'
and then swf_create_object lr_sofm 'SOFM' ls_sofm_key.
before I call some macros to fill the container.
Anyone else who have tried to do this with success? I'm greatful for any help.
Regards, TineHello there.
This is probably an usability question that you should ask Microsoft, not us. In any case, you probably need to open the document (it's probably a document that can't be open inside Firefox, so use the appropriate software) and copy it from there.
I'm sorry I can't be of more help. -
Over Time Workflow Container elements not updated
Hi,
I am using Standard Task TS20000459 for approval of Overtime entered for an employee in CAT2 transaction.
Work item is getting generated to his manager's inbox.
Issue is, subject of the work item should have employee number and Employe name. Standard Task contains Container elements &TS_PERNR& and &TS_ENAME& which is not getting filled with any values.
Can any one suggest me how to get the same?
Regards,
Saravana PerumalHi Shanti
I faced the same problem...And i resolved that problem by binding...
Create the container element for PERNR and ENAME in the standard task ts20000459 as well as in workflow container.Then bind those container values.
Before bind the workflow and task container, you have to bind the workflow container with the event container.
Regards,
Hemalatha. -
Workflow container element empty
Hi all,
I have the following problem:
- my workflow container has an element named 'AbsenceRequest'
- in the element 'AbsenceRequest' I have a subelement named Comments which is a table
- I created a business object type 'ZESS_AREQ' in SWO1 which has an attribute named 'Comments' and a method named 'Create'
- In a report I create an object of this object type using swc_create_object and I set subelement 'Comments' to a value 'test' using swc_set_table
- Then I call method 'Create' of the created object
- In that method I retrieve the value from the container using swc_get_table and I receive value 'test'
Then I have the following piece of code:
swc_free_object lf_object.
MOVE lw_areq-pernr TO object-key-personnelnumber.
MOVE lw_areq-id TO object-key-id.
swc_create_object lf_object 'ZESS_AREQ' object-key.
IF sy-subrc EQ 0.
swc_raise_event lf_object 'Created' container.
COMMIT WORK AND WAIT.
ENDIF.
Which should start the corresponding WF (which it does), but in my WF container the subelement Comments is empty...
Any idea what goes wrong?
Many thanks in advance!
JulienWell actually the WF container element has one entry but this entry is empty (blank)...
-
How to use data of multiline element from workflow container
Hi,
Can you please tell me how to access rows of multiline element of workflow container.
Scenario is like below.
I have values in a multiline container(table) of workflow container.
Now inside Fork branches i need to check for specific data in the above table and with that condition i have to send workitem.
I hope u can understand,otherwise please revert.
Thanks in advance,
MadhuYou cannot didrectly check the condition...
what you have to do is.. write a inside the method as below and set the flag...and use the flag in condition editor...
SWC_GET_TABLE CONTAINER 'AGENTS' lt_agents.
loop at lt_agents ino wa_agents.
if wa_agents = 'A'.
lv_flag = X.
endif.
endloop.
SWC_SET_ELEMENT CONTAINER 'FLAG' lv_flag.
Create an export parameter FLAG as char1 with export marked.
Do the neccesary bindings from task to workflow.
Then in workflow check this flag in condition editor. -
Passing multiline element to workflow container ? how do i ?
Hello Folks,
I need to pass an internal table to the workflow container...In this container i had already created an Multiline element which the right table type assigned..
I need to call this Workflow using FM SAP_WAPI_START_WORKFLOW.... Eg:
CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
EXPORTING
TASK = WFNAME
LANGUAGE = SY-LANGU
DO_COMMIT = 'X'
USER = SY-UNAME
START_ASYNCHRONOUS = 'X'
DESIRED_START_DATE =
DESIRED_START_TIME =
DESIRED_START_ZONLO = SY-ZONLO
IFS_XML_CONTAINER =
IMPORTING
RETURN_CODE = lv_return_code
WORKITEM_ID = lv_workitem_id
NEW_STATUS =
TABLES
INPUT_CONTAINER = lt_container_wf
MESSAGE_STRUCT = lt_message_struct
MESSAGE_LINES = lt_msg_lines.
lt_container_wf values should have an internal table to be passed a multiline element.....
I am unble to pass it this way and the error i get is that " Single Line element <XXXX> is being passed several times...
How do i tell the system the the element which is passed is a mulitple element..
Regards,
Anandcheck this code snippet
include <cntn01>.
DATA:
lv_retcode TYPE sysubrc,
lt_cont TYPE TABLE OF swcont,
ls_cont TYPE swcont,
lt_kna1 TYPE TABLE OF kna1,
ls_kna1 TYPE kna1.
SELECT * FROM kna1 INTO TABLE lt_kna1 UP TO 10 ROWS.
swc_create_container lt_cont.
swc_set_table lt_cont 'CUSTOMER' lt_kna1.
CALL FUNCTION 'EWW_WORKFLOW_START'
EXPORTING
x_task = 'WSXXXXXXXX'
TABLES
X_CONTAINER = lt_cont
EXCEPTIONS
INVALID_TASK = 1
NO_ACTIVE_PLVAR = 2
START_FAILED = 3
GENERAL_ERROR = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
Can we pass Internal tables to workflow container?
workflow container has a size limitation, we need to pass any infotype to the workflow container, so can we pass internal tables to workflow container or is there any alternate solution?
Thanks in Advance
HariHi,
Check the <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/a6/9bac935f2c11d194a40000e82dec10/frameset.htm">Multiline Container Element Definition.</a>
Regards
<i><b>Raja Sekhar</b></i> -
Hello everybody,
since release 6.10 the container data is stored in XML-Tables. The question is how can i access them?
regards,
MarkusHi Markus,
Within a workflow context (object methods, agent rules) you can still use the standard container macros. Use the include <cntn01> for the macro definitions.
If your requirement is to read the container from an ABAP report, use the SAP_WAPI_READ_CONTAINER function module.
Cheers,
Ramki. -
PASS DATA FROM ABAP PROGRAM TO WORKFLOW CONTAINER
Hello Everybody,
I am a workflow beginner and I want to pass a data from my ABAP code to a workflow container. This workflow container is used in the Send Mail step.
The ABAP Program is:
REPORT zdb_work_flow.
tables : vbak.
DATA : k TYPE sweinstcou-objkey,
e TYPE swetypecou-event.
DATA : st TYPE swcont,
itab TYPE STANDARD TABLE OF swcont.
PARAMETERS : vbeln TYPE vbak-vbeln.
start-of-selection.
st-element = 'VBELN'. "This is my WORKFLOW CONTAINER
st-tab_index = 1.
st-elemlength = 10.
st-type = 'C'.
st-value = vbeln.
append st to itab.
k = vbeln.
e = 'TRIGGER' "This is an event in my BUS OBJ ZDB_WFLOW
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
objtype = 'ZDB_WFLOW' "My BUS OBJ
objkey = k
event = e "Event TRIGGER in ZDB_WFLOW
tables
event_container = itab
exceptions
objtype_not_found = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. .
COMMIT WORK.
Now I have created a workflow in SWDD as ZDB_WF_SW.
In this WF I have created a container as VBELN.
In the SEND MAIL I have given a header as "Worflow Triggered for &VBELN&"
PROBLEM.
The Workflow is getting triggered. I am also getting a mail "Workflow Triggered for" in my mailbox but the &VBELN& is missing from the header.
I have set the IMPORT EXPORT flag of the WF CONTAINER "VBELN"
Please Help.
Edited by: Deepankar.B on Feb 22, 2011 4:08 PM
Edited by: Deepankar.B on Feb 22, 2011 4:10 PMYou wouldn't use a SMA as an assistance class - but refer to one within it.
I would use Shared Memory Area classes - but I'd also build a SMA that could talk across multiple application servers.
Thomas Jung proposed this in a forum reply some time ago.
It shouldn't be too difficult to use RFC's to access the content of SMA's in multiple app servers - ensuring synchronisation across multi app servers. I've not yet had the need, so haven't attempted.
The long polling in 7.02 apparently uses this approach, so in a 7.02 system there may even be standard components/ SMAs that you could use.
I do not think global areas in FM's are available across sessions - I don't think you could use that as a data transport.
Maybe you are looking for
-
Is it possible to have two USB drives for the IPad? I want to bring RAW files from my camera through the IPad and out to an external hard drive. One of my cameras has an SD card but the other one doesn't have a card that would fit in any of the cam
-
Changes made in RFC is not reflected in data services
Hi, I am using a data service based on SAP R/3 RFC in my view In my RFC i have some import parameters and some export parameters and when place a data service which is based on this RFC on the view for the first time , I am getting the import parame
-
Hi guru's Am creating the service SO in which payment method field is optional, but still while creating the SO it is ask for payment method mandtory, I check the Incompletion log. In that this field is not mandotary, Can any one help me to finout h
-
Data load InfoPackage gets shot dumps
This is related to the solution Vijay provided in the link What is the functionality of 0FYTLFP [Cumulated to Last Fiscal Year/Period I encounter the problem again for Data Mart load that I created different initial load InfoPackages with different d
-
Hi - I've a problem using hyphen in unicode programs
Subject changed by moderator - use a meaningful subject in future Hi, Please solution for this error. In Unicode programs, the "-" character cannot appear in names, as it does here in the name "TEST-001" Thanks, Rajesh Edited by: Matt on Nov 14, 2008