Workflow for crm lead creation

Hi,
     while creating the lead in crmd_order transaction. i need partnerfunction value in Business object repository. so i have created one subtype for that, then i created the attribute as a data dictonary field then system has asked to generate the code automatically wt is my doubt is is that the correct data system retrieves ( so any body give me the clarity that how to create the attributes and access the attributes in bor )

Hi,
I am not sure about Lead transaction but in general Partner Functions are maintained in IHPA table. You can get the Partners based on the object number for Lead. To fetch the correct Partner you need to know the Object number (OBJNR) and partner funtion (PARVW). You can have multiple values.
In your workflow,
1. Create and generate a subtype(Z-business object) for Lead business object BUS2000108  and deligate the same to standard business object. (as suggested by Saumya)
2. Create an attribute in the subtype. the attribute should be a VIRTUAL ATTRIBUTE.
3. Place the cursor on the attribute and click on program, it will generate some code.
4. between Get_property and End_property for your virtual field write the logic such that you get the object number from Lead tables and fetch partners from IHPA table and fill the final attribute using macros.
swc_set_element container <container Name> object-<Container name>.
4. Once the coding is completed, release the attribute and business object and generate subtype.
Now required Partners will be available in workflow.
Hope this helps you in resolving your issue. If you have any additional queries please feel free to reply to this tread.
Regards,
Gautham Paspala

Similar Messages

  • ABAP & Workflow for CRM

    Hello  Buddies,
            I have seen so mail threads somewhat near to my doubt but could you please tell me some good link for learning ABAP & Workflow for CRM. Also please advise me, being ABAP-Workflow Consultant which section of CRM is best suitable for me.
    Thanks in advance. Your guidance is appreciated.
    Warm Regards,
    N. Singh

    Hi,
    ABAP    and Workflow for CRM is nothing different and specific to CRM. They are same and at least all the basic concepts are present. There might be some implementation and conceptual differences but they are more of functionality driven.
    You start learning SAP CRM Fucntionality which will help you to understand SAP CRM much better. And then you can have a feel of the CRM feature and where and how it's been used to drive the ABAP and Workflow functionality.
    Hope this helps. You can scan the forum for good links and resources.
    Best Regards,
    Samantak

  • Trigger workflow for MIRO invoice creation

    Hello,
    In standard functionning it is not possible to trigger the workflow for documents coming from MM.
    When using transaction MIRO and selecting invoice creation the created document has following value :
    BKPF-AWTYP = 'RMRP'. whereas creating it from FB60 results to BKPF-AWTYP = 'BKPF'.
    The problem is standard code checks AWTYP is not equal to 'RMRP' before creating event to start the standard workflow for invoice validation.
    Question : why sap doesn't allow workflow creation for invoices from MIRO?
    Thanks for your answers.
    Best regards,
    Laurent.

    Hi,
    here they are...
    WS20000397 MMIVBlockedP Treatment of inv. blkd for price, Log.IV
    WS20001004 MMIVToRel Release the Completed Log. IV Document
    WS00400026 MMIVquantity Treatment inv.blocked f.quantity reasons
    WS20001003 MMIVToCompl Complete the Parked Log. IV Document
    WS00400027 MMIVprice Treatment invoic.blocked f.price reasons
    All of these workflows are a one-step / one-level of approval and needs some workflow configuration at least for the agent assignments. For a full-blown workflow you should take these workflows as an example, how you could work with it.
    The last two workflows work with preliminary posting on the miro (transaction MIR7).
    Best regards,
    Florin

  • Workflow for Purchase order creation!!!

    Hi,
    I am new for SAP Workflow. I have a requirement to create workflow for PO creation. Once the approval of 2 levels, then PO should be released. Could you please help me to do this. Please provice me the step by step procedure or relevent materials links.
    Thanks in Advance!!

    Hi,
    Get yourself familiar with terms like PO release strategy, etc. This has lots of material in SAP help. You might also take a look to SAP MM workflow scenarions document - it has documentation of PR release, but the idea is quite similar with POs.
    You can also google "PO release strategy in SAP", and you should find some step by step instructions.
    In general, lots of things can be done purely by configuring in SPRO and not that much WF development (if any) is required unless you have some specific requiremenets.
    Regards,
    Karri

  • Workflow for CRM.

    Dear Experts,
    I am a beginer to Workflow.
    I have a scenario in CRM.
    1,The requester logs into portal and creates an activity in CRM PCUI screen.
    what i want to do in workflow is
    When the requester creates the activity and saves their is a field with a user name.
    I want to send a mail to that user name.
    and after that the user will acknowledge it, then the requester should get a confirming mail.
    After the user completes the task and comes back to the Portal and changes the status to completed.
    then the workflow should send a mail to the requester stating that task is completed.
    I will be glad if somebody can explain me the steps involved in doing this workflow.
    thanks and regards
    Neel

    Hi Neel Kamal,
    It is simple.
    As you said that the responsible person will be found using masters.
    You know the initiator of the workflow.
    1. Go to the business object, create the subtype of the supertype. SWO1
    2. In the Method find the mail id of A and B. Create one more method for finding the status.
    3. Have this mail ids in a container element of the method
    4. Go SWDD, create a activity step, inside that call the method which is used to find the mail id of A and B.
    5. Do the binding between task-->method
    and Method-->task
    6. Come out and do the binding between task-->workflow container
    workflow container-->task
    7. Create a send mail step. In element give the B email id container element.
    8. Check for the condition for status change
    9. If status changed, create a send mail there give the A email id container element.
    10. activate the workflow.
    Finished
    Thanks and Regards
    Balaji K.

  • BW Status for CRM Leads

    We have an issue where the leads are not picking up the user status from CRM in the 0CRM_LEAD_H extractor.
    I have read the associated notes and have gone through the customization of the extractor. I added an append structure for the field BWSTONELEAD and completed the necessary config in SBIW for that status object group and status object. The only thing extra I had to do was manually change the value in ROOSFIELD for the field to show up in RSA6.
    The strange thing is that we have done the same configuration for BWSTONEOPPT for the 0CRM_OPPT_H extractor, and the values come through perfectly fine. Everything seems to be the same between opportunities and leads in the extractors, yet values come in for Opportunities and not for leads.
    Anyone have any ideas? We're on CRM 5.0 -> BW 7.0
    Thanks!

    Hi,
    I have a similiar issue.
    If u have solved it, can u share, how u solved the issue.
    Thanks,
    Raja

  • BADI for return order creation in CRM

    Hi group,
    I have an requirement. In CRM ,Return order should be created from UBB service contract when change process takes place(Contract termination), ie throgh actions in the UBB service contract. these steps are configured through Actions.
    The requirement is, I need to enhance the  BADI implemention(COPY_DOCUMENT) by creating a function module. this function module should provide the necessary data for Return Order creation. Is there any function module to create a Return order in CRM or how to proceed? Appreciate if any suggestions
    Regards,
    Sankar

    Hi,
           You can use BAPI_SALESORDER_CREATEFROMDAT2 .
    In import TESTRUN = X
    Description
    This parameter is a test switch.
    If you activate the switch, the system does not save the document.
    Value range
    Space = Document should be saved
      X   = Document should not be saved
    Default
    Space

  • Very urgent: Doubts regarding CRM WORKFLOW OF BUSINESS PARTNER CREATION

    HI ,
    I HAVE DOUBTS REGARDING CRM WORKFLOW OF BUSINESS PARTNER CREATION, WHILE I AM CREATING BUSINESS PARTNER THROUGH R/3 , IT REFLECT IT INTO MYSAP CRM ALSO, AT THAT TIME IT SENDING THE MAIL TWICE TO THE RECEIPIENT. IS THERE ANY WAY THROUGH  WHICH I CAN RESTRICT IT TO SEND THE MAIL ONLY ONCE,
    PLZ SEND ME THE REPLY AS SOON AS POSSIBLE,
    THANKS  ADVANCED,

    HI
    WORKFLOW SEETING. SAP MAIL
    MULTIPLE MAILS AND
    ONLY ONCE CHOOSE
    ONLY ONCE OPTION ON WHICH VERSION U R WORKING?
    REWARD IF HELPFUL
    VENKAT

  • Approval workflow for creation of organization

    Hi,
    I need to configure an approval workflow for the creation of organization. When the admin tries to create a new org, the approval should go to a admin group. The org should get created only once approval is done. I have configured an approval workflow for the Xellerate Organization resource object. I have created an unconditional task where the assignment tab has the admin group. When I test it, the org gets created without going through the approval process. Could someone please tell me what am I missing?
    Thanks,
    Supreetha
    Edited by: Supreetha on Jan 22, 2011 8:38 AM

    You'll have to raise request for Dummy Organization. It's Order for Organization so will not appear for user.
    I am not sure the full flow/complete requirement of your.
    APMU, you want approval while creating Organization into OIM.
    This is not possible OOTb when you create ORg in OIM.
    You'll create 1 dummy Org
    1 Dummy RO "OFO".
    Attach one Object Form with this RO.
    Raise request for Dummy Org and Give the name of Org on the object form for which you want approval.
    In the provisioning workflow, use OIM API to create Org into OIM.
    Done !!!

  • Standard workflow for SO approval process in CRM

    Hi all
    I would like to know if there is any standard workflow for Sales order approval process. I have tried my best and couldnt come across any.
    And also what is the commonly used approval process?
    Thanks & Regards
    Mui Kanva

    Hi
    check workflows: WS10000279 and WS10001068 (aut approval).
    But we created our own schema to implement two step approval.
    Regards
    Radek

  • Lead Creation Error thro ABAP Code

    Hi CRM ABAP Experts,
    I have written a code for lead creation by referring SDN Code. when i execute code , lead is created and transaction get saved in to system. but atlast one error comes. plz help me.  when i pass testrun = 'X'  then i am not getting error but lead trasaction is not created. and when i passedtestrun = blank then lead is created but gives below error.Below error i am facing.
    Short text
        An exception occurred that was not caught.
    What happened?
        The exception 'CX_OS_OBJECT_NOT_FOUND' was raised, but it was not caught
         anywhere along
        the call hierarchy.
        Since exceptions represent error situations and this error was not
        adequately responded to, the running ABAP program
         'CL_METHODCALL_PPF=============CP' has to be
        terminated.
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_OS_OBJECT_NOT_FOUND', was not
         caught in
        procedure "IF_MEDIUM_PPF~EXECUTE" "(METHOD)", nor was it propagated by a
         RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        Could not find the referenced object with the OID
        "00000000000000000000000000000000" (instance GUID) and
    My Code is as follows
    DATA: it_HEADER type standard table of  BAPIBUS2000108_HEADER_INS.
    DATA: wa_HEADER  like line of it_HEADER.
    DATA:it_ORGANISATION TYPE STANDARD TABLE OF     BAPIBUS20001_ORGMAN_INS,
         wa_ORGANISATION LIKE LINE OF it_ORGANISATION.
    DATA: it_partner type table of BAPIBUS20001_PARTNER_INS.
    DATA: wa_partner like line of it_partner.
    DATA:HEADERX TYPE STANDARD TABLE OF     BAPIBUS2000108_HEADER_INSX,
         st_headerx TYPE bapibus2000108_header_insx,
         PARTNERX TYPE STANDARD TABLE OF BAPIBUS20001_PARTNER_INSX,
         st_partnerx TYPE bapibus20001_partner_insx,
         i_orgx  TYPE STANDARD TABLE OF BAPIBUS20001_ORGMAN_INSX,
         st_orgx TYPE bapibus20001_orgman_insx,
         i_save TYPE TABLE OF bapibus20001_object_id,
         i_return TYPE TABLE OF bapiret2,
         DATEX  TYPE STANDARD TABLE OF BAPIBUS20001_APPOINTMENT_INSX.
    DATA:i_itemx TYPE TABLE OF bapibus20001_item_insx,
         i_item TYPE TABLE OF bapibus20001_item,
         st_itemx TYPE bapibus20001_item_insx,
         st_item TYPE bapibus20001_item,
         i_schedulex TYPE TABLE OF bapibus20001_schedlinx,
         i_schedule TYPE TABLE OF bapibus20001_schedlin,
         st_schedulex TYPE bapibus20001_schedlinx,
         st_schedule TYPE bapibus20001_schedlin.
    DATA :c_x TYPE char01 VALUE 'X',
          TESTRUN type BAPIFLAG-BAPIFLAG.
    data i_input TYPE TABLE OF bapibus20001_input_fields.
    data st_input TYPE bapibus20001_input_fields.
    DATA:ORG_NO TYPE OBJEKTID,
         PARTNER_NO1 TYPE BU_PARTNER,
         CUST_BP TYPE BU_PARTNER,
         SALE_OFF TYPE CRMT_SALES_ORG_RESP.
    DATA:msg TYPE ZRETURN_ERROR.
    DATA:w_item TYPE CRMT_ITEM_NO,
         w_handle TYPE CRMT_HANDLE.
    CLEAR:st_headerx.
    st_headerx-handle = c_x.
    st_headerx-process_type = c_x.
    st_headerx-DESCR_LANGUAGE = c_x.
    st_headerx-POSTING_DATE = c_x.
    st_headerx-lead_type = c_x.
    st_headerx-importance = c_x.
    st_headerx-source = c_x.
    APPEND st_headerx TO headerx.
    CLEAR wa_header.
    wa_HEADER-HANDLE = '0000000001'.
    wa_HEADER-PROCESS_TYPE = 'ZCDL'.
    wa_HEADER-DESCR_LANGUAGE = 'EN'.
    wa_HEADER-POSTING_DATE = '20100603'.
    wa_HEADER-IMPORTANCE = '5'.
    wa_HEADER-SOURCE = '019'.
    wa_HEADER-LEAD_TYPE = '0016'.
    APPEND WA_HEADER TO IT_HEADER.
    CLEAR:st_input.
    st_input-ref_handle = '0000000001'.
    st_input-ref_kind = 'A'.
    st_input-objectname = 'ORDERADM_H'.
    st_input-fieldname = 'PROCESS_TYPE'.
    APPEND st_input TO i_input.
    CLEAR st_input.
    st_input-ref_handle = '0000000001'.
    st_input-ref_kind = 'A'.
    st_input-objectname = 'LEAD_H'.
    st_input-fieldname = 'SOURCE'.
    APPEND st_input TO i_input.
    st_input-fieldname = 'IMPORTANCE'.
    APPEND st_input TO i_input.
    st_input-fieldname = 'LEAD_TYPE'.
    APPEND st_input TO i_input.
    *To fill the Organization X Structure
    CLEAR:st_orgx.
    st_orgx-ref_handle = c_x.
    st_orgx-ref_kind = c_x.
    st_orgx-dis_channel = c_x.
    st_orgx-sales_org_resp = c_x.
    APPEND st_orgx TO i_orgx.
    *To fill the Organization Structure
    CLEAR:wa_ORGANISATION.
    wa_ORGANISATION-ref_handle = '0000000001'.
    wa_ORGANISATION-ref_kind = 'A'.
    wa_ORGANISATION-dis_channel = '01'.
    wa_ORGANISATION-sales_org_resp = 'O 50000041'.
    APPEND wa_ORGANISATION TO it_ORGANISATION.
    *Fill input fields for Organization data
    CLEAR st_input.
    st_input-ref_handle = '0000000001'.
    st_input-ref_kind = 'A'.
    st_input-objectname = 'ORGMAN'.
    st_input-fieldname = 'DIS_CHANNEL'.
    APPEND st_input TO i_input.
    st_input-fieldname = 'SALES_ORG'.
    APPEND st_input TO i_input.
    *To fill the Partner X Structure
    st_partnerx-ref_handle = c_x.
    st_partnerx-ref_kind = c_x.
    st_partnerx-ref_partner_handle = c_x.
    st_partnerx-kind_of_entry = c_x.
    st_partnerx-partner_no = c_x.
    st_partnerx-partner_fct = c_x.
    st_partnerx-no_type = c_x.
    st_partnerx-display_type = c_x.
    st_partnerx-MAINPARTNER = c_x.
    APPEND st_partnerx TO partnerx.
    *To fill the Partner Structure
    *CLEAR:wa_partner.
    *wa_partner-ref_handle = '0000000001'.
    *wa_partner-ref_kind = 'A'.
    *wa_partner-ref_partner_handle = '0001'.
    *wa_partner-kind_of_entry = 'C'.           """""""A
    *wa_partner-partner_no = '62563'.
    *wa_partner-partner_fct = '00000022'.
    *wa_partner-no_type = 'BP'.
    *wa_partner-display_type = 'BP'.
    *wa_partner-MAINPARTNER = 'X'.
    *APPEND wa_partner TO it_partner.
    CLEAR:wa_partner.
    wa_partner-ref_handle = '0000000001'.
    wa_partner-ref_kind = 'A'.
    wa_partner-ref_partner_handle = '0001'.
    wa_partner-kind_of_entry = 'C'.         """""""A
    wa_partner-partner_no = '62564'.
    wa_partner-partner_fct = '00000021'.
    wa_partner-no_type = 'BP'.
    wa_partner-display_type = 'BP'.
    wa_partner-MAINPARTNER = 'X'.
    APPEND wa_partner TO it_partner.
    CLEAR:wa_partner.
    wa_partner-ref_handle = '0000000001'.
    wa_partner-ref_kind = 'A'.
    wa_partner-ref_partner_handle = '0001'.
    wa_partner-kind_of_entry = 'C'.    """"""""A
    wa_partner-partner_no = '71024'.
    wa_partner-partner_fct = 'ZCDLSM'.
    wa_partner-no_type = 'BP'.
    wa_partner-display_type = 'BP'.
    wa_partner-MAINPARTNER = 'X'.
    APPEND wa_partner TO it_partner.
    *Fill input fields for Partner data
    CLEAR st_input.
    st_input-ref_handle = '0000000001'.
    st_input-ref_kind = 'A'.
    st_input-objectname = 'PARTNER'.
    *st_input-logical_key = w_logickey_partner.
    st_input-fieldname = 'DISPLAY_TYPE'.
    APPEND st_input TO i_input.
    st_input-fieldname = 'KIND_OF_ENTRY'.
    APPEND st_input TO i_input.
    st_input-fieldname = 'NO_TYPE'.
    APPEND st_input TO i_input.
    st_input-fieldname = 'PARTNER_FCT'.
    APPEND st_input TO i_input.
    st_input-fieldname = 'PARTNER_NO'.
    APPEND st_input TO i_input.
    st_input-fieldname = 'MAINPARTNER'.
    APPEND st_input TO i_input.
    *To fill the Item X Structure
    st_itemx-handle = c_x.
    st_itemx-header_handle = c_x.
    st_itemx-ordered_prod = c_x.
    st_itemx-number_int = c_x.
    st_item-mode = c_x.
    APPEND st_itemx TO i_itemx.
    *To fill Schedule line X Structure
      st_schedulex-item_handle = c_x.
      st_schedulex-handle = c_x.
      st_schedulex-quantity = c_x.
      st_schedulex-logical_key = c_x.
    APPEND st_schedulex TO i_schedulex.
    CLEAR: w_item, w_handle.
    w_item = '0000000010'.
    *To fill the Item Structure
    w_handle = 1.
    st_item-handle = w_handle.
    st_item-header_handle = '0000000001'.
    st_item-ordered_prod = '400000120' .
    st_item-number_int = w_item.
    st_item-mode = 'A'.
    APPEND st_item TO i_item.
    *To fill Schedule line Structure
    DATA:qty TYPE CRMT_SCHEDLIN_QUAN VALUE '1'.
      st_schedule-item_handle = w_handle.
      st_schedule-quantity = qty.
    APPEND st_schedule TO i_schedule.
    *Fill input fields for Item data
    CLEAR st_input.
    st_input-ref_handle = w_handle.
    st_input-ref_kind = 'B'.
    st_input-objectname = 'ORDERADM_I'.
    st_input-fieldname = 'MODE'.
    APPEND st_input TO i_input.
    st_input-fieldname = 'NUMBER_INT'.
    APPEND st_input TO i_input.
    st_input-fieldname = 'ORDERED_PROD'.
    APPEND st_input TO i_input.
    Fill input fields for schedule line data
    CLEAR st_input.
    st_input-ref_handle = w_handle.
    st_input-ref_kind = 'B'.
    st_input-objectname = 'SCHEDLIN'.
    st_input-fieldname = 'LOGICAL_KEY'.
    APPEND st_input TO i_input.
    st_input-fieldname = 'QUANTITY'.
    APPEND st_input TO i_input.
    CLEAR testrun.
    *Testrun = 'X'.
    CALL FUNCTION 'BAPI_LEAD_CREATEMULTI'
    EXPORTING
       TESTRUN            = Testrun
    TABLES
       HEADERX            = headerx
       PARTNERX           = partnerx
       ORGANISATIONX      = i_orgx
       itemx              = i_itemx
       sched_linx         = i_schedulex
       HEADER             = it_header
       ORGANISATION       = it_ORGANISATION
       PARTNER            = it_partner
       item               = i_item
       SCHED_LIN          = i_schedule
       INPUT_FIELDS       = i_input
       RETURN             = i_return
       SAVED_PROCESS      = i_save  .
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT          = 'x'.
    IF SY-SUBRC = 0.
      IF sy-subrc = 0.
      ENDIF.
    ENDIF.

    Hi,
    Look at the post. No one will be able to understand anything out of this. Kindly Repaste code using  markup.
    Regards,
    Harsh.
    Edited by: Harsh Saxena on Aug 28, 2010 11:40 AM

  • Sap workflow ws10001011 - convert lead into opportunity

    Hi
    There is a workflow
    There is a workflow ws10001011 which converts leads into opportunties in CRM
    Can you plss tell me step by step directions to activate this workflow.
    Also will a standard workflow work for - standard lead and standard opportunity transactions or if I have z lead and opportunity transaction type-will it work?
    Thanks
    Tarang which converts leads into opportunties in CRM
    Can you plss tell me step by step directions to activate this workflow.
    Also will a standard workflow work for - standard lead and standard opportunity transactions or if I have z lead and opportunity transaction type-will it work?
    Thanks
    Tarang

    Hi,
    Second alternative of using workflow would be better to convert Lead into Opportunity , once LEAD is HOT and Error free.
    This workflow is standard functionality offered by SAP for requirement of converting LEAD into Opportunity.
    Hope this helps,
    PD

  • CRM Lead to Opportunity

    Hello CRMers
    The requirement is as follows, when a lead is created it has to be received by the sales representative automatically (via workflow)
    How do I acheive this im CRM ? Please help me as the requirement is quite urgent.
    Thank you
    Patricia

    Hi Patricia
    We have workflow in CRM called WS10001011 which is used for this purpose
    Do the following
    ath is CRM &#61614; Basic Functions &#61614; SAP Business Workflow &#61664; Perform Task-specific Customizing
    Choose application component abbrev. CRM-BTX-LEA
    Choose Activate event linking (if not activated already).
    On the Event Linkage: Triggering Event screen expand workflow 10001011
    Activate the events
    Choose Assign Agents.
    Assign the sales rep to the Tasks TS  and WS 10001011 by positioning your cursor on the relevant task and choosing Create agent assignment.
    Select Object Type User and press Continue.
    Select the sales rep SALES_REP using the dialog box and then choose Generate.
    The sales employees are now assigned to the chosen task.
    Hope this would help
    Regards
    Rekha Dadwal
    <b>Reward with points if helpful</b>

  • Parameters not gettin passed while lead creation..........

    Hi...
                 I am passing the values of the fields SOURCE and IMPORTANCE in the exporting parameter IT_LEAD_H to the FM CRM_ORDER_MAINTAIN while lead creation...When I check the CRM_LEADH table I find that these values arent gettin reflected ...The guid and the leadtype are gettin saved but the values of these two fields are not present...This is the code I'm using.....
    CT_ORDERADM_H
        ls_orderadm_h-handle        = '1'.
    .   ls_orderadm_h-PROCESS_TYPE  = 'LEAD'.
        ls_orderadm_h-mode          = 'A'.
        INSERT ls_orderadm_h INTO TABLE lt_orderadm_h.
      build table with change fields
        FREE lt_input_field_names.
        ls_input_field_names-fieldname = 'PROCESS_TYPE'.
        INSERT ls_input_field_names INTO TABLE lt_input_field_names.
        ls_input_field_names-fieldname = 'MODE'.
        INSERT ls_input_field_names INTO TABLE lt_input_field_names.
        CLEAR ls_input_fields.
        ls_input_fields-ref_handle  = '1'.
      ls_input_fields-objectname  = 'ORDERADM_H'.
        ls_input_fields-field_names = lt_input_field_names.
        INSERT ls_input_fields INTO TABLE ct_input_fields.
    CRMT_LEAD_H_COMT
      IF IT_LEAD_H IS INITIAL.
        ls_lead_h-ref_handle     = '1'.
        ls_lead_h-SOURCE         = '002'.
        ls_lead_h-IMPORTANCE     = '2'.
      ENDIF.
        INSERT ls_lead_h INTO TABLE lt_lead_h.
      build table with change fields
        FREE lt_input_field_names.
        IF ls_lead_h-SOURCE IS NOT INITIAL.
          ls_input_field_names-fieldname = 'SOURCE'.
          INSERT ls_input_field_names INTO TABLE lt_input_field_names.
        ENDIF.
        IF ls_lead_h-IMPORTANCE IS NOT INITIAL.
          ls_input_field_names-fieldname = 'IMPORTANCE'.
          INSERT ls_input_field_names INTO TABLE lt_input_field_names.
        ENDIF.
        CLEAR ls_input_fields.
        ls_input_fields-ref_handle  = '1'.
        ls_input_fields-ref_kind    = 'A'.
        ls_input_fields-objectname  = 'LT_LEAD_H'.
        ls_input_fields-field_names = lt_input_field_names.
        INSERT ls_input_fields INTO TABLE ct_input_fields.
    IT_STATUS
      IF is_status IS INITIAL.
        ls_status-ref_handle     = '1'.
        ls_status-status         = STATUS.
       ls_status-user_stat_proc = 'CRMLEAD'.
        ls_status-activate       = 'X'.
       ls_status-process        = 'ACCI'.
      ENDIF.
        INSERT ls_status INTO TABLE lt_status.
      build table with change fields
        FREE lt_input_field_names.
        IF ls_status-status IS NOT INITIAL.
          ls_input_field_names-fieldname = 'STATUS'.
          INSERT ls_input_field_names INTO TABLE lt_input_field_names.
        ENDIF.
        IF ls_status-activate IS NOT INITIAL.
          ls_input_field_names-fieldname = 'ACTIVATE'.
          INSERT ls_input_field_names INTO TABLE lt_input_field_names.
        ENDIF.
        CLEAR ls_input_fields.
        ls_input_fields-ref_handle  = '1'.
        ls_input_fields-ref_kind    = 'A'.
        ls_input_fields-objectname  = 'STATUS'.
        ls_input_fields-field_names = lt_input_field_names.
        INSERT ls_input_fields INTO TABLE ct_input_fields.
    ENDIF.
    bring changed fields with values to object layer
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
        EXPORTING
          it_lead_h         = lt_lead_h
          it_survey         = it_survey
          it_status         = lt_status
        CHANGING
          ct_orderadm_h     = lt_orderadm_h
          ct_orderadm_i     = lt_orderadm_i
          ct_input_fields   = ct_input_fields
        EXCEPTIONS
          error_occurred    = 1
          document_locked   = 2
          no_change_allowed = 3
          no_authority      = 4
          OTHERS            = 5.
    Are there any other parameters that I have to pass?Plz suggest a solution for this......

    Hi Francois,
    Thank you for looking into the issue. Your first response was did you try get_form_field. Yes I did, and it did not work. I realised later (hopefully correctly) that get_form_field will work only if the field below is treated as an input field within <htmlb:form> and </htmlb:form>.
    I shall re-explain the scenario. In default.htm, I enter an IDoc Number(input field) and click submit button. In the <form action > I have mentioned idoc.htm page. In idoc.htm, in On Initialization , I create a tree.
    Method of creating tree
    a) I create a table of type TVIEWNODE and populate the relevant details, except for the link field. The parameters that needs to be passed to the next page is a structure. In order to achieve this(I found this method in one of the posts in the forum),
    Step I -- Serialize the structure data using CL_BSP_UTILITY=>SERIALIZE_DATA and fill a table LT_PARAMETER_LIST.
    Step II -- I then construct a URL using CL_BSP_RUNTIME=>IF_BSP_RUNTIME~CONSTRUCT_BSP_URL passing APPLICATION NAME, 'SEGMENT.HTM' and table LT_PARAMETER_LIST.
    Step III -- This method returns a URL which is then appended in the TVIEWNODE table and the tree is created.
    The tree is created perfectly and the links are perfect as well.
    However as mentioned in my earlier post when I click on the link, the URL shows all the attributes but I am not able to fetch the same using GET_ATTRIBUTE method or GET_FORM_DATA method.
    Next point mentioned was create an attribute. This is an interesting point that you have mentioned. In page attributes, when I try pa_s_idoc-segnam, it mentions special characters not allowed.
    I will explore the possibility of creating fields of internal table as page attributes i.e. using SEGNAM instead of pa_s_idoc-SEGNAM and then pass values to these.
    If there are any other solutions do let me know.
    Thanks again, Francois.

  • Workflow at sales order creation

    Hi ,
    I have this requirement that when a sales order is created then i need to check the delivery block and if the sales order is credit blocked then send a workflow to an agent.
    I am using a custom workflow for this and using the BUS2032.I have linked both CREATED and CHANGED event to my workflow.
    For changed event its working perfectly fine.
    Now the problem is that how can I trigger my workflow on creation of the sales order based on delivery block value.Delivery block field is not available in BUS2032.
    So I cant use it in the start condition.
    Thanks

    Hi Asit Garg,
    Correct me if i am "X".
    You want to trigger the workflow for two different scenario that is 1. when the sales order is changed 2. when the sales order is created with delivery block.
    For the 1. As you said it is working fine.
    For the 2. sales order created with delivery block.
                 Make your workflow to work like this, Whenever the sales order is created trigger the workflow and at first step check for the condition weather the sales order have the delivery block or not if not terminate the workflow through terminating event if not proceed as you wish.
    Hope it will helps you,
    Regards
    Balaji E.

Maybe you are looking for