Skip to Content
author's profile photo Former Member
Former Member

Triggering attachments with certain parameters to be passed to it

Hi All,

I need to pass at least four parameters and then call a custom transaction through the attachment technique for Workflow Item.

Following steps are already done:

1) Created my own Decision step.

2) I bind the whole object to it so it shows up in the Decision step.

3) Created a new 'Display' method in my custom BOR object which calls the transaction.

4) Changed the default method of the BOR object to 'Display' so that it calls that method.

My problem is, where and how should I pass those 4 parameters which I am receiving in my Workflow container to this method 'Display' so that it displays an ALV based on them.

Right now, as no parameter is passed to the method, it just takes me to that selection screen of custom transaction. I want to pass those 4 parameters and display and ALV list screen directly.

P.S. I had to use BDC as the custom transaction I am calling is a Module Pool transaction.

A quick reply would be really appreciated. Tight deadlines!!!

Thanks in advance.

Ankit

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Posted on Sep 22, 2009 at 04:37 PM

    Hello,

    Can't you pass those parameters within the method that replaces Display? Where do their values come from, the object instance?

    regards

    Rick Bakker

    Hanabi Technology

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2009 at 05:24 PM

    Hi Rick,

    I am triggering my WF from a custom event. These 4 parameters are passed from the Triggering program to the triggering event which has 4 parameters. And from the event container to the WF container. Hence I am not sure, if there is any way to push it to the method 'Display'(As we do not make any explicit call to this method 'Display' in the WF, it gets triggered as an attachment, simply because it is the default method declared at the Header level of my custom BOR object).

    I hope I am clear, else just send a reply and I will try to put it other way.

    Thanks in advance,

    Ankit

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello,

      Thanks, I understand what you mean.

      If those parameter values are only associated with the workflow instance, and not the object instance, then you'll have to add code to your method (which replaced Display) to find the workflow instance, extract the parameter values from the container, and pass them through when the transaction (or whatever) is called. Probably fm SAP_WAPI_GET_WORKITEM_DETAIL will be useful.

      regards

      Rick Bakker

      Hanabi Technology

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2009 at 06:09 PM

    Hi Rick,

    Thanks for you reply.

    I have not used the FM 'SAP_WAPI_GET_WORKITEM_DETAIL' before.

    I looked at it and if we want to use it, it will ask for the workitem-id as the first thing.

    How would I get(access) it in that default method?

    Regards,

    Ankit

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Ankit,

      I understand that your bind to the custom method was successful and you got the values from Workflow.

      Now using those parameters, why don't you use "CALL TRANSACTION" OR "SUBMIT PROGRAM".. that simplifies and you can call the custom transaction by passing the parameters and skip the first screen so it displays the ALV list directly.

      Look into the syntax they are simple.. if not i can provide simple code for call transaction as well.

      Eg: Submit the progam

      submit zus6mmxl00900

      using selection-screen 'A'

      with selection-table rspar_tab

      with p_werks eq p_werks

      with s_lifnr1 between s_lifnr-low and s_lifnr-high

      with s_lifnr1 in range_tab

      with s_budat between s_budat-low and s_budat-high

      with p_lname eq p_lname.

      Thnx,

      Sudhir

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2009 at 06:23 PM

    Hi Rick,

    Found some other things as well. Thanks for your hint. Give me sometime and will try and come back and let you know.

    Thanks a ton :).

    Ankit

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2009 at 06:50 PM

    Hi Sudhir,

    The custom method is a default method. It is not getting called in the Workflow anywhere.

    It will just get passed automatically as an attachment to the work item.

    When user will click on the attachment, this method will trigger.

    Hence I can not do any direct binding between the Workflow container and this method.

    I have checked through debugger and neither the below codes

    "swc_get_element container '_Workitem' lv_wi_object.

    swc_get_property lv_wi_object 'Workitemid' lv_wiid. "

    nor FMs like 'SWE_WI_GET_FROM_REQUESTER' will work. Becaue at that point, my container is simply empty.

    Only thing I am able to access there is a structure called 'OBJECT' which contains the key being passed from the triggering FM 'SAP_WAPI_CREATE_EVENT'.

    Hope you get the whole picture.

    Thanks & Regards,

    Ankit

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2009 at 10:28 AM

    Hi All,

    I had to create a custom table to save the Work Item Id with a random key, before calling the User Decision.

    I passed this random key as the object-id to the event.

    Later when user clicks on the attachment, I get this random key, go to my custom table, pick the Work Item stored against it and then call 'SAP_WAPI_READ_CONTAINER'.

    That's how I solved it.

    Thanks Rick for your hint. Marks awarded.

    Closing the thread.

    Cheers,

    Ankit

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.