Crm_order_maintain  . create items.

hi all.
i have to update order using fm crm_order_maintian.
i am able to update header but when i c order using crm_order_read there is no item data  now i have to craete items of header.
please suggest how to create items  in order using crm_order_maintain....
Message was edited by:
        gaurav jain

Hi Gaurav,
The following the  code i used to add  a product( Item ) to Service order.
Service Contract Updating while Sales Order Creation
FUNCTION zzomotc_sc_update.
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(IV_GUID) TYPE  CRMT_OBJECT_GUID
*"  CHANGING
*"     VALUE(CV_OWN_MESSAGE) TYPE  CRMT_BOOLEAN OPTIONAL
***&                             Constants                                             *
  CONSTANTS: c_stparty     TYPE comt_partner_fct VALUE '00000001'.     "Sold-To-Party
*&                            Internal Tables  Declaration                           *
  DATA:i_orderadm_h        TYPE crmt_orderadm_h_wrkt,
       i_orderadm_i        TYPE crmt_orderadm_i_wrkt,
       i_orderadmsc_i      TYPE crmt_orderadm_i_wrkt,
       i_itemdet           TYPE crmt_orderadm_i_comt,
       i_product_i         TYPE crmt_product_i_wrkt,
       i_sales             TYPE crmt_sales_wrkt,
       i_orgman            TYPE crmt_orgman_wrkt,
       i_shipping          TYPE crmt_shipping_wrkt,
       i_schedlin          TYPE crmt_schedlin_wrkt,
       i_partner           TYPE crmt_partner_external_wrkt,
       i_guid_header       TYPE crmt_object_guid_tab,
       i_status            TYPE crmt_status_wrkt,
       i_text              TYPE crmt_text_wrkt,
       i_billing           TYPE crmt_billing_wrkt,
       i_service_contracts TYPE TABLE OF crmt_portal_resultlist,
       i_customer_h        TYPE crmt_customer_h_wrkt,
       i_customer_i        TYPE crmt_customer_i_wrkt,
       i_input_fields      TYPE crmt_input_field_tab,
       i_sales_sc          TYPE crmt_sales_comt,
       i_field_names       TYPE crmt_input_field_names_tab,
       i_guid_save         TYPE crmt_object_guid_tab.
*&                 Local structure/Work Area Declaration                             *
  DATA:st_sales            TYPE crmt_sales_wrk,
       st_shipping         TYPE crmt_shipping_wrk,
       st_orderadm_i       TYPE crmt_orderadm_i_wrk,
       st_orderadmsc_i     TYPE crmt_orderadm_i_wrk,
       st_orderadmsc1_i    TYPE crmt_orderadm_i_wrk,
       st_partner          TYPE crmt_partner_external_wrk,
       st_billing          TYPE crmt_billing_wrk,
       st_customer_i       TYPE crmt_customer_i_wrk,
       st_service          TYPE crmt_portal_resultlist,
       st_input_fields     TYPE crmt_input_field,
       st_field_names      TYPE crmt_input_field_names,
       st_itemdet          TYPE crmt_orderadm_i_com.
*&                         local Variables Declaration                               *
  DATA: l_guid            TYPE crmt_object_guid,
        l_flag            TYPE c VALUE ' ',
        l_partner_fct     TYPE crmt_portal_service_search-partner_fct,
        l_partner_no      TYPE crmt_portal_service_search-bu_partner.
  CHECK iv_guid IS NOT INITIAL.
  COLLECT iv_guid INTO i_guid_header.
  CALL FUNCTION 'CRM_ORDER_READ'
    EXPORTING
      it_header_guid       = i_guid_header
    IMPORTING
      et_orderadm_h        = i_orderadm_h
      et_orderadm_i        = i_orderadm_i
      et_product_i         = i_product_i
      et_customer_h        = i_customer_h
      et_customer_i        = i_customer_i
      et_sales             = i_sales
      et_orgman                = i_orgman
      et_shipping          = i_shipping
      et_billing           = i_billing
      et_schedlin          = i_schedlin
      et_partner           = i_partner
      et_text              = i_text
    EXCEPTIONS
      document_not_found   = 1
      error_occurred       = 2
      document_locked      = 3
      no_change_authority  = 4
      no_display_authority = 5
      no_change_allowed    = 6
      OTHERS               = 7.
  IF sy-subrc <> 0.
** SO Order doesn't exists
  ENDIF.
***Get partner function as sold-to-party
  DELETE ADJACENT DUPLICATES FROM i_partner.
  READ TABLE i_partner WITH KEY partner_fct = c_stparty  INTO st_partner.
  LOOP AT i_orderadm_i INTO st_orderadm_i.
    IF ( st_orderadm_i-itm_type EQ 'ZTAP' ) OR  ( st_orderadm_i-itm_type EQ 'ZWVN' ) OR
       ( st_orderadm_i-itm_type EQ 'ZCPP' ) OR  ( st_orderadm_i-itm_type EQ 'YWVN' ).
