Problem creating Service POs with BAPI_PO_CREATE1

Hi.
I'm trying to create service POs with data that i read from an excel file, to do this I'm using the bapi: <b>BAPI_PO_CREATE1</b> I'm passing the following parameters:
IMPORT:
- poheader
- poheaderx
TABLES:
- return
- poitem
- poitemx
- poaccount
- poaccountx
- poservices
- posrvaccessvalues
- poservices text
- extensionin
When I execute the bapi, I'm getting the following messages into table return:
<i>W - Error transferring ExtensionIn data for enhancement CI_EKKODB
E - No instance of object type PurchaseOrder has been created. External reference:
E - PO header data still faulty
E - Purchase order date is in the past
I - Change WBS Element could not be effected
E - You cannot maintain service specs. due to incomplete transfer structure</i>
Can anybody, please say me what am i doing wrong? How this bapi works?
Regards.
Gregory.

Hello My friend
Check this code:
Code listing for: LZMMIUP001F01
Description: Include LZMMIUP001F01
***INCLUDE LZMMIUP001F01 .
*&      Form  fill_item
      text
     -->P_WA  text
FORM fill_item  TABLES:  poitem STRUCTURE bapimepoitem "Item Data
                         poitemx STRUCTURE bapimepoitemx "Item Data (Change Parameter
                USING wa STRUCTURE zlo_mmcnv009
                      package.
item number
  poitem-po_item = wa-itemnum.
  poitemx-po_itemx = 'X'.
  poitemx-po_item = wa-itemnum.
  IF package <> ''.
    poitem-pckg_no = package.
    poitemx-pckg_no = 'X'.
  ENDIF.
*Account Assignment Category
  IF wa-category <> ''.
    poitem-acctasscat = wa-category.
    poitemx-acctasscat = 'X'.
  ENDIF.
*Item Category in Purchasing Document
  IF wa-itemcat <> ''.
    poitem-item_cat = wa-itemcat.
    poitemx-item_cat = 'X'.
  ENDIF.
*Short Text
  IF wa-sortxt <> ''.
    poitem-short_text = wa-sortxt.
    poitemx-short_text = 'X'.
  ENDIF.
*Material Number
  IF wa-material <> ''.
    poitem-material = wa-material.
    poitemx-material = 'X'.
  ENDIF.
Unit of Measure
  IF wa-undmesure <> ''.
    poitem-po_unit = wa-undmesure.
    poitemx-po_unit = 'X'.
  ENDIF.
*Purchase Order Quantity
  IF wa-quantity <> ''.
    poitem-quantity = wa-quantity.
    poitemx-quantity = 'X'.
  ENDIF.
*Net Price in Purchasing Document
  IF wa-netprice <> ''.
    poitem-net_price = wa-netprice.
    poitemx-net_price = 'X'.
  ENDIF.
*Plant
  IF wa-plant <> ''.
    poitem-plant = wa-plant.
    poitemx-plant = 'X'.
  ENDIF.
*Material Group
  IF wa-matgrp <> ''.
    poitem-matl_group = wa-matgrp.
    poitemx-matl_group = 'X'.
  ENDIF.
*Free Item
  IF wa-free <> ''.
    poitem-free_item = wa-free.
    poitemx-free_item = 'X'.
  ENDIF.
  APPEND poitem.
  APPEND poitemx.
ENDFORM.                    " fill_item
*&      Form  fill_header
      text
     -->P_WA  text
FORM fill_header  USING wa STRUCTURE zlo_mmcnv009
                    poheader STRUCTURE bapimepoheader "Header Data
                    poheaderx STRUCTURE bapimepoheaderx. "Header Data (Change Toolbar)
  DATA: dia(2), mes(2), ano(4),
        vendor(10) TYPE n.
  dia = wa-docdate(2).
  mes = wa-docdate+2(2).
  ano = wa-docdate+4(4).
  CONCATENATE ano mes dia INTO wa-docdate.
  dia = wa-datestart(2).
  mes = wa-datestart+2(2).
  ano = wa-datestart+4(4).
  CONCATENATE ano mes dia INTO wa-datestart.
  dia = wa-datend(2).
  mes = wa-datend+2(2).
  ano = wa-datend+4(4).
  CONCATENATE ano mes dia INTO wa-datend.
Document Type
  IF wa-doctyp <> ''.
    poheader-doc_type = wa-doctyp.
    poheaderx-doc_type = 'X'.
  ENDIF.
vendor number
  IF  wa-vendor <>  ''.
    IF NOT ( wa-vendor CA sy-abcde ).
      vendor = wa-vendor.
      poheader-vendor = vendor.
      poheaderx-vendor = 'X'.
    ELSE.
      poheader-vendor = wa-vendor.
      poheaderx-vendor = 'X'.
    ENDIF.
  ENDIF.
Document Date
  IF wa-docdate <> ''.
    poheader-doc_date = wa-docdate.
    poheaderx-doc_date = 'X'.
  ENDIF.
purchasing organization
  IF wa-organiz <> ''.
    poheader-purch_org = wa-organiz.
    poheaderx-purch_org = 'X'.
  ENDIF.
Purchasing Group
  IF wa-purgroup <> ''.
    poheader-pur_group = wa-purgroup.
    poheaderx-pur_group = 'X'.
  ENDIF.
Start of Validity Period
  IF wa-datestart <> ''.
    poheader-vper_start = wa-datestart.
    poheaderx-vper_start = 'X'.
  ENDIF.
End of Validity Period
  IF wa-datend <> ''.
    poheader-vper_end = wa-datend.
    poheaderx-vper_end = 'X'.
  ENDIF.
Company Code
  IF wa-compcode <> ''.
    poheader-comp_code = wa-compcode.
    poheaderx-comp_code = 'X'.
  ENDIF.
  Status of Purchasing Document
  IF wa-status <> ''.
    poheader-status = wa-status.
    poheaderx-status =  'X'.
  ENDIF.
ENDFORM.                    " fill_header
*&      Form  fill_account
      text
     -->P_WA  text
FORM fill_account  TABLES  poaccount STRUCTURE bapimepoaccount
                           poaccountx STRUCTURE bapimepoaccountx
                   USING wa STRUCTURE zlo_mmcnv009.
  DATA: account(10) TYPE n.
  poaccount-po_item = wa-itemnum.
  poaccountx-po_item = wa-itemnum.
*Cost Centre
  poaccount-costcenter = wa-coscenter.
  poaccountx-costcenter = 'X'.
*Order Number
  poaccount-orderid = wa-ordernumb.
  poaccountx-orderid = 'X'.
*"G/L Account Number
  IF wa-accnumb <> ''.
    account = wa-accnumb.
    poaccount-gl_account = account."wa-accnumb.
    poaccountx-gl_account = 'X'.
  ENDIF.
  IF NOT ( wa-coscenter = '' AND
     wa-ordernumb = '' AND
     wa-accnumb = '' ).
    APPEND poaccount.
    APPEND poaccountx.
  ENDIF.
ENDFORM.                    " fill_account
*&      Form  fill_schedule
      text
     -->P_WA  text
FORM fill_schedule  TABLES  poschedule STRUCTURE bapimeposchedule
                            poschedulex STRUCTURE bapimeposchedulx
                    USING wa STRUCTURE zlo_mmcnv009.
  DATA: dia(2), mes(2), ano(4).
  dia = wa-delivdate(2).
  mes = wa-delivdate+2(2).
  ano = wa-delivdate+4(4).
  CONCATENATE ano mes dia INTO wa-delivdate.
*Delivery Date
  poschedule-po_item = wa-itemnum.
  poschedulex-po_item = wa-itemnum.
  poschedule-delivery_date = wa-delivdate.
  poschedulex-delivery_date = 'X'.
  IF NOT wa-delivdate = ''.
    APPEND poschedule.
    APPEND poschedulex.
  ENDIF.
ENDFORM.                    " fill_schedule
*&      Form  fill_header_contract
      text
     -->P_WA  text
     -->P_HEADER  text
     -->P_HEADERX  text
FORM fill_header_contract  USING wa STRUCTURE zlo_mmcnv009
                             coheader STRUCTURE bapimeoutheader
                             coheaderx STRUCTURE bapimeoutheaderx.
  DATA: dia(2), mes(2), ano(4).
  dia = wa-datestart(2).
  mes = wa-datestart+2(2).
  ano = wa-datestart+4(4).
  CONCATENATE ano mes dia INTO wa-datestart.
  dia = wa-datend(2).
  mes = wa-datend+2(2).
  ano = wa-datend+4(4).
  CONCATENATE ano mes dia INTO wa-datend.
Purchasing Document Date
  coheader-doc_date = sy-datum.
  coheaderx-doc_date = 'X'.
*Item Number Interval
  coheader-item_intvl = '10'.
  coheaderx-item_intvl = 'X'.
Currency Key
  coheader-currency = 'BHD'.
  coheaderx-currency =  'X'.
languaje
  coheader-langu = 'EN'.
  coheaderx-langu = 'X'.
Document Type
  IF wa-doctyp <> ''.
    coheader-doc_type = wa-doctyp.
    coheaderx-doc_type = 'X'.
  ENDIF.
vendor number
  IF  wa-vendor <>  ''.
    coheader-vendor = wa-vendor.
    coheaderx-vendor = 'X'.
  ENDIF.
purchasing organization
  IF wa-organiz <> ''.
    coheader-purch_org = wa-organiz.
    coheaderx-purch_org = 'X'.
  ENDIF.
Purchasing Group
  IF wa-purgroup <> ''.
    coheader-pur_group = wa-purgroup.
    coheaderx-pur_group = 'X'.
  ENDIF.
Start of Validity Period
  IF wa-datestart <> ''.
    coheader-vper_start = wa-datestart.
    coheaderx-vper_start = 'X'.
  ENDIF.
End of Validity Period
  IF wa-datend <> ''.
    coheader-vper_end = wa-datend.
    coheaderx-vper_end = 'X'.
  ENDIF.
ENDFORM.                    " fill_header_contract
*&      Form  fill_item_contract
      text
     -->P_WA  text
     -->P_COITEM  text
     -->P_COITEMX  text
FORM fill_item_contract  TABLES: coitem STRUCTURE bapimeoutitem
                                 coitemx STRUCTURE bapimeoutitemx
                         USING  wa STRUCTURE zlo_mmcnv009.
item number
  coitem-item_no = wa-itemnum.
  coitemx-item_no = wa-itemnum.
  coitemx-item_nox = 'X'.
*Material Number
  IF wa-material <> ''.
    coitem-material = wa-material.
    coitemx-material = 'X'.
  ENDIF.
*Target Quantity
  IF wa-quantity <> ''.
    coitem-target_qty = wa-quantity.
    coitemx-target_qty = 'X'.
  ENDIF.
*Net Price in Purchasing Document
  IF wa-netprice <> ''.
    coitem-net_price = wa-netprice.
    coitemx-net_price = 'X'.
  ENDIF.
  APPEND coitem.
  APPEND coitemx.
ENDFORM.                    " fill_item_contract
*&      Form  fill_service
      text
     -->P_POSERVICES  text
     -->P_T_ITEM  text
     -->P_ITEMNUM  text
FORM fill_service  TABLES   poservices STRUCTURE bapiesllc
                            t_item STRUCTURE zlo_mmcnv009
                            poservices_2  STRUCTURE  bapiesklc
                   USING    itemnum packno.
  DATA: line(10) TYPE n,
        service(18) TYPE n,
        packno2(10) TYPE n.
  poservices-pckg_no = packno.
  packno2 = packno.
  packno = packno + 1.
  poservices-line_no = '0000000001'.
  poservices-outl_ind = 'X'.
  poservices-subpckg_no = packno.
  APPEND poservices.
  line = '0000000002'.
  LOOP AT t_item WHERE itemnum = itemnum.
    IF t_item-activity <> ''.
      IF NOT ( t_item-activity CA sy-abcde ).
        service = t_item-activity.
        poservices-service = service.
      ELSE.
        poservices-service = t_item-activity.
      ENDIF.
    ELSE.
      poservices-service = t_item-activity.
    ENDIF.
    poservices-pckg_no = packno.
    poservices-line_no = line. "itemnum.
    poservices-ext_line = t_item-line.
    poservices-quantity = t_item-quantity1.
    poservices-base_uom = t_item-undmed.
    poservices-gr_price = t_item-price.
    poservices-short_text = t_item-shortxt.
    poservices-subpckg_no = '0000000000'.
    poservices-outl_ind = ''.
    APPEND poservices.
    poservices_2-pckg_no = packno.
    poservices_2-line_no = line.
  poservices_2-SERNO_LINE =
  poservices_2-SERIAL_NO =
    poservices_2-quantity = t_item-quantity1.
    poservices_2-net_value = t_item-price.
    APPEND poservices_2.
    line = line + 1.
  ENDLOOP.
ENDFORM.                    " fill_service
*&      Form  fill_pocond
      text
     -->P_POCOND  text
     -->P_POCONDX  text
     -->P_WA  text
FORM fill_pocond TABLES  pocond      STRUCTURE bapimepocond
                         pocondx STRUCTURE bapimepocondx
                   USING wa STRUCTURE zlo_mmcnv009.
*Net Price in Purchasing Document
  IF wa-netprice <> ''.
    pocond-itm_number = wa-itemnum.
    pocondx-itm_number = wa-itemnum.
    pocond-cond_value = wa-netprice.
    pocondx-cond_value = 'X'.
    pocond-currency = 'BHD'.
    pocondx-currency = 'X'.
    pocond-cond_type = 'PBXX'.
    pocondx-cond_type = 'X'.
*COND_TYPE
    APPEND pocond.
    APPEND pocondx.
  ENDIF.
ENDFORM.                    " fill_pocond

Similar Messages

  • Creation of Service POs using BAPI_PO_CREATE1

    Hi Friends,
    I am trying to create service POs through BAPI (BAPI_PO_CREATE1). I am facing different errors like Please maintain service or limits eve though I am providing the details in POSERVICES. Can any one suggest me the fields which we have to provide for creating the service POs.
    I am using this BAPI in LSMW.
    Thanks,
    Gagan Chodhry

    Check this it may help u.
    DATA: BEGIN OF po_header OCCURS 0.
    INCLUDE STRUCTURE BAPIEKKOC.
    DATA: END OF po_header.
    DATA: BEGIN OF po_iteam OCCURS 10.
    INCLUDE STRUCTURE BAPIEKPOC.
    DATA: END OF po-items.
    DATA: BEGIN OF PO_ITEM_SCHEDULES OCCURS 0.
    INCLUDE STRUCTURE BAPIEKET.
    DATA: END OF PO_ITEM_SCHEDULES.
    DATA: BEGIN OF I_BAPIRETURN OCCURS 0.
    INCLUDE STRUCTURE BAPIRETURN.
    DATA: END OF I_BAPIRETURN.
    CALL FUNCTION 'BAPI_PO_CREATE'
    EXPORTING
    PO_HEADER = PO_HEADER
    SKIP_ITEMS_WITH_ERROR = 'X'
    TABLES
    PO_ITEMS = PO_ITEMS
    PO_ITEM_SCHEDULES = PO_ITEM_SCHEDULES
    RETURN = I_BAPIRETURN
    EXCEPTIONS
    OTHERS = 1.
    Regards

  • Function module for Create service order with reference to sales doc (RAS )

    Hi All,
    I have to create a service order (type SM03) with reference to sales document (doc type RAS, in other way it is called as repair order).
    I have used function module 'ALM_ME_ORDER_CREATE' && 'CO_ZV_ORDER_POST' to create service order and its working fine but problem is that i am not able to create linking between repair order and service order.
    Can anyone suggest me function module, BAPI to create service order with reference as sales document (RAS) so that all related details of sales document will automatically reflect to service order..
    Sumit

    Try this function module BAPI_ORDER_MAINTAIN. Just search with BAPI_ORDER* in SE37 you will get some more functions.
    Regards
    Kathirvel

  • Problem creating service jboss.security:name=XMLLoginConfig

    Hello,
    I am trying to to run my application using Java 5 and JBoss 4.2.1, but i am stuck in the middle. The error which i received is as follows:-
    2008-10-15 12:56:06,031 WARN | (org.jboss.system.ServiceController:337) - Problem creating service jboss.security:name=XMLLoginConfig
    java.lang.AbstractMethodError: org.jboss.security.auth.login.XMLLoginConfig.jbossInternalLifecycl
    (Ljava/lang/String;)V
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
    at $Proxy0.create(Unknown Source)
    at org.jboss.system.ServiceController.create(ServiceController.java:330)
    at org.jboss.system.ServiceController.create(ServiceController.java:273)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy4.create(Unknown Source)
    at org.jboss.deployment.SARDeployer.create(SARDeployer.java:258)
    at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy5.deploy(Unknown Source)
    at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
    at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
    at org.jboss.Main.boot(Main.java:200)
    at org.jboss.Main$1.run(Main.java:508)
    at java.lang.Thread.run(Thread.java:595)
    2008-10-15 12:56:06,078 INFO | (org.jboss.logging.Log4jService$URLWatchTimerTask:440) - Configur
    ng from URL: resource:log4j.xml
    log4j: Reading configuration from URL resource:log4j.xml
    log4j: Could not find root logger information. Is this OK?I am not able to find the cause of this error. May be deployment is not happening. But the code was properly working on Java 4 and JBoss 3.0.0. Now when i migrated it to newer version , here i get this error.
    Please help me
    Thanks in advance
    Monadear

    Hi,
    Looking at your document URL for the WSDL, the PeopleSoft IB should contain "Service" in it's name, it looks like you are using your IB Gateway URL instead.
    This is what you posted:
    - http://xxx.com:11001/PSIGW/PeopleSoftListeningConnector/CI_Z_POSITION_DATA.1.wsdl
    Try the following and this should resolve your problem.
    - http://xxx.com:11001/PSIGW/PeopleSoftServiceListeningConnector/CI_Z_POSITION_DATA.1.wsdl
    Regards,
    Dan

  • Problem creating Purchase Order with Bapi_po_create  Return Message is ""

    Hello everybody
    When I get to create PO with bapi_po_create . I get this message in the return parameter :"Enter the PURCH_ORG".
    I think that I have implemented it very well but I don´t get the results that I was expected : No PO was created.
    Please see the following codes and let me know if something is wrong. Thanks .
    =====================================
    *& Report  Z_PED_TRAS                                                  *
    REPORT  z_ped_tras  .
    Definición de la tabla asociada la tabla interna bdcdata
    *DATA :in_data LIKE bdcdata OCCURS 0 WITH HEADER LINE.
    Definición de la estructura que contendrá los pedidos
    DATA : s_cabeceras_pedidos LIKE bapiekkoc,
           s_pos_pedidos LIKE bapiekpoc.
    DATA : t_cabeceras_pedidos LIKE  bapiekkoc OCCURS 0 WITH HEADER LINE,
           t_pos_pedidos LIKE  bapiekpoc OCCURS 0 WITH HEADER LINE,
           t_final_cabeceras_pedidos LIKE  bapiekkoc OCCURS 0 WITH HEADER
    LINE,
           t_final_pos_pedidos LIKE  bapiekpoc OCCURS 0 WITH HEADER LINE.
    Data : item_schedule like BAPIEKET occurs 0 with header line.
    *DATA : BEGIN OF pedidos,
          ematn TYPE mepo1211-ematn, "Número de material
          menge TYPE mepo1211-menge, "Cantidad de pedido
          name1 TYPE mepo1211-name1," Centro destino
          lgobe TYPE mepo1211-lgobe, "Almacén
         END OF pedidos.
    *DATA: s_pedidos  LIKE pedidos,
         wa_pedidos LIKE pedidos,
         t_pedidos LIKE pedidos OCCURS 0 .
    Variables  auxiliaires
    Variables para la ejecución del explorador de archivos
    DATA: l_temp_dir TYPE string.
    DATA: l_filter TYPE string.
    DATA: l_files TYPE filetable.
    DATA: l_rc TYPE i.
    DATA: l_file TYPE filename.
    DATA: l_filename TYPE string.
    DATA: excel TYPE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    DATA: s_excel TYPE alsmex_tabline.
    DATA: qid LIKE apqi-qid.
    Declaración de parametros de selección
    PARAMETERS :
       p_center LIKE bapiekkoc-suppl_plnt OBLIGATORY,"" Proveedor/Centro
       p_ekorg LIKE bapiekkoc-purch_org OBLIGATORY , " Organización compras
       p_ekgrp LIKE bapiekkoc-pur_group OBLIGATORY, " Grupo de compras
       p_bukrs LIKE bapiekkoc-co_code OBLIGATORY,"Sociedad"
       p_date LIKE sy-datum DEFAULT sy-datum OBLIGATORY,  "fecha
       test AS CHECKBOX DEFAULT 'X'.
      p_center LIKE mepo_topline-superfield, " Proveedor/Centro
      p_ekorg LIKE mepo1222-ekorg, " Organización de compras
      p_ekgrp LIKE mepo1222-ekgrp, " Grupo de compras
      p_bukrs LIKE mepo1222-bukrs,"Sociedad"
      p_date LIKE sy-datum," Fecha
      test AS CHECKBOX DEFAULT 'X'.
    PARAMETERS: p_file LIKE rlgrap-filename DEFAULT 'C:PEDIDOS.XLS'. " Ruta
    Carga del explorador de ficheros **
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      l_temp_dir = 'C:A'.
      l_filter = '.'.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          default_extension       = '*.xls'
          file_filter             = l_filter
          initial_directory       = l_temp_dir
        CHANGING
          file_table              = l_files
          rc                      = l_rc
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4
          OTHERS                  = 5.
      IF NOT l_files[] IS INITIAL.
        READ TABLE l_files INTO l_file INDEX 1.
        p_file = l_file.
        TRANSLATE p_file TO UPPER CASE.
      ENDIF.
    START-OF-SELECTION.
      IF p_file NE space.
        PERFORM upload_data.
        PERFORM fill_data.
        PERFORM llamar_bapi.
      ENDIF.
    END-OF-SELECTION.
    *&      Form  Upload_data
          text
    -->  p1        text
    <--  p2        text
    FORM upload_data .
      IF excel IS INITIAL .
        CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
          EXPORTING
            filename                = p_file
            i_begin_col             = 1
            i_begin_row             = 2
            i_end_col               = 4
            i_end_row               = 50000
          TABLES
            intern                  = excel
          EXCEPTIONS
            inconsistent_parameters = 1
            upload_ole              = 2
            OTHERS                  = 3.
        IF sy-subrc <> 0.
          WRITE :/'Hay un problema al cargar los datos delfichero excell'.
        ENDIF.
        SORT excel DESCENDING BY row col.
      ENDIF.
    ENDFORM.                    " Upload_data
    *&      Form  fill_excell
          text
    -->  p1        text
    <--  p2        text
    FORM fill_data .
      DATA :  cant TYPE i ,
              value_row TYPE i VALUE 1,
              data_aux TYPE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    Leer las filas del fichero excell.
      IF test NE 'X'.
        s_cabeceras_pedidos-suppl_plnt = p_center.
        s_cabeceras_pedidos-purch_org = p_ekorg.
        s_cabeceras_pedidos-pur_group = p_ekgrp .
        s_cabeceras_pedidos-co_code = p_bukrs .
        s_cabeceras_pedidos-doc_date = p_date.
        APPEND  s_cabeceras_pedidos TO t_cabeceras_pedidos.
        cant = excel-row.
        DO cant TIMES.
          LOOP AT excel WHERE row EQ value_row.
            APPEND excel TO data_aux.
          ENDLOOP.
          SORT data_aux BY col.
          LOOP AT data_aux.
            CASE data_aux-col.
              WHEN '1'.
                s_pos_pedidos-pur_mat = data_aux-value.
              WHEN '2'.
                s_pos_pedidos-DISP_QUAN = data_aux-value.
              WHEN '3'.
                s_pos_pedidos-plant = data_aux-value.
              WHEN '4'.
                s_pos_pedidos-store_loc = data_aux-value.
            ENDCASE.
          ENDLOOP.
          APPEND s_pos_pedidos TO t_pos_pedidos.
        ENDDO.
      ENDIF.
    ENDFORM.                    " fill_data
    *&      Form  llamar_Bapi
          text
    -->  p1        text
    <--  p2        text
    FORM llamar_bapi .
    data : T_RETURN LIKE BAPIRETURN OCCURS 0 WITH HEADER LINE,
           PORDER LIKE BAPIEKKOC-PO_NUMBER.
    t_final_cabeceras_pedidos[] = t_cabeceras_pedidos[].
    t_final_pos_pedidos[] = t_pos_pedidos[].
      CALL FUNCTION 'BAPI_PO_CREATE'
        EXPORTING
          po_header                        = t_final_cabeceras_pedidos
    IMPORTING
       PURCHASEORDER                     = PORDER
        TABLES
          po_items                       = t_final_pos_pedidos
          po_item_schedules                = item_schedule
          RETURN                           = T_RETURN
      IF sy-subrc EQ 0 .
        WRITE :/ 'P O created well'.
      ELSE .
        WRITE :/ 'P .O was not created  well'.
        endif.
      ENDFORM.                    " llamar_Bapi

    Hi,
    When we use BAPI_PO_CREATE1 to create service PO, following tables are populated at item level:
    a) POITEM
    b) POITEMX
    c) POACCOUNT
    d) POACCOUNTX
    e) POSERVICES
    f) POSRVACCESSVALUES
    For service items: POITEM-PCKG_NO = u20180000000001u2019. (assign package no as a dummy number)
    Set PCKG_NO flag in POITEMX table as u2018Xu2019.
    Package No is the link that connect POITEM table to POACCOUNT table through tables POSERVICES and POSRVACCESSVALUES.
    Set POACCOUNT-SERIAL_NO to u201801u2019.
    Set same PCKG_NO to u20180000000001u2019 in POSERVICES table. Maintain two entries in POSERVICES table like this:
    WA_POSERVICES-PCKG_NO = u20180000000001u2019.
    WA_POSERVICES-LINE_NO = u20180000000001u2019.
    WA_POSERVICES-OUTL_IND = u2018Xu2019.
    WA_POSERVICES-SUBPCKG_NO = u20180000000003u2019. (Dummy No.)
    WA_POSERVICES-QUANTITY = u2018100.000u2019.
    WA_POSERVICES-BASE_UOM = u2018EAu2019.
    WA_POSERVICES-PRICE_UNIT = u20181u2019.
    WA_POSERVICES-GR_PRICE = u2018100.000u2019.
    WA_POSERVICES-SHORT_TEXT = u2018SERVICE TESTu2019.
    APPEND WA_POSERVICES TO IT_POSERVICES.
    WA_POSERVICES- PCKG_NO = u20180000000003u2019.
    WA_POSERVICES- LINE_NO = u20180000000002u2019.
    WA_POSERVICES-QUANTITY = u201810.000u2019.
    WA_POSERVICES- BASE_UOM = u2018EAu2019.
    WA_POSERVICES--PRICE_UNIT = u20181u2019.
    WA_POSERVICES-GR_PRICE = u2018100.000u2019.
    WA_POSERVICES-SHORT_TEXT = u2018SERVICE 1u2019.
    WA_POSERVICES-MATL_GROUP = u20180012u2019.
    APPEND WA_POSERVICES TO IT_POSERVICES.
    Set PCKG_NO as SUB_PCKG_NO in table POSRVACCESSVALUES this:
    WA_POSRVACCESSVALUES-PCKG_NO = u20180000000003u2019.
    WA_POSRVACCESSVALUES-LINE_NO = u20180000000002u2019.
    WA_POSRVACCESSVALUES-SERNO_LINE = u201801u2019.
    WA_POSRVACCESSVALUES-SERIAL_NO = u201801u2019.
    WA_POSRVACCESSVALUES-QUANTITY = u201910.000u2019.
    APPEND WA_POSRVACCESSVALUES TO IT_ POSRVACCESSVALUES.
    This logic will work definitely and PO Service Items will be created.
    Thanks & Regards.
    Dhina..

  • Creating Service PO using BAPI_PO_CREATE1

    Hi gurus,
    I am trying to create a PO with service lines using BAPI_PO_CREATE1 but am getting the following errror even though i have passed values to the structures POSERVICES POSRVACCESSVALUES and POACCOUNT along with item and header details:
    Please maintain services or limits
    Please suggest what are the basic details that need to be passed to the structures for creating a PO with service lines.

    Hi,
    You need to use Package Number to link the services with the item. Check the tables like ESKN to know how the linking works with your existing data.
    There are lot of posts related to this. Please do a search to get detailed answers. Thanks for your patience!!
    Regards,
    Yogesh

  • Problem creating Allocation Table with Reference to a PO

    Dear Folks,
    I am having problems creating an allocation table with reference to a PO in T-code WA01.
    I read the SAP help that some prerequisites need to exist:
    ==> You can only reference order items flagged as being relevant to a stock split (the Allocation table relevant indicator in the additional item data).
    Can anyone advice me where to find this stock split indicator?
    Also, can anyone advice me how to reuse an allocation table? For example, I had previously created an allocation table with many articles and various allocation rules. I already generated follow on documents for this table.
    Say after 2 weeks, I have the similar requirements that I can make use of the same table, only with minor adjustments to the quantity. How do I create a new allocation table using the existing allocation table data?
    Thanks and Regards
    Junwen

    Any idea please?
    thanks

  • Problem creating a table with a subquery and a dblink

    Hello!!
    I have a little problem. When I create a table with a subquery and a dblink, for example:
    CREATE TABLE EXAMPLE2 AS SELECT * FROM EXAMPLE1@DBLINK
    the table definition is changed. Fields with a type of CHAR or VARCHAR2 are created with a size three times bigger than the original table in the remote database. Field of type DATE and NUMBER are not changed. For example if the original table, in the database 1, has a field of type CHAR(1) it is create in the local database with a type of CHAR(3), and a VARCHAR2(5) field is created with VARCHAR2(15).
    Database 1 has a WE8DEC character set.
    Database 2 has a AL32UTF8 character set.
    Could it be related to the difference in character sets?
    What can I do to make Oracle use the same table definition when creating a table in this way?
    Thanks!!

    That is related to character sets, and probably necessary if you want all the data in the remote table to be able to fit in the new table.
    When you declare a column VARCHAR2(5), by default, you're allocating 5 bytes of storage. In a single-byte character set, which I believe WE8DEC is, that also happens to equate to 5 characters. In a multi-byte character set like AL32UTF8, though, 1 character may require up to 3 bytes of storage, so you'd need to allocate 15 bytes to store that data. That's what's going on here.
    You could still store all the data if you create the table locally by explicitly requesting 5 characters of storage by declaring the column VARCHAR2(5 CHAR). You could also set the NLS_LENGTH_SEMANTICS parameter to CHAR rather than BYTE before creating the table, but I believe that both of these will only apply when you're explicitly defining columns as part of your CREATE TABLE. I don't believe either will apply to CTAS statements.
    Justin

  • Problem creating process order with ref of sale order

    Dear all,
    Kindly give solution for this scenerio..............................
    I am creating Process Order with ref of sale order manually in cor1. In the COR1 screen copy from field i gave my ref sale order, so that particualr order and batch is assigned to that order only.
    My problem was suppose if sale order is created for 10 tonns, but my batch size and resource capacity is 2 tonns only. so first time i change my batch quantity 2 tonns instead of 10 tonns and created my order and confirmed.
    if i go to second time the same process i am doing creating process order with ref of same sale order but it comes again 10 tonns instead of 8 tonns. why it comes like this already i confirmed 2 tonns in this sale order?
    my requirement is if any process order is created with ref of any sale order and again if i am creating any process order with ref of same sale order left quantity only system should show.
    for this what i have to do kindly help to this
    regards,
    s.sakthivel

    Dear KK,
    Pls check whether ZKIN, ZKQT, ZKOR have all the properties similar to IN, QT, OR respectively. If they are different, please ensure that you know the reason why they are different. This check has to be done at tcode VOV8
    Some fields like sales document category, Transaction group, screen seq group, Doc pricing procedure need to be similar to the parent document unless you know why you have changed them.
    Once this check is done, check the copy controls in VTAA. Before that try creating these documents separately without reference. This shoudl work fine only after which you need to check copy control. If this is not working fine, then there is some problem with the document type settings in VOV8. Testing this is possible only if Reference mandatory field is left empty. Make sure that is properly configured.
    Once this is done, check copy controls in VTAA. You can just copy the copycontrol between IN and QT and QT and OR and create for ZKIN to ZKQT and ZKQT to ZKOR.
    Once this is done, check whether your item category settings are properly done , also the schedule line settings. The tcodes are VOV7, VOV6, VOV4, VOV5 etc.
    Now check whether your material master and customer master are consistent with the item category settings(Item category group).
    Now create the transaction. It shoudl work fine.
    Reward if this helps.

  • Problem creating a datablock with columns from 2 tables...

    Hello guys, i have a problem in creating a datablock with columns from 2 different tables. I try to create the datalock manually and in the Query Data Source Type Property i choose FROM clause query, and in the query data source name property i type my sql statement with the columns i want to display.After that i place the items that the datablock will contain , manually from the painter. However , when i run the application, the datablock doesn't display the items from the database. Am i doing something wrong?
    Thanx in advance,
    Regards,
    Bill.

    Never mind Peter, I found the error. I forgot to make execute_query for the datablock, so this was the reason why the items weren't displayed to me.
    Thanx anyway a lot for your advices and your time you spent !

  • Create service request with inbound email linked to it

    Hi,
    we are on CRM 7.0 and interaction center agents need to open and read inbound emails in the agent inbox and in some cases manually create Service Requests to which the email should be linked.
    Is there any standard functionality to manually create a new Service Request with the inbound email linked to it or do we have to implement it with custom coding? (we have already used ERMS to automatically create Service Requests linked to emails, but in some scenarios agents need to create manually service requests linked to mails after reading the email in the inbox)
    Thanks,
    laura.

    Hi Joaquin,
    Thank you for answering. I already tried: I select the line with the email in the Inbox, I press Interact (the account is automatically recognized and I am asked to confirm it), I confirm the account and then I navigate to "Service Request" workcenter: a new Service Request is displayed, with the employee responsible and the customer automatically filled. However, I can see no data regarding any attached email in any of the Service Request tabs (even if I save or select "End").
    After your answer, I tried the same procedure with the "Service Ticket" and noticed that the email is correctly displayed as an Interaction Record under the Business Content tab for the Service Ticket: since you confirmed that this should work also for Service Request, I guess there's something wrong in my customizing settings and now I will search for errors.
    Thanks for your help.
    Best regards,
    Laura.

  • Create Service Request with Category Level4

    Hi,
    I am trying to create service request from Legacy system by calling SSC_SR_CREATE.
    I am not sure on how to fill in the category level 4 data in IT_SERVICE_OS.
    I have tried passing following fields in this structure.
    SUBJECT_PROFILE
    ASP_ID
    CAT_ID
    KATALOG_TYPE
    Service request gets created successfully however on UI I cannot see category data filled at all.
    Plz Help!!!

    Hi Joaquin,
    Thank you for answering. I already tried: I select the line with the email in the Inbox, I press Interact (the account is automatically recognized and I am asked to confirm it), I confirm the account and then I navigate to "Service Request" workcenter: a new Service Request is displayed, with the employee responsible and the customer automatically filled. However, I can see no data regarding any attached email in any of the Service Request tabs (even if I save or select "End").
    After your answer, I tried the same procedure with the "Service Ticket" and noticed that the email is correctly displayed as an Interaction Record under the Business Content tab for the Service Ticket: since you confirmed that this should work also for Service Request, I guess there's something wrong in my customizing settings and now I will search for errors.
    Thanks for your help.
    Best regards,
    Laura.

  • Create Service Request with Multiple Choices

    Dears,
    I need to create Service Request to appear in the portal with Multiple Choices like blow 
    Mohamed Fawzi | http://fawzi.wordpress.com

    Hi Mohamed.
    I am sitting almost in the same sudation, I am designing a service request form in the portal and will be using multiple checkboxes for various new equipment aka desktop, laptop, mobile blah blah.
    were you able to get multiple checkboxes to work in the portal, and if so, could you possibly share the solution. also if I may ask, can you have two or there checkboxes in the same row (next to each other), or only in a column?
    thanks in advance

  • Created Service Order with out contract

    Hi
    I have created Service Order  without contract. Now I have been asked to change it to a Service Order with contract, . Is it possible for me to change the existing SO - or do I have to create a new one??? If possible please explain the steps.
    Regards,
    Rahul

    Hi,
    You have two options :
    1- You can delete your SO and create a service rquisition and reference a contract OR..... with you PR ceate a Service Order.
    2 You can delete your SO and create a SO and reference a contract.
    I guess you want all conditions from your contract to pull through into you SO.
    Thanks

  • Problem while creating service PO using bapi_po_create1

    hi all,
        i am getting error :
    In case of account assignment, please enter acc. assignment data for item
    what does this mean?
    please help,,
    thanks,
    Siddhartha Prakash

    Hi Sid.
    I'm having this same problems on creating PO Service. Did you solve it? How did you do that?
    I'm using a PR and the Category is 'Y', and I cant find where is the problem.
    The tables that I'm passing to the BAPI_PO_CREATE1 are:
    POITEM/ POITEMX
    POACCOUNT/ POACCOUNTX
    POSERVICES
    POSRVACCESSVALUES
    Please, if you have any idea, let me know!
    Tks a lot!
    Renata

Maybe you are looking for

  • IPod nano won't show up on iTunes

    I got a new iPod nano 4GB (3G) last week and it worked fine for a while. Yesterday, I installed a new DVD burner and drivers (Memorex) in my computer and now, my iPod won't show up on iTunes. It says: "The software required for communicating with the

  • Problem in handling complex CSV file

    Hi, I am facing a strange problem in handling a complex CSV file. The content of the file is as follows. It is getting executed through an XSD and the target is a table. First time when the interface is executed ( for e.g session id - 19001) it is ge

  • Hooking up Visual Communicator

    My wife is an Elementary school teacher. One of her daily duties is to have about 4-5 kids give a live school news/lunch menu/etc. show. I told her about visual communicator and told her that I would like to set this up for the kids. With the chance

  • TreeView in Left and Image List in Right in Ipad

    How can i Impement this Functionality in IPAD : TreeView in Left Side and Images in Right Side. [IMG]http://www.mediafire.com/imgbnc.php/f69fea1bf8f4a5de6dfbd65ea4eb1e0634aba2ceb7fa b2854a0dd449ac385e766g.jpg[/IMG] I am Totally New in IPaD Developmen

  • How to realize the process for having "bottle-washing" service outside

    Dear Gurus, Here in our company, we would like to realize the below process in SAP. 1. We create a Purchase Order(PO) to buy some bottles from the supplyer. (PO Creation) 2. The supplyer delivers the bottles as per the PO and we receive them. (Post G