SWC_SET_ELEMENT CONTAINER

Hello,
I have got a requirement to change a method of any object type, i am new to BOR i find these statements in the methods:
swc_set_table container 'Sequential_Approvers' sequential_approvers.
swc_set_element method_container 'Status' status.
Could anyone please let me know what do tehy stand for.
It would be really helpful if some one could let me know relevant links which would give me some information on this.
Thanks,
Simmi

Hi Simmi,
These are used in BOR methods.
SWC_ELEMENT_SET and SWC_TABLE_SET are for output parameters. when you pass values to any BOR method then that method will receive those values using SWC_ELEMENT_GET and when that method return you any value then it i spossible by SWC_ELEMENT_SET.
mostly these BOR are used in workflows because it triggers automatically on any transaction and because of which workflow linked to that BOR will start automatically.
feel free to revert back for any query.
Thanks,
Rahul

Similar Messages

  • How to store a class-based exception as container element?

    Hello,
    In a BO type method, there are situations where unexpected class-based exceptions can occur, I handle them with TRY ... CATCH ... ENDTRY.
    If such an error occurs, my BO type method also returns a BO type method exception using a return code (as usually).
    1) Now, my question is how can I store the exception instance in the task container ? (so that to get more information about what happened... it is an unexpected error as I said)
    Note that my question may apply to any class instance.
    2) To achieve this, I have an idea but not sure if it's realistic (maybe the question is not realistic too ). I'll create a new BO type ZOOINSTANC with string attribute containing the serialized instance, with a method to display it.
    Example how it could work, in my BO type method (it returns EXCEPTION parameter of type ZOOINSTANC):
    TRY.
      CATCH cx_root INTO lo_exc.
        DATA l_exc TYPE string.
        CALL TRANSFORMATION id
            SOURCE oo = lo_exc
            RESULT XML l_exc.
        DATA l_bor_zooinstanc TYPE swc_object.
        swc_create_object l_bor_zooinstanc 'ZOOINSTANC' ''. "no key
        swc_set_property l_bor_zooinstanc l_exc.
        swc_set_element container 'EXCEPTION' l_exc.
        exit_return 1001 '' '' '' ''.
    ENDTRY.
    One important issue is that I don't know any API to display the instance :-p
    Do you have any ideas, advices, ... ?
    Thx
    sandra

    Hi Mike, thank you for your answer, and sorry for the delay.
    > I'd rather go with the idea of returning the error details in a structured format that you can view in the container
    Yes, but that's the issue as I don't know which exceptions can be triggered, as I'd like to handle all exceptions.
    > I'd also ask why it's necessary to use BOR for this?
    When a BOR method fails, I want technical support to have all the details of the error, not only a generic error message. It's why I want to store the exception in the workitem container, and be able to display it later.
    > It's obviously your own development, so why not use classes. Subclasses of CX_BO_ERROR are recognised by workflow and you can even  bring a proper message back to the WF log. There's also some info on this in the second edition of the WF book.
    I did a test using demo workflow WS56400159 ("absence"), where I forced CX_BO_ERROR right after SWX_FORMABS_CREATE call in CL_SWF_FORMABSENC / CREATE method, but it seems that only the short text of the exception is kept.
    So, I'm a little disappointed to see that we have a great exception "tool" with class-based exceptions, but only the last text is kept in the system! That would have been great to be able to store the whole information (the attributes, and the whole bunch of cascading exceptions (PREVIOUS attribute), instead of only a simple text).
    sandra

  • Workflow Step type for Container Operation

    Hi,
    A STEP in a given Workflow has to have an Agent? Can't I create a Step to get data from the DB into the container and that's it?
    I have created a container variable called "Grade" and I need to fetch the Grade of a User (WF Inititator) from a DB table and populate the "Grade" variable from the container that will be used in further steps.
    The Workflow gets kicked off but when it reaches the STEP, it stays there waiting for something (Action from a user?).
    Thanks & Regards,
    Ernesto

    Ok, now this is getting weird. Will try to explain what I am doing for one single step:
    1) I have my workflow. On PFTC I Have a workflow Template. Under the Container Tab I created a Parameter called "Grade" with the Import/Export check-boxes set and a "CreatedBy" parameter with the import/export check-boxes set as well.
    2) Then on the Workflow Builder I created a Step called Get Grade. This step calls a Custom Task and processes in the background so there is no agent determination.
        2.1) Here I have two bindings: a) Binding Between Workflow Container and Task and between Task and BO Method       
               Get_grade.  The Method Get_grade has 2 parameters (CreatedBy, that is an attribute of the Object and is an import
               parameteter and Grade that it is an import/export parameter).
        2.2) The Binding between the WF Container and the Task is like this:
                  &PROCCONFIRMATION.CREATEDBY& --> &CREATEDBY&
                  &GRADE& <-- &GRADE&
        2.3) Binding Between Task and Method is:
                 &_WI_OBJECT_ID.CREATEDBY& --> &CREATEDBY&
                 &GRADE& <-- &GRADE&   
        2.4) The Code for my method is:
    begin_method get_grade changing container.
    DATA:
          lv_grade TYPE zmm_app_req_info-grade,
          lv_userid TYPE zmm_app_req_info-requestor
    swc_get_property self 'CreatedBy' lv_userid.
    SELECT SINGLE grade FROM zmm_app_req_info
    INTO lv_grade
    WHERE requestor = lv_userid.
    IF sy-subrc IS INITIAL.
      swc_set_element container 'Grade' lv_grade.
    ENDIF.
    end_method.
    The only thing I need is to get the Grade parameter of the WF Container populated. This parameter will be used later on.
    Thanks & Regards,
    Ernesto.

  • 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,
    Madhu

    You 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.

  • How to transfer my container element to the bor object

    Hello
    I am quite new to workflow. I have created a workflow with a task and in this task I have a container element that is an Id for a campaign element and I can see that the container is filled correctly. In my task I call a BOR object amd a method and I want to transfer my campaign Id to this method, but when I debug I can see the ID is getting into the bor object. How do I get the id into the bor object
    Thanks
    Claus

    Hi Claus
       After binding from task to method. You will get the data in the method parameters but to transfer the data from parameter to method you need to use this code in your method.
    SWC_GET_ELEMENT CONTAINER 'CONTAINER NAME' VARIABLE NAME.
    SWC_SET_ELEMENT CONTAINER 'CONTAINER NAME' VARIABLE NAME.
      Use this statement to get the data to the method container.
    Regards
    vijay

  • Filling Worflow container with objects (OOAD)

    Hi Gurus,
               I have created a workflow,which has abap objects as container element. Can anyone let me know how can I fill the container element with object..I have tried with marcos as mentioned in the library..but not container is not filled ..plz advice....
    Create a variable for the object reference. Use the following command to do this:
    DATA <Object> TYPE SWC_OBJECT.
    Create the object reference. Use the following command to do this:
    SWC_CREATE_OBJECT <Object> <ObjectType> <ObjectKey>.
    Write the object reference into the container using the following macro instruction:
    SWC_SET_ELEMENT <Container> <ContainerElement> <Object>.
    Thank you
    - Senthil Bala

    BalusC -- The line that gives me my NullPointerException is when I call the "DisplayProduct()" method. Its a dumb question, but with NetBeans how do I find out which reference could be null? I'm not very familiar with how NetBeans works with finding out how to debug. Any help you can give me would be greatly appreciated.The IDE is com-plete-ly irrelevant. It's all about the source code.
    Do you understand anyway when and why a NullPointerException is been thrown? It is a subclass of RuntimeException and those kind of exceptions are very trival and generally indicate an design/logic/thinking fault in your code.
    SomeObject someObject = null; // The someObject reference is null.
    someObject.doSomething(); // Invoking a reference which is null would throw NPE.

  • Passing values from and to workflow container

    Hi Guys,
                 I am reading and writing back into the workflow container element from task container using FM.
    But its not writing back the values into workflow container.
    here is my code.
    swc_get_element container 'TripNumber' trip_no.   
    Fetch Personal No. from Trip No.                
      SELECT SINGLE pernr FROM ptrv_head INTO l_pernr  
        WHERE reinr = trip_no.                                                                               
    IF sy-subrc NE 0.                                 
      EXIT.                                            
    ENDIF.                                                                               
    Fetch Employee Name                             
    SELECT SINGLE ename FROM  pa0001 INTO l_ename      
           WHERE  pernr = l_pernr                      
           AND    endda  >= sy-datum                   
           AND    begda  <= sy-datum.                  
    Fetch Employee Email id                         
    select single usrid_long from pa0105 into l_email 
       where pernr = l_pernr                           
         and usrty = '0010'                            
         and endda  >= sy-datum                        
         AND begda  <= sy-datum.                       
    Set Personal No.                          
    swc_set_element container 'Pernr1' l_pernr. 
    Employee Name                             
    swc_set_element container 'Ename' l_ename.  
    Email ID                                  
    swc_set_element container 'Email' l_email   
    Am I missing anything here.
    Thanks

    Hi,
    I faced the same issue and i found that it is not sufficient to just have proper bindings and using macros with exact container names.
    You need to create IMPORT and EXPORT parameters for that METHOD with names matching with container element names. Once you do this, you see a GREEN binding icon right below the BO and Method name in the TASK. Click that icon and create binding between TASK and METHOD.
    This should resolve your problem.
    All - Please correct me if am wrong as i am new to the workflow.
    Thanks,
    SKJ

  • Setting the container element values

    Hi Experts,
    While I am trying to set the container element values, it is resulting in an error.
    We are designing a leave request WF using WS12300111. We are using ABAP classes.
    Inside a method, I have written the following code :
    swc_set_element container 'PERNR' lv_pernr.
    It is giving an error. It says 'SWC_SET_ELEMENT' not defined.
    First of all i would like to know if we can use this statement in ABAP classes. If we have to set a value of a container element, how can we go about doing the same in ABAP classes.
    Kindly guide me on the same.
    Cheers,
    Belinda Clarke

    Hi,
    No, you cannot use those in the ABAP classes. (EDIT: Or you can, put it doesn't make really any sense.)
    Just make exporting parameters into your method. Put your variables (PERNR, etc.) in those. Then do the binding from method to the task container (in the task editor). This way you will get the values from a method to the task container.
    Regards,
    Karri
    Edited by: Karri Kemppi on Sep 9, 2011 9:24 AM

  • IMporting Container Value

    Hi,
    My requirment is to show the description on workflow task ,I have to add Plant in Description for one of the Task ,I created a Z method and write a select query to get the Plant .I Created a new container with the IMport parameter and assign SWC_set_element container 'PLANT 'PLANT and in Step I did a Binding &PLANT& -> &PLANT&.
    I check in debug mode I can see the Plant value ,but when I checked the container in workflow log it shows not set .
    Help will be appreciated by deserve points.THanks

    Hi Vinod,
    I think the steps seems fine.
    Just check if you have missed on one of the following:
    1. Create a BO method, and add an output parameter 'Plant'.
    2. Add a data statement in the method and create a parameter 'lv_Plant'.
    3 . Fetch the value of Plant from the database table / FM into the parameter 'lv_Plant'.
    4. Then use the code:
    swc_set_element container 'Plant' lv_Plant
    to set the value of the output parameter in the code.
    5. In the workflow task create an input output parameter 'tk_Plant'.
    6. In the binding between the task container and method pass the value of 'Plant' to 'tk_Plant'
    7. Create an input output parameter in workflow container 'wf_Plant'.
    8. In the binding between the workflow container and task container pass the value of 'tk_Plant' to 'wf_Plant'
    Hope this helps!
    Regards,
    Saumya

  • Rule with SELFITEM-SENDTASKDESCRITION task's workitem goes error

    Dear all,
               I have created a workflow with an activity step that uses business object SELFITEM and method SENDTASKDESCRIPTION  with rule AC00000168.
              On executing the WF, the workitem successfully goes to right agent.
              But, when the agent executes the workitem, it goes to error state.
              In the workflow log, I get the error message as "Exception occurred Error handling for work item 000000968991 eeom division 09.07.2010 - 11:28:52 " with exception 0,error type 1 and message 0.
              Following is binding details between workflow and task container.
    &MANAGER&      ->     &ADDRESSSTRINGS&
    &_ATTACH_OBJECTS&      ->     &ATTACHMENTS&
    &ATTENDANCEINSTANCE&     ->   &ATTENDANCE&
    &EXPRESS&     ->     &EXPRESS&
    &LANGUAGE& ->     &LANGUAGE&
    &LINEWIDTH&     ->     &LINEWIDTH&
    &TYPEID&     ->     &TYPEID&
    &SELFITEM&     ->     &_WI_OBJECT_ID&
            In the above binding parameter,MANAGER. is a workflow container of ABAP data dictionary type WFSYST-AGENT where the rule's agent is collected.
    Please suggest why the work item at agent inbox on execution goes error for which I will be grateful.
    Thanks and regards,
    S.Suresh

    Hello Rick !
            Thank you so much for your fruitful solution.
            Also, I am deeply sorry for delayed reply.
           I used the function module 'SWX_GET_MANAGER' in the custom method  as you suggested.
    BEGIN_METHOD FINDMANAGER CHANGING CONTAINER.
    DATA:
          EXTENDEDOBJECTID TYPE OBJEC-REALO,
          addresstype like soxna-type,
          RECIPIENTADDRESS TYPE SOXNA-FULLNAME.
    DATA:
          ac_container like swcont occurs 0 with
          addressstrings like soxna-fullname occu
      SWC_GET_ELEMENT CONTAINER 'ExtendedObjectID
    addresstype = 'G'.
    ac_container-element = 'OBJID'.
    ac_container-tab_index = '000001'.
    ac_container-elemlength = '008'.
    ac_container-type = 'N'.
    ac_container-value = EXTENDEDOBJECTID.
    append ac_container.
    ac_container-element = 'OTYPE'.
    ac_container-tab_index = '000001'.
    ac_container-elemlength = '002'.
    ac_container-type = 'C'.
    ac_container-value = 'P '.
    append ac_container.
      CALL FUNCTION 'SWX_GET_MANAGER'
        TABLES
          ACTOR_TAB = addressstrings
          AC_CONTAINER = ac_container
        EXCEPTIONS
          NOBODY_FOUND = 01
          OTHERS = 02.
      CASE SY-SUBRC.
       WHEN 0.            " OK
       WHEN 01.    " to be implemented
        WHEN OTHERS.       " to be implemented
      ENDCASE.
      loop at addressstrings.
      if addressstrings(2) = 'P '.
      delete addressstrings.
      endif.
      endloop.
    move addressstrings to recipientaddress.
      SWC_SET_ELEMENT CONTAINER 'RecipientAddress' RECIPIENTADDRESS.
    END_METHOD.
    Therafter, the values accumulated at RECIPIENTADDRESS is passed to the workflow container(SOXNA-FULLNAME) of SENDMAIL step.
    Also, I thank every one who contributed fruitful suggestions to solve my problem.
    Thanks and regards,
    S.Suresh

  • How to get the Last releaser of PR ?

    Dear Expert,
    I am working on PR release Workflow.As it is Overall relase so I am using BUS2105. Depending different value and document type differen person is responsible for relasing the PR.I got the requirement that when  the last releasing authority will release the PR only then the Procurement manger should get the information to raise PO.
    I can send the information after any release but I am not able to find any way to send him after the final release.
    I found the the Field FRGKZ the release indicator of Table EBAN is gettin the Value 02, Blocked for PO.
    I tried to use this one in WF container but it is not getting the Value.
    Can Anyone help me , How I can achieve the Requirement.
    Regards
    Sony

    Hope you are using the Standard workfow WS20000077 for PR. As per the design, notification is sent to the WF Initiator after each and every release.
    Inorder to avoid this and to send notification only one time, copy the standard workflow and customize it as follows:
    1) Customize the Buiness Object BUS2105 and add a new method. use the sample code for reference.
    DATA: z_ind_task type FRGKZ.
    DATA: z_rel type FRGKZ.
    DATA: zpr like eban-banfn.
    swc_get_element container 'z_prnum' zpr.
    if sy-subrc EQ 0.
    endif.
    select FRGKZ from eban into z_ind_task where banfn = zpr.
    endselect.
    swc_set_element container 'z_ind_task' z_ind_task.
    2)  Create a background task and use the above method in the task. (to find release indicator).
    3)  Insert the task created in step 2 above the "Requisition Released" step in workflow template.
    4) put a condition step which says if the release indicator is 2 only then the "Requisiton Released" Step will be processed otherwise it wont be processed before final release and hence you can avoid multiple notifications after each release.
    Hope it gives you some idea....
    Regards,
    PR.

  • Email PDF smart form Support Desk

    Hi SDN,
    I'm working on support desk - solution manager, and i need to send the solution of the support message by email to the final user.
    There is an standard action (SLF1 -SMSD_SERVICE_ORDER_DNO_OUTPUT)  that sends the solution in pdf format by email, but we couldn't set the receivers online.
    So, I'm using an "z" action that executes an smart form, and i would like to send the smart form in pdf format by the internet.
    I'd like to use fm SO_DYNP_OBJECT_SEND, because the user must fill the receivers on-line
    So far i have de OTF, and i know that i can make a conversion to pdf format, but i've the following problem
    - the pdf in attach is empty, it may be because of the format, or may be i'm not using correctly this function.
    Thanks in advance,
    Maria João Rocha
          call function 'CONVERT_OTF'
            exporting
               format                = 'PDF'
            importing
              bin_filesize          = w_pdf_size
            tables
              otf                   = es_job_output_info-otfdata[]
              lines                 = t_pdf[]
            exceptions
              err_max_linewidth     = 1
              err_format            = 2
              err_conv_not_possible = 3
              err_bad_otf           = 4
              others                = 5.
    * header
          wa_head-objnam = 'EMAIL'.
          wa_head-objdes = ls_output_options-tdtitle.
          wa_head-objnam = ls_output_options-tdtitle.
          wa_head-objla = sy-langu.
          wa_head-objsns = 'O'.
          wa_head-file_ext = 'TXT'.
          append wa_head to t_head.
          wa_packing_list-transf_bin = 'X'.
          wa_packing_list-head_start = 1.
          wa_packing_list-head_num = 0.
          wa_packing_list-body_start = 1.
          wa_packing_list-objtp = 'RAW'.
    *      wa_packing_list-objtp = 'EXT'.
          wa_packing_list-objdes = ls_output_options-tdtitle.
          wa_packing_list-objla = sy-langu.
          wa_packing_list-objlen = w_pdf_size.
          wa_packing_list-file_ext = 'PDF'.
          append wa_packing_list to t_packing_list.
    *---------- enviar o mail
          call function 'SO_DYNP_OBJECT_SEND'
            exporting
    *            object_hd_change           = ls_output_options-tdtitle
              object_type                = 'RAW'
    *            originator_type            = 'B'
    *            originator                 = sy-uname
    outbox_flag      = 'S'
            tables
    *            objcont                    = t_text
    *            receivers                  = t_receivers
              packing_list               = t_packing_list
              att_cont                   = t_cont
              att_head                   = t_head
            exceptions
              active_user_not_exist      = 1
              communication_failure      = 2
              component_not_available    = 3
              folder_not_exist           = 4
              folder_no_authorization    = 5
              forwarder_not_exist        = 6
              note_not_exist             = 7
              object_not_exist           = 8
              object_not_sent            = 9
              object_no_authorization    = 10
              object_type_not_exist      = 11
              operation_no_authorization = 12
              owner_not_exist            = 13
              parameter_error            = 14
              substitute_not_active      = 15
              substitute_not_defined     = 16
              system_failure             = 17
              too_much_receivers         = 18
              user_not_exist             = 19
              x_error                    = 20
              others                     = 21.
        endif.

    Thanks for your reply.
    I'm working on it, and I’ve seen the SCOT documentation, so I've change my strategy.
    Right now I'm using some of the methods of the BOR.
    I think I've to code because I want a popup to introduce the list of the receivers and the mail body, and of course I want to attach a smart form on pdf format.
    But I can’t send the mail because of the error: Erro interno: SO_OBJECT_MIME_GET Exceção: 2
    Can you help me on this? What I’m doing wrong? What document class I need to use on the “AttachmentType”?
    Thanks in advance.
    Best regards,
    Maria João Rocha
    FUNCTION Z_MAIL_DIALOGO.
    *"*"Interface local:
    *"  IMPORTING
    *"     REFERENCE(TITULO) TYPE  SOOD1-OBJDES OPTIONAL
    *"     REFERENCE(FILE_SIZE) TYPE  SOOD1-OBJLEN OPTIONAL
    *"  TABLES
    *"      OTF TYPE  TSFOTF OPTIONAL
    *"      PDF STRUCTURE  TLINE OPTIONAL
    *"      CONTEXT TYPE  SOLI_TAB OPTIONAL
    * Makros für Zugriff aufs BOR
    include <cntn01>.
    *parameters: dialog like sonv-flag.
    data: dialog like sonv-flag.
    * Datendeklaration
    data: message type swc_object.
    data: recipient type swc_object.
    data: recip_tab type swc_object occurs 1 with header line.
    data: objkey like swotobjid-objkey.
    data: content like soli-line occurs 0 with header line.
    data: title(80).
    data: persnumber like adcp-persnumber.
    data: sent_to_all like sonv-flag,
          object_list like sosndinf occurs 1 with header line.
    data: t_otf type standard table of ITCOO.
    data: itab like soli occurs 0.
    * Deklaration eines Containers
    swc_container container.
    * Message-Objekt anlegen
    * * Neues Message-Objekt generieren
    swc_create_object message 'Message' space.
    swc_clear_container container.
    if dialog = space.
    * * Create w/o dialog
      concatenate 'Mensagem Support Desk' sy-datum sy-uzeit into title
               separated by '/'.
      swc_set_element container 'DOCUMENTTITLE' title.
      swc_set_element container 'DOCUMENTNAME' 'Support Desk'.
    *  swc_set_element container 'DOCUMENTTYPE' 'INT'.
    *  swc_set_element container 'DOCUMENTTYPE' 'SCR'.
      swc_set_element container 'DOCUMENTTYPE' 'OTF'.
      swc_set_element container 'NO_DIALOG' 'X'.
    else.
    * * Create with dialog
      swc_set_element container 'NO_DIALOG' ' '.
    endif.
    swc_call_method message 'Create' container.
    perform error_handling(rssobcitest11).
    * Create attachment (RAW document from internal table)
    SWC_CLEAR_CONTAINER CONTAINER.
    *att_bor_obj-objtype = 'MESSAGE'.
    *swc_set_element container 'ATTACHMENT' pdf.
    *swc_set_element container 'ATTACHMENT' otf.
    swc_set_element container 'ATTACHMENT' context.
    swc_set_element container 'ATTACHMENTTITLE' 'Anexo'.
    swc_set_element container 'AttachmentType' 'OTF'.
    *swc_set_element container 'DocumentSize' 0.
    swc_set_element container 'DocumentSize' file_size.
    *swc_set_table container 'DocumentContent' itab.
    SWC_CALL_METHOD MESSAGE 'Attach' CONTAINER.
    PERFORM ERROR_HANDLING(RSSOBCITEST11).
    *SWC_CLEAR_CONTAINER CONTAINER.
    *SWC_SET_ELEMENT CONTAINER 'EditorSettings' 'D'.
    *SWC_SET_ELEMENT CONTAINER 'STARTING_AT_X' '5'.
    *SWC_SET_ELEMENT CONTAINER 'STARTING_AT_Y' '5'.
    *SWC_SET_ELEMENT CONTAINER 'EnableApplObjAttachments' 'X'.
    *SWC_CALL_METHOD MESSAGE 'EditRecipientList' CONTAINER.
    *PERFORM ERROR_HANDLING(RSSOBCITEST11).
    * Einen Empfänger (interner Benutzer) automatisch hinzufügen
    * Recipient-Objekt anlegen
    swc_clear_container container.
    swc_create_object recipient 'Recipient' space.
    swc_set_element container 'AddressString' sy-uname.
    swc_set_element container 'TypeId' 'B'.
    swc_call_method recipient 'CreateAddress' container.
    perform error_handling(rssobcitest11).
    * Kopie des Recipient-Objekts anfügen
    swc_clear_container container.
    swc_set_element container 'NewRecipient' recipient.
    swc_call_method message 'AddCopyOfRecipient' container.
    perform error_handling(rssobcitest11).
    * Outbox-Flag setzen
    swc_clear_container container.
    swc_set_element container 'OutboxFlag' 'X'.
    swc_call_method message 'SetOutboxFlag' container.
    perform error_handling(rssobcitest11).
    * Empfängerliste editieren
    swc_clear_container container.
    swc_call_method message 'EditRecipientList' container.
    perform error_handling(rssobcitest11).
    swc_get_table container 'RecipientsInfo' object_list.
    if sy-subrc = 8.
    * Kopiertes Message-Objekt versenden
      swc_clear_container container.
      swc_call_method message 'Submit' container.
      perform error_handling(rssobcitest11).
      swc_get_table container 'RecipientsInfo' object_list.
    endif.
    swc_get_element container 'SentToAll' sent_to_all.
    * Kopiertes Message-Objekt sichern
    swc_clear_container container.
    swc_call_method message 'Save' container.
    perform error_handling(rssobcitest11).
    * Protokollausgabe:
    * Key des Message-Objekts ermitteln
    *SWC_GET_OBJECT_KEY MESSAGE OBJKEY.
    *WRITE: / 'Key des Messageobjekts', OBJKEY.
    * Protokollausgabe:
    perform write_recipient_info(rssobcitest11) tables object_list
                                                using  sent_to_all.
    * Freigeben der Referenzen
    * MESSAGE-Objekt
    swc_free_object message.
    * RECIPIENT-Objekt
    swc_free_object recipient.
    commit work.
    ENDFUNCTION.

  • Workflow for training and event management

    Hi,
    I have to develope a workflow regarding event type prebooking whic will be pre-booked thru pv02 , now my requirement is to send a workitem text  to manager ess account  who will appprove or reject this event type.
    After approval it shud make updation in database but not in the case of   rejection .After that Manager preebook a event for those who are alredy approved for the same event type and after event booking it shud also update the attendance table or infotype . 
    Thanks .

    Hi,
    Set the Values to the Business Object container
    SWC_SET_ELEMENT CONTAINER   'profit'  profit.
    Read the Values in the attribute
    swc_get_property SELF 'TravelerName'  Lv_traveller
    Also refer this [Link|https://wiki.sdn.sap.com/wiki/x/moOmAw]
    Regards,
    Surjith
    Edited by: surjith kumar on Mar 26, 2009 9:45 AM

  • Regarding the change status of leave workflow.

    hi friends,
    i have copied the standard leave worklfow "WS12300111" and customized it just to meet our requirement means for multiple approvers.
    everything is working fine in production  means if user ID "AIHR01' raise a leave request the workitem will go to "AIHR02" after his approving the workitem will go to the final approver means "AIHR03" after his approval the leave request will be completed and the status in the TC - PTARQ is coming as "APPROVED" means only after the approving of "AIHR03" the status is coming "APPROVED" but in some cases when user id "AIHR02" is approved instead of coming status "SENT" it is coming "APPROVED"  in TC-PTARQ and because of this status the workitem is coming blank in UWL of "AIHR03".
    I have already incorporated the given below method in the "WORKFLOW" just to change the status from "APPROVED"  to "SENT" after the approval of user ID "AIHR02" but in some cases it is not working fine it is giving BUG.
    begin_method changestatus changing container.
    DATA:request TYPE ptreq_header-request_id,
              wi_id TYPE swwwihead-wi_id.
    DATA: request_instance TYPE REF TO if_pt_req_request,
               event   TYPE tim_req_xfer_event VALUE
               cl_pt_req_const=>c_reqtrans_send,
               ex_status TYPE tim_req_status,
               container_wi TYPE swcont OCCURS 0,
               agents TYPE STANDARD TABLE OF swhactor WITH HEADER LINE.
              swc_get_element container 'REQUEST' request.
              swc_get_element container 'Wi_id' wi_id.
    DO.
      CALL FUNCTION 'ENQUEUE_EPTREQ'
       EXPORTING
        MODE_PTREQ_HEADER       = 'S'
        MANDT                   = SY-MANDT
         request_id              = request
        X_REQUEST_ID            = ' '
        _SCOPE                  = '2'
        _WAIT                   = ' '
        _COLLECT                = ' '
       EXCEPTIONS
         foreign_lock            = 1
          system_failure          = 2
          OTHERS                  = 3
        IF sy-subrc = 0.
          EXIT.
        ENDIF.
        WAIT UP TO 60 SECONDS.
      ENDDO.
      IF sy-subrc = 0.
        CALL METHOD ca_pt_req_header=>agent->get_request
          EXPORTING
            im_request_id     = request
          IMPORTING
            ex_request        = request_instance
          EXCEPTIONS
            request_not_found = 1
            OTHERS            = 2.
        IF sy-subrc = 0.
          CALL METHOD request_instance->initiate_state_trans
            EXPORTING
              im_transfer_event = event
               im_external_call  = 'X'
       im_ret_value      = 0
                     ex_new_status     = ex_status
       ex_ret_code       =
          swc_set_element container 'Ex_Status' ex_status.
        ENDIF.
        CALL FUNCTION 'DEQUEUE_EPTREQ'
         EXPORTING
      MODE_PTREQ_HEADER       = 'S'
      MANDT                   = SY-MANDT
           request_id              = request
      X_REQUEST_ID            = ' '
      _SCOPE                  = '3'
      _SYNCHRON               = ' '
      _COLLECT                = ' '
      ENDIF.
      swc_create_container container_wi.
      swc_set_element container_wi 'WI_ID' wi_id.
      agents-otype = 'US'.
      agents-objid = sy-uname.
      APPEND agents.
      CALL FUNCTION 'SWW_WI_START_SIMPLE'
        EXPORTING
          task                         = 'TS90000089'
          called_in_background         = 'X'
        TABLES
          agents                       = agents
          wi_container                 = container_wi
        EXCEPTIONS
          id_not_created               = 1
          read_failed                  = 2
          immediate_start_not_possible = 3
          execution_failed             = 4
          invalid_status               = 5
          OTHERS                       = 6.
      end_method.
    Request you to plesase help me to solve this issue .why in some cases instead of coming status "SENT" it is coming "APPROVED"  after the approval of user id "AIHR02".
    BECAUSE of the  "APPROVED" staus the same workitem is coming blank in the UWL OF "AIHR03".

    solved by own

  • The source and target structure have a different number of fields

    Hi,
    I am new to workflow and I am trying to create an attachment in Workflow (SAP ECC 6.0) and pass it through to a User Decision (User Decision works fine) however the workflow is failing on the attachment step with u2018The source and target structure have a different number of fieldsu2019. The bindings check ok. Please see details below.
    I have used document u2018Creating Attachments to Work Items or to User Decisions in Workflowsu2019 by Ramakanth Reddy for guidance. Thanks in advance.
    1) Workflow containers (SWDD)
    WORKITEMID (import)
    ZSWR_ATT_ID (export)
    SOFM (export)
    2) Task Container (PFTC)
    1 Import parameter defined u2013 WORKITEMID (swr_struct-workitemid)
    2 Export parameters defined
    - SOFM (Ref. obj. type SOFM)
    - ZSWR_ATT_ID  (swr_att_id-doc_id)
    Binding task -> Method
    Binding for 1 parameter (import) defined
    Task <- Method
    Binding for 2 parameters (export) defined
    3) Z  BOR object created with a Method, Method Parameters and Event (SWO1)
    1 import parameter defined
    2 export parameters defined
    Method calls FM SSF_FUNCTION_MODULE_NAME, CONVERT_OTF, SCMS_XSTRING_TO_BINARY and SAP_WAPI_ATTACHMENT_ADD
    Workflow is triggered by FM SAP_WAPI_CREATE_EVENT, Return_code = 0
    Event_id = 00000000000000000001
    Test results
    A) Triggered by ABAP/ FM SAP_WAPI_CREATE_EVENT - SWI2_DIAG results
    Work item  14791: object <z bor object name> method <method name> cannot be executed. The source and target structure have a different number of fields (this message is repeated 3 times). Error handling for work item 14791. No errors occurred -> details in long text (message is repeated 3 times).
    Message no. WL821, OL383, WL050 in long text
    B) Z BOR Test method <execute>
    Enter workitem id.
    Runtime error - Data objects in Unicode programs cannot be converted. The statement "MOVE src TO dst" requires that the operands "dst" and "src" are convertible. Since this statement is in a Unicode program, the special conversion rules for Unicode programs apply.                                        
    In this case, these rules were violated.   
    Program                             SAPLSWCD                
    Include                                LSWCDF00                
    Row                                    475                     
    Module type                        (FORM)                  
    Module Name                      MOVE_CONTAINER_TO_VALUE           
    C) Z BOR Test method <debugging>
    Enter workitem id.
    SAP_WAPI_ATTACHMENT_ADD, return_code = 0, message_lines  = Attachment created            
    both  swc_set_element container work ok
    Runtime error occurs after end_method executed. Data objects in Unicode programs cannot be converted.
    D) Workflow test
    Enter workitem id <execute>
    Task started> Workflow log> Status = Error
    Workflow errors in Attachment step (however Office document can be viewed in details for step).

    Problem has now been resolved. Problem was related to use of swr_att_id structure and swc_set_element statement in BOR program - problem resolved by only setting w/f container to swr_att_id-doc_id.

Maybe you are looking for

  • How To make certain that a page is removed from memory, silverlight

     Hello, I have a big solution with several branches. These branches was tested individually for errors and memory issues, using VS profiler and debugger. A final solution was found that at highest with animations and music peaked to 100mb,

  • Using an Applet as a client

    Hi, I'm have created a .war file that contains an html page and a JApplet. When I deploy the .war file and connect to the server, the html page is found. but, I get an exception that the applet class can not be found. when I use the assembly tool tha

  • Java Card Jobs in India

    Hi All Members, Since we people are working in Java card technology, But I am more focused about the career in Java card Technology. In INDIA specially we do not have scope to work on Java Card technology, I have been searching for good Job from 2 ye

  • UML to XML? How??

    Hi, I need to build an XML representation of an UML model (a couple of classes and relationships between them). I know that I must use an XMI standard representation, but my problem is another one: I know yet rules to generate an XMI-Schema (the spec

  • What is Virtual Key Figure ?

    Hello, I would like to know about Virtual Key Figure. What is Virtual Key Figure ? How to we created ? what is use of Virtual Key Figure? Thank you Anup G shah