Import parameters in jco

All,
Can anyone tell me how to use a table import parameters in a jco call
Thanks

One Example using Sap Enterprise Connector with JCO:
RFC: BAPI_FLIGHT_GETLIST
EnterpriseConectorTest connector = null;
try {
     connector = new EnterpriseConectorTest();
     connector.client = JCO.getClient(POOL_NAME);
     System.out.println("Client: " + connector.client.getAttributes());
     Bapi_Flight_Getlist_Input input = new Bapi_Flight_Getlist_Input();
     BAPI_FLIGHT_GETLIST_PortType proxy = new BAPI_FLIGHT_GETLIST_PortType();
     proxy.messageSpecifier.setJcoClient(connector.client);
     //BapisfldatType datType = new  BapisfldatType();
     //datType.setAirline("AA");
     //Bapi0002_1Type types = new Bapi0002_1Type();
     //types.setComp_Code("AA");
     input.setAirline("AA");
     Bapi_Flight_Getlist_Output output = proxy.bapi_Flight_Getlist(input);
     BapisfldatType[] list = output.getFlight_List();
     System.out.println("Size: " + list.length);
     for (int i = 0; i < list.length; i++) {
          BapisfldatType type = list<i>;
          System.out.println(type.getAirline() + " - " + type.getCityfrom());
} catch (Exception e) {
     e.printStackTrace();
Regards
Marcos

Similar Messages

  • Are Import parameters compressed in external JCo RFC calls?

    I would like to send XML data from a Java program to an SAP ABAP System running on NW 7.02.
    The connection is done by Java Connector 3.0. The XML file should be passed as a parameter of an RFC function module.
    In older versions the data would have been passed as a TABLES parameter and would be compressed automatically if the payload exceeds 8kb or the connection would be marked as a slow connection. (see also Note 977407).
    Now I would like to use the basXML RFC protocol. There it is advised to use Table Types in Import parameters instead of TABLES parameters for table data. Now will the data be compressed if I send them as Table data in an Import parameter? And will they also be compressed when I send them as an Import parameter as STRING or XSTRING instead of a table?
    Unfortunately the help documentation is incomplete on these topics and I did not find any details for this scenario.

    Yes it is possible
    SAP JCo can be implemented with Desktop applications and with Web server applications.
    SAP JCo is used as an integrated component in the following applications:
    ●     SAP Business Connector, for communication with external Java applications
    ●     in the Application Server, for connecting the integrated J2EE server with the ABAP environment.
    SAP JCo can also be implemented as a standalone component, for example to establish communication with the SAP system for individual online (web) applications.
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/09/a4a9e1d51d11d6b2c200508b5d5c51/frameset.htm

  • Exporting and importing parameters

    Hi,
    Can any one explain how the exporting and imopting parameters work in case of function call.
    for example in the folowing code:
    CALL FUNCTION ‘DOWNLOAD’
         EXPORTING
              FILENAME     = <default file name>
              FILETYPE     = <default file type>
              MODE          = <create new or extend>
         IMPORTING
              FILESIZE     = <size of file in bytes>
         TABLES
              DATA_TAB     = <internal table to transfer>
         EXCEPTIONS. . . .
    Do we have to specify the importin parameters also in the program, and if yes what is the use of specifying them.
    Thanks,
    Dhiraj

    You need to fill only export parameter and tables parameter
    CALL FUNCTION ‘DOWNLOAD’
    EXPORTING
    FILENAME = <default file name> -> specify local file name
    FILETYPE = <default file type> 'ASC'
    MODE = <create new or extend> comment mode
    IMPORTING -> comment import parameters
    FILESIZE = <size of file in bytes> comment
    TABLES
    DATA_TAB = <internal table to transfer> -> give internal table
    EXCEPTIONS. . . . uncomment all exceptions
    this FM will download the data from internal table data to local file as like.txt or .xls
    Thanks
    Seshu

  • How does one pass import parameters to a report within a method?

    Hello all,
    Well how does one  pass import parameters to a report which is within a method ...end method.
    for example :
    method 123
    SUBMIT reportname using selection '1000'
    endmethod .
    Here we need to pass values into the selection screen and run the report for those values.
    The values are say 'ABC'   (  tablename "DEF" and field name "HIJ" ).
    I hope the question is clear, awaiting your response 
    Thanks and Regards,
    Sandeep.

    Go to SE24
    Parameters: Give the Parameter name, Typing method is "Type" is the domain type that u are selecting, say for e.g :  Parameter is "P_CONT" , its associated type "CHAR32" etc
    For Select Options:  Parameter name say "S_CUST", Type"importing". For this you need to give an associated type which must be created as "TABLE TYPE " in SE11. That table type needs to have a "LINE TYPE" .
    LINE TYPE is a Structure created with components "SIGN, OPTION, LOW & HIGH" for select-Options.
    NOTE: for a Table type related to Customer data fields "say KUNNR", the line type created must have the Component Type and data Type corresponding to the Data Element associated with "KUNNR" ;i.e: "CHAR" etc.
    See if this is clear to you or revert back in case of any Confusion.

  • Export/Import Parameters dissapear when using user-exit

    I am using some import/export parameters in a dynamic action when I create a new record (infotype). I am also using a user exit to avoid modifying BEGDA and ENDDA when I modify the record (IPSYST = 'MOD'). Using this user-exit, the parameters dissapear from memory so the dynamic action does not execute well. What can I do to use the user-exit?? Anything to add?

    In the dinamic actions when I create, I delimit records on infotype with export/import parameters defined in infotype Module Pool. When I delete, I avoid deleting the record if it is not the last one. With the user-exit the modification of begda endda in infotype is not allowed. If I use the user-exit, the dinamic actions which use export/import parameters, don't work.
    I have tried to do in MP what I do in user-exit but it is not easy because I haven´t got in PSAVE what I want.

  • Get Import Parameters of a Function Module

    Hi,
    Is there a way to find the import parameters and their Data Type of a Function Module in any Table??
    For example, i know i can find the name and the include of the Funtion Module in TFDIR. Is there anywhere i can find the list of Import Parameters and their Data Types??
    Thanks and Regards,
    Kaeyur

    you can use
    Data: lv_type type c.
    clear:lv_type.
    DESCRIBE FIELD p_bukrs TYPE lv_type.
    It will return C as its type C and p_bukrs is selection screen parameter.
    hope this helps.

  • Import parameters in a FM with a previous date

    Dear experts,
    I need to default the import parameters in one of my function modules with a previous date.
    For eg: if i hiit F8 on my Z** function module the default value should be YESTERDAYS date NOT todays date.
    How can i do this?
    Thanks
    Ricky

    Check in the code whether the import parameter was supplied, and if it wasn't, then calculate the value by deducting 1 from today's date.
    So something like:
    IF I_DATE IS NOT SUPPLIED.
      I_DATE = SY-DATUM - 1.
    ENDIF.
    Edit: Upon re-reading your question, I see that you want to set the default only in the FM test environment... off the top of my head, I don't know a way to calculate the previous day like that. But the above code works as setting a default if the FM is called from a program - provided the parameter is set up as 'Pass by value'.
    Edited by: Tamas Hoznek on Apr 21, 2011 12:07 PM

  • VBA and RFC - How to deal with tables in export/import parameters

    Hi,
    maybe one of you can support me...
    I have a couple of vba modules reading and writing data to SAP by means of function modules. As usual, they use export and import parameters as well as tables (in the table section). They work very well.
    Now, I want to execute some newer function modules and they don't use tables in the table section (because they're obsolete nowadays), instead they expect the tables as export resp. import parameters. I tried it in a couple of ways, without any success.
    Has anybody tried this before? And if so, do you mind share some snippets?
    Best regards, Thomas

    Hello Thomas,
    I think we discussed the same problem here, but unfortunately without any result. Please, take a look at this post and let us know.
    Cheers
    Stefan

  • Importing parameters in Function Module SD_VBFA_ARRAY_READ_VBELV

    Hi All,
    Please let me know the use of importing parameters in the Function Module SD_VBFA_ARRAY_READ_VBELV.
    The importing parameters are,
    I_BYPASSING_BUFFER
    I_REFRESH_BUFFER
    I'm having problem of memory overflow in the function module so I thought these importing parameters may help me.
    Kindly explainn me the use of these importing parameters and tell me whether they help m out to avoid memory overflow problem.
    Thanks a lot in advance,
    Rama Krishna

    Hello Rama
    If you bypass the buffer the fm will always read directly from the DB.
    And if you refresh the buffer the buffer is cleared and will be filled again with every call of the fm.
    Regards
      Uwe

  • Selection for up to 3 import parameters

    Hi,
    I am creating a FM for a BAPI that has to select data based on the following prerequisites:
    2 tables are to be used:
    table_h:
    salesman_no  key     BusinessPartner
    record last changed   DATS
    table_i
    Salesman_no  key    BusinessPartner
    ProductID                
    ProductPrice
    A bapi has to be generated from a FM that has these import parameters:
    I_Salesman_no1
    I_Salesman_no2
    I_Salesman_no3
    The user who requests the data can ask for 1 to 3, but at least 1. That gives the 3 possible combination of searched:
    Salesman_no1 only (mandatory for search)
    Salesman_no1 and Salesman_no2
    Salesman_no1 and Salesman_no2 and Salesman_no3
    The search has to find productprices for either 1, 2 or 3 salesmen and return the data to an output table within the FM.
    What puzzles me is: How to handle the various numbers of import  parameters / selections in the source code for the FM ?

    You can create a range and fillup the values in the range and use that range in the selection.
    Like:
    DATA: R_KUNNR TYPE RANGE OF KNA1-KUNNR,
    LA_KUNNR LIKE LINE OF R_KUNNR.
    IF I_IMPORT_1 IS NOT INITIAL.
    LA_KUNNR-SIGN = 'I'.
    LA_KUNNR-OPTION = 'EQ'
    LA_KUNNR-LOW = I_IMPORT_1.
    APPEND LA_KUNNR TO R_KUNNR.
    CLEAR LA_KUNNR.
    ENDIF.
    IF I_IMPORT_2 IS NOT INITIAL.
    LA_KUNNR-SIGN = 'I'.
    LA_KUNNR-OPTION = 'EQ'
    LA_KUNNR-LOW = I_IMPORT_2.
    APPEND LA_KUNNR TO R_KUNNR.
    CLEAR LA_KUNNR.
    ENDIF.
    IF I_IMPORT_3 IS NOT INITIAL.
    LA_KUNNR-SIGN = 'I'.
    LA_KUNNR-OPTION = 'EQ'
    LA_KUNNR-LOW = I_IMPORT_3.
    APPEND LA_KUNNR TO R_KUNNR.
    CLEAR LA_KUNNR.
    ENDIF.
    SELECT KUNNR
    INTO IT_KNA1
    FROM KNA1
    WHERE KUNNR IN R_KUNNR.
    Regards,
    Naimesh Patel

  • Can one method  import parameters can be added in another method parameters

    hello all,
    I am using a BADI   WORKORDER_UPDATE  in which In_update method is there with certain import parameters.
    I want some of those parameters in another method named at_release of same BADI .
    Those import parameters are not there in at_release. They are only in Import of in_update.
    I have actually created an Implementation of the BADI.
    I dont know how to do that please let me know.
    Thanks in advance.

    Hello Sonal
    The solution for your problem is quite simple:
    Define all required IMPORTING parameters of IN_UPDATE as instance attributes of your class, e.g.:
    MT_HEADER    TYPE cobai_t_header.
    Within method IN_UPDATE store the required IMPORTING parameters, e.g.:
    METHOD IF_EX_WORKORDER_UPDATE~IN_UPDATE.
      me->mt_header = it_header.
    ENDMETHOD.
    Within method AT_RELEASE you can access the header data like this:
    LOOP AT me->mt_header INTO ...
    ENDLOOP.
    Regards
      Uwe

  • How to call an eCATT programmatically with import parameters

    Hi there,
    I am using function module ECATT_EXECUTE to call test scripts from within ABAP test code, like below. Unfortunately, I am not able to pass my actual import parameter values. It seems that the interface does not provide a way to pass import parameters to the eCATT.
    Although posted in November, this is still an issue for me. Does anybody know an answer?
      call function 'ECATT_EXECUTE'
        exporting
          to_execute              = lt_script
          display_log             = space
          i_supress_output        = 'X'
        importing
          executed                = lt_executed
          logid                   = ls_logid
          trace_prot              = lt_trace
        exceptions
          nothing_to_do           = 1
          too_many_scripts_called = 2
          others                  = 3.
    Does anybody reading this have a solution?
    Thanks and regards,
    Rüdiger
    Edited by: Rüdiger Plantiko on Jan 17, 2008 3:05 PM
    Edited by: Rüdiger Plantiko on Jan 17, 2008 3:05 PM

    Hello Rüdiger,
    direct passover would be fine - well, I've come to get used to finding workarounds in SAP though. Maybe, the function module will support the missing parameters in some forthcoming release.
    Btw I switched over to tables ECTC_VAR / ECTC_DATA and pass obj_type = 'ECTC' to ECATT_EXECUTE, since test configurations can directly be executed.
    You don't happen to know what has to be done, if the call of ECATT_EXECUTE results in a dump? After correctly executing the test configuration. Looks like eCatt tries to put the resulting log to nowhere. Perhaps I have to initialize some kind of a log receiver first or set some option in the start profile? I passed DISPLAY_LOG = SPACE, and SUPPRESS_OUTPUT = 'X'.
    Dump was:
    Laufzeitfehler         OBJECTS_OBJREF_NOT_ASSIGNED
    Datum und Zeit         05.03.2008 17:37:00
    Zeile Quelltext
         1 METHOD http_send_and_receive .
         2
         3   DATA: l_errortext       TYPE string.
         4   DATA: l_http_subrc      TYPE sy-subrc.
         5 *----------------------------------------------------------------
         6
    >>>>>   im_http_client->request->set_data( data = im_request ).
         8
    Aktive Aufrufe/Ereignisse
    Nr.   Art          Programm                            Include                             Zeile
          Name
        6 METHOD       CL_HTTP_TESTZONE_RESULT=======CP    CL_HTTP_TESTZONE_RESULT=======CM00Q     7
          CL_HTTP_TESTZONE_RESULT=>HTTP_SEND_AND_RECEIVE
        5 METHOD       CL_HTTP_TESTZONE_RESULT=======CP    CL_HTTP_TESTZONE_RESULT=======CM00O    16
          CL_HTTP_TESTZONE_RESULT=>HTTP_REQUEST_NEWRESULTID
        4 METHOD       CL_HTTP_TESTZONE_RESULT=======CP    CL_HTTP_TESTZONE_RESULT=======CM00T    34
          CL_HTTP_TESTZONE_RESULT=>SEND_TO_RESULT_REPOSITORY
        3 METHOD       CL_APL_ECATT_LOG_TO_RESREP====CP    CL_APL_ECATT_LOG_TO_RESREP====CM001   400
          CL_APL_ECATT_LOG_TO_RESREP=>GET_LOG_DATA
        2 FUNCTION     SAPLECATT_EXECUTE                   LECATT_EXECUTEU01                     888
          ECATT_EXECUTE
        1 EVENT        ZDSD_SL_VIA_CATT                    ZDSD_SL_VIA_CATT                       26
          START-OF-SELECTION
    Regards + have a nice weekend,
    Matthias

  • Importing parameters not available in Production system

    Hi Experts,
    I am facing an issue after moving my objects into Production system.
    I have created a calss and which contains five methods. Each method contains itsown importing parameter. There is one method to send mail, which contains three importing Parameters. I have captured this class and the methods in a TR and basis team moved this TR into production system.
    The TR has  moved successfully into the production system. But when I checked the Parameters of the class SEND_EMAIL has only one importing parameter insted of three.
    Again I created a new TR and captured all the objects related to Class, which contains class definition, methods etc.
    I have moved it to quality system successfuly. When I checked in quality i can see the three importing parametrs in SEND_EMAIL method.
    This TR has moved to Production successfully. When I checked in production I can see only one importing parameter in SEND_EMAIL method.
    But it is showing same active version in Quality and Production.
    Please suggest me how can I resolve this issue?
    Thanks
    Pradeep.

    Dear Pradeep
    First you check the parameter which u are sending that are already in prd server exist or not
    some there are some thing we can see which are available in qua those are not seen in production
    see in se06 and try to modify the exact component to modifaible state
    check sp pack of qua and prd are one and the same
    check kernal rel level in both
    check chmod  and chown are same in both
    Regards

  • UDF Importing Parameters

    Hi all,
    I have a user defined function which contains 32 importing parameters to pass to RFC for RFC lookup.
    But in UDF editor its allowing only 20 importing parameters to enter.
    Can any one help me out in this?
    please suggest me a best way to proceed.
    Thanks in advance,
    Sri.
    Message was edited by:
            sri kanth

    Hi sri,
    make two UDFs:
    The first write 20 parameters in an arrayList and writes it to the global container element
    The second read the global container element and the remaining parameters.
    Regards Mario

  • RFC importing parameters values

    Hi guys,
    One doubt, I've implemented an RFC with a table and an importing parameter of the the type char.
    I've done the mapping on the IR and everything is ok.
    When I test the scenario, I've introduced a breakpoint on the R/3 side to check if the values are coming right on the rfc, and I'm not getting any values on the table or on the char parameter.
    What is the "catch" that I'm missing...?
    Thanks in advance.

    Hi Naveen,
    I've been trying to see if there was any other problem but I can't get anything...
    On the R/3 side I now have two importing parameters, two tables and in the exporting parameters I have one char.
    "are u testing end to end , that is from xi to r3 or just testign your rfc on the abap side??"
    >> The scenario is an end to end, XI calling R/3, sending the xml file with a structure expected (theoretically) by R/3.
    "also if you were testing from xi, do u see testing data in sxmb_moni??"
    >> Yes, I see my XML file one the sending data.
    did you make any changes to the rfc after you imported the rfc into XI??
    >> No, the RFC is rightly imported...
    When I test the scenario, when the RFC is called, on the breakpoint I don't get any of the tables filled...
    Do you have any suggestions why isn't XI filling the tables?

Maybe you are looking for

  • Response.sendRequest() question

    Hi, My question concerns, the sendRedirect method of the response object. In one of my jsp's I have an if statement that sendRedirect's to another page if it evaluates to true. The odd thing that occurs is when it is supposed to redirect, the rest of

  • Unable to attach documents in Edit mode of Reply to a Discussion

    Hi SCN, I am unable to attach documents in Edit mode of Reply to a Discussion (No Choose file button). Is it a bug or a specific case due to some circumstances? Referring to thread How to maintain total asset price  where I was trying to replace an a

  • Pictures in iphoto not showing

    I just purchased a new MacBook pro and transferred all my files from my 2007 MacBook.  Everything worked well but now, there are many pictures in my iPhoto library that are showing up as grey squares.  Sometimes, when I'm scrolling, I can see the pic

  • Archiving invoices

    We have a requirement regarding archiving invoice. That is " Is it possible to archive an sales invoice when theere is an accounting error or invoice not posted into accounts because of account determination problem?" Due to some business reasons we

  • How to shrink TBS_DATA

    Dear All, I am working on Oracle 10g I am trying to import a DMP file with no data in it and the DMP file is about 2MB. After import it turns out that the TBS_DATA that is booked for usage is about 30 GB. It looks like when creating the objects/ the