**    Search a valid Service contract based on customer i.e.sold-to-party and product combination
      l_partner_fct = c_stparty.
      l_partner_no  = st_partner-partner_no.
      CALL FUNCTION 'CRM_SERVICE_CONTRACTS_SEARCH'
        EXPORTING
          partner_function      = l_partner_fct
          partner_number        = l_partner_no
*          product_id            = st_orderadm_i-ordered_prod
*          to                    = sy-datum
        TABLES
          service_contract_list = i_service_contracts.
      IF i_service_contracts[] IS NOT INITIAL.
        LOOP AT i_service_contracts INTO st_service WHERE date_end GE sy-datum.
          REFRESH  i_guid_header.
          COLLECT st_service-guid INTO  i_guid_header.
          CALL FUNCTION 'CRM_ORDER_READ'
            EXPORTING
              it_header_guid       = i_guid_header
            IMPORTING
              et_orderadm_i        = i_orderadmsc_i
            EXCEPTIONS
              document_not_found   = 1
              error_occurred       = 2
              document_locked      = 3
              no_change_authority  = 4
              no_display_authority = 5
              no_change_allowed    = 6
              OTHERS               = 7.
          READ TABLE i_orderadmsc_i INTO st_orderadmsc_i
              WITH KEY ordered_prod = st_orderadm_i-ordered_prod.
          IF sy-subrc EQ 0.
            l_flag = 'X'.
            l_guid = st_service-guid.
            EXIT.
          ENDIF.
        ENDLOOP.
****    Deactivate the line item of existing service contract and add new service item to this contract
        IF  l_flag EQ 'X'.
          REFRESH : i_guid_header, i_orderadm_h, i_orderadmsc_i.
          COLLECT l_guid INTO  i_guid_header.
          CALL FUNCTION 'CRM_ORDER_READ'
            EXPORTING
              it_header_guid       = i_guid_header
            IMPORTING
              et_orderadm_h        = i_orderadm_h
              et_orderadm_i        = i_orderadmsc_i
*              et_pricing_i         = i_pricing_i
              et_status            = i_status
            EXCEPTIONS
              document_not_found   = 1
              error_occurred       = 2
              document_locked      = 3
              no_change_authority  = 4
              no_display_authority = 5
              no_change_allowed    = 6
              OTHERS               = 7.
          READ TABLE i_orderadmsc_i INTO st_orderadmsc_i INDEX sy-tabix.
          st_input_fields-ref_guid     = st_orderadmsc_i-guid.
          st_input_fields-ref_kind     = 'B'.
          st_input_fields-objectname   = 'ORDERADM_I'.
          st_field_names-fieldname     = 'MODE'.
          APPEND st_field_names TO i_field_names.
          st_field_names-fieldname     = 'ORDERED_PROD'.
          APPEND st_field_names TO i_field_names.
          st_input_fields-field_names   = i_field_names.
          APPEND st_input_fields TO i_input_fields.
          REFRESH i_field_names.
          st_input_fields-ref_guid     = st_orderadmsc_i-guid.
          st_input_fields-ref_kind     = 'B'.
          st_input_fields-objectname   = 'PRODUCT_I'.
          st_field_names-fieldname     = 'PROCESS_QTY_UNIT'.
          APPEND st_field_names TO i_field_names.
          st_input_fields-field_names   = i_field_names.
          APPEND st_input_fields TO i_input_fields.
          REFRESH i_field_names.
          st_input_fields-ref_guid     = st_orderadmsc_i-guid.
          st_input_fields-ref_kind     = 'B'.
          st_input_fields-objectname   = 'SCHEDLIN'.
          st_field_names-fieldname     = 'QUANTITY'.
          APPEND st_field_names TO i_field_names.
          st_input_fields-field_names   = i_field_names.
          APPEND st_input_fields TO i_input_fields.
          REFRESH i_field_names.
          MOVE-CORRESPONDING st_orderadmsc_i TO st_itemdet.
*          st_orderadmsc1_i-header       =  st_orderadmsc_i-header.
*          st_orderadmsc1_i-ordered_prod =  st_orderadm_i-ordered_prod.
          APPEND  st_itemdet TO i_itemdet.
          CALL FUNCTION 'CRM_ORDER_MAINTAIN'
*            EXPORTING
**              it_pricing_i      = i_pricing_i
*              it_product_i      = i_product_i
*              it_schedlin_i     = i_schedlin_i
            CHANGING
              ct_orderadm_i     = i_itemdet
              ct_input_fields   = i_input_fields
            EXCEPTIONS
              error_occurred    = 1
              document_locked   = 2
              no_change_allowed = 3
              no_authority      = 4
              OTHERS            = 5.
          IF sy-subrc EQ 0.
            COLLECT l_guid INTO i_guid_save.
            CALL FUNCTION 'CRM_ORDER_SAVE'
              EXPORTING
                it_objects_to_save = i_guid_save
              EXCEPTIONS
                document_not_saved = 1
                OTHERS             = 2.
            CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
            REFRESH i_guid_save.
            l_flag = 'X'.
          ENDIF.
        ELSE.
          REFRESH: i_guid_header, i_orderadmsc_i.
          READ TABLE  i_service_contracts INTO st_service INDEX 1.
          COLLECT st_service-guid INTO  i_guid_header.
          CALL FUNCTION 'CRM_ORDER_READ'
            EXPORTING
              it_header_guid       = i_guid_header
            IMPORTING
              et_orderadm_h        = i_orderadm_h
              et_orderadm_i        = i_orderadmsc_i
