Binding Structure/Internal Table to Workflow from Webdynpro
Hi Gurus,
I have to trigger workflow from WEBDYNPRO application. For now I have two ways they are:
1. Triggering WFLow using SAP_WAPI_START_WORKFLOW (Successfull):
How could I bind Structure/Internal Table (DDIC referred structure) to workflow directly. Presently I am mapping indvidual fields which makes my code complex using FM SAP_WAPI_START_WORKFLOW.
2. Triggering WFLow using SAP_WAPI_CREATE_EVENT (Bindind issues):
Also When I try to submit using BOR event with SAP_WAPI_CREATE_EVENT workflow triggers successfully But I cannot able to bind the values. So are there any specific configuration need to be made.( like making task as General while triggering workflow using SAP_WAPI_START_WORKFLOW).
<<text removed>>
Edited by: Matt on Aug 5, 2011 7:49 PM
Hi
Please make use of the below code
INCLUDE cntn01_swc.
DATA lt_kna1 TYPE TABLE OF kna1.
DATA lt_cont TYPE TABLE OF swcont.
DATA lv_wiid TYPE sww_wiid.
swc0_create_container lt_cont.
SELECT * FROM kna1 INTO TABLE lt_kna1 UP TO 10 ROWS.
swc0_set_table lt_cont 'CUST' lt_kna1.
CALL FUNCTION 'SWW_WI_START'
EXPORTING
creator = sy-uname
task = 'WSXXXXXXXX'
do_commit = 'X'
IMPORTING
wi_id = lv_wiid
TABLES
wi_container = lt_cont
EXCEPTIONS
id_not_created = 1
read_failed = 2
immediate_start_not_possible = 3
execution_failed = 4
invalid_status = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
The other way to do is you can also make use of OO ABAP classes to trigger the workflow. If you want to create a rfc function module then create a wrapper function module .
SAP_WAPI_START_WORKFLOW cannot transfer structures or tables which are more thatn 255 characters. So the work around is either make use of OO container or SWCONT container.
The above code snippet should be included in the assistance class of the webdynpro application and you need to include the define the include cntn01_swc in the class local types under macros.
and then you create a method ....... and include the above code in that method. excluding the include statement.
Regards
Pavan
Similar Messages
-
Code To Update the Table in ECC from Webdynpro
Hi All,
I want to know, the table is dispalyed in the webdynpro browser when we calls the Adaptive RFC Model.
after i want to add one more row in the webdynpro and just clicking on add button the row will be updated in the ECC server(backend) for that how can i write the coding, regarding this issue can you please help me.
ThanX All,Hi Sriram,
Assuming you have a table filled with records by adding one by one, If you want to update a table in SAP ECC, follow these steps.. i think already you are triggering the action for the button in view(for table updation) to method in controller or created a custom controller and mapped the model node.
1. Initialize the main model node and bind the model node with the intialised object like
Zbapi_MainModelNode_Input input = new Zbapi_MainModelNode_Input();
wdContext.nodeZbapi_MainModelNode_Input ().bind(input);
2. Now loop the table node and set the values with corresponding class in the generated model (from webdynpro explorer) and initialize like
IPrivateControllerName.ITableElement myTab = null;
for ( int i = 0; i < wdContext.nodeTable().size();i++)
myTab = this.wdContext.nodeTable().getTableElementAt(i);
Bapi_structname name = new Bapi_structname();
name.setFieldName1(myTab.getFieldName1);
name.setFieldName2(myTab.getFieldName2);
input.addT_Bapi_(name);
Finally execute the BAPI..
wdContext.currentZbapi_MainModelNode_Input tElement().modelObject().execute();
Hope this solves your issue - Update the Table in ECC from Webdynpro.
Regards,
Manjunath
Edited by: Manjunath Subramani on Nov 20, 2009 4:26 PM
Edited by: Manjunath Subramani on Nov 20, 2009 4:27 PM -
What is the difference between Structure & Internal Tables,
Regards.Hi chidambar,
to say simply the internal table can have data within it but a structure is that which can be used by an internal table to define its columns ,it cannot have data on its own
coming to thoery this may help you,but dont confuse more with the theory
Structures
A structure is a sequence of any elementary types, reference types, or complex data types.
You use structures in ABAP programs to group work areas that logically belong together. Since the elements of a structure can have any data type, structures can have a large range of uses. For example, you can use a structure with elementary data types to display lines from a database table within a program. You can also use structures containing aggregated elements to include all of the attributes of a screen or control in a single data object.
The following terms are important when we talk about structures:
Nested and non-nested structures
Flat and deep structures
A nested structure is a structure that contains one or more other structures as components. Flat structures contain only elementary data types with a fixed length (no internal tables, reference types, or strings). The term deep structure can apply regardless of whether the structure is nested or not. Nested structures are flat so long as none of the above types is contained in any nesting level.
Any structure that contains at least one internal table, reference type, or string as a component (regardless of nesting) is a deep structure. Accordingly, internal tables, references, and strings are also known as deep data types. The technical difference between deep structures and all others is as follows. When you create a deep structure, the system creates a pointer in memory that points to the real field contents or other administrative information. When you create a flat data type, the actual field contents are stored with the type in memory. Since the field contents are not stored with the field descriptions in the case of deep structures, assignments, offset and length specifications and other operations are handled differently from flat structures.
Internal Tables
Internal tables consists of a series of lines that all have the same data type. Internal tables are characterized by:
The line type, which can be any elementary type, reference type, or complex data type.
The key identifies table rows. It is made up of the elementary fields in the line. The key can be unique or non-unique.
The access method determines how ABAP will access individual table entries. There are three access types, namely unsorted tables, sorted index tables and hash tables. For index tables, the system maintains a linear index, so you can access the table either by specifying the index or the key.
Hashed tables have no linear index. You can only access hashed tables by specifying the key. The system has its own hash algorithm for managing the table.
You should use internal tables whenever you need to use structured data within a program. One imprint use is to store data from the database within a program.
plz reward if helpful,
plz get back to me for further queries.
thanks and regards,
srikanth tulasi. -
How to Import customized internal table to smartform from Print Program
Hi Gurus,
I want to Import customized internal table to smartform from print program, Can anybody tell me how it is possible.
With regards,
S.SaravananThere is no problem passing an internal table to a smarforms, smartforms have the same interface as a function module ([Defining the Form Interface|http://help.sap.com/saphelp_nw70/helpdata/en/1c/f40c5bddf311d3b574006094192fe3/frameset.htm] in [Smart Forms|http://help.sap.com/saphelp_nw70/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm]) so could you elaborate a little more on your requirement (is it a standard a custom forms, etc.)
Regards,
Raymond -
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> -
Trigger an workflow from webdynpro abap.
hai
gurus!
iam new to webdynpro.iam femilier with workflow . can anybody explain me with an clear example, how to trigger an workflow from webdynpro abap.
regards
roseHi Rose
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/using%20web%20dynpro%20java%20and%20web%20dynpro%20abap%20applications%20in%20universal%20work%20list.pdf">Click</a> Here, to know the step by step procedure of using Webdynpro in Workflows
Use SAP_WAPI_START_WORKFLOW RFC
Regards
Abhimanyu L
Message was edited by:
Abhimanyu Lagishetti -
Trigger MDM workflow from Webdynpro Java
Hi All,
After updating records in MDM, I want to trigger an MDM workflow from Webdynpro Java and pass those updated records to workflow. Any inputs on how to accomplish this. Workflow has already been developed using MSVISIO by the MDM team.
Thanks,
TomBy following steps, it is possible to integrate workflow (or any workflow designed in MDM) within portal:
1. UWL (Universal Worklist): The UWL gives users unified and centralized way to access their work and the relevant
information in the portal. It collects tasks and notifications from multiple provider systems. One can expose MDM
workflow functionality on Portal using UWL.
2. JAVA APIu2019s: MDM Java API consists of set of classes related to MDM workflows through which one can create an
application that provide the MDM workflow functionality and expose the application as an iView in the portal. -
Kicking off workflow from webdynpro using events?
I have abap experience but no workflow. Any advice will be appreciated.
I have to kick off a workflow from webdynpro. I assume that I have to set up a business object (eg. ZOBJECT), create an event therein (eg. ZEVENT).
Then when webdynpro runs I use a rfc function module to trigger this event.
The questions I have are:
1. How do I set up the workflow to be triggered by this event?
2. Do I set up an event in Business object builder or in SM62?
3. How do I trigger an event in a function module. I have found SWE_EVENT_CREATE but don't want to create an event just want to trigger the event and in turn set off the workflow?
Thank you,
Warren.try this below parameters are passed or not
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
object_type = 'BUS2105'
object_key = lv_objkey
event = 'CREATED'
commit_work = 'X'
event_language = sy-langu
language = sy-langu
user = sy-uname. -
Pass structure, internal table from workitem to BSP
Hi All,
I have a requirement where a BSP application is to be called from the workitem.
How can i pass a structure or an internal table from the workitem to the BSP application?In the BSP application mark the check box AUTO on the PAGE ATTRIBUTES tab and this makes the value available in the displayed URL of the BSP application.
the documention mentation provided by SAP regarding this option is
A page attribute marked as automatic is automatically supplied with a value from the calling URL or the navigation from another page. However there must exist a parameter of the same name with value in the URL or navigation interface.
here your navigation interface is WF_EXTSRV that you have already defined make the parameter as Exporting and when you get the URL read the URL and by using the OFFSET concept you can read the value of the element that you want in the BSP application -
Passing Internal tables to Workflow
Hello all,
I learning workflow and have a small doubt related to passing internal table as parameter to workflow when it is triggered by a report program explicitely.
I wrote a prog to upload data from flat file into internal table and by passing this ITAB to the workflow for futher processing. <b>Actually i succeeded in this with only one field in my flat file (lfa1-lifnr).</b>
<b>what if my flat file contains more than one field? (i.e., lifnr, name1, city, county) how should i declare the parameters for my EVENT (triggering event) and same with my container declaration?</b>
Any inputs in this regards are welcome.
Thank you in advance,
Lakshmi NarayanaHi Lakshmi,
Create Workflow container
swc_container lt_container.
swc_create_container lt_container.
Fill internal table with data
The container type and the internal table type should be same, U can use a structure to define both.
Declare a structure with all the fields.
Define a conatiner of same type of structure in worklow and set it in <b>wait for event</b> setp.
swc_set_table lt_container '<container_name>' lit_int_data.
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
objtype = lc_objtyp
objkey = lv_objkey
event = lc_event
IMPORTING
event_id = lv_eventid
TABLES
event_container = lt_container
EXCEPTIONS
objtype_not_found = 1
OTHERS = 2.
Rgds,
Prakash
Message was edited by: Prakashsingh Mehra -
How to create an internal table with fields from different sources
Hi.
I need to create an internal table where some of the fields are from a database table, and the other fields are user specified. How do i do that?
Example:
DB table ZTAB with fields ZTAB-FIELD1, ZTAB-FIELD2.
I want to create an internal table ITAB with the fields ZTAB-FIELD1, ZTAB-FIELD2 from ZTAB. In addition, I also want to have one more field RECORD_NO, which is not from ZTAB. How do I do it? Could I do something like below?
DATA BEGIN OF ITAB.
INCLUDE STRUCTURE ZTAB.
DATA RECORD_NO TYPE I.
DATA END OF UPLINE.
Or, are there more efficient way of doing it? Thanks.hi KIan,
go:
general type
TYPE : BEGIN OF ty_itab,
field1 TYPE ztab-field1,
field2 TYPE ztab-field2,
*your own fields here:
field TYPE i,
field(30) TYPE c,
END OF ty_itab.
work area
DATA : gw_itab TYPE ty_itab.
internal table
DATA : gt_itab TYPE TABLE OF ty_itab.
hope this helps
ec -
Filling dynamic internal table with data from other internal table
Hi Friends,
My problem is that i have already built a dynamic internal table
(class int_table->create) but now i want to fill it with data from other internal table.
The dynamic table column name and the field value of the data filled internal table are same, but how to access that column name, since i cant hard code it anyway.
Like if my werks field value is '8001'. I want to place it under the column 8001 of dynamic table, Can anybody help me in this regard?
Awarding points is not a problem for even giving a slight hint.
Best RegardsHi
See this
Dynamic internal table is internal table that we create on the fly with flexible column numbers.
For sample code, please look at this code tutorial. Hopefully it can help you
Check this link:
http://www.****************/Tutorials/ABAP/DynamicInternaltable/DynamicInternalTable.htm
Sample code:
DATA: l_cnt(2) TYPE n,
l_cnt1(3) TYPE n,
l_nam(12),
l_con(18) TYPE c,
l_con1(18) TYPE c,
lf_mat TYPE matnr.
SORT it_bom_expl BY bom_comp bom_mat level.
CLEAR: l_cnt1, <fs_dyn_wa>.
Looping the component internal table
LOOP AT it_bom_expl INTO gf_it_bom_expl.
CLEAR: l_cnt1.
AT NEW bom_comp.
CLEAR: l_cnt, <fs_dyn_wa>, lf_mat.
For every new bom component the material data is moved to
temp material table which will be used for assigning the levels
checking the count
it_mat_temp[] = it_mat[].
Component data is been assigned to the field symbol which is checked
against the field of dynamic internal table and the value of the
component number is been passed to the dynamic internal table field
value.
ASSIGN COMPONENT c_comp_list OF STRUCTURE <fs_dyn_wa> TO
<fs_check>.
<fs_check> = gf_it_bom_expl-bom_comp.
ENDAT.
AT NEW bom_mat.
CLEAR l_con.
ENDAT.
lf_mat = gf_it_bom_expl-bom_mat.
Looping the temp internal table and looping the dynamic internal table
*by reading line by line into workarea, the materialxxn is been assigned
to field symbol which will be checked and used.
LOOP AT it_mat_temp.
l_nam = c_mat.
l_cnt1 = l_cnt1 + 1.
CONCATENATE l_nam l_cnt1 INTO l_nam.
LOOP AT <fs_dyn_table2> ASSIGNING <fs_dyn_wa2>.
ASSIGN COMPONENT l_nam OF STRUCTURE <fs_dyn_wa2> TO <fs_xy>.
ENDLOOP.
IF <fs_xy> = lf_mat.
CLEAR lf_mat.
l_con1 = l_con.
ENDIF.
Checking whether the material exists for a component and if so it is
been assigned to the field symbol which is checked against the field
of dynamic internal table and the level of the component number
against material is been passed to the dynamic internal table field
value.
IF <fs_xy> = gf_it_bom_expl-bom_mat.
ASSIGN COMPONENT l_nam OF STRUCTURE <fs_dyn_wa> TO <fs_check>.
CLEAR l_con.
MOVE gf_it_bom_expl-level TO l_con.
CONCATENATE c_val_l l_con INTO l_con.
CONDENSE l_con NO-GAPS.
IF l_con1 NE space.
CONCATENATE l_con1 l_con INTO l_con SEPARATED BY c_comma.
CLEAR l_con1.
l_cnt = l_cnt - 1.
ENDIF.
<fs_check> = l_con.
l_cnt = l_cnt + 1.
ENDIF.
ENDLOOP.
AT END OF bom_comp.
At end of every new bom component the count is moved to the field
symbol which is checked against the field of dynamic internal table
and the count is been passed to the dynamic internal table field
value.
ASSIGN COMPONENT c_count OF STRUCTURE <fs_dyn_wa> TO <fs_check>.
<fs_check> = l_cnt.
INSERT <fs_dyn_wa> INTO TABLE <fs_dyn_table>.
ENDAT.
ENDLOOP.
Reward if useful
Anji -
Display 2 different structured internal tables in single screen using ALV
Hi,
I have two internal tables. Both has different structures. My requirement is to display both the internal tables in single screen using ALV Grid but NOT using OO ALV Grid display.
Is there any way of spliting the Final ALV display screen into two with two different headers and details as shown below.
Header1 for internal table 1
Data of internal table 1
Header1 for internal table 2
Data of internal table 2
Can anyone suggest a better way to display this.
Regards,
Senthilhi
first think i can say ALV GRID means only for OO ALV it is not possible to display two I.T. data in singr report screen.
better to use of the fm: REUSE_ALV_BLOCK_LIST_DISPLAY
so that u can display both I.T. data in separate report list under single screen
Check the example programs:
BALVBT01 Testprogram ALV: Block list
BCALV_TEST_BLOCK_LIST Program BCALV_TEST_BLOCK_LIST
Regards,
deepak -
Fill dynamic internal table with data from another dynamic table
Hi,
I have a huge dynamic table with a few columns and need to fill another dynamic table with some of the columns, that are also existing in the other one. I first know at runtime, which fields the smaller table contains.
Until now, I did it that way:
LOOP AT <it_tab_structure> ASSIGNING <wa_tab_structure>.
LOOP AT lt_comp_full INTO ls_comp_full.
ASSIGN COMPONENT ls_comp_full-name OF STRUCTURE <structure> TO <column>.
ASSIGN COMPONENT ls_comp_full-name OF STRUCTURE <wa_tab_structure> TO <value>.
<column> = <value>.
ENDLOOP.
APPEND <structure> TO <table>.
ENDLOOP.
lt_comp_full contains the columns of the second table, that have to be filled.
This is taking a very long time, as there can be a lot of columns in the source table and the source table contains at least 100000 records.
Is there therefore any way to fill the other table faster?
Thank you & best regards,
MichaelHey Sharath,
thank you for your answer! Unfortunately I don't have a 7.4 system here, but your example pointed out, that I can also use move-corresponding from one structure to the other, which I thought, was not possible. I'm trying out, if this makes it faster now.
I'll let you all know, if this made the deal.
Thank you & best regards,
Michael & Arne -
ABAP Client proxies: structure/internal table error
Hi All,
We are getting following error when we check for errors in ABAP program for ABAP client proxies:
"RECORDS" is not an internal table - the "OCCURS n" specification is missing.
Let me explain the scenario and proxy objects its generated and proxy objects we are refering in program:
Its syncrounous client proxy scenario.
In XI:
We have DT_Req, MT_Req, DT_Res, MT_Res and MI_Sync_OB (O/p Message: MT_Req, I/P message:MT_Res)
Proxy Objects generated:
ZCO_MI_SYNC_OB
ZMT_REQ
ZDT_REQ
ZDT_REQ_RECORDS
ZMT_RES
ZDT_RES
ZDT_RES_RECORDS
ZDT_RES_RECORDS_TAB
ABAP Code:
REPORT ZTEST_DELETE.
DATA:
lo_history TYPE REF TO ZCO_MI_SYNC_OB,
lo_sys_exception TYPE REF TO cx_ai_system_fault,
Structures to set and get message content
lv_history_req_mt TYPE ZMT_REQ OCCURS 0 WITH HEADER LINE,
lv_history_res_mt TYPE ZMT_RES,
lv_history_req_rec TYPE ZDT_REQ_RECORDS,
lv_history_res_rec TYPE ZDT_RES_RECORDS.
lv_history_req_rec-VLAUE = SY-DATUM.
APPEND lv_history_req_rec TO lv_history_req_mt-MT_REQ-RECORDS.
CREATE OBJECT lo_history.
TRY.
Call outbound Proxy
CALL METHOD lo_history->execute_synchronous
EXPORTING
output = lv_history_req_mt
IMPORTING
input = lv_history_res_mt.
Error handling
CATCH cx_ai_system_fault INTO lo_sys_exception.
SKIP 2.
WRITE:/ lo_sys_exception->errortext.
RETURN.
ENDTRY.
When we execute this program we get following error:
"REC" is not an internal table - the "OCCURS n" specification is missing.
Can anybody please fogure out the why we getting this error??
We had the similar kind of scenario working. Only one difference in the proxy objects generated:
In working scenario we had the _TAB object genearated for the Req
In our current scenario _TAB proxy is generated for the Res.
Thanx
NavinHi Moorthy,
Everything you said is done. Still get the same error.
Hi Mario,
I tried to define with your example a, still I have problem.
I think I kind of figure out the reason.
As I mentioned in the first post (question), proxy object "ZDT_RES_RECORDS_TAB" has created for the object data type DT_RES. The fields in the data type "DT_RES" are already existing in the SAP.
The fields in the data type DT_REQ are not in the SAP, and in the proxy objects its not generated any kind of TABLE. I think this is the reason we are getting error ""RECORDS" is not an internal table - the "OCCURS n" specification is missing." either we define
lv_history_req_mt TYPE ZMT_REQ OCCURS 0 WITH HEADER LINE, OR
lv_history_req_mt TYPE ZMT_REQ,
Does it make sense what I was explaining above???
Any lead on this would be great.
Thanx
Navin
Maybe you are looking for
-
I am using a PC with Windows 7 and MS Office/Outlook 2007 together with the latest iCloud control panel. Everything seems to be fine, but the synchronization works only for the calendar "Calendar in iCloud". Which is the one coming from my iPhone. Wh
-
Custom BIOS requested for the MSI GP60 2PE Leopard
Hi, Is it possible to generate a BIOS update, for allowing the notebook to have 32 GB (2x16 GB) SODIMMs. It seems that the Memory Reference Code needs some adjustments to allow this. I got currently the MSI GP60 2PE Leopard (i7-4700HQ • 16 GB DIMM).
-
Can't install new itunes and mobile device support keeps crashing
a while ago, i tried getting new quicktime, but my computer crashed in the middle of the updating (also a problem- anyone know why it keeps lagging, freezing, and crashing on me?). i ignored it, and plugged in my ipod a few days later. itunes wouldn'
-
Hi S.A.P Gurus Need to create Budgets for various locations, but i am able to create only on e FM area per company code. Can anyone tell me how the same can be done Workflow variant in compay code. How do i create the same & can you tell me the purpo
-
On starting Bridge CS3 (2.1.1.9) in OS 10.5.4 the Bridge menus display along the top of the screen but no window appears. Selecting Cmd-N does nothing, but if I select Cmd-H from the Bridge drop-down menu to hide the application, as expected it shrin