Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

function module parameters declare BOR Object

Former Member
0 Likes
1,186

I dont know if this is even logical...

I need to create a function module which will be used in my program..

Can I create an object of BOR object type say 'Sales Order' and pass it as an export parameter in Function Module..

i.e i will pass the obj key and obj type as import..

I want to instantiate that Sales Order.. and pass the whole Sales oRder as export/tables parameter..

I know swc_object_create is supposed to create an object but as i can see it only has the handle.. and it is of type swc_object..

But i want to export the whole Instance .. so that i can call the methods of the object in my original program..

Regards,

krishna

1 ACCEPTED SOLUTION
Read only

raviprakash
Product and Topic Expert
Product and Topic Expert
0 Likes
817

Hi krishna,

Firstly it is possible hence your question does have a solution. I am sure that its possible from my experience with Workflow where, one a Work Item comes and sits in the inbox, the instance of the BOR Object remains with Work Item even when you log off and log in.

Try using fm:-

1) call function 'SWC_ELEMENT_CREATE'

2) call function 'SWC_ELEMENT_SET'

3) call function 'SWC_ELEMENT_GET'

I feel you can create a container, and set and element with required value and later get it when required.

Includes <OBJECT>, <cntn01> and <cntn02> and <cntn03> can prove helpful.

Regards,

Ravi.

4 REPLIES 4
Read only

raviprakash
Product and Topic Expert
Product and Topic Expert
0 Likes
817

Hi krishna,

Firstly it is possible hence your question does have a solution. I am sure that its possible from my experience with Workflow where, one a Work Item comes and sits in the inbox, the instance of the BOR Object remains with Work Item even when you log off and log in.

Try using fm:-

1) call function 'SWC_ELEMENT_CREATE'

2) call function 'SWC_ELEMENT_SET'

3) call function 'SWC_ELEMENT_GET'

I feel you can create a container, and set and element with required value and later get it when required.

Includes <OBJECT>, <cntn01> and <cntn02> and <cntn03> can prove helpful.

Regards,

Ravi.

Read only

raviprakash
Product and Topic Expert
Product and Topic Expert
0 Likes
818

Hi krishna,

Firstly it is possible hence your question does have a solution. I am sure that its possible from my experience with Workflow where, one a Work Item comes and sits in the inbox, the instance of the BOR Object remains with Work Item even when you log off and log in.

Try using fm:-

1) call function 'SWC_ELEMENT_CREATE'

2) call function 'SWC_ELEMENT_SET'

3) call function 'SWC_ELEMENT_GET'

I feel you can create a container, and set and element with required value and later get it when required.

Includes <OBJECT>, <cntn01> and <cntn02> and <cntn03> can prove helpful.

Regards,

Ravi.

Read only

0 Likes
817

Hi Ravi ,

I simplified my requirement but my actual requirement is with workflows...

I have a scenario in workflow where,

1.Activity step to fill internal table with sales order numbers

2.loop at sales order numbers internal table

3.Activity Step to Instantiate based on order numbers

4. Activity Step to Edit these sales orders

5.end the loop

For the above logic in workflows i have separate Activity step for instantiation..What I am thinking of is to instantiate the sales orders and fill the instances in the internal table in Step 1 instead of just order numbers..In the BOR method/F.M of Step 1 I need to export the Instance of the Sales Orders (this is my actual question/problem, how do i instantiate while coding??swc_object_create, creates only a ref to object ...If I am able to create the object what should the type be in export /tables parameter)

This way i can remove the loop and offer parallel processing (from miscellaneous tab in activity step) and send multiple Edit workitems to user at Once instead of one after the other..

Please let me also know how you would handle the above situation, i am very new to workflows and BOR.

Read only

raviprakash
Product and Topic Expert
Product and Topic Expert
0 Likes
817

Hi Sk,

1) You do one thing, create a container which contains a table of the BOR object for Sales Order.

2) In your step one, you create a WF task which takes input the table you declared and also imports it back.

3) In this new TASK you code using the 3 Function Modules i told in beginning and fill your container

with various instances of your Sales order numbers.

4) Finally it shall be available directly to your WF via the Task-Workflow interface.

Many regards,

Ravi.