*              et_pricing_i         = i_pricing_i
              et_status            = i_status
            EXCEPTIONS
              document_not_found   = 1
              error_occurred       = 2
              document_locked      = 3
              no_change_authority  = 4
              no_display_authority = 5
              no_change_allowed    = 6
              OTHERS               = 7.
          READ TABLE i_orderadmsc_i INTO st_orderadmsc_i INDEX sy-tabix.
          st_input_fields-ref_guid     = st_orderadmsc_i-guid.
          st_input_fields-ref_kind     = 'B'.
          st_input_fields-objectname   = 'ORDERADM_I'.
          st_field_names-fieldname     = 'MODE'.
          APPEND st_field_names TO i_field_names.
          st_field_names-fieldname     = 'ORDERED_PROD'.
          APPEND st_field_names TO i_field_names.
          st_input_fields-field_names   = i_field_names.
          APPEND st_input_fields TO i_input_fields.
          REFRESH i_field_names.
          st_input_fields-ref_guid     = st_orderadmsc_i-guid.
          st_input_fields-ref_kind     = 'B'.
          st_input_fields-objectname   = 'PRODUCT_I'.
          st_field_names-fieldname     = 'PROCESS_QTY_UNIT'.
          APPEND st_field_names TO i_field_names.
          st_input_fields-field_names   = i_field_names.
          APPEND st_input_fields TO i_input_fields.
          REFRESH i_field_names.
          st_input_fields-ref_guid     = st_orderadmsc_i-guid.
          st_input_fields-ref_kind     = 'B'.
          st_input_fields-objectname   = 'SCHEDLIN'.
          st_field_names-fieldname     = 'QUANTITY'.
          APPEND st_field_names TO i_field_names.
          st_input_fields-field_names   = i_field_names.
          APPEND st_input_fields TO i_input_fields.
          REFRESH i_field_names.
          st_orderadmsc1_i-header       =  st_orderadmsc_i-header.
          st_orderadmsc1_i-ordered_prod =  st_orderadm_i-ordered_prod.
          APPEND  st_orderadmsc1_i TO i_orderadmsc_i.
          MOVE-CORRESPONDING st_orderadmsc1_i TO st_itemdet.
          APPEND  st_itemdet TO i_itemdet.
          CALL FUNCTION 'CRM_ORDER_MAINTAIN'
*            EXPORTING
**              it_pricing_i      = i_pricing_i
*              it_product_i      = i_product_i
*              it_schedlin_i     = i_schedlin_i
            CHANGING
              ct_orderadm_i     = i_itemdet
              ct_input_fields   = i_input_fields
            EXCEPTIONS
              error_occurred    = 1
              document_locked   = 2
              no_change_allowed = 3
              no_authority      = 4
              OTHERS            = 5.
          IF sy-subrc EQ 0.
            COLLECT st_service-guid INTO i_guid_save.
            CALL FUNCTION 'CRM_ORDER_SAVE'
              EXPORTING
                it_objects_to_save = i_guid_save
              EXCEPTIONS
                document_not_saved = 1
                OTHERS             = 2.
            CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
            REFRESH i_guid_save.
            l_flag = 'X'.
          ENDIF.
        ENDIF.
      ELSE.
*** Create a new service contract for it and add line item to it.
        DATA: st_servicec_h TYPE crmt_iservice_baskethead_il,
              st_servicec_i TYPE crmt_srv_webreq_item_il ,
              st_screate_h  TYPE crmt_orderadm_h_com,
              st_screate_i  TYPE crmt_orderadm_i_com.
        READ TABLE i_partner INTO st_partner WITH KEY partner_fct  =  '00000001'.
        st_servicec_h-handle          = '00001'.
        st_servicec_h-ref_handle      = '00001'.
        st_servicec_h-process_type    = 'ZSC'.
        st_servicec_h-description     = 'Service Contract'.
        st_servicec_h-descr_language  = 'E'.
        st_servicec_i-handle       = '00002'.
        st_servicec_i-ref_handle   = '00001'.
*          st_servicec_i-ITM_TYPE     =
        st_servicec_i-ordered_prod = st_orderadm_i-ordered_prod.
*          st_servicec_i-ORDER_QTY    =
*        st_servicec_i-QTY_UNIT     =
        CALL FUNCTION 'CRM_SERVICE_ORDER_CREATE'
          EXPORTING
            is_service_baskethead  = st_servicec_h
            is_service_basketitem  = st_servicec_i
            iv_service_productguid = st_orderadm_i-product
            iv_partner_ag          = st_partner-partner_no
            iv_partn_fct_ag        = '00000001'
          IMPORTING
            es_orderadm_h          = st_screate_h
            es_orderadm_i          = st_screate_i
          EXCEPTIONS
            error_occured          = 1
            OTHERS                 = 2.
        IF sy-subrc EQ 0.
          COLLECT st_screate_h-guid INTO i_guid_save.
          CALL FUNCTION 'CRM_ORDER_SAVE'
            EXPORTING
              it_objects_to_save = i_guid_save
            EXCEPTIONS
              document_not_saved = 1
              OTHERS             = 2.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
          REFRESH i_guid_save.
          l_flag = 'X'.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.
ENDFUNCTION.
Actually, this FM was created for updating the service contract while creation of sales order with serivce product as its line item. It search for valid SC for sold-to-Party and checks for the products if not there adds the same product as line item to SC. If SC not avaliable , Creates SC and adds the same product
Hope it will help you.
Regards,
Arjun
<b>Pl. Reward points</b>

Similar Messages

  • Create items using func mod crm_order_maintain

    Hi,
    I am trying to create items within a service order with higher level item. Items are create but higher level item field is blank.
    insert fieldnames
      ls_fldnames-fieldname = 'MODE'.
      insert ls_fldnames into table lt_fldnames.
      ls_fldnames-fieldname = 'ORDERED_PROD'.
      insert ls_fldnames into table lt_fldnames.
    ls_fldnames-fieldname = 'NUMBER_PARENT'.
      ls_fldnames-fieldname = 'PARENT_HANDLE'.
      insert ls_fldnames into table lt_fldnames.
      ls_fldnames-fieldname = 'ITM_PROC_IDENT'.
      insert ls_fldnames into table lt_fldnames.
        ls_ordm_i-header = gv_hdrguid.
        ls_ordm_i-itm_proc_ident = 'SRVC'.
        if gs_hier-parent is not initial.
          ls_ordm_i-ordered_prod = ls_outtab-sor.
        else.
          ls_ordm_i-ordered_prod = ls_outtab-svc_act.
        endif.
        lv_prodid = ls_ordm_i-ordered_prod.
        if lv_prodid co '0123456789 '.
          unpack lv_prodid to lv_prodid.
        endif.
        add 1 to lv_handle.
        ls_ordm_i-mode = 'A'.        "create
        ls_ordm_i-handle = lv_handle.
        if gs_hier-parent is not initial.
          ls_ordm_i-parent_handle = ls_parent-handle.
        endif.
        insert ls_ordm_i into table lt_ordm_i.
        ls_parent-posnr = gv_posnr.
        ls_parent-handle = lv_handle.
        append ls_parent to lt_parent.
        ls_product-ref_handle = lv_handle.
        insert ls_product into table lt_product.
    insert input fields
        ls_inputflds-field_names[] = lt_fldnames[].
        ls_inputflds-ref_handle = lv_Handle.
        ls_inputflds-objectname = 'ORDERADM_I'.
        insert ls_inputflds into table lt_inputflds.
      endloop.
    return selected products back to service order's items
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
        EXPORTING
          it_product_i      = lt_product
        CHANGING
          CT_ORDERADM_I     = lt_ordm_i
          ct_input_fields   = lt_inputflds
        EXCEPTIONS
          ERROR_OCCURRED    = 1
          DOCUMENT_LOCKED   = 2
          NO_CHANGE_ALLOWED = 3
          NO_AUTHORITY      = 4
          OTHERS            = 5.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

    Amit,
    I am calling a action from a service order which will popup a window containing product tree. User will select the products. If a higher level product is select, child product will also be created as items with higher level item.
    As I said the items are showing in the service order, but child item's higher level item is blank.
    Cheers.

  • Workflow does not start automatically on create item (yet another time)

    The topic has been discussed broadly throughout different forums, but I didn't find the solution to my issue yet and hope you can help me out with ideas to sidestep the difficulties created by Microsoft.
    I have one list 1 in Site Collection A, and one list 2 in Site Collection B (PWA site collection). I need to copy an item from list 1 to list 2 with some values. I use a "Call http web service" action to accomplish
    that as I need to copy informatin cross site collections.
    The "Call webservice" is in an App Step, because the user creating an item in list 1 does not have permissions on list 2. Thus, my item is created "by workflow" (not "by System Account") in list 2. Now I need a second
    workflow to start on list 2 which will create a project in Project Server.
    As I am working across 2 site collections, I can not use a SharePoint 2010 workflow with impersonation step for list 1 as the "Call a webservice" action is not available for SP2010 workflows and "Copy item" only works in the same site.
    In Nintex I can impersonate the web service call - is this also somehow possible for SPD2013 workflows? Or is there any other possibility to get over this silly restriction of workflows not starting automatically on System account created items? Someway
    perhaps to tweak the App Step in impersonating with another user account?
    Any help appreciated!
    I really can't understand, that this common requirement is still not solved by Microsoft :-(  I found more threads on the topic than I can count, so this seems to happen quite often... at least they should finally offer a proper way of doing some kind
    of impersonation with the calls so we have a chance to change the creating user account.

    Hi,
    As I understand, you would like to use workflow to copy list items cross site collection.
    So far it is not supported with OOB workflow option, here is an codeplex workaround:
    https://spdactivities.codeplex.com/wikipage?title=Copy%20List%20Item%20Extended%20Activity
    Please check if it can be help.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • This script is not checking the existing of the new created item

    Dear Friends
    I have This script is not checking the existing of the new created item I am using this script in side WHEN-BUTTON-PRESSED trigger
    I am using oracle Forms [32 Bit] Version 6.0.8.11.3 (Production)
    My script as the following :
    BEGIN
    BEGIN
    SELECT ITEM_CODE INTO :GLOBAL.DUMMY
    FROM IM_INVENTORY
    WHERE ITEM_CLASS = TO_NUMBER(RTRIM(LTRIM(:IM_NEW_ITEMS.ITEM_CLASS)))
    AND ITEM_TYPE = TO_NUMBER(RTRIM(LTRIM(:IM_NEW_ITEMS.ITEM_TYPE)))
    AND ITEM_LENGTH = :IM_NEW_ITEMS.ITEM_LENGTH
    AND ITEM_WIDTH = :IM_NEW_ITEMS.ITEM_WIDTH
    AND ITEM_HIGHT1 = :IM_NEW_ITEMS.ITEM_HIGHT1
    AND ITEM_HIGHT2 = :IM_NEW_ITEMS.ITEM_HIGHT2
    AND COLOR_CODE = TO_NUMBER(RTRIM(LTRIM(:IM_NEW_ITEMS.COLOR_CODE)))
    AND SHAPE_CODE = TO_NUMBER(RTRIM(LTRIM(:IM_NEW_ITEMS.SHAPE_CODE)));
    -- get_err_message(87);
    SHOW_MESSAGE('This Item Already Exist !!!');
    RAISE FORM_TRIGGER_FAILURE;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    show_message('here');
    INSERT INTO IM_INVENTORY
    (ITEM_CODE,ITEM_NAME_A,ITEM_NAME_E,STOCK_ITEM,ITEM_CLASS,ITEM_TYPE,SUPP_CODE,ITEM_LENGTH,ITEM_WIDTH,
    ITEM_HIGHT1,ITEM_HIGHT2,COLOR_CODE,SHAPE_CODE,ITEM_SIZE_TYPE,VOLUME,CON_FACTOR,ITEM_PRICE1,
    ITEM_DISCOUNT,MIN_QTY,MAX_QTY,COSTING_METHOD,ITEM_COST,STANDARD_COST,WEIGHT,ITEM_PRICE2,ITEM_PRICE3,
    OPENING_COST,LAST_PUR_COST,QTY_FOR_PRICE2,QTY_FOR_PRICE3,ITEM_PRICE_METHOD,USER_ID,USER_DATE)
    VALUES(:IM_NEW_ITEMS.ITEM_CODE,:GLOBAL.LOC_VAR_A,:GLOBAL.LOC_VAR_E,'1',:IM_NEW_ITEMS.ITEM_CLASS,:IM_NEW_ITEMS.ITEM_TYPE,'0',
    :IM_NEW_ITEMS.ITEM_LENGTH,:IM_NEW_ITEMS.ITEM_WIDTH,:IM_NEW_ITEMS.ITEM_HIGHT1,:IM_NEW_ITEMS.ITEM_HIGHT2,
    NVL(:IM_NEW_ITEMS.COLOR_CODE,0),NVL(:IM_NEW_ITEMS.SHAPE_CODE,0),1,NVL(:IM_NEW_ITEMS.VOLUME,0),1,:GLOBAL.ITEM_PRICE1,0.00,0.00,0.00,'1',0.00,0.00,
    0.00,:GLOBAL.ITEM_PRICE1,:GLOBAL.ITEM_PRICE1,0.000,0.000,0.000,0.000,1,:IM_NEW_ITEMS.USER_ID,:IM_NEW_ITEMS.USER_DATE);
    standard.commit; -- NEW COMMITED
    clear_message; -- NEW COMMITED
         WHEN FORM_TRIGGER_FAILURE THEN
         SHOW_MESSAGE('Error : '||SQLERRM);
    RAISE FORM_TRIGGER_FAILURE ;
    WHEN OTHERS THEN
    SHOW_MESSAGE('Error : '||SQLERRM);
    RAISE FORM_TRIGGER_FAILURE ;
    END;
    END;
    Waiting for your valuable answer .
    Best regards
    Jamil Alshaibani

    Hi,
    I have written the script also with constants values but still it is not going to
    SHOW_MESSAGE('This Item Already Exist !!!');
    and the script is written as the following :
    BEGIN
    SELECT 1 INTO :GLOBAL.DUMMY
    FROM IM_INVENTORY
    WHERE ITEM_CLASS ='110'
    AND ITEM_TYPE ='110105'
    AND ITEM_LENGTH = 1
    AND ITEM_WIDTH = 1
    AND ITEM_HIGHT1 = 1
    AND ITEM_HIGHT2 = 0
    AND COLOR_CODE = '3001'
    AND SHAPE_CODE = '201' ;
    SHOW_MESSAGE('1- This Item Already Exist !!!');
    RAISE FORM_TRIGGER_FAILURE;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    show_message('here');
    INSERT INTO IM_INVENTORY
    (ITEM_CODE,ITEM_NAME_A,ITEM_NAME_E,STOCK_ITEM,ITEM_CLASS,ITEM_TYPE,SUPP_CODE,ITEM_LENGTH,ITEM_WIDTH,
    ITEM_HIGHT1,ITEM_HIGHT2,COLOR_CODE,SHAPE_CODE,ITEM_SIZE_TYPE,VOLUME,CON_FACTOR,ITEM_PRICE1,
    ITEM_DISCOUNT,MIN_QTY,MAX_QTY,COSTING_METHOD,ITEM_COST,STANDARD_COST,WEIGHT,ITEM_PRICE2,ITEM_PRICE3,
    OPENING_COST,LAST_PUR_COST,QTY_FOR_PRICE2,QTY_FOR_PRICE3,ITEM_PRICE_METHOD,USER_ID,USER_DATE)
    VALUES(:IM_NEW_ITEMS.ITEM_CODE,:GLOBAL.LOC_VAR_A,:GLOBAL.LOC_VAR_E,'1',:IM_NEW_ITEMS.ITEM_CLASS,:IM_NEW_ITEMS.ITEM_TYPE,'0',
    :IM_NEW_ITEMS.ITEM_LENGTH,:IM_NEW_ITEMS.ITEM_WIDTH,:IM_NEW_ITEMS.ITEM_HIGHT1,:IM_NEW_ITEMS.ITEM_HIGHT2,
    NVL(:IM_NEW_ITEMS.COLOR_CODE,0),NVL(:IM_NEW_ITEMS.SHAPE_CODE,0),1,NVL(:IM_NEW_ITEMS.VOLUME,0),1,:GLOBAL.ITEM_PRICE1,0.00,0.00,0.00,'1',0.00,0.00,
    0.00,:GLOBAL.ITEM_PRICE1,:GLOBAL.ITEM_PRICE1,0.000,0.000,0.000,0.000,1,:IM_NEW_ITEMS.USER_ID,:IM_NEW_ITEMS.USER_DATE);
    standard.commit; -- NEW COMMITED
    clear_message; -- NEW COMMITED
         WHEN FORM_TRIGGER_FAILURE THEN
         SHOW_MESSAGE('Error : '||SQLERRM);
    RAISE FORM_TRIGGER_FAILURE ;
    WHEN OTHERS THEN
    SHOW_MESSAGE('Error : '||SQLERRM);
    RAISE FORM_TRIGGER_FAILURE ;
    END;
    Best regards
    Jamil

  • Question about "Create Item" page

    Im working on trying to Insert a new item into a Self-Service Web Applications page.
    As part of my research, I have been looking at this doc:
    Oracle® Application Framework
    Personalization Guide
    Release 11i
    Part No. B25439-02
    From:
    http://download.oracle.com/docs/cd/B25516_18/current/acrobat/115fwkpg.pdf
    The document does not seem to go into much detail about how to Insert an item on a page. I also checked the "OA Component Reference" document.
    I checked the online help via "Create Item Page" - e.g.
    http://oursite/pls/PSAT/fndgfm/fnd_help.get/US/FND/CUST_PERSADMIN_CREATEITEM.HTM
    Again, that doesn't give a lot of information.
    As part of my testing / research, I would like to add a new Item to a page, and have the value of the item to be taken from an existing SQL Query.
    For example, in iProcurement, when viewing a Requisition Details, e.g. via this page:
    http://oursite/OA_HTML/OA.jsp?page=/oracle/apps/icx/por/reqmgmt/webui/ReqDetailsPG&reqHeaderId={!!BX6R96mkQOcfNZ60BeTaJQ}&retainAM=Y&addBreadCrumb=Y&_ti=245778094&PersonalizationParam=PersonalizationParamAdmin&oapc=12&oas=mYF7zP1VI7xoAWcUQHTEkQ..
    I would like to add in the "NOTE_TO_AUTHORIZER" field from the "po.po_requisition_headers_all" table.
    From looking at the "About this Page" link, I can see there is a View Object called "oracle.apps.icx.por.reqmgmt.server.ReqHeaderVO".
    This ViewObject contains an Attribute called "NoteToAuthorizer" with a Type of "java.lang.String".
    When I go to the "Create Item" page, and choose and Item Style of "Message Styled Text" there seems to be no way to say which database field you want to include.
    From looking at a previous customisation that a developer did, I can see you can pull in an Attribute via the "View Attribute" field, and link in the VO via the "View Instance" field.
    When inserting database values into a Self-Service page, can we only insert Attributes, and not any of the other regular fields from View Objects?
    Apologies for the rambling essay.
    Any advice much appreciated.
    Thanks

    Hi Jimr,
    In OAF sql queries are represented by View Objects and columns of query will be represented by View Attribute.
    For every column in query there will be corresponding view attribute name, so while adding any item on self service page which represents data from database you need to specify view instance name and view attribute name, which will specify which column and from which query it will show the data.
    *"When I go to the "Create Item" page, I can't work out how to tell Oracle that the Item I want to create should be the "NoteToAuthorizer" field from the "ReqHeaderVO" ViewObject."* so ReqHeaderVO1 will be the instance(by default OAF generates instance like this) and "NoteToAuthorizer" can be mentioned in View Attribute name property.
    Let me know if you need further clarification.
    Regards,
    Reetesh Sharma

  • Newly created item through personalization not visible

    Hi All,
    I have added on new item , in a page,
    Howerver when I clicked apply on that item , once I define the required properties of the item.
    I am getting this error
    "Attachment item "%ITEM" has been created successfully, however, it does not have an Entity Map associated with it. To avoid a runtime error, please either create an Entity Map for this attachment item, or delete attachment item "%ITEM"."
    I am not able to locate that item , anywhere * either in personalzied page nor in application page

    I have gone to personalize page -> selected LOVRN -> create item ->
    level - Site
    Item Type - MessageLOVInput
    Prompt - some custom prompt
    Id - some custom id
    External LOV- given exisitng seeded path for LOV with region name in the last
    apply .
    Then the error appeared as
    Attachment item "%ITEM" has been created successfully, however, it does not have an Entity Map associated with it. To avoid a runtime error, please either create an Entity Map for this attachment item, or delete attachment item "%ITEM". appeared
    After the above steps complete. I have again gone to personalization ->complete view . But I am not able to locate the item created in above mentioned steps.
    One thing to note, I have tried creating new item , however everytime I am getting the above error after clicking on apply. In one occasion I have given incomplete path in the external LOV field mentioned above.(i.e. I forgot to mention the region Name )
    Please help....

  • How to create item wise invoice with reference to sales order.

    Hi ,
    Please let me know how to create item wise invoice with reference to sales order.
    Ex : Sales order has 2 line items .
              When creating invoice system should create two invoices for each line items.
    I have tried with copy control but I am not able to do it.
    Please advise.
    Regards

    Hi,
    Please let us know your exact requirement. Whether you want it to be fixed like only one line item to be billed every time ot it to be based on selection you do every time.
    As per my understanding it should not be fixed and in that case it should like as follows,
    In VF01 you will select Del. document/S.O. number and click on selection list and will take you to next screen as mention below,
    and select desire line item to be billed and click on copy and will take you to billing screen.
    Regards,
    Ajit K Singh

  • Create items by vendor and customer on Foreign Currency Valuation

    When we execute Foreign Currency Valuation, we would like to create items in a document by vendor and customer.
    Can we handle it a 'Corp.group-vendors' flag(Evaluate Accounts According to Group Definition) ?
    Can you help with this issue please?
    Thanks,
    Sato.Ishikawa

    HI,
    With the report SAPF100, you will be able to valuate foreign currencies
    from customer and vendor accounts.
    It is not possible to post a foreign currency valuation directly to a
    vendor or customer account. This is only possible for g/l accounts.
    You can refer to the following workarounds:
    From the technical point of view you can use FB01 to post such a posting
    You have to enter a exchange rate manually in the first screen. In this
    case this exchange rate is used instead of the exhange rate of table
    TCURR (transaction OB08).
    You have to choose a exchange rate which transfer the amount in local
    currency to 0,00 in foreign currency.Another possibility is to use
    RFBIBL00 in transfer type direct input for FB01.An amount of 0 in
    foreign currency should work.
    The system is designed not to post documents with 0 amount in foreign
    currency to vendors/customers.
    Reg
    Madhu M

  • Unable to create item under a region

    Hi All,
    I wanted to create a item under one region in a seeded page. When I went to Personalize page, next to the region where I need to create the item, I don't see the "Create Item" button. But for the other regions I see that button. Any ideas what could be done to enable this?
    Regards,
    Pradeep

    Hi,
    It could be a dynamic region itself or a region extended.
    If its a dynamic region, you will have to do Controller extension to extend it.
    -Idris

  • Add restriction while create item by "Old Purchase Orders and Templates"

    We are consider to add restriction while create shopping cart item by "Old Purchase Orders and Templates".  After implement such restriction, create item by copying old shopping cart item is not allow for particular matereial group number.
    Is there any BADI can be used in our case?  If there is no, could modify HTML template the only solution?
    Regards,
    Donald

    Hi,
    If the restriction is for certain group of people,then you  have 2 options:
    1.Make the link invisible for those group of people by implementing the BADI BBP_SC_MODIFY_UI.In the BADI,first check the user attributes like particular role and based on that make the link invisible.
    2. Assign certain role to the  group of users who should not see the link "Old Purchase order and templates".You can hide this link in the MENU by removing this from the lits of trasctions in that particular role.In PFCG,go in that role and then under MENU tab,remove the entry for "OLD PURCHASE ORDER AND TEMPLATES".
    BR,
    Disha.
    Do reward points for useful answers.

  • Can we create items dynamically in forms 6i??

    Dear All,
    Is it possible to create items,i.e. Text items,display items etc. dynamically?
    Suppose I select Table name EMP,then it must get all columns from database and place it on form.Now I change table name from EMP to DEPT,now it should get all columns for dept table and place it on same form removing all EMP table colums.I should not have to call another form,i.e. it should be strictly done through single form.
    Thanks in advance

    You can make a form with 10 or more items (depends on the maximum number of the columns you have) and place them in a non base table block. Then you populate the block with a cursor and if you press a button you can populate the same block with another cursor making visible only the columns you need.
    Hope it helps you,
    Fabrizio

  • Created Items need a Heading Template

    I have created 3 items with labels that need to be put into some type of style template. When you create a report you can choose a report template 2, standard, but if you create items that are placed into that same region they are not part of that style template. How can I make the labels for my items match the style (template) used for the text headings of the report attributes?

    Matthew,
    Perhaps label templates are what you need.
    Scott

  • Create Item button on personalization page.

    Hi,
    I have Personailze Self Service Defn profile option enabled at site level. (User also set to YES).
    However I don't see create item button on many pages personalization screen, (like HomePage, or some other page).
    And on functional administrator responsibility's any page (like profile page in core, create Item is there).
    Its been checked on other instances that the create item button appears there for the same pages in problem.
    What can be the reason?
    Abdul Wahid

    Hi,
    Talked to Anil enabled "FND: Personalization Seeding Mode / FND_PERSONALIZATION_SEEDING_MODE" personalization link. It worked (even though the documentation says that its only for oracle's internal usage).
    Also related diagnostic story got via other cooleague with deeper cause of the problem and solution.
    Need to set system profiles to change old personalizations - expected?
    Abdul Wahid

  • Create Item button not enabled in Personalization page

    Hi All,
    In one of the OA pages, I clicked "Personalize Page" icon and went to the personalization page. The following columns are not present in that page:
    Create Item
    Update Item
    Delete Item
    So I m not able to create any new items through personalization.
    Let me know if someone has idea abt this.
    Regards,
    Pradeep

    Hey Gyan,
    Thanks.. After changing the profile option I m able to see the create item and update item icons in the personalization page.
    Could you also please tell the impact of changing the profile?
    Thanks,
    Pradeep

  • Create Item disable at PageLayout level

    Hi,
    I am trying to add an image item under pageLayout (/oracle/apps/ap/oie/entry/summary/webui/ConfirmationPG). However, the "Create Item" icon is disabled. I tried to change "Admin Personalization" at all the level, but still its disabled.
    I had a similar issue while adding an image item to another page, and was able to resolve it by changing Admin Personalization to true at Responsibility level. But its not working in this case.
    Am i missing something?
    Ashish

    Is the create item link disabled only against the pagelayout region or against all the regions?
    --Shiv                                                                                                                                                                                                                   

Maybe you are looking for

  • Get PO/PR Approval List

    Dear All, I need to list out the approvers along with their approval date of PO and PR ,where can i get the approver name details along with approval dates of a particular PO and PR ?I have checked in the Header/Item changes of PO but cannot correlat

  • Can two ATV's receive same video at once?

    Hey gang- We have an Apple TV 2 in one room and thinking of adding another in a different room.   I was wondering if two Apple TV 2's can receive the same video stream from iTunes at the same time?   In other words, playing the same movie or TV show

  • Shopping Cart workflow error

    Hi, We have just started with the setting up of the SRM 5.0 system. Scenario is Classic. we have activated the Shopping Cart without approval WF, however, when a SHC is created the system shows the status of SHC in Approval. Dont know what i have mis

  • My trackballs not working help plz

    its been a few days now my bb is 9300 the track ball has gone loopy when i click on summat its scolls up an down it self i have tryed to clean it also been on the screen/keypad setting my setting are on horizon- 60 vertical-60 audile mute...... pleas

  • Need info on BW system sanity check

    Hi , I am new to this Area, can any one tell me what is the BMW system sanity check? when we need to do this check? on what BW system we need to do this? Is there any pre defined steps we need to follow on sanity check? Is there any check list availa