on 08-01-2016 3:39 PM
Dear All,
I need to pass internal table from my user exit to workflow template using SAP_WAPI_CREATE_EVENT function module.
This function module has INPUT_CONTAINER which can be used to pass the structure ONLY.However my requirement is to pass internal table which can be achieved using IFS_XML_CONTAINER of this function module.
How ever how to use this parameter is not clear for passing internal table.
Can anybody kindly guide how this can be achieved.
A sample code will be great help.
Regards,
SD
Hi SD,
Table parameter INPUT_CONTAINER can be used to pass internal table, declare an internal table of type SWRTCONT which is table type for structure SWR_CONT and add entries into this table. refer below logic:
lt_container type SWRTCONT.
ls_container type SWR_CONT.
loop at lt_mara into ls_mara.
ls_container-element = 'CONTAINER_NAME'
ls_container-value = ls_mara.
append ls_container to lt_container.
endloop.
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
object_type = 'BO_Name'
object_key = l_objkey
event = l_event
TABLES
input_container = lt_container.
Hope this will help your query.
Regards,
Deb
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
please read the answers to your previous post
https://scn.sap.com/message/16661983#16661983
first, before opening a new thread with the same remaining question.
Florin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Floriin ,
Thnaks for response.
Actually last time i was stuck at following and i was waiting for your resposnse to query.I will eb really thankful for kindly answering following queries.
1)lo_event_container is not defined in include <swfcntn01>.
I got error : FIeld lo_event_container is unknown in my code.
I also went through the macros/declarations available in the include.
2)Also kindly let me know if container declaration needed or lv_xml_container is to be replaced with wa_mara and how to declare this container.
Hello SD,
I gave some example coding with having omitted some parts.
lo_event_container is the data field with the type declared in the include. As per a common naming convention, LO_... is a local variable holding an object instance.
... with my statement .... like the one defined in <swfcntn01> I was adressing line #12, where the type is defined: swf_container
So the example(!) coding goes like this. Please adapt yourself accordingly.
swf_container lo_event_container.
DATA: v_xml_container TYPE STRING.
swf_create_container lo_event_container.
"... Now add the elements as you need and continue with the ...to_xml() call later on.
There you are.
Florin
Hi,
well, you should be somewhat experiences with ABAP-OO when working on newer Workflow-Scenarios. However, most - or nearly all, including the to_xml() call - is part of this post, or the previously referenced post, too.
I'm not gonna write the complete code for you; but maybe someone else is showing up here. ... or ask a colluege with some OO know-how.
Florin
Are you sure you can't pass several lines of a table element by adding the lines to INPUT_CONTAINER with the same table element name?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.