Need sample code to connect MDM using JCO

hi friends,
I want to connect MDM server using JCO,
can you please provide me the sample code for that.
Regards,
Venki.

Hello Venki,
why do you want to use JCo for connecting to MDM? MDM has its own specific Java API for this task. There's no need for using JCo at all.
BR Michael.

Similar Messages

  • Need sample code to connect MDM using JCA

    hi friends,
    I want to connect MDM server using JCA
    can you please provide me the sample code for that.
    Regards,
    Venki

    Hello Venki,
    why do you want to use JCo for connecting to MDM? MDM has its own specific Java API for this task. There's no need for using JCo at all.
    BR Michael.

  • Need Sample Code for Vendor creation using JAVA API

    Hi,
    I have a scenario like Vendor creation using <b>Java API</b>.
    1.I have Vendors (Main) Table.
    2.I have <b>look up</b> tables like Account Group.
    3.Also <b>Qualifier table</b>(Phone numbers) too.
    Could you please give me the sample code which helps me to create Vendor records using Java API?
    <b>I need Code samples which should cover all of the above scenario.</b>
    <b>Marks will be given for the relevent answers.</b>
    Best Regards
    PK Devaraj

    Hi Devraj,
    I hope the below code might solve all your problem:-
    //Adding Qualified field
    //Creating empty record in Qualifed table 
    //Adding No Qualifiers
    Record qualified_record = RecordFactory.createEmptyRecord(new TableId(<TableId>));
    try {
    qualified_record.setFieldValue(new FieldId(<fieldId of NoQualifier), new StringValue(<StringValue>));//Adding No Qualifier
    catch (IllegalArgumentException e2) {
    // TODO Auto-generated catch block
    e2.printStackTrace();
    catch (MdmValueTypeException e2) {
    // TODO Auto-generated catch block
    e2.printStackTrace();
    //Creating Record in Qualified table
    CreateRecordCommand create_command = new CreateRecordCommand(connections);
    create_command.setSession(sessionId);
    create_command.setRecord(qualified_record);
    try
    create_command.execute();
    catch(Exception e)
    System.out.println(e.toString());
    RecordId record_id = create_command.getRecord().getId();
    //Adding the new record to Qualifed Lookup value and setting the Yes Qualifiers
    QualifiedLookupValue lookup_value = new QualifiedLookupValue();
    int link = lookup_value.createQualifiedLink(new QualifiedLinkValue(record_id));
    //Adding Yes Qualifiers
    lookup_value.setQualifierFieldValue(0 , new FieldId(<FieldID of Yes Qualifier>) , new StringValue(<StringValue>));
    //Now adding LookUP values
    //Fetch the RecordID of the value selected by user using the following function
    public RecordId getRecordID(ConnectionPool connections , String sessionID , String value , String Fieldid , String tableid)
    ResultDefinition rsd = new ResultDefinition(new TableId(tableid));
    rsd.addSelectField(new FieldId(Fieldid));
    StringValue [] val = new StringValue[1];
    val[0] = new StringValue(value);
    RetrieveRecordsByValueCommand val_command = new RetrieveRecordsByValueCommand(connections);
    val_command.setSession(sessionID);
    val_command.setResultDefinition(rsd);
    val_command.setFieldId(new FieldId(Fieldid));
    val_command.setFieldValues(val);
    try
         val_command.execute();
    catch(Exception e)
    RecordResultSet result_set = val_command.getRecords();
    RecordId id = null;
    if(result_set.getCount()>0)
         for(int i = 0 ; i < result_set.getCount() ; i++)
         id = result_set.getRecord(i).getId();     
    return id;
    //Finally creating the record in Main table
    com.sap.mdm.data.Record empty_record = RecordFactory.createEmptyRecord(new TableId("T1"));
    try {
         empty_record.setFieldValue(new FieldId(<FieldId of text field in Main table>),new StringValue(<StringValue>));
         empty_record.setFieldValue(new FieldId(<FieldId of lookup field in Main table>), new LookupValue(<RecordID of the value retrieved using the above getRecordID function>));
    empty_record.setFieldValue(new FieldId(<FieldId of Qualified field in Main table>), new QualifiedLookupValue(<lookup_value>));//QualifiedLookUp  value Retrieved above
    } catch (IllegalArgumentException e1) {
    // TODO Auto-generated catch block
         e1.printStackTrace();
    } catch (MdmValueTypeException e1) {
         // TODO Auto-generated catch block
         e1.printStackTrace();
    //Actually creating the record in Main table
    CreateRecordCommand create_main_command = new CreateRecordCommand(connections);
    create_main_command.setSession(sessionId);
    create_main_command.setRecord(empty_record);
    try
         create_main_command.execute();
    catch(Exception e)
         System.out.println(e.toString());
    Thanks
    Namrata

  • Need sample code with RV_INVOICE_CREATE used

    Hi everybody!
    I need sample code with RV_INVOICE_CREATE or similar FMs used.
    The thing is that I do not know how to populate parametres of this and other invoicing FMs....
    For example, there are some tables to be passed to RV_INVOICE_CREATE
         TABLES
              XKOMFK     = XKOMFK
              XKOMV       = XKOMV
              XTHEAD      = XTHEAD
              XVBFS        = XVBFS
              XVBPA        = XVBPA
              XVBRK        = XVBRK
              XVBRP        = XVBRP
              XVBSS        = XVBSS
    How to populate them? I mean how to fill them with needed values?
    Useful answers will be awarded.
    Kind regards, M.

    RV_INVOICE_CREATE is the function module to create invoice based on delivery .
    when you pass delivery number ,it will create invoice ,see the invoice number in vf02,vf03 transaction. and also see the data vbrk,vbrp tables
    I have done this development and i have cancelled invoice,reverse goods issue,updated the delivery and again i am createing invoice..see the below progrm to get better understanding.
    REPORT ZWM_OVERWEIGHT_FIX  no standard page heading
                               message-id zwm.
    ======================================================================
    Program Name : ZWM_OVERWEIGHT_FIX                                    *
    Description  : Tool to fix Overweight in delivery line item,         *
                   Used All Function module to cancel invoice ,          *
                   Reverse the goods issue  ,Update Delivery qty,Create  *
                   invoice                                               *
    Author       : Seshu                                                 *
    Date         : 05/08/2007                                            *
    MODIFICATION HISTORY                                                 *
    DATE    | AUTHOR   | CHANGE #   | DESCRIPTION OF MODIFICATION        *
    --|||--
    05/08/07| Seshu    | DEVK921979 | Initial                            *
    D A T A - D E C L A R A T I O N     *******************
    Tables
    Tables : vbak,
             vbap,
             vbfa,
             likp,
             lips,
             vbrk,
             vbrp.
    Internal Tables
    data : i_lips like lips occurs 0 with header line,
           i_vbap like vbap occurs 0 with header line.
    Variables
    data : v_deliv like vbfa-vbelv,
           v_invoic like vbfa-vbelv.
    Data Declaration Part for Post Goods Issue
    DATA: l_vbeln LIKE likp-vbeln,
          l_vbkok LIKE vbkok,
          i_prot LIKE prott OCCURS 0 WITH HEADER LINE,
          ef_error_any_0 TYPE c,
          ef_error_in_item_deletion_0 TYPE c,
          ef_error_in_pod_update_0 TYPE c,
          ef_error_in_interface_0 TYPE c,
          ef_error_in_goods_issue_0 TYPE c,
          ef_error_in_final_check_0 TYPE c,
          d_return   LIKE bapireturn1.
    Internal tables for BAPI Function Module
    data : i_cret like BAPIRETURN1 occurs 0 with header line,
           i_csucess like BAPIVBRKSUCcESS occurs 0 with header line,
           i_ret2 like bapiret2 ,
           flag type c,
           i_mesg like mesg occurs 0 with header line.
    Data Declaration for Invoice Creation
    DATA: VBSK_I     LIKE  VBSK.
    data: d_success  type  c.
    DATA: XKOMFK LIKE      KOMFK   OCCURS 0 WITH HEADER LINE,
          XKOMV  LIKE      KOMV    OCCURS 0 WITH HEADER LINE,
          XTHEAD LIKE      THEADVB OCCURS 0 WITH HEADER LINE,
          XVBFS  LIKE      VBFS    OCCURS 0 WITH HEADER LINE,
          XVBPA  LIKE      VBPAVB  OCCURS 0 WITH HEADER LINE,
          XVBRK  LIKE      VBRKVB  OCCURS 0 WITH HEADER LINE,
          XVBRP  LIKE      VBRPVB  OCCURS 0 WITH HEADER LINE,
          XVBSS  LIKE      VBSS    OCCURS 0 WITH HEADER LINE,
          XKOMFKGN LIKE    KOMFKGN OCCURS 0 WITH HEADER LINE.
    S E L E C T I O N  -  S C R E E N   ******************
    Selection-screen
    Selection-screen : begin of block blk with frame title text-001.
    parameters : p_vbeln like vbak-vbeln obligatory.
    selection-screen : end of block blk.
    A T -  S E L E C T I O N  - S C R E E N ***************
    Validation on Sales order
    at selection-screen on p_vbeln.
    Check the data on VBAK Table
      select single vbeln from vbak into vbak-vbeln
                                where vbeln = p_vbeln.
      if sy-subrc ne 0.
        message e006 with p_vbeln.
      endif.
    S T A R T  - O F - S E L E C T I O N *******************
    Start-of-selection.
      break sreddy.
    Get the Invoice Number corresponding Sales Order Number
      perform get_invoice.
    Step 1.
    Cancel the Invoice  - Transaction VF11
      perform cancel_invoice.
    Reverse the goods issue
      perform reverse_goodsissue.
    Get the Order and Delivery Items
      perform get_sales_deliv.
    Delivery Change
      perform Delivery_change.
    Create Invoice document
      perform invoice_create.
    E N D  -  O F -  S E L E C T I O N  *******************
    end-of-selection.
    if flag = 'X'.
    message i012 with p_vbeln.
    endif.
    *&      Form  get_invoice
          Get Invoice Number
    FORM get_invoice.
    Clear Variables
      clear : v_deliv,
              v_invoic,
              flag.
    Get the Delivery Number First
      select single vbeln from vbfa into v_deliv
                               where vbelv = p_vbeln
                               and   vbtyp_n = 'J'.
      if sy-subrc ne 0.
        message i004 with p_vbeln.
        stop.
      endif.
    Get the Invoice Number
      select single vbeln from vbfa into v_invoic
                               where vbelv = p_vbeln
                               and   vbtyp_n = 'M'.
      if sy-subrc ne 0.
        message i003 with p_vbeln.
        stop.
      endif.
    ENDFORM.                    " get_invoice
    *&      Form  cancel_invoice
          Cancel the Invoice
    FORM cancel_invoice.
      clear : i_ret2,
              i_cret,
              i_csucess.
      refresh : i_cret,
                i_csucess.
      CALL FUNCTION 'BAPI_BILLINGDOC_CANCEL1'
        EXPORTING
          BILLINGDOCUMENT       = v_invoic
      TESTRUN               =
      NO_COMMIT             =
      BILLINGDATE           =
        TABLES
          RETURN                = i_cret
          SUCCESS               = i_csucess
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
           EXPORTING
                WAIT   = space
           IMPORTING
                RETURN = i_ret2.
    read table i_cret with key type = 'E'.
      if sy-subrc ne 0.
        message i005 with v_invoic.
        stop.
      endif.
    ENDFORM.                    " cancel_invoice
    *&      Form  reverse_goodsissue
          Reverse the goods Issue
    FORM reverse_goodsissue.
    Local Variable
      data : lv_vbtyp like likp-vbtyp.
      clear : i_mesg,
              lv_vbtyp.
      refresh : i_mesg.
      select single vbtyp from likp into lv_vbtyp
                               where vbeln = v_deliv.
      CALL FUNCTION 'WS_REVERSE_GOODS_ISSUE'
        EXPORTING
          I_VBELN                         = v_deliv
          I_BUDAT                         = sy-datum
        I_COUNT                         =
        I_MBLNR                         =
        I_TCODE                         =
          I_VBTYP                         = lv_vbtyp
        TABLES
          T_MESG                          = i_mesg
       EXCEPTIONS
         ERROR_REVERSE_GOODS_ISSUE       = 1
         OTHERS                          = 2
      if sy-subrc ne 0.
        message i007 with v_deliv.
      endif.
    ENDFORM.                    " reverse_goodsissue
    *&      Form  get_sales_deliv
          Get the Sales order and Deliv Items
    FORM get_sales_deliv.
    Local Variables
      data : lv_kwmeng like vbap-kwmeng.
      clear : i_lips,
              i_vbap.
      refresh : i_lips,
                i_vbap.
    Select the data from LIPS
      select * from lips into table i_lips
                         where vbeln = v_deliv.
      if sy-subrc ne 0.
        message i008 with v_deliv.
        stop.
      endif.
      sort i_lips by vbeln posnr.
      Get the Sales order Item Data.
      select * from vbap into table i_vbap
                              where vbeln = p_vbeln.
      if sy-subrc ne 0.
        message i006 with p_vbeln.
        stop.
      endif.
      sort i_vbap by vbeln posnr.
    Compare delivery Item and Order Items
      loop at i_lips.
        clear lv_kwmeng.
        read table i_vbap with key posnr = i_lips-posnr.
        if sy-subrc eq 0.
          lv_kwmeng = i_vbap-kwmeng * 2.
          if lv_kwmeng >= i_lips-lfimg.
            i_lips-lfimg = i_vbap-kwmeng.
            modify i_lips.
          endif.
        endif.
      endloop.
    ENDFORM.                    " get_sales_deliv
    *&      Form  Delivery_change
          Delivery Update
    FORM Delivery_change.
      Clear : i_prot.
      refresh : i_prot.
    Delivery Update
      CALL FUNCTION 'LE_MOB_DELIVERY_UPDATE'
           EXPORTING
                do_commit                = 'X'
           TABLES
                t_delivery_items         = i_lips
                prot                     = i_prot
           EXCEPTIONS
                conversion_overflow      = 1
                essential_data_missing   = 2
                error                    = 3
                nothing_to_update        = 4
                lock_after_update_failed = 5
                error_in_delivery_update = 6
                OTHERS                   = 7.
      COMMIT WORK.
      IF sy-subrc <> 0.
        MESSAGE i009 with v_deliv.
      endif.
    Post Goods Issue
      CLEAR:    d_return,
                i_prot,
                l_vbeln,
                l_vbkok.
      REFRESH i_prot.
      CLEAR:  ef_error_in_item_deletion_0    ,
              ef_error_in_pod_update_0       ,
              ef_error_in_interface_0        ,
              ef_error_in_goods_issue_0      ,
              ef_error_in_final_check_0      .
    carry out goods issue
      l_vbeln          = v_deliv.
      l_vbkok-vbeln_vl = l_vbeln.
      l_vbkok-wabuc    = 'X'.
    carry out goods issue
      l_vbeln          = v_deliv.
      l_vbkok-vbeln_vl = l_vbeln.
      l_vbkok-wabuc    = 'X'.
    SET UPDATE TASK LOCAL.
      CALL FUNCTION 'WS_DELIVERY_UPDATE'
           EXPORTING
                vbkok_wa                    = l_vbkok
                synchron                    = 'X'
                no_messages_update          = ' '
                update_picking              = 'X'
                commit                      = 'X'
                delivery                    = l_vbeln
                nicht_sperren               = 'X'
                if_error_messages_send_0    = space
           IMPORTING
                ef_error_any_0              = ef_error_any_0
                ef_error_in_item_deletion_0 = ef_error_in_item_deletion_0
                ef_error_in_pod_update_0    = ef_error_in_pod_update_0
                ef_error_in_interface_0     = ef_error_in_interface_0
                ef_error_in_goods_issue_0   = ef_error_in_goods_issue_0
                ef_error_in_final_check_0   = ef_error_in_final_check_0
           TABLES
                prot                        = i_prot
           EXCEPTIONS
                error_message               = 1
                OTHERS                      = 2.
      if sy-subrc ne 0.
        message i010 with v_deliv.
      else.
        COMMIT WORK .
      endif.
    ENDFORM.                    " Delivery_change
    *&      Form  invoice_create
          Invoice Creation
    FORM invoice_create.
      refresh: XKOMFK, XKOMV,
               XTHEAD, XVBFS,
               XVBPA,  XVBRK,
               XVBRP,  XVBSS.
      clear  : XKOMFK, XKOMV,
               XTHEAD, XVBFS,
               XVBPA,  XVBRK,
               XVBRP,  XVBSS,
               VBSK_I.
      VBSK_I-SMART = 'F'.
      XKOMFK-VBELN =  v_deliv.
      XKOMFK-VBTYP = 'J'.
      APPEND XKOMFK.
      CALL FUNCTION 'RV_INVOICE_CREATE'
           EXPORTING
                VBSK_I       = VBSK_I
                WITH_POSTING = 'C'
           TABLES
                XKOMFK       = XKOMFK
                XKOMV        = XKOMV
                XTHEAD       = XTHEAD
                XVBFS        = XVBFS
                XVBPA        = XVBPA
                XVBRK        = XVBRK
                XVBRP        = XVBRP
                XVBSS        = XVBSS.
      if sy-subrc eq 0.
        COMMIT WORK.
       flag = 'X'.
      else.
      message i011 with p_vbeln.
      endif.
    ENDFORM.                    " invoice_create
    Reward Points if it is helpful
    Thanks
    Seshu

  • Sample code to connect LDAP server using jndi

    Hi,
    can any one help me with sample code to connect LDAP server using jndi,
    like i want to make use of Ldap server for serching Active directoty.
    Thanks in advance,
    Regards
    Muthu

    You can set ldap_auth=none for anonymous user.
    User/password is mandatory otherwise. Please refer to http://docs.oracle.com/cd/E21764_01/integrate.1111/e12644/appendix_ldap_driver.htm#CHDHCABH
    Thansk,

  • Need sample code for Using BADI ME_PROCESS_REQ_CUST

    Dear all,
    Initially my requirement is to Validate the Document Type of Purchase Request ion as per material.
    I have created a implementation for BADI : ME_PROCESS_REQ_CUST .
    im new to OOPS-ABAP, so pls send *sample code for how to use these methods PROCESS_ITEM,
    like declarations, assignment of data into internal table  for further validation*.
    Regards,
    NIranjan.G

    Hi,
    get the item data ....
         *DATA : lt_item TYPE MEREQ_ITEM,
                       ls_item liek line of it_item*
             CALL METHOD im_item->GET_DATA
               RECEIVING
                 RE_DATA = lt_item .
    you will get the data in lt_item.. table
    Thanks,
    Shailaja Ainala.

  • Need sample code using windows BitBlt() function to display image in CVI

    Hello all,
    I need a sample code which uses windows BitBlt() function to display image in CVI
    Thank you.
    Bob.

    Hello Bob -
    I'm curious why you'd like to use BitBlt.  What functionality does it offer that you've not seen in the CVI canvas control?
    It's hard to say without knowing what transitions you're looking for, but the canvas is very capable of animating/transitioning.  The place it can fall a little short is if you require access to the alpha channel for transparency.
    I put together a short demo for you - maybe it will address some of what you're looking for.  The important functions are CanvasStartBatchDraw, CanvasEndBatchDraw, and CanvasDrawBitmap.  The animation/transition is driven by a simple UI timer.
    Let me know if you have any questions -
    NickB
    National Instruments
    Attachments:
    CanvasAnimation.zip ‏10 KB

  • Need Sample Code in C#  to Insert,Update,Query data using W 2.0 wsdl

    Hi,
    Can anyone please share sample code in C# to Insert,Update,Query data using W 2.0 wsdl.
    Thanks in advance

    I have found solution.
    Need add following line for non string data type.
    objOutreachUpdateList.Opportunity[0].IndexedNumber0Specified = true;

  • Need sample code to get handle of Selected rows from ADF Table

    Hi,
    I am new to ADF. I have an ADF table based on VO object.On some button action,I need to get handle of selected rows in application module.
    If anybody is having sample code to do this then please share with me.
    Thanks,
    ashok

    wow now link http://blogs.oracle.com/smuenchadf/examples/#134 is working.thanks a lot.
    also the link http://baigsorcl.blogspot.com/2010/06/deleting-multi-selected-rows-from-adf.html is very useful. Thanks a lot for Sameh Nassar too.He made it clear that in 11g Select column is not available for a ADF table and provided a solution to get Select column.
    Thanks,
    ashok

  • Need Sample code to upload the data to Application Server

    Hi ,
    I need to upload the data to application server.
    The output should be an XML file.
    Can anybody send me sample code for this.
    Reward points are assured.
    Best Regards
    Bhagat.

    may be this code wil help ,first to downjload the XML fine -
    1)
    REPORT  zhr_test2_tk.
    TYPE-POOLS: ixml.
    TYPES: BEGIN OF xml_line,
            data(256) TYPE x,
           END OF xml_line.
    DATA: l_ixml            TYPE REF TO if_ixml,
          l_streamfactory   TYPE REF TO if_ixml_stream_factory,
          l_ostream         TYPE REF TO if_ixml_ostream,
          l_renderer        TYPE REF TO if_ixml_renderer,
          l_document        TYPE REF TO if_ixml_document.
    DATA: l_element_position TYPE REF TO if_ixml_element,
          l_element_title    TYPE REF TO if_ixml_element,
           l_element_flight  TYPE REF TO if_ixml_element,
           l_element_from    TYPE REF TO if_ixml_element,
           l_element_to      TYPE REF TO if_ixml_element,
            l_element_dummy   TYPE REF TO if_ixml_element,
             l_value           TYPE string.
    DATA: l_xml_table       TYPE TABLE OF xml_line,
          l_xml_size        TYPE i,
          l_rc              TYPE i.
    DATA: lt_erec TYPE TABLE OF hrp5126,
          l_erec TYPE hrp5126.
    DATA: date(10),
          time(4),
          filepath TYPE string.
    CONSTANTS: filedir TYPE string VALUE 'C:\tmp\',
               filename TYPE string VALUE 'ZHR_test'.
    START-OF-SELECTION.
    fill internal table
      SELECT * FROM hrp5126 INTO TABLE lt_erec.
    Start filling xml DOM object from internal table lt_erec.
      LOOP AT lt_erec INTO l_erec.
    *Create the root node 'position'
        IF sy-tabix EQ 1.
        create an ixml factory
          l_ixml = cl_ixml=>create( ).
        create Document Object Model
          l_document = l_ixml->create_document( ).
       Fill root node with value 'position'
          l_element_position = l_document->create_simple_element(
                         name   = 'position'
                         parent = l_document ).
        ENDIF.
        IF sy-tabix GT 1.
        create element jobtitle as child of position
          l_value = l_erec-jobtitle.
          l_element_title = l_document->create_simple_element(
                             name   = 'job_title'
                             parent = l_element_position
                             value  = l_value ).
          l_value = l_erec-empl_start_date.
          l_element_dummy = l_document->create_simple_element(
                             name   = 'StartDate'
                             parent = l_element_title
                             value  = l_value ).
          l_value = l_erec-empl_end_date.
          l_element_dummy = l_document->create_simple_element(
                             name   = 'EndDate'
                             parent = l_element_title
                             value  = l_value ).
        ENDIF.
      ENDLOOP.
      IF sy-subrc NE 0.
        WRITE: 'No data in table hrp5125'.
      ENDIF.
    create a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
    connect internal XML table to streamfactory
      l_ostream = l_streamfactory->create_ostream_itable(
                      table = l_xml_table ).
    render the document
      l_renderer = l_ixml->create_renderer( ostream  = l_ostream
                                            document = l_document ).
      l_rc = l_renderer->render( ).
    Get time and date
      WRITE sy-uzeit2(2) TO time2(2).
      WRITE sy-uzeit0(2) TO time0(2).
      WRITE sy-datum4(2) TO date0(2).
      WRITE sy-datum6(2) TO date2(2).
      WRITE sy-datum0(4) TO date4(4).
    *Build filename with date and time reference
    CONCATENATE filedir filename date time '.xml' INTO filepath.
    <i>* This is the code I hope to modify in order to save the xml structure on the application server, with a specified filepath.</i>
    <b>  OPEN DATASET filepath FOR OUTPUT IN BINARY MODE.
      LOOP AT lt_erec into l_erec.
        TRANSFER  l_erec TO filepath.
      ENDLOOP.
      CLOSE DATASET filepath.</b>
    save XML document
      l_xml_size = l_ostream->get_num_written_raw( ).
    *This is the code for download to local computer
    CALL METHOD cl_gui_frontend_services=>gui_download
       EXPORTING
         bin_filesize            = l_xml_size
         filename                = filepath
         filetype                = 'BIN'
       CHANGING
         data_tab                = l_xml_table
       EXCEPTIONS
         file_write_error        = 1
         no_batch                = 2
         gui_refuse_filetransfer = 3
         invalid_type            = 4
         no_authority            = 5
         unknown_error           = 6
         header_not_allowed      = 7
         separator_not_allowed   = 8
         filesize_not_allowed    = 9
         header_too_long         = 10
         dp_error_create         = 11
         dp_error_send           = 12
         dp_error_write          = 13
         unknown_dp_error        = 14
         access_denied           = 15
         dp_out_of_memory        = 16
         disk_full               = 17
         dp_timeout              = 18
         file_not_found          = 19
         dataprovider_exception  = 20
         control_flush_error     = 21
         OTHERS                  = 22.
    IF sy-subrc <> 0.
       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    2) uploading tht PC XML file to APPliaction server -
    DATA rec like QISRS_XML_LINE.
    OPEN DATASET filepath FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    LOOP AT l_xml_table into rec.
    TRANSFER rec TO filepath.
    ENDLOOP.
    CLOSE DATASET filepath.

  • Sample code for connect to database

    Hi
    like to know if there is any sample code for me to follow through to connect to database using ODBC.
    I am currently writing a program in visual c++.
    like to know how to connect database to store image in the database
    using visual c++ code.....
    hope that is not too difficult.

    in JSTL pratical guide for JSP programmers by Sue Spielman
    <sql:setDataSource var="datasource"
    driver="org.gjt.mm.mysql.driver"
    url="jdbc:mysql://localhost/db"
    user="guest"
    password="guest" />
    <sql:query datasource="${datasource}...
    <html>
    <head>
    <title>
    Display Results
    </title>
    </head>
    <body>
    <c:catch var="sqlError">
    <sql:query var="bookList" dataSource="${datasource}">
         SELECT * FROM books WHERE title LIKE 'J%' ORDER BY author
    </sql:query>
    </c:catch>
    <c:if test="${not empty sqlError}" >
    Make sure you have already run the databaseinit.jsp file
    </c:if>
    <h2>Listing all books that start with a 'J', ordered by author</h2>
    <br>
    <table>
    <th>Title</th>
    <th>Author</th>
    <c:forEach var="book" items="${bookList.rows}">
         <tr>
              <td><c:out value="${book.title}" /></td>
              <td><c:out value="${book.author}" /></td>
         </tr>
    </c:forEach>
    </table>
    </table>
    <h2>Show using choose/when/otherwise conditional to display results</h2>
    <table>
    <tr><th>Title</th></tr>
    <c:forEach var="book" varStatus="current" items="${bookList.rows}">
    <tr>
    <c:choose>
         <c:when test="${current.first}" >
              <td><font color="#0000FF"><c:out value="${book.title}"/></font></td>
         </c:when>
         <c:when test="${current.count % 2 == 1 }" >
              <td><font color="#FF0000"><c:out value="${book.title}"/></font></td>
         </c:when>
         <c:otherwise>
              <td><c:out value="${book.title}"/></td>
         </c:otherwise>
    </c:choose>
    </tr>
    </c:forEach>
    </table>
    </body>
    </html>

  • Need sample program OO abap alv using  hotspot( interactive report)

    need sample program on Object Oriented program using alv interactive report.

    *& Report Z8VM_N_PO_PRICING_CONDITION *
    REPORT Z8VM_N_PO_PRICING_CONDITION NO STANDARD PAGE HEADING
    MESSAGE-ID Z8VM.
    vivekanand meghmala
    trial assignment
    po with pricing condition interactive report with checkbox
    data declaration
    TYPES : BEGIN OF STRUCT_EKKO, "po header
    BUKRS LIKE T001-BUKRS,
    EBELN LIKE EKKO-EBELN,
    BSART LIKE EKKO-BSART,
    BEDAT LIKE EKKO-BEDAT,
    EKORG LIKE EKKO-EKORG,
    WAERS LIKE EKKO-WAERS,
    LIFNR LIKE EKKO-LIFNR,
    KNUMV LIKE EKKO-KNUMV,
    END OF STRUCT_EKKO.
    TYPES : BEGIN OF STRUCT_EKPO, "po details
    EBELN LIKE EKPO-EBELN,
    EBELP LIKE EKPO-EBELP,
    MATNR LIKE EKPO-MATNR,
    END OF STRUCT_EKPO.
    TYPES : BEGIN OF STRUCT_KONV,
    KNUMV LIKE KONV-KNUMV,
    KPOSN LIKE KONV-KPOSN,
    KSCHL LIKE KONV-KSCHL,
    KAWRT LIKE KONV-KAWRT,
    KBETR LIKE KONV-KBETR,
    END OF STRUCT_KONV.
    DATA : IT_EKKO TYPE STANDARD TABLE OF STRUCT_EKKO WITH HEADER LINE.
    DATA : IT_EKPO TYPE STANDARD TABLE OF STRUCT_EKPO WITH HEADER LINE.
    DATA : IT_KONV TYPE STANDARD TABLE OF STRUCT_KONV WITH HEADER LINE.
    PARAMETERS : T_BUKRS LIKE EKKO-BUKRS .
    SELECT-OPTIONS : S_BEDAT FOR IT_EKKO-BEDAT.
    SELECT-OPTIONS : S_EKORG FOR IT_EKKO-EKORG.
    validations
    AT SELECTION-SCREEN.
    IF T_BUKRS = ' '.
    MESSAGE E009.
    ENDIF.
    SELECT BUKRS FROM T001
    INTO CORRESPONDING FIELDS OF IT_EKKO
    WHERE BUKRS = T_BUKRS.
    EXIT.
    ENDSELECT.
    IF SY-SUBRC 0.
    MESSAGE E001.
    ENDIF.
    logic
    START-OF-SELECTION.
    SELECT BUKRS
    EBELN
    BSART
    BEDAT
    EKORG
    WAERS
    LIFNR
    KNUMV FROM EKKO INTO CORRESPONDING FIELDS OF TABLE IT_EKKO
    WHERE BUKRS = T_BUKRS
    AND BEDAT IN S_BEDAT
    AND EKORG IN S_EKORG.
    SELECT EBELN
    EBELP
    MATNR FROM EKPO INTO CORRESPONDING FIELDS OF IT_EKPO
    FOR ALL ENTRIES IN IT_EKKO WHERE EBELN = IT_EKKO-EBELN.
    APPEND IT_EKPO.
    ENDSELECT.
    LOOP AT IT_EKPO.
    SELECT KNUMV
    KPOSN
    KSCHL
    KAWRT
    KBETR FROM KONV INTO CORRESPONDING FIELDS OF IT_KONV
    WHERE KPOSN = IT_EKPO-EBELP.
    APPEND IT_KONV.
    ENDSELECT.
    ENDLOOP.
    *data printing
    LOOP AT IT_EKKO.
    WRITE :/ IT_EKKO-BUKRS,IT_EKKO-EBELN,IT_EKKO-BSART,IT_EKKO-BEDAT,
    IT_EKKO-EKORG,IT_EKKO-WAERS,IT_EKKO-LIFNR,IT_EKKO-KNUMV.
    LOOP AT IT_EKPO WHERE EBELN = IT_EKKO-EBELN.
    WRITE :/ IT_EKPO-EBELP,IT_EKPO-MATNR.
    LOOP AT IT_KONV.
    WHERE KPOSN = IT_EKPO-EBELN.
    WRITE :/ IT_KONV-KNUMV COLOR 3,IT_KONV-KPOSN COLOR 3,IT_KONV-KSCHL COLOR 3,IT_KONV-KAWRT COLOR 3,IT_KONV-KBETR COLOR 3.
    ENDLOOP.
    ENDLOOP.
    ENDLOOP.[/code]
    thanks
    reward if helpful

  • Pleasee Help , URGENTT , Need sample code

    We should upload Sales Order XML File into OA Tables everyday .
    As I am very new to XML I request to give complete sample code ( giving just the logic needs time to understand, very urgent..)
    The current XML File can have mutilpe one sales order and each sales order can have many lines .Each line can have multiple taxes.
    Pls give the sample Code which you think is the best approach.
    I have used xpath(may not be right)
    I want to insert Parent Node / Child Node / Grand Child Done as one set of data.
    I used Xpath syntax , when I give the Parent node path in for loop, it inserts all parent nodes data at one time into the table , similarly all child nodes at one time .
    So I am unable to link grand child record with child record and parent record.
    To be specific , I am unable to trace these are the tax records for this line from this order.
    I have used xpath. I have loaded the xml file into table with clob variable
    l_OrderRequest_nodelist := xslprocessor.selectNodes(xmldom.makeNode(l_doc), '/Recordset');
    FOR rec IN 0 .. xmldom.getlength(l_OrderRequest_nodelist) -1 loop l_OrderRequest_node := xmldom.item(l_OrderRequest_nodelist,
    rec);
    end loop;
    we are not validating Sales order XML File with DTD or XSD .
    Please give sample code for parent / child /grandchild .
    Below is the sample file.
    - <Recordset>
    - <Header dueDate="2007-01-17T16:09:05" orderDate="2004-01-17" orderID="0009" transactionID="1389" type="new">
    <KeyIndex>2</KeyIndex>
    - <BillTo>
    - <Address addressID="5619" isoCountryCode="US">
    <Name>fMat</Name>
    - <PostalAddress name="default">
    <Street>34545</Street>
    <City>dfgfg</City>
    <State>AZ</State>
    <PostalCode>85086-1693</PostalCode>
    <County>Maricopa</County>
    <Country>US</Country>
    </PostalAddress>
    <Email name="default">[email protected]</Email>
    </Address>
    </BillTo>
    <PromotionCode />
    - <SubTotal>
    <Money currency="USD">32.49</Money>
    </SubTotal>
    - <Tax>
    <Money currency="USD">2.32</Money>
    <Description />
    </Tax>
    - <Shipping>
    <Money currency="USD">8.95</Money>
    <Description />
    </Shipping>
    </Header>
    - <Detail lineNumber="1" quantity="1">
    - <ItemDetail>
    - <UnitPrice>
    <Money currency="USD">29.99</Money>
    </UnitPrice>
    <ShortName>Little;reg; pxxxx® Learning System</ShortName>
    </ItemDetail>
    - <Tax>
    <Money currency="USD">1.68</Money>
    <Description />
    - <TaxDetail category="sales">
    - <TaxAmount>
    <Money currency="USD">1.68</Money>
    </TaxAmount>
    <TaxLocation>AZ</TaxLocation>
    </TaxDetail>
    </Tax>
    </Detail>
    - <Detail lineNumber="2" quantity="1">
    - <ItemDetail>
    - <UnitPrice>
    <Money currency="USD">29.99</Money>
    </UnitPrice>
    <ShortName>Little;reg; pxxxx® Learning System</ShortName>
    </ItemDetail>
    - <Tax>
    <Money currency="USD">1.68</Money>
    <Description />
    - <TaxDetail category="sales">
    - <TaxAmount>
    <Money currency="USD">1.68</Money>
    </TaxAmount>
    <TaxLocation>AZ</TaxLocation>
    </TaxDetail>
    </Tax>
    - <Tax>
    <Money currency="USD">0.68</Money>
    <Description />
    - <TaxDetail category="sales">
    - <TaxAmount>
    <Money currency="USD">0.68</Money>
    </TaxAmount>
    <TaxLocation>DISTRICT</TaxLocation>
    </TaxDetail>
    </Tax>
    </Detail>
    </Recordset>
    We are working on Oracle9i Enterprise Edition Release 9.2.0.6.0
    Thanks in Adv
    Kal

    Hi
    here is a quick demo:
    DATA: a,b, result(10).
    IF a IS Initial.
      Result = 'yes'.
    ELSEIF NOT a IS Initial AND NOT b is initial.
      Result = 'no'.
    Else.
    RESULT = 'abc'.
    ENDIF.

  • Need Sample code to retrieve Data from Portal DB(Oracle)

    Would anyone provide me steps to create application with a sample code to retrieve data from portal DB which is oracle and see the output in table format.

    Hi Bris ,
    The sample code , you didnt specified from where do u want to access the oracle thorough java code or through webdynpro .
    Sample code to access through Java
    import java.sql.*;
    class Customer
    public static void main(String args[]) throws SQLException
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    System.out.println("Connecting to the database...");
    try
    Connection cn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","scott","t");
    Statement st=cn.createStatement();
    ResultSet rs=st.executeQuery("select 'Connected' from dual");
    rs.next();
    String s=rs.getString(1);
    System.out.println(s);
    st.close();
    cn.close();
    catch(Exception ex)
    System.out.println("The exception raised is:" + ex);
    [code]
    If accessing through JDBC datasorce.
    https://www.sdn.sap.com/irj/sdn/thread?threadID=328550
    https://www.sdn.sap.com/irj/sdn/thread?threadID=309386
    [code]
    package com.dhl.employeemodel;
    import java.sql.Connection;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    public class DBConnectionManager {
         Connection connection;
          * @return
         public Connection getConnection() {
              try
                   Context jndiContext = new InitialContext();
                   DataSource ds = (DataSource)jndiContext.lookup("jdbc/MyAlias");
                   connection = ds.getConnection();
             catch(Exception connectionErrEx)
                   //connectionErrEx.printStackTrace();
                   return null;
              return connection;
    Thanx
    Pankaj

  • Can I get a sample code on how to use CL_GUI_ALV_GRID........

    Can I get a sample code and documents on how to use CL_GUI_ALV_GRID, cl_gui_custom_container. Or cl_salv_table
    I want to create an ALV report and pick my columns with header information.
    Thanks,
    Eric.
    Moderator Message: There are enough sample codes and documents on how to use CL_GUI_ALV_GRID. Please search for them.
    Edited by: kishan P on Nov 12, 2010 10:53 AM

    Hi Eric Adinku,
    There are many reports available. In SE38 check reports starting with BCALV & SALV. Few examples include :
    BCALV_EDIT_01
    BCALV_EDIT_02
    Thanks & Regards,
    Faheem.

Maybe you are looking for

  • Search help how to restrict number of hits.

    Hi, I have created a search help in SE11, the search help reads a table view and the search help is connected to exit HRMC_PREM_EXIT_A in HR. Everything works fine except for that I want to restrict the number of hits to 500, I don't want to get a re

  • Win 7 Pro x64 will not sign into iCloud

    I am attempting to get iCloud set up on my Win 7 Pro x64 machine, and I am getting the following symptoms: - In input my username and password into the control panel and it just sits there and spins.  I end up having to cancel out of it to close the

  • New podcast episode downloads in subscription but not shown in episode list

    We are uploading podcasts under the name Rivendell Fellowship. (link is http://itunes.apple.com/us/podcast/rivendell-fellowship/id392550297) I subscribe and the most recent episode downloaded automatically and plays in I-tunes. But when I search thro

  • IDE relationship confusion studio ONE vs netbeans , etc

    I have been using an IDE to make my Swing GUI. It has been very helpful. I use Sun ONE STudio 4 Community Edition because it seemed like the standard. I am confused that it says it is built on netbeans. Does that mean it uses the netbeans code and im

  • Content aware fill - how to sample from small area?

    Is there a way how to sample from small area and then apply content aware fill to the much more bigger area? For example - there is an object on a table. The object fills 90% of the image and the table 10% image. Now, I just want to delete the object