BAPI_ACTIVITYCRM_CREATEMULTI - Passing PREDECESSOR_PROCESS

Hello,
  We have a customized code for creating activities from inbound mails from customers. We are calling BAPI_ACTIVITYCRM_CREATEMULTI to create the activity. In the header parameter structure, if I pass the guid of the parent activity in the PREDECESSOR_PROCESS and also pass the PREDECESSOR_OBJECT_TYPE, will it link the current activity with it's parent activity in the doc flow.
Regards,
Sanjay

Ajay,
  In the program "CRM_CALL_ACTIVITY_INTERFACE", the PREDECESSOR values are not populated. So, if I can't use the PREDECESSOR values to change the parents doc flow then I will have to call 'BAPI_ACTIVITYCRM_CHANGEMULTI' to change the doc flow of the parent. Can anyone please tell me if the PREDECESSOR values are populated then will it change the doc flow of the parent to show the current activity as the objkey_b.

Similar Messages

  • Error In BAPI_ACTIVITYCRM_CREATEMULTI

    Hi,
    I am using BAPI_ACTIVITYCRM_CREATEMULTI for creating activity with text.please refer below code for reference.
    I am able to create activity but not able to create text.
    Error which I am getting is
    1) If  wa_text-REF_KIND = 'A'.  Error is "An authorization check could not be executed"
    2) if wa_text-REF_KIND = 'E'  Error is "Referenced object type (TEXTS) not allowed"
    3) If I am commeting  wa_text-ref_handle = 1. Then it create 2 activities 1) with partner 2) for Text without Partner.
    Can you please suggest what are changes needed in code below so that i can create Activities with long text.
    *& Report  ZACTI_UPD
    REPORT  ZACTI_UPD.
    data: header type standard table of BAPIBUS2000110_HEADER_INS,
          wa_header type BAPIBUS2000110_HEADER_INS,
          headerX type standard table of BAPIBUS2000110_HEADER_INSX,
          wa_headerX type BAPIBUS2000110_HEADER_INSX,
          partner type standard table of BAPIBUS20001_PARTNER_INS,
          wa_partner type BAPIBUS20001_PARTNER_INS,
          PARTNERX type standard table of BAPIBUS20001_PARTNER_INSX,
          wa_partnerx type BAPIBUS20001_PARTNER_INSX,
          return type standard table of BAPIRET2,
          createdProcess type standard table of BAPIBUS20001_HEADER_INS,
          MATERIAL type standard table of  BAPIBUS2000110_MATERIAL,
          wa_MATERIAL type BAPIBUS2000110_MATERIAL,
          MATERIALX type standard table of BAPIBUS2000110_MATERIALX ,
          wa_MATERIALX type BAPIBUS2000110_MATERIALX,
          EXTENSIONIN type standard table of BAPIPAREX,
          wa_EXTENSIONIN type BAPIPAREX,
          JOURNAL type standard table of  BAPIBUS2000110_JOURNAL,
          wa_JOURNAL type BAPIBUS2000110_JOURNAL,
          JOURNALX type standard table of BAPIBUS2000110_JOURNALX,
          wa_JOURNALX type BAPIBUS2000110_JOURNALX,
          lt_extensionin    type table of bapiparex,
          text type standard table of BAPIBUS20001_TEXT_INS,
          wa_text type  BAPIBUS20001_TEXT_INS,
          TEXTX type standard table of BAPIBUS20001_TEXT_INSX,
          wa_TEXTX type BAPIBUS20001_TEXT_INSX.
    call function 'GUID_CREATE'
        importing
          ev_guid_32 = wa_header-GUID.
    My Activity Type
          wa_header-PROCESS_TYPE = 'ZH01'.  "Value pass from legacy transcation type
          wa_header-description = 'Bapi Test'.
    My Activity Category
         wa_header-CATEGORY = 'CX4'.  "Value pass from legacy cetogory
         wa_header-PRIORITY = '5'.  "Value pass from legacy proiroty
          wa_header-posting_date = sy-datum.
          wa_header-MODE = 'A'.
         wa_header-direction = 0.
          append wa_header to header.
          wa_headerx-GUId = 'X'.
          wa_headerx-PROCESS_TYPE = 'X'.
          wa_headerx-DESCRIPTION = 'X'.
         wa_headerx-CATEGORY = 'X'.
         wa_headerx-PRIORITY = 'X'.
          wa_headerx-OBJECTIVE = 'X'.
          wa_headerx-POSTING_DATE = 'X'.
          wa_headerx-MODE = 'X'.
         wa_headerx-DIRECTION = 'X'.
          append wa_headerx to headerx.
          wa_partner-ref_guid = wa_header-GUID.
          wa_partner-REF_KIND = 'A'.
         wa_partner-REF_PARTNER_HANDLE = 1.
          wa_partner-PARTNER_FCT = '00000009'.
          wa_partner-partner_no = '1000000004'.
          wa_partner-NO_TYPE = 'BP'. " BP = Business partner #
          wa_partner-DISPLAY_TYPE = 'BP'.
          append wa_partner to partner.
         wa_partner-REF_PARTNER_HANDLE = 2.
         wa_partner-PARTNER_FCT = '00000026'.
    **User Name
         wa_partner-partner_no = '1000000004'.
         wa_partner-NO_TYPE = 'US'. "US = USER
         wa_partner-DISPLAY_TYPE = 'US'.
         append wa_partner to partner.
          wa_partnerx-REF_GUID = 'X'.
          wa_partnerx-REF_KIND = 'X'.
         wa_partnerx-REF_PARTNER_HANDLE = 'X'.
          wa_partnerx-PARTNER_FCT = 'X'.
          wa_partnerx-PARTNER_NO = 'X'.
          wa_partnerx-NO_TYPE = 'X'.
          wa_partnerx-DISPLAY_TYPE = 'X'.
          append wa_partnerx to partnerx.
    TEXT
      wa_text-ref_Guid = wa_header-GUID.
        wa_text-ref_handle = 2.
        wa_text-REF_KIND = 'A'.
        wa_text-tdid = 'A002'. "'A002'. " '0200'.
        wa_text-tdspras = 'E'.
        wa_text-tdline = 'This is my test text.'.
        wa_text-tdstyle = 'SYSTEM'.
        wa_text-tdform = 'SYSTEM'.
        wa_text-mode = 'A'.   "guess
        wa_text-tdformat = '*'.
        append wa_text to text.
       wa_textx-ref_guid = 'X'.
       wa_textx-ref_handle = 'X'.
        wa_textx-REF_KIND = 'X'.
        wa_textx-tdid = 'X'..
        wa_textx-tdspras = 'X'.
        wa_textx-tdline = 'X'.
        wa_textX-tdstyle = 'X'.
        wa_textX-tdform = 'X'.
        wa_textx-mode = 'X'.
        wa_textx-tdformat = 'X'.
        append wa_textx to textx.
    data: ls_process_settings type bapibus20001_procsettings.
    ls_process_settings-msglevel = 8   ."gc_msglevel-administrator.
    ls_process_settings-save     = 'X' . "true.
    call function 'BAPI_BUSPROCESSND_PROCSETTINGS'
        exporting
         process_settings_in = ls_process_settings
        tables
          return              = return
    CALL FUNCTION 'BAPI_ACTIVITYCRM_CREATEMULTI'
      TABLES
        HEADER                = header
        HEADERX               = headerx
        PARTNER               = partner
         PARTNERX             = partnerx
      ORGANISATION          =
      ORGANISATIONX         =
      DATE                  =
      DATEX                 =
        TEXT                  =  text
        TEXTX                 =  textx
      REASON                =
      REASONX               =
      OUTCOME               =
      OUTCOMEX              =
      STATUS                =
      STATUSX               =
      LOCATION              =
      LOCATIONX             =
      INPUT_FIELDS          =
       CREATED_PROCESS        = CREATEDPROCESS
        RETURN                =  return
      DOCUMENT_FLOW         =
      JOURNAL                = journal
      JOURNALX               = journalx
       MATERIAL              = material
       MATERIALX             = materialx
       EXTENSIONIN            = lt_extensionin
      if sy-subrc = 0 .
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      WAIT          =
    IMPORTING
      RETURN        =
      endif.
      field-symbols: <cp> type BAPIBUS20001_HEADER_INS,
                      <rt> type BAPIRET2.
      loop at createdprocess assigning <cp>.
        write: / <cp>-OBJECT_ID,
                 <cp>-description.
      endloop.
      loop at return assigning <rt>.
      write:/ <rt>-message.
      endloop.

    its is resolved

  • Using BAPI_ACTIVITYCRM_CREATEMULTI for creating sales order in CRM

    Hello Experts,
    I am creating a sales order using BAPI_ACTIVITYCRM_CREATEMULTI, But I am getting the following errors:
    1. Reference Object Type (ORGMAN) not allowed
    2. Reference Object Type (PARTNER) not allowed
    3. Incomplete interface data - No reference specified
    4. Item was not found
    Can you please help me with the mandatory fields, that has to be filled in the BAPI, and do I need to use Commit BAPI after this BAPI.
    Please I am in critical postion,
    Now I am able to create a sales order there is no data it like the partner number and Item.May be I am missing some important fileds.
    Please help.
    Thanks,
    Suma
    Edited by: Suma B on Aug 8, 2008 1:05 PM

    Hi,
    I am passing data using SE37 T-Code.
    I was told by the fucntioal guys that GUID will be generated by CRM, so we dont need to send that as an input.
    Still facing the same error...
    These are my input fields:
    REF_HANDLE
    REF_GUID
    R
    OBJECTNAME
    LOGICAL_KEY
    FIELDNAME
    C
    |
    0000000000
    ORDERADM_H
    PROCESS_TYPE
    0000000000
    ORDERADM_H
    POSTING_DATE
    0000000000
    ACTIVITY_H
    CATEGORY
    0000000000
    ACTIVITY_H
    PRIORITY
    0000000000
    ACTIVITY_H
    DIRECTION
    0000000000
    PARTNER
    000000000022XXXXXXX
    REF_PARTNER_FCT
    0000000000
    PARTNER
    000000000022XXXXXXX
    REF_PARTNER_NO
    0000000000
    PARTNER
    000000000022XXXXXXX
    PARTNER_FCT
    0000000000
    PARTNER
    000000000022XXXXXXX
    PARTNER_NO
    0000000000
    ORGMAN
    DIS_CHANNEL
    0000000000
    ORGMAN
    DIVISION
    0000000000
    ORGMAN
    SALES_ORG
    0000000000
    ORDERADM_I
    PRODUCT
    0000000001
    B
    SCHEDLIN
    00000000000000000000000000000000
    QUANTITY
    |
    This is error log:
    T
    ID
    NUM
    MESSAGE
    LOG_NO
    LOG_MS
    MESSAGE_V1
    MESSAGE_V2
    MESSAGE_V3
    MESSAGE_V4
    PARAMETER
    ROW
    FIELD
    SYSTEM
    |
    W
    CRM_ORDER
    004
    Referenced object type (ORGMAN) not allowed
    $000001
    000001
    ORGMAN
    ORDER
    0
    CR5CLNT100
    W
    CRM_ORDER
    004
    Referenced object type (PARTNER) not allowed
    $000001
    000002
    PARTNER
    ORDER
    0
    CR5CLNT100
    W
    CRM_ORDER
    005
    Incomplete interface data - No reference specified
    $000001
    000003
    ORDER
    0
    CR5CLNT100
    E
    CRM_ORDERADM_I
    006
    Item  was not found.
    $000001
    000004
    ORDER
    0
    CR5CLNT100
    E
    CRM_ORDER
    005
    Incomplete interface data - No reference specified
    $000001
    000005
    ORDER
    0
    CR5CLNT100
    S
    CRM_MESSAGES
    005
    A log has been generated for single document
    $000001
    000006
    MESSAGES
    0
    CR5CLNT100
    E
    COM_PARTNER
    119
    Enter   Sold-To Party
    $000002
    000001
    Sold-To Party
    PARTNER
    0
    PARTNER_NO
    CR5CLNT100
    E
    COM_PARTNER
    119
    Enter   Ship-To Party
    $000002
    000002
    Ship-To Party
    PARTNER
    0
    PARTNER_NO
    CR5CLNT100
    E
    COM_PARTNER
    119
    Enter   Bill-To Party
    $000002
    000003
    Bill-To Party
    PARTNER
    0
    PARTNER_NO
    CR5CLNT100
    E
    COM_PARTNER
    119
    Enter   Payer
    $000002
    000004
    Payer
    PARTNER
    0
    PARTNER_NO
    CR5CLNT100
    E
    COM_PARTNER
    119
    Enter   Sold-To Party
    00000000000000047612
    000001
    Sold-To Party
    PARTNER
    0
    PARTNER_NO
    CR5CLNT100
    E
    COM_PARTNER
    119
    Enter   Ship-To Party
    00000000000000047612
    000002
    Ship-To Party
    PARTNER
    0
    PARTNER_NO
    CR5CLNT100
    E
    COM_PARTNER
    119
    Enter   Bill-To Party
    00000000000000047612
    000003
    Bill-To Party
    PARTNER
    0
    PARTNER_NO
    CR5CLNT100
    E
    COM_PARTNER
    119
    Enter   Payer
    00000000000000047612
    000004
    Payer
    PARTNER
    0
    PARTNER_NO
    CR5CLNT100
    |
    Thanks,
    Suma

  • Add Text to Activity using  BAPI_ACTIVITYCRM_CREATEMULTI

    All:
    I am creating activities as part of a data load.
    One of the requirements is to assign text to a text type associated with an activity journal. However, I am struggling with this last piece of the puzzle.
    I have lifted most of my code from the program "CRM_CALL_ACTIVITY_INTERFACE". Unfortunately, the demo program does not include parameters for passing text.
    The snippet below is from my workup program.
    Any ideas why the text is not making through the bapi?
    data:   text type standard table of BAPIBUS20001_TEXT_INS,
            wa_text type  BAPIBUS20001_TEXT_INS,
           TEXTX type standard table of BAPIBUS20001_TEXT_INSX,
          wa_TEXTX type BAPIBUS20001_TEXT_INSX.
    TEXT
        wa_text-ref_Guid = wa_header-GUID.
        wa_text-tdid = '0200'.
        wa_text-tdspras = 'E'.
        wa_text-tdline = 'This is my test text.'.
        wa_text-tdstyle = 'SYSTEM'.
        wa_text-tdform = 'SYSTEM'.
        wa_text-mode = 'I'.   "guess
        wa_text-tdformat = '*'.
        append wa_text to text.
        wa_textx-ref_guid = 'X'.
        wa_textx-tdid = 'X'..
        wa_textx-tdspras = 'X'.
        wa_textx-tdline = 'X'.
        wa_textX-tdstyle = 'X'.
        wa_textX-tdform = 'X'.
        wa_textx-mode = 'X'.
        wa_textx-tdformat = 'X'.
        append wa_textx to textx.
    CALL FUNCTION 'BAPI_ACTIVITYCRM_CREATEMULTI'
      TABLES
        HEADER                = header
        HEADERX               = headerx
        PARTNER               = partner
         PARTNERX             = partnerx
      ORGANISATION          =
      ORGANISATIONX         =
      DATE                  =
      DATEX                 =
        TEXT                  =  text
        TEXTX                 =  textx
      REASON                =
      REASONX               =
      OUTCOME               =
      OUTCOMEX              =
      STATUS                =
      STATUSX               =
      LOCATION              =
      LOCATIONX             =
      INPUT_FIELDS          =
       CREATED_PROCESS        = CREATEDPROCESS
        RETURN                =  return
      DOCUMENT_FLOW         =
       JOURNAL                = journal
       JOURNALX               = journalx
        MATERIAL              = material
        MATERIALX             = materialx
       EXTENSIONIN            = lt_extensionin
    Thanks in advance.

    Mauricio:
    Pardon me. You were right about the GUID. I haven't gone through a deep debug, but the results are there.
    The GUID is generated a the start of the program and passed to all of the tables required by the function module. This follows the logic laid out in the demo program.
    Following your  logic, I removed the generated GUID from the table TEXT. Poof my item text appeared in the new generated activity journal.
    Thanks for your help.
    RM
    I have included my code for anyone's perusal. No warranties implied or expressed. Use at you own risk.
    *& Report  Z_LOAD_ACTIVITIES_FROMDATA                                  *
    REPORT  Z_LOAD_ACTIVITIES_FROMDATA              .
    data: header type standard table of BAPIBUS2000110_HEADER_INS,
          wa_header type BAPIBUS2000110_HEADER_INS,
          headerX type standard table of BAPIBUS2000110_HEADER_INSX,
          wa_headerX type BAPIBUS2000110_HEADER_INSX,
          partner type standard table of BAPIBUS20001_PARTNER_INS,
          wa_partner type BAPIBUS20001_PARTNER_INS,
          PARTNERX type standard table of BAPIBUS20001_PARTNER_INSX,
          wa_partnerx type BAPIBUS20001_PARTNER_INSX,
          return type standard table of BAPIRET2,
          MATERIAL type standard table of  BAPIBUS2000110_MATERIAL,
          wa_MATERIAL type BAPIBUS2000110_MATERIAL,
          MATERIALX type standard table of BAPIBUS2000110_MATERIALX ,
          wa_MATERIALX type BAPIBUS2000110_MATERIALX,
          EXTENSIONIN type standard table of BAPIPAREX,
          wa_EXTENSIONIN type BAPIPAREX,
          JOURNAL type standard table of  BAPIBUS2000110_JOURNAL,
          wa_JOURNAL type BAPIBUS2000110_JOURNAL,
          JOURNALX type standard table of BAPIBUS2000110_JOURNALX,
          wa_JOURNALX type BAPIBUS2000110_JOURNALX,
          text type standard table of BAPIBUS20001_TEXT_INS,
          wa_text type  BAPIBUS20001_TEXT_INS,
          TEXTX type standard table of BAPIBUS20001_TEXT_INSX,
          wa_TEXTX type BAPIBUS20001_TEXT_INSX.
    constants: gc_lenstruc   type i value 30.
    constants: begin of gc_bapi_te,
                activity_i   type  crmt_object_name  value
                                  'BAPI_TE_CRMD_ACTIVITY_I',
                activity_ix  type  crmt_object_name  value
                                  'BAPI_TE_CRMD_ACTIVITY_IX',
                product_i    type  crmt_object_name  value
                                  'BAPI_TE_CRMD_PRODUCT_I',
                lead_h       type  crmt_object_name  value
                                  'BAPI_TE_CRMD_LEAD_H',
                opport_h     type  crmt_object_name  value
                                  'BAPI_TE_CRMD_OPPORT_H',
                orderadm_h   type  crmt_object_name  value
                                  'BAPI_TE_CRMD_ORDERADM_H',
                orderadm_i   type  crmt_object_name  value
                                  'BAPI_TE_CRMD_ORDERADM_I',
                shipping     type  crmt_object_name  value
                                  'BAPI_TE_CRMD_SHIPPING',
                sales        type  crmt_object_name  value
                                  'BAPI_TE_CRMD_SALES',
                schedlin     type  crmt_object_name  value
                                  'BAPI_TE_CRMD_SCHEDLIN',
                pricing      type  crmt_object_name  value
                                  'BAPI_TE_CRMD_PRICING',
                pricing_i    type  crmt_object_name  value
                                  'BAPI_TE_CRMD_PRICING_I',
                billing      type  crmt_object_name  value
                                  'BAPI_TE_CRMD_BILLING',
                ordprp_i     type  crmt_object_name  value
                                  'BAPI_TE_CRMD_ORDPRP_I',
               end of gc_bapi_te.
    * My structure for loading the journal
    data: ls_activity_i_add_fields type zzcrmt_activity_i_add_fields,
          ls_te_activity_i  type bapi_te_crmd_activity_i,
          ls_te_activity_ix type bapi_te_crmd_activity_ix,
          ls_extensionin    type bapiparex,
          lt_extensionin    type table of bapiparex.
    data: ls_activity_bapi  type bapibus2000110_header_ins,
          lt_return2 type standard table of bapiret2,
          createdProcess type standard table of BAPIBUS20001_HEADER_INS.
    field-symbols: <lv_anyfield>     type simple,
                   <lv_flagfield>    type simple,
                   <lv_fn>   type any,
                   <lv_ft>   type any.
    data:
    laeng    type zzcrmt_activity_i_add_fields-laeng,
      breit    type zzcrmt_activity_i_add_fields-breit,
      hoehe    type zzcrmt_activity_i_add_fields-hoehe,
      meabm    type zzcrmt_activity_i_add_fields-meabm,
      prava    type zzcrmt_activity_i_add_fields-prava,
      pravb    type zzcrmt_activity_i_add_fields-pravb,
      subjecta type zzcrmt_activity_i_add_fields-subjecta,
      subjectb type zzcrmt_activity_i_add_fields-subjectb,
      result   type zzcrmt_activity_i_add_fields-kv_result,
      resreas  type zzcrmt_activity_i_add_fields-resreas,
      kv_deko  type zzcrmt_activity_i_add_fields-kv_deko,
      dekotp   type zzcrmt_activity_i_add_fields-dekotp,
      kv_stock type zzcrmt_activity_i_add_fields-kv_stock,
      posloc   type zzcrmt_activity_i_add_fields-posloc,
      kv_zpanz type zzcrmt_activity_i_add_fields-kv_zpanz,
      kv_zpava type zzcrmt_activity_i_add_fields-kv_zpava,
      nrmshf   type zzcrmt_activity_i_add_fields-nrmshf,
      nrpshf   type zzcrmt_activity_i_add_fields-nrpshf,
      posver   type zzcrmt_activity_i_add_fields-posver,
      poshor   type zzcrmt_activity_i_add_fields-poshor,
      posqli   type zzcrmt_activity_i_add_fields-posqli,
      ecropt   type zzcrmt_activity_i_add_fields-ecropt,
      nroffac  type zzcrmt_activity_i_add_fields-nroffac,
      faclen   type zzcrmt_activity_i_add_fields-faclen,
      facwid   type zzcrmt_activity_i_add_fields-facwid,
      facdep   type zzcrmt_activity_i_add_fields-facdep,
      facunit  type zzcrmt_activity_i_add_fields-facunit,
      sprice   type zzcrmt_activity_i_add_fields-sprice,
      oprice   type zzcrmt_activity_i_add_fields-oprice,
      aprice   type zzcrmt_activity_i_add_fields-aprice,
      kvcurr1  type zzcrmt_activity_i_add_fields-kvcurr1,
      phrefnr  type zzcrmt_activity_i_add_fields-phrefnr,
      storno   type zzcrmt_activity_i_add_fields-storno,
      lbval    type zzcrmt_activity_i_add_fields-lbval,
      grade    type ZZCRMT_ACTIVITY_I_ADD_FIELDS-grade,
      trade_name type ZZCRMT_ACTIVITY_I_ADD_FIELDS-grade.
    data: logsys  type bapibus20001_doc_flow_ins-logsys_a.
    data: lr_structdescr_bapi_te    type ref to cl_abap_structdescr,
          lr_structdescr_add_fields type ref to cl_abap_structdescr,
          lv_component   like line of cl_abap_structdescr=>components.
    *  INITIALIZATION                                                      *
    initialization.
      data: lv_datum(10) type c,
            lv_uzeit(6)  type c..
      write: sy-datum to lv_datum dd/mm/yyyy,
             sy-uzeit to lv_uzeit using edit mask '__:__'..
      call function 'OWN_LOGICAL_SYSTEM_GET'
        importing
          own_logical_system = logsys
        exceptions
          others             = 0.
      lr_structdescr_bapi_te    ?= cl_abap_typedescr=>describe_by_data(
    ls_te_activity_i ).
      lr_structdescr_add_fields ?= cl_abap_typedescr=>describe_by_data(
    ls_activity_i_add_fields ).
    start-of-selection.
    * Test journal entries
      subjecta = 'Z000000001'.
      subjectb = 'Z007'.
      FACUNIT = 'KG'.
      grade = '200%'.
      trade_name = 'Chlorine Tonner'.
    call function 'GUID_CREATE'
        importing
          ev_guid_32 = wa_header-GUID.
    * My Activity Type
          wa_header-PROCESS_TYPE = 'ZCON'.
          wa_header-description = 'This is my bapi test'.
    * My Activity Category
          wa_header-CATEGORY = 'Z01'.
          wa_header-PRIORITY = '5'.
          wa_header-posting_date = sy-datum.
          wa_header-MODE = 'A'.
          wa_header-direction = 0.
          append wa_header to header.
          wa_headerx-GUId = 'X'.
          wa_headerx-PROCESS_TYPE = 'X'.
          wa_headerx-DESCRIPTION = 'X'.
          wa_headerx-CATEGORY = 'X'.
          wa_headerx-PRIORITY = 'X'.
          wa_headerx-OBJECTIVE = 'X'.
          wa_headerx-POSTING_DATE = 'X'.
          wa_headerx-MODE = 'X'.
          wa_headerx-DIRECTION = 'X'.
          append wa_headerx to headerx.
          wa_partner-ref_guid = wa_header-GUID.
          wa_partner-REF_KIND = 'A'.
          wa_partner-REF_PARTNER_HANDLE = '0001'.
          wa_partner-PARTNER_FCT = '00000009'.
          wa_partner-partner_no = '45000181'.
          wa_partner-NO_TYPE = 'BP'.
          wa_partner-DISPLAY_TYPE = 'BP'.
          append wa_partner to partner.
          wa_partner-REF_PARTNER_HANDLE = '0002'.
          wa_partner-PARTNER_FCT = '00000022'.
    *User Name
          wa_partner-partner_no = 'RMYERS'.
          wa_partner-NO_TYPE = 'US'.
          wa_partner-DISPLAY_TYPE = 'US'.
          append wa_partner to partner.
          wa_partnerx-REF_GUID = 'X'.
          wa_partnerx-REF_KIND = 'X'.
          wa_partnerx-REF_PARTNER_HANDLE = 'X'.
          wa_partnerx-PARTNER_FCT = 'X'.
          wa_partnerx-PARTNER_NO = 'X'.
          wa_partnerx-NO_TYPE = 'X'.
          wa_partnerx-DISPLAY_TYPE = 'X'.
          append wa_partnerx to partnerx.
         wa_material-header = wa_header-GUID.
         wa_material-handle = 1.
    *Product GUID
         wa_material-product ='A105BA8D09107646BF7C58408DCECEFA'.
         wa_material-ORDERED_PROD = '90000113'.
    * using volume not quanitiy fileds
         wa_material-volume = 100.
    *     wa_material-QUANTITY = 100.
         append wa_material to material.
         wa_materialx-HANDLE = 'X'.
         wa_materialx-PRODUCT = 'X'.
         wa_materialx-HEADER = 'X'.
         wa_materialx-volume = 'X'.
         wa_material-ORDERED_PROD = 'X'.
         wa_materialx-QUANTITY = 'X'.
         append wa_materialx to materialx.
      data j_guid like wa_JOURNAL-journal_guid.
      j_guid = 'B845C68411370348807A9C46F74A756C'.
      wa_JOURNAL-ref_handle = '0000000001'.
    * My journal GUID
      wa_JOURNAL-journal_guid = 'B845C68411370348807A9C46F74A756C'.
      append wa_journal to journal.
      wa_JOURNALX-journal_guid = 'X'.
      wa_JOURNALX-ref_handle  = 'X'.
      append wa_JOURNALX to journalx.
    move: laeng    to ls_activity_i_add_fields-laeng,
            breit    to ls_activity_i_add_fields-breit,
            hoehe    to ls_activity_i_add_fields-hoehe,
            meabm    to ls_activity_i_add_fields-meabm,
            prava    to ls_activity_i_add_fields-prava,
            pravb    to ls_activity_i_add_fields-pravb,
            subjecta to ls_activity_i_add_fields-subjecta,
            subjectb to ls_activity_i_add_fields-subjectb,
            result   to ls_activity_i_add_fields-kv_result,
            resreas  to ls_activity_i_add_fields-resreas,
            kv_deko  to ls_activity_i_add_fields-kv_deko,
            dekotp   to ls_activity_i_add_fields-dekotp,
            kv_stock to ls_activity_i_add_fields-kv_stock,
            posloc   to ls_activity_i_add_fields-posloc,
            kv_zpanz to ls_activity_i_add_fields-kv_zpanz,
            kv_zpava to ls_activity_i_add_fields-kv_zpava,
            nrmshf   to ls_activity_i_add_fields-nrmshf,
            nrpshf   to ls_activity_i_add_fields-nrpshf,
            posver   to ls_activity_i_add_fields-posver,
            poshor   to ls_activity_i_add_fields-poshor,
            posqli   to ls_activity_i_add_fields-posqli,
            ecropt   to ls_activity_i_add_fields-ecropt,
            nroffac  to ls_activity_i_add_fields-nroffac,
            faclen   to ls_activity_i_add_fields-faclen,
            facwid   to ls_activity_i_add_fields-facwid,
            facdep   to ls_activity_i_add_fields-facdep,
            facunit  to ls_activity_i_add_fields-facunit,
            sprice   to ls_activity_i_add_fields-sprice,
            oprice   to ls_activity_i_add_fields-oprice,
            aprice   to ls_activity_i_add_fields-aprice,
            kvcurr1  to ls_activity_i_add_fields-kvcurr1,
            phrefnr  to ls_activity_i_add_fields-phrefnr,
            storno   to ls_activity_i_add_fields-storno,
            lbval    to ls_activity_i_add_fields-lbval,
            grade    to  ls_activity_i_add_fields-grade,
            trade_name to  ls_activity_i_add_fields-trade_name.
      move-corresponding ls_activity_i_add_fields to ls_te_activity_i.
      include: crm_bapi_eewfields_move.
      while sy-subrc eq 0. "// Set the X-flags generic
        assign component sy-index of structure ls_te_activity_i to
    <lv_anyfield>.
        if sy-subrc eq 0.
          if not <lv_anyfield> is initial.
            assign component sy-index of structure ls_te_activity_ix to
    <lv_flagfield> casting type bapiupdate.
            if sy-subrc eq 0.
              <lv_flagfield> = 'X'.
            endif.
          endif.
        endif.
      endwhile.
      if not ls_te_activity_ix is initial.
        ls_te_activity_i-ref_handle   = ls_te_activity_ix-ref_handle   = 1.
    ls_te_activity_i-journal_guid = ls_te_activity_ix-journal_guid = j_guid
        call method cl_abap_container_utilities=>fill_container_c
          exporting
            im_value               = ls_te_activity_i
          importing
            ex_container           = ls_extensionin+gc_lenstruc
          exceptions
            illegal_parameter_type = 1
            others                 = 2.
        move gc_bapi_te-activity_i to ls_extensionin-structure.
        append ls_extensionin to lt_extensionin.
        call method cl_abap_container_utilities=>fill_container_c
          exporting
            im_value               = ls_te_activity_ix
          importing
            ex_container           = ls_extensionin+gc_lenstruc
          exceptions
            illegal_parameter_type = 1
            others                 = 2.
        move gc_bapi_te-activity_ix to ls_extensionin-structure.
        append ls_extensionin to lt_extensionin.
      endif.
    * TEXT
    *    wa_text-ref_Guid = wa_header-GUID.
        wa_text-ref_handle = '0000000001'.
        wa_text-REF_KIND = 'B'.
        wa_text-tdid = '0200'.
        wa_text-tdspras = 'E'.
        wa_text-tdline = 'This is my test text.'.
        wa_text-tdstyle = 'SYSTEM'.
        wa_text-tdform = 'SYSTEM'.
        wa_text-mode = 'B'.   "guess
        wa_text-tdformat = '*'.
        append wa_text to text.
    *    wa_textx-ref_guid = 'X'.
        wa_textx-REF_KIND = 'X'.
        wa_textx-tdid = 'X'..
        wa_textx-tdspras = 'X'.
        wa_textx-tdline = 'X'.
        wa_textX-tdstyle = 'X'.
        wa_textX-tdform = 'X'.
        wa_textx-mode = 'X'.
        wa_textx-tdformat = 'X'.
        append wa_textx to textx.
    data: ls_process_settings type bapibus20001_procsettings,
           lt_created_header   type table of bapibus20001_header_ins,
           ls_created_header   type bapibus20001_header_ins.
           ls_process_settings-msglevel = 8   ."gc_msglevel-administrator.
           ls_process_settings-save     = 'X' . "true.
    call function 'BAPI_BUSPROCESSND_PROCSETTINGS'
        exporting
         process_settings_in = ls_process_settings
        tables
          return              = lt_return2.
    CALL FUNCTION 'BAPI_ACTIVITYCRM_CREATEMULTI'
      TABLES
        HEADER                = header
        HEADERX               = headerx
        PARTNER               = partner
         PARTNERX             = partnerx
    *   ORGANISATION          =
    *   ORGANISATIONX         =
    *   DATE                  =
    *   DATEX                 =
        TEXT                  =  text
        TEXTX                 =  textx
    *   REASON                =
    *   REASONX               =
    *   OUTCOME               =
    *   OUTCOMEX              =
    *   STATUS                =
    *   STATUSX               =
    *   LOCATION              =
    *   LOCATIONX             =
    *   INPUT_FIELDS          =
       CREATED_PROCESS        = CREATEDPROCESS
        RETURN                =  return
    *   DOCUMENT_FLOW         =
       JOURNAL                = journal
       JOURNALX               = journalx
        MATERIAL              = material
        MATERIALX             = materialx
       EXTENSIONIN            = lt_extensionin
      if sy-subrc = 0 .
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    * EXPORTING
    *   WAIT          =
    * IMPORTING
    *   RETURN        =
      endif.
      field-symbols: <cp> type BAPIBUS20001_HEADER_INS,
                      <rt> type BAPIRET2.
      loop at createdprocess assigning <cp>.
        write: / <cp>-OBJECT_ID,
                 <cp>-description.
      endloop.
      loop at return assigning <rt>.
      write:/ <rt>-message.
      endloop.

  • From dialog user to service user & BAPI BAPI_ACTIVITYCRM_CREATEMULTI

    Hello all,
    I have a question. When being a<b> dialog</b> user, running the fm BAPI BAPI_ACTIVITYCRM_CREATEMULTI creates no problems. E.g., the number of partners added to the activity is correctly stored in the internal table. However, since I want to prevent that I have to update the password every x days, I want to use a <b>system</b> or <b>service</b> type of user.
    The problem now is that the function modules returns with an <b>error</b>. Because a certain partner now is NOT added/available anymore.
    To sum, running the fm with dialog user gives a good, desired result. Chaning the user the system gives an erroneous result.
    What changes do I have to make so that it correctly adds the desired partner type to my activity?
    Mehmet

    Thanks RENE for your answer.
    The problem is solved, it seems that i was passing fields that i didn´t have to pass, so instead of passing all the fields of the partner, now i just pass:
      wa_partner_bapi-ref_guid
      wa_partner_bapi-ref_kind
      wa_partner_bapi-partner_no
      wa_partner_bapi-partner_fct
      wa_partner_bapi-ref_partner_handle
      wa_partner_bapi-no_type
      wa_partner_bapi-display_tyype
    Regards,
    Filipe

  • FM "BAPI_ACTIVITYCRM_CREATEMULTI"

    Hello All ,
    We are creating activity using fm "BAPI_ACTIVITYCRM_CREATEMULTI",
    it's work fine but we figure out 2 problems :
    1.We try to update the user status through BAPIBUS20001_STATUS_INS, we pass following parameters :
    REF_GUID = transaction guid
    STATUS = "E0009"
    USER_STAT_PROC = "ZACTI1" but transaction created with initial status "EOOO1".
    2.Where we create transaction manually the "Employee Creator" filled automatically, where we trying to do it with FM we can't update/create automatically  this field.
    Any help will be appriciate.
    Rika

    Hi Rika,
    Try to call function CRM_ORDER_CHANGE_STATUS just for
    the  status after BAPI ACTIVITY CREATE MULTI.
    But you have to remember that E0009 is still in range
    Low and High of status E0001.
    Hope this helps.
    Gun

  • Date Issue while creating Activity using BAPI_ACTIVITYCRM_CREATEMULTI

    Hi,
    I'm creating an activity using BAPI BAPI_ACTIVITYCRM_CREATEMULTI and this is working fine. The only thing which is not reflecting in the activity is the date which I'm passing to this BAPI. The system  always puts the default date, which is system date.
    Below are the parameters I'm passing in DATE and DATEX parameters of BAPI_ACTIVITYCRM_CREATEMULTI. Let me know if I'm doing something wrong.
    Can someone help me? Any help in resolving this would be appreciated and rewarded with points. Thanks!
        lt_date-ref_handle = lt_header-handle. "handle for activity
        lt_date-ref_kind   = 'A'. "Adm header
        lt_date-appt_type  = 'ORDERACTUAL'. "Order actual date type
        lt_date-date_from  = '20060120'. "e.g.
        lt_date-time_from  = '1200000'. "e.g.
        lt_date-date_to    = '20060120'."e.g.
        lt_date-time_to    = '1200000'. "e.g.
        lt_date-show_local = 'X'.
        lt_date-mode       = 'A'."Create
        lt_datex-ref_handle = 'X'.
        lt_datex-ref_kind   = 'X'.
        lt_datex-appt_type  = 'X'.
        lt_datex-date_from  = 'X'.
        lt_datex-time_from  = 'X'.
        lt_datex-date_to    = 'X'.
        lt_datex-time_to    = 'X'.
        lt_datex-show_local = 'X'.
        lt_datex-mode      = 'X'.
        append: lt_date, lt_datex.
    Regards,
    Sandeep

    Hi,
    Here is a sample code for you.
    *& Report  YAM_TEST_CONT_END_DATE                                      *
    REPORT  yam_test_cont_end_date                  .
    DATA: lit_header_guid TYPE crmt_object_guid_tab,
          lit_appointment TYPE crmt_appointment_comt,
          lit_status_comt TYPE crmt_status_comt,
          wa_status_comt  LIKE LINE OF lit_status_comt.
    DATA : lit_ret          TYPE TABLE OF bapiret2,
           lit_obj_to_save  TYPE TABLE OF bapibus20001_guid_dis,
           lit_saved_obj    TYPE TABLE OF bapibus20001_object_id.
    DATA: lv_header_guid   TYPE crmt_object_guid,
          lv_item_guid     TYPE crmt_object_guid,
          lv_timestamp(15) TYPE c.
    DATA: lit_fname TYPE crmt_input_field_names_tab,
          wa_fname  TYPE crmt_input_field_names.
    DATA: lit_input TYPE crmt_input_field_tab,
          wa_input  TYPE crmt_input_field.
    DATA: wa_appointment      TYPE  crmt_appointment_com,
          wa_logical_date_key TYPE  crmt_date_logical_date_key.
    CONSTANTS: lc_end       TYPE crmt_apptype     VALUE 'CONTEND',
               lc_appt      TYPE crmt_fieldname   VALUE 'APPT_TYPE',
               lc_from      TYPE crmt_fieldname   VALUE 'TIMESTAMP_FROM',
               lc_to        TYPE crmt_fieldname   VALUE 'TIMESTAMP_TO',
               lc_obj       TYPE crmt_object_name VALUE 'APPOINTMENT',
               lc_tzone_from(13) TYPE c           VALUE 'TIMEZONE_FROM',
               lc_tzone_to(11)   TYPE c           VALUE 'TIMEZONE_TO'.
    PARAMETER: p_objid TYPE crmt_object_id.
    START-OF-SELECTION.
    * Get the HEADER GUID for the Contract Number
      SELECT SINGLE guid
        INTO lv_header_guid
        FROM crmd_orderadm_h
       WHERE object_id EQ p_objid.
      CHECK sy-subrc EQ 0.
    * Get the Item GUID for the HEADER GUID
      SELECT SINGLE guid
        INTO lv_item_guid
        FROM crmd_orderadm_i
       WHERE header EQ lv_header_guid.
      CHECK sy-subrc EQ 0.
      APPEND lv_header_guid TO lit_header_guid.
      APPEND lv_header_guid TO lit_obj_to_save.
    * Convert System date and time to timestamp
      CONCATENATE sy-datum sy-uzeit INTO lv_timestamp.
    * Setting Contract End Date
      MOVE: lv_item_guid          TO wa_appointment-ref_guid,
            'B'                   TO wa_appointment-ref_kind,
            'CONTEND'             TO wa_appointment-appt_type,
            lv_timestamp          TO wa_appointment-timestamp_from,
            lv_timestamp          TO wa_appointment-timestamp_to,
            sy-zonlo              TO wa_appointment-timezone_to,
            sy-zonlo              TO wa_appointment-timezone_from.
    * Filling the Input Fields for Appointment
      wa_fname-fieldname = lc_appt.
      INSERT wa_fname INTO TABLE lit_fname.
      CLEAR: wa_fname.
      wa_fname-fieldname = lc_from.
      INSERT wa_fname INTO TABLE lit_fname.
      CLEAR: wa_fname.
      wa_fname-fieldname = lc_to.
      INSERT wa_fname INTO TABLE lit_fname.
      CLEAR: wa_fname.
      wa_fname-fieldname = lc_tzone_from.
      INSERT wa_fname INTO TABLE lit_fname.
      CLEAR: wa_fname.
      wa_fname-fieldname = lc_tzone_to.
      INSERT wa_fname INTO TABLE lit_fname.
      CLEAR: wa_fname.
      wa_logical_date_key-appt_type = lc_end.
      MOVE: lv_item_guid          TO wa_input-ref_guid,
            'B'                   TO wa_input-ref_kind,
            lc_obj                TO wa_input-objectname,
            wa_logical_date_key   TO wa_input-logical_key,
            lit_fname             TO wa_input-field_names.
      APPEND wa_input TO lit_input.
      CLEAR: wa_input, wa_logical_date_key.
      APPEND wa_appointment TO lit_appointment.
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
        EXPORTING
          it_appointment    = lit_appointment
          it_status         = lit_status_comt
        CHANGING
          ct_input_fields   = lit_input
        EXCEPTIONS
          error_occurred    = 1
          document_locked   = 2
          no_change_allowed = 3
          no_authority      = 4
          OTHERS            = 5.
      CHECK sy-subrc EQ 0.
    * Saving the items alone
      CALL FUNCTION 'BAPI_BUSPROCESSND_SAVE'
        TABLES
          objects_to_save = lit_obj_to_save
          saved_objects   = lit_saved_obj
          return          = lit_ret.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    <b>Reward points if it helps.</b>
    Regards,
    Amit Mishra

  • Added new field to cube but data not passed from DSO

    Hope someone can help.
    (BI 7.0) We added new fields into a cube. The fields already existed in the DSO. When we ran the process chain in development for the first time after making this change, we notice that the 'historical' data for these fields is populated in the cube. When we do this in our quality system only new data passed to the cube is updated. In development in the sub-chain DTP request we see all previous requests listed under selections. In quality it is only the latest request. The only difference is that the DeltaInit flag in the DTP request in development is ticked (extraction mode) - but not in quality. Does anyone know whyb this is?

    hi peter,
    Adding fields to cube doesn't affect delta status...The delta DTP should be able to handle delta requests automatically.
    I guess in you quality system, the cube already got all requests updated from ODS before you importing the change request. And in develop system none of the requests in ODS were updated before the change.
    Regards,
    Frank

  • How to call a rtf template from another rtf template by passing a value

    Hi Gurus,
    Its about calling a rtf template from another rtf template by passing a value.
    My requirement is like:
    I got a quote report from Siebel, based on the product PartNumber I need to pull product description or literature from another database database.
    My approach is something like; get a partnumber from quote report pass it to another rtf template which uses the partnumber and get the data from table using DataSource. When user pull a quote report from siebel this new rtf template should attach to the quote at the end.
    I've gone through all available blogs about sub-reports and white papers from Oracle they are not much helpful since I need step-by-step.
    http://www.adivaconsulting.com/adiva-blog/item/36-working-with-rtf-sub-templates.html
    bip-subtemplate-1-132933.pdf
    I'm using 10g obiee integrated with Siebel.
    Just started learning BIP.
    Thanks in advance.
    Edited by: 911927 on Apr 2, 2013 8:56 AM
    Edited by: 911927 on Apr 2, 2013 8:57 AM

    How to call a rtf template from another rtf template by passing a value try in main template create hyperlink of url with parameters for another template
    http://bipconsulting.blogspot.ru/2010/02/drill-down-to-detail-or-another-report.html
    When user pull a quote report from siebel this new rtf template should attach to the quote at the end.it'll be only another report
    IMHO you can not attach it to main. it'll be second independent report
    you can try subtemplate but it's not about rtf from rtf by click
    it's about call automatically rtf subtemplate from main rtf based on some conditions
    for example, main template contain some data and if some condition is true then call subtemplate and place it instead of its condition

  • Report parameter field value has a single quote. need to escape before pass

    Report has a parameter whose value might have a single quote in it. If I pass that value directly into the SQL Command... like
    where ... user_name = {?parm_user_name}...
    which would translate to
    user_name='O'Donnel Honda'
    I am getting an error... so would like to convert this parameter value into 'O''Donnel Honda' before passing into the query.
    I created a formula called parse_user_name with following:
    Replace ({?parm_user_name}, "'", "''")
    And used in the query like
    where ... user_name = {@parse_user_name}...
    I am getting an error like invalid SQL92 character...

    I think you should use the condition like this
    where ... user_name = '{?parm_user_name}'
    keep the parameter in single quote at the command level itself.
    Now use the same formula like
    replace({?Parameter},"'","''")
    This works only if the parameter is a single value parameter but not multi value parameter.
    Regards,
    Raghavendra

  • [Interface] - Passing variety parameters/input to PL/SQL report

    Hi,
    I've the PL/SQL report which can allow passing in the parameter, i use '&'.
    the report is given to the end user who do not have the IDE for PL/SQL. the machanism of the report is generated into the spool file and import into excel format.
    now i am wondering how to create a tool using SQL or PL/SQL to allow the end user to choose the parameter(s) dynamically and passing into the PL/SQL to generate the report based on the input selected.
    the parameters like below:
    package code :
    week no :
    year :
    department :
    all the above parameters, the data would be selected from the existing lookup table. the user is allow to select more than 1 input for specified parameter for instance i want to spool report for week 1 until week 5.
    pls advise any solution on this topic. thanks

    hi scoot,
    thank for reply.
    yep, i'm using sql*plus and also sql navigator 4.0 .
    the user don't have the software to interact. i'm thinking of build an simple interface using VB and passing in the parameter then initiate the sql*plus to run the program in background mode.
    but if you have any other solution which not need to use other software to wirte such program , pls let me know immediately. thank

  • How to pass Schedule lines of an item Line to 'BAPI_QUOTATION_CREATEFROMDAT

    Hi Friends,
    I am trying to create Sales Quotation using the  'BAPI_QUOTATION_CREATEFROMDATA2'  from Webdynpro Application.
    I am able to create the quotation with Line items, but I am not able to pass the multiple schedul line for an Item line.
    it takes,but it checks the item availabilty and propses the delivery propsal dates.
    but my requirement is It should take only the schedule line items which I am passing to BAPI,because I do the availability check in my application and pass those schdule line items to BAPI.
    If I pass only one schedule line item then should create only with one schdule line item,If I pass Muliple then it should create schedul lines for item line.
    Please help me in solving the issue.
    Regards,
    Xavier.P

    Hi max,
    loop at lt_nd_quote_items into ls_nd_quote_items.
        lv_item = lv_item + 10.
    *Check weather Availablity check is done or not.
        read table lt_nd_schedule_lines into ls_nd_schedule_lines
                           with key matnr = ls_nd_quote_items-matnr.
        if sy-subrc = 0.
          loop at lt_nd_schedule_lines into ls_nd_schedule_lines
                            where matnr = ls_nd_quote_items-matnr
                            and   kwmeng = ls_nd_quote_items-kwmeng.
            lv_sch_line = lv_sch_line + '0001'.
            wa_order_schedule-itm_number         = lv_item.
            wa_order_schedule_inx-itm_number     = lv_item.
            wa_order_schedule-sched_line         = lv_sch_line.
            wa_order_schedule_inx-sched_line     = lv_sch_line.
            wa_order_schedule-req_date           = ls_nd_schedule_lines-delv_date.
            wa_order_schedule_inx-req_date       = c_abap_true.
            wa_order_schedule-req_qty            = ls_nd_schedule_lines-kwmeng.
            wa_order_schedule_inx-req_qty        = c_abap_true.
            wa_order_schedule-SCHED_TYPE         = 'BP'.
            wa_order_schedule_inx-SCHED_TYPE     = 'X'.
            wa_order_schedule-MS_DATE = ls_nd_schedule_lines-delv_date.
            wa_order_schedule_inx-MS_DATE = 'X'.
            wa_order_schedule_inx-updateflag     = 'I'.
            append:wa_order_schedule to  it_order_schedule,
                   wa_order_schedule_inx to it_order_schedule_inx.
            clear:ls_nd_schedule_lines.
          endloop.
        else.
    *If no Availablity check is done,pass the item details to schedule lines.
          lv_sch_line = lv_sch_line + sy-tabix.
          wa_order_schedule-itm_number         = lv_item.
          wa_order_schedule_inx-itm_number     = lv_item.
          wa_order_schedule-sched_line         = lv_sch_line.
          wa_order_schedule_inx-sched_line     = lv_sch_line.
          wa_order_schedule-req_date           = ls_nd_quote_items-delivery_on.
          wa_order_schedule_inx-req_date       = c_abap_true.
          wa_order_schedule-req_qty            = ls_nd_quote_items-kwmeng.
          wa_order_schedule_inx-req_qty        = c_abap_true.
          wa_order_schedule_inx-updateflag     = 'I'.
          append:wa_order_schedule to  it_order_schedule,
                 wa_order_schedule_inx to it_order_schedule_inx.
        endif.
        clear:ls_nd_quote_items,lv_sch_line.
      endloop.
    Max,  the internal table lt_nd_schedule_lines  is containg my schedule lines,if there are no lines in that table i am just passing the default line item details so that the BAPI take care of schdule line for that Line item.
    Could you please help me in figuring the issue?
    Regards,
    Xavier.P

  • To pass new session variable value to stored proc before running a report.

    Hi,
    Below is summary of the report requirement -
    Database level design
    1. Created a view and a global temporary table (GTT)
    2. Created an Oracle package procedure to accept from and to business dates on basis of which it will fetch, process and populate the GTT.
    Repository level design
    1. Created a business model containing the view and the GTT (mentioned above)
    2. Created two SESSION variables "from_dt" and "to_dt" to be initialized by their respective init blocks. Each of the variable is initialized with a DATE column value (of type DATETIME) from a database lookup table. I have also set the option "Enable that variable to be set by any user" for both variables.
    Query for these variables :
    from_dt = select from_date from <table>
    to_dt = select add_months(from_date,12) from <table>
    Presentation level design
    1. Using a text box, i display the default/initialized values of these variables like this -
    Current business date:@{biServer.variables['NQ_SESSION.from_dt']} Future business dt:@{biServer.variables['NQ_SESSION.to_dt']}
    Dates get displayed in YYYY-MM-DD 00:00:00 format
    The text msg displays these default dates and allows the user to specift different date range for which i create prompts as shown below.
    2. Using any random two columns of date type from the business model, i create two date dashboard prompts with labels "From Dt" and "To Dt".
    i select Calender Controls for both; setting Default To = Report Defaults.
    The Set Variable is set to Presentation variables - such that pv_from_dt maps to "From Dt" and pv_to_dt maps to "To Dt".
    3. i create the report using the business model created above. In the report "Advanced Tab" => "Prefix" field i specify the following -
    SET VARIABLE from_dt='@{pv_from_dt}',to_dt='@{pv_to_dt}';
    Note : The logic here is to display the default dates and allow user to specify different date values which will be stored in presentation variables.
    If the user does specify different "from dt" and "to dt" values, then using the presentation variables, i want to "write" back these new values to the corresponding session variables mentioned above.
    If the user does not specify different date range, then the default/initialized dates must be considered.
    I also display the default and new date values in the report title.
    Back to Repository level design
    To execute the stored procedure that will load the GTT before running the report I need to pass two date parameters to the stored procedure on basis of which it will fetch data, process and populate the GTT.
    In the Connection Pool --> Connection Script Tab --> Execute before query, I wrote the below query using the repository variables FROM_DT and TO_DT to execute the procedure -
    DECLARE
    v_from_dt date;
    v_to_dt date;
    BEGIN
    v_from_dt := VALUEOF(From_Dt);
    v_to_dt := VALUEOF(To_Dt);
    package_name1.package_body(v_from_dt,v_to_dt);
    END;
    Now when i try to run the report i get the following error :
    [nQSError: 10058] A general error has occurred. [nQSError: 23006] The session variable, NQ_SESSION.to_dt, has no value definition. (HY000)..
    Need help on this.
    Is it possible to "write back" a new value to a session variable ?
    Any other alternatives.
    Thanks
    Nusrat
    Edited by: user10309945 on Jan 24, 2011 10:08 PM

    Sandeep, I found a several topics where users describe saving values in DB through stored procedure or function. For example, [How to store OBIEE presentation level variable values in DB |http://forums.oracle.com/forums/thread.jspa?threadID=892006] I tried it and get an error
    *10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 14551, message: ORA-14551: cannot perform a DML operation inside a query ORA-06512*
    It's not a BI error. This error are generated by Oracle DB. If I write next:
    SELECT MyPLSQLFunction(p1,p2) FROM DUAL
    I get the same error.
    Oracle doesn't allow DML operations in SELECT.
    Did you relalize this feature yourself? Where did I mistake?

  • Background Job pass value

    Hi, I am calling a Background job in my program. I am using JOB_OPEN, JOB_SUBMIT and JOB_CLOSE FM to start a job. My need is to pass a value to the job program(job program doesnt have any selection screen values). Is their any way without creating variants each time to pass value to it.
    Please advice.....

    Hello,
    You can first use  JOB_OPEN which returns job number. Then build ranges or parameters to use SUBMIT to call the program.
    Eg: SUBMIT RM06BB20 AND RETURN
          WITH S_EKGRP IN R_EKGRP
          WITH S_EKORG IN R_EKORG
          WITH S_FLIEF IN R_FLIEF
          WITH S_KONNR IN R_KONNR
          USER sy-uname VIA JOB w_jobname
          NUMBER w_job_number.
    Now use JOB_CLOSE.
    Thanks,
    Venu

  • Job scheduling(passing the values to the child program)

    when i'm trying to schedule a background job(using job_open job_submit and job_close) i'm passing the values of the selection screen(parent program) to my child program using set parameter id. And trying to get the values using get parameter id in the cild program.
    But the values of the parent program are not being passed to the child program what may be the cause for it?

    rathan,
    Why con't you use
    SUBMIT... [VIA SELECTION-SCREEN]
    [USING SELECTION-SET <var>]
    [WITH <sel> <criterion>]
    [WITH FREE SELECTIONS <freesel>]
    [WITH SELECTION-TABLE <rspar>].
    When you start an executable program, the standard selection screen normally appears, containing the selection criteria and parameters of both the logical database connected to the program and of the program itself (see Direct Execution - Reports). When you start an executable program using SUBMIT, there are various additions that you can use to fill the input fields on the selection screen:
    SUBMIT... [VIA SELECTION-SCREEN]
    [USING SELECTION-SET <var>]
    [WITH <sel> <criterion>]
    [WITH FREE SELECTIONS <freesel>]
    [WITH SELECTION-TABLE <rspar>].
    These options have the following effects:
    VIA SELECTION-SCREEN
    The selection screen of the called executable program (report) appears. If you transfer values to the program using one or more of the other options, the corresponding input fields in the selections screen are filled. The user can change these values. By default, the system does not display a selection screen after SUBMIT.
    USING SELECTION-SET <var>
    This option tells the system to start the called program with the variant <var>.
    WITH <sel> <criterion>
    Use this option to fill individual elements <sel> of the selection screen (selection tables and parameters). Use one of the elements <criterion>:
    <op> <f> [SIGN <s>], for single value selection
    If <sel> is a selection criterion, use <op> to fill the OPTION field, <f> to fill the LOW field, and <s> to fill the SIGN field of the selection table <sel> in the called program.
    If <sel> is a parameter, you can use any operator for <op>. The parameter <sel> is always filled with <f>.
    [NOT] BETWEEN <f1> AND <f2> [SIGN <s>], for interval selection
    <f1> is transferred into the LOW field, <f2> into the HIGH field, and <s> into the SIGN field of the selection table <sel> in the called program. If you omit the NOT option, the system places the value BT into the OPTION field; if you use NOT, the system fills OPTION with NB.
    IN <seltab>, transferring a selection table
    This addition fills the selection table <sel> in the called program with the values of the table <seltab> in the calling program. Table <seltab> must have the structure of a selection table. Use the RANGES statement to create selection tables.
    WITH FREE SELECTION <freesel>, user dialog for dynamic selections
    To use this option, the called program must be connected to a logical database that supports dynamic selections. In the calling program, use the function modules FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG. They allow the user to enter dynamic selections on a selection screen. One export parameter of these function modules has structure RSDS_TEXPR from the RSDS type group. Transfer the values of this export parameter by means of the internal table <freesel> of the same structure to the called report.
    WITH SELECTION-TABLE <rspar>, dynamic transfer of values
    You need an internal table <rspar> with the Dictionary structure RSPARAMS. The table then consists of the following six fields:
    SELNAME (type C, length 8) for the name of the selection criterion or parameter
    KIND (type C, length 1) for the selection type (S for selection criterion, P for parameter)
    SIGN, OPTION, LOW, HIGH as in a normal selection table, except that LOW and HIGH both have type C and length 45.
    This table can be filled dynamically in the calling program with all of the required values for the selection screen of the called program. If the name of a selection criterion appears more than once, the system creates a multiple-line selection table for that criterion in the called program. If the name of a parameter appears more than once, the system uses the last value. Note that LOW and HIGH have type C, so that the system executes type conversions to the criteria of the called program. This is important for date fields, for example. Before your program is used in a live context, you should check it using the VIA SELECTION-SCREEN addition.
    Except for WITH SELECTION-TABLE, you can use any of the above options several times and in any combination within a SUBMIT statement. In particular, you can use the WITH <sel> option several times for one single criterion <sel>. In the called program, the system appends the corresponding lines to the selection tables used. For parameters, it uses the last value specified. The only combination possible for the WITH SELECTION-TABLE option is USING SELECTION-SET.
    If the input fields on the selection screen are linked to SPA/GPA parameters, you can also use this technique to pass values to the selection screen (see Passing Data Between Programs).
    The following executable program (report) creates a selection screen containing the parameter PARAMET and the selection criterion SELECTO:
    REPORT  demo_program_submit_rep1.
    DATA number TYPE i.
    PARAMETERS      paramet(14) TYPE c.
    SELECT-OPTIONS  selecto FOR number.
    The program DEMO_PROGRAM_SUBMIT_REP1 is called by the following program using various parameters:
    REPORT demo_program_submit_sel_screen NO STANDARD PAGE HEADING.
    DATA: int TYPE i,
          rspar TYPE TABLE OF rsparams,
          wa_rspar LIKE LINE OF rspar.
    RANGES seltab FOR int.
    WRITE: 'Select a Selection!',
    SKIP.
    FORMAT HOTSPOT COLOR 5 INVERSE ON.
    WRITE: 'Selection 1',
         / 'Selection 2'.
    AT LINE-SELECTION.
      CASE sy-lilli.
        WHEN 4.
          seltab-sign = 'I'. seltab-option = 'BT'.
          seltab-low  = 1.   seltab-high   = 5.
          APPEND seltab.
          SUBMIT demo_program_submit_rep1 VIA SELECTION-SCREEN
                          WITH paramet eq 'Selection 1'
                          WITH selecto IN seltab
                          WITH selecto ne 3
                          AND RETURN.
        WHEN 5.
          wa_rspar-selname = 'SELECTO'. wa_rspar-kind = 'S'.
          wa_rspar-sign = 'E'. wa_rspar-option = 'BT'.
          wa_rspar-low  = 14.  wa_rspar-high = 17.
          APPEND wa_rspar TO rspar.
          wa_rspar-selname = 'PARAMET'. wa_rspar-kind = 'P'.
          wa_rspar-low  = 'Selection 2'.
          APPEND wa_rspar TO rspar.
          wa_rspar-selname = 'SELECTO'. wa_rspar-kind = 'S'.
          wa_rspar-sign = 'I'. wa_rspar-option = 'GT'.
          wa_rspar-low  = 10.
          APPEND wa_rspar TO rspar.
          SUBMIT demo_program_submit_rep1 VIA SELECTION-SCREEN
                          WITH SELECTION-TABLE rspar
                          AND RETURN.
      ENDCASE.
    Pls. reward if useful...

Maybe you are looking for