A Problem about BAPI

Hi,everyone.
Now i want to use JCo and BAPI to execute a function(create sales order ps:transaction code is VA01).
How do i to find the BAPI that i need?
And where can i find some documents about BAPI?
Thx~~ a lot
PS:if this topic isn`t suitable in Java Programming,plz tell me thx ,^^ 
                     by Louis

HI Louis,
   You can find out the bapis , by running transaction -bapi (Bapi Explorer).
Here u get a list of standard BAPI's given by SAP.
u can select appropriate bapi  from here.. Associated with each bapi documentation is there . from this u will get a clear picture of import params ,export params and tables.
Now to execute  BAPI  or RFC using JCO,
please go through this sample piece of code. fill the params of standard jco methods with appropriate parameters for your use.
private static JCO.Client client;
private static JCO.Repository repository;
client =
                    JCO.createClient(
                         "<client num>",
                         "<user name>",
                         "<password>",
                         "en",
                         "<server ip or server name>",
                         "<instance number>");
               client.connect();
               repository = new JCO.Repository("REP", client);
try {
IFunctionTemplate m_read_container;
m_read_container =repository.getFunctionTemplate("<RFC Name>");
JCO.Function function_read_cont  = m_read_container.getFunction();
JCO.ParameterList importparam =
function_read_cont.getImportParameterList();
importparam.setValue(<Your value to pass>, "<Import parameter name as in RFC>");
client.execute(function_read_cont);
JCO.ParameterList tables =
   function_read_cont.getTableParameterList();
//For Tables
JCO.Table container = tables.getTable("<Your table Name from table parameter>");
for (int iCtr = 0; iCtr < container.getNumRows(); iCtr++) {
container.setRow(iCtr);
Strin value = container.getString("<Tale fieldName>");
JCO.ParameterList exp_abs_read =
function_read_cont.getExportParameterList();//For Export Params
JCO.Structure st_abs_read =
exp_abs_read.getStructure("<If structure using then give structure name>");
for (int iCtrst = 0;iCtrst < st_abs_read.getNumFields();
                         iCtrst++) {
                         //          String str_field_val = st_abs_read.getString("<Structure Field Name>"));
String fieldName = st_abs_read.getName(iCtrst);
} catch (Exception e) {
                             Regards
                              Kishor Gopinathan

Similar Messages

  • A problem about bapi dd check

    Hi, all.
        I tried to use arfc2 to call a bapi to get PO data from R/3 in 7.1.1. So I did model binding for my component controller`s context. Then I tried to get the result from these parameters programly. But I always got dd check error.
    For example. If an attribute "A" `s data type is int. But the attribute "A" is empty in R/3, so it always returns " " to the attribue "A". Then it will raise an dd check error. The bapi which I used is BAPI_PO_GET_LIST. There are many attributes with this bapi. How can I solve this problem?
    Thanks.

    Hi,
    please check if the below link can help in your case.
    [https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bc_db/~form/handler]
    Regards
    Narendra
    Edited by: Narendra Singh on Apr 3, 2009 11:54 AM

  • A Problem about BAPI (BAPI_SALESORDER_CREATEFROMDAT2)

    Hi, all.
    Now i try to use BAPI to create order,following is part of my codes:
    function=this.createFunction("BAPI_SALESORDER_CREATEFROMDAT2 ");
                       JCO.ParameterList input = function.getImportParameterList();
                       JCO.ParameterList table = function.getTableParameterList();
                       JCO.Structure ORDER_HEADER_IN = input.getStructure("ORDER_HEADER_IN");
                        ORDER_HEADER_IN.setValue("TA","DOC_TYPE");
                        ORDER_HEADER_IN.setValue("3000","SALES_ORG");
                        ORDER_HEADER_IN.setValue("10","DISTR_CHAN");
                        ORDER_HEADER_IN.setValue("00","DIVISION");
    JCO.Table ORDER_PARTNERS = table.getTable("ORDER_PARTNERS");
    ORDER_PARTNERS.setValue("SP","PARTN_ROLE");
                  ORDER_PARTNERS.setValue("3250","PARTN_NUMB");
    JCO.Table ORDER_ITEMS_IN = table.getTable("ORDER_ITEMS_IN");
                  ORDER_ITEMS_IN.setValue("P104","MATERIAL");
                  ORDER_ITEMS_IN.setValue("10","ITM_NUMBER");
    I ha already setup "ORDER_HEADER_IN"`s parameters.
    But i still can`t create an order successfully.
    And i got two message:
    1.Plz enter sold-to party or ship-to party
    2.Sales documents was not changed.
    Can anyone help me solve this situation?

    hi Louis,
       Checkout the link..,
      http://www.henrikfrank.dk/abapexamples/Java/sapjava_createsalesorder.htm
      hope it helps..,
    regards,
    Vinoth

  • Problem about bapi BAPI_ACC_DOCUMENT_POST

    Field rstgr in bseg table am not able to field this field in BAPI, what can i do ,help me ,pls.

    Hi,
    you could play a dangerous game, modifying the value in the memory of the Abap program. I give you an example :
      field-symbols: <field1> type any ,
                     <field2> type any .
      data : w_field1(30) value '(SAPMM06I)PREIS_KSCHL' ,
             w_field2(30) value '(ZZ_FG007)KSCHL'.
      assign (w_field1) to <field1>.
      check sy-subrc eq space.
      assign (w_field2) to <field2>.
      check sy-subrc eq space.
      move <field2> to <field1>.
    in this code I will modify the value of of the field PREIS_KSCHL in the program SAPMM06I (I'm not in this program when I do that).
    but ... it's quiete dangerous
    Fred

  • Question about BAPI Performance

    I am currently evaluating options to implement interface between legacy systems and SAP. We have a requirement to post goodsmovement from external application. As some of my team claim that the BAPI approach can cause performance problems. I would like to cross check whether the claim is true.
    And if it is, May I have your advice how can we prevent such problem about performance?
    Ho w can I get additional source of information?
    Kindly advise.
    The BAPI which we are going to use is BAPI_GOODSMVT_CREATE
    Thank you

    No performance problem is there.
    Infact BAPI is advisable against BDC. Also since BAPI is like FM there is no issue.
    I am using it in lot of the objects we have created.
    Cheers
    Regards
    Nishant

  • An old and difficult problem about "UnsatisfiedLinkError"

    Hi dear all,
    I have been struck with the problem about "UnsatisfiedLinkError". I have a c++ class HelloWorld with a method hello(), and I want to call it from within a java class. In fact, I have succeeded in calling it on the windows platform. But when I transfer it to linux, the error "UnsatisfiedLinkError" comes out. I have tried to take the measures as Forum has suggested, but it failed.
    The source code is very simple to demonstrate JNI.
    "HelloWorld.h"
    #ifndef INCLUDEDHELLOWORLD_H
    #define INCLUDEDHELLOWORLD_H
    class HelloWorld
    public:
    void hello();
    #endif
    "HelloWorld.cpp"
    #include <iostream>
    #include "HelloWorld.h"
    using namespace std;
    void HelloWorld::hello()
    cout << "Hello, World!" << endl;
    "JHelloWorld.java"
    public class JHelloWorld
    public native void hello();
    static
    System.loadLibrary("hellolib");
    public static void main(String[] argv)
    JHelloWorld hw = new JHelloWorld();
    hw.hello();
    "JHelloWorld.cpp"
    #include <iostream>
    #include <jni.h>
    #include "HelloWorld.h"
    #include "JHelloWorld.h"
    JNIEXPORT void JNICALL Java_JHelloWorld_hello (JNIEnv * env, jobject obj)
    HelloWorld hw;
    hw.hello();
    All the files are in the same directory and all the processes are under the dirctory:
    1. javac JHelloWorld.java
    2. javah -classpath . JHelloWorld
    3. g++ -c -I/usr/java/jdk1.3/include -I/usr/java/jdk1.3/include/linux JHelloWorld.cpp HelloWorld.cpp
    4. ld -shared -o hellolib.so *.o
    5. java -cp . -Djava.library.path=. JHelloWorld
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no hellolib in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1349)
    at java.lang.Runtime.loadLibrary0(Runtime.java:749)
    at java.lang.System.loadLibrary(System.java:820)
    at JHelloWorld.<clinit>(JHelloWorld.java:7)
    Tried another measure:
    i) export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
    ii)java -cp . JHelloWorld
    The same error came out as above.
    I really don't know what is wrong with it.
    Would you like to help me as soon as possible?
    Thanks.
    Regards,
    Johnson

    Hi Fabio,
    Thanks a lot for your help.
    It is very kind of you.
    Regards,
    Johnson

  • A problem about calling Labview vi in VB

    Hi all:
    I meeting a problem about data transfer and parallel operation between VB and Labview.
    Actually, I want develop a VB program, in which, the Labview VI can be called and corresponding parameters can be transferred to Labview. and then, I also can operate my system by VB program at same time. something like parallel operation (VB and Labview program).
     But the question is :
    1.   If I use "Call" method of ActiveX in VB,  and the LabVIEW subvi is not stopped (for example, a loop structure), I can not do  parallel operation on VB program. The error message is "other application is busy" which is attached below. The sample codes is also attached.
    2.   I tried to use other methods like "OpenFrontPanel" and "Run", but I am not sure how to transfer the parameter??
    3.  Then I tried to use "SetControlValue" to set the parameters, but there is a error " := expected", which is very strange, because the statement  I wrote is followed with the help documents [ eg: VI.SetControlValue ("string", value)], why it is still need a "=" ??
    Does anybody know something about it? Thanks a lot
    Message Edited by hanwei on 11-07-2008 03:18 PM
    Attachments:
    vb_labview_error_message_1.JPG ‏14 KB
    VB_to_LV.zip ‏10 KB

    I sure hope OP has solved it by now.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • HT201210 hi everyone, i have a problem about my iphone 4S, doesn't work with wifi connection and bluetooth since upgrade to the IOS 7.0.3. Can anyone can help me tosolve this problem?????Thank's regards paulus

    hi everyone, i have a problem about my iphone 4S, doesn't work with wifi connection and bluetooth since upgrade to the IOS 7.0.3. Can anyone can help me tosolve this problem?????Thank's regards paulus

    Try the suggestions here to see if they resolve your problem:
    http://support.apple.com/kb/ts1559
    If these don't work you may have a hardware problem. Visit an Apple store for an evaluation or contact Apple Support.

  • Problem about Handling of Empty Files in File Adapter

    Hello everyone,
    NetWeaver 2004s --- XI
    In Sender i have a File Adapter.
    Now i meet a problem about Handling of Empty Files. When i send empty file, but don't cerate a leer message.
    I have seen following text in help document. But in adapter configuration i can not find the correspond parameter.
    can you give me some tips?
    Thx in advance
    best regards
    Yaning
    SAP Help Document über File Adapter
    +Handling of Empty Files
    Specify how empty files (length 0 bytes) are to be handled.
    &#9675;       Do Not Create Message
    No XI messages are created from empty files.
    The files are processed according to the selected Processing Mode.
    For example, if the processing mode is Delete, empty files are deleted in the source directory.
    &#9675;       Process Empty Files
    XI messages are created with an empty main payload.
    The files are processed according to the selected Processing Mode.
    &#9675;       Skip Empty Files
    No XI messages are created from empty files.
    Empty files are skipped and remain in the source directory.+
    Help Docu

    hi,
    it's available since Sp19 for XI 3.0
    and the corresponding SPS fpr XI 7.0
    http://help.sap.com/saphelp_nw04/helpdata/en/44/f565854b7341e6e10000000a1553f6/frameset.htm
    so probably you need to install the new SP
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Problem about sales order stock stock transfer and batch determination

    Hi, experts, I get a problem about sales order stock stock transfer and batch determination.The following is the current situation of my system:
      In OMCG I assigned search procedure ME0001 to both 311 and 311 E and ticked check batch. After that, I found  that if iI need to tranfer unrestricted-use material from storage location 1000 to 2000 with movement type 311, I just need to input * at the field batch, then the system will display all of the available batches. But for the transferring of sales order stock with movement type 311 E, after I input * at the batch field, no batch is displayed and there is also no message from the system.
      Can anybody help me? Is there anything else I need to do? Thanks very much.

    I think my question is not clear, actually I tried 562 E , 411 E and 413 already. all the transaction looking for the sales order but unfortunatly the sales order is deleted  from SAP.

  • Hello apple I have the problem with my iPhone and my friends have this problem too. My iPhone have the problem about calling and answer the call. When I use my iPhone to call I can't hear anything from my iPhone but the person that I call can answer it bu

    Hello apple
    I have the problem with my iPhone and my friends have this problem too.
    My iPhone have the problem about calling and answer the call. When I use my iPhone to call I can't hear anything from my iPhone but the person that I call can answer it but when answer both of us can't hear anything and when I put my iPhone to my face the screen is still on and when I quit the phone application and open it again it will automatic call my recent call. And when my friends call me my iPhone didn't show anything even the missed call I'm only know that I missed the call from messages from carrier. Please check these problem I restored my iPhone for 4 time now in this week. I lived in Hatyai, Songkhla,Thailand and many people in my city have this problem.
    Who have this problem??

    Apple isnt here. this is a user based forum for technical questions. The solution is to restart, reset, and restore as new which is in the manual after that get it replaced for hard ware failure. if your within your one year warranty its replaced if it is out of the warranty then it is 199$

  • Problem about updating to Mac OS X 10.5.3

    Hi there,
    I just bought my Macbook two months ago. I encounted a problem about updating it to the latest version of MAC OS X. The system reminded me to restart, I proceed. Everythig looked just fine until a poping up window shown "Mac OS X 10.5.3 pacakage can not be validated". Dose anyone know what did that mean? How can I update my little mac?

    Hi Hummer,
    First, welcome to Apple discussions.
    To answer your question, your computer checks all downloaded updates before installing them. It does this to make sure it's got the entire file and that the update will install correctly. The fact that validation fails on your machine probably means the file did not download correctly.
    To install 10.5.3, simply go to this website, download the "10.5.3 combo update" and then run it on your Mac: http://www.apple.com/support/downloads/

  • Hardware diagnostic shows me a problem about charging battery. What about it ?

    Hi.
    I bought a MacBook Pro retina 13', mid 14. on last december, and after almost a month I did the hardware test of apple as the Technic support says, and this hardware test shows me a problem about charging battery, so, I wanna know what about it, is it normal ? or is it a battery problem or is it a problem about the Current adaptador ? Thank your for your answers.

    Could be battery, could be adaptor, could be the computer itself.  You will have to take it in for testing.  Fortunately, you are still under warranty.

  • The problem about vrrp

    Dear all,I have a problem about vrrp,my core switch is cisco 3750x and huawei S5700-28C-EI, after I configured vrrp between them,the switch log got the error problem as follow:
    *Jan 11 00:01:43.111: %VRRP-6-STATECHANGE: g1/0 Grp 3 state Backup -> Master
    *Jan 11 00:01:43.111: VRRP: tbridge_smf_update failed
    *Jan 11 00:01:44.187: VRRP: Advertisement from 10.252.200.34 has an incorrect group 10 id for interface g1/0
    *Jan 11 00:01:46.539: VRRP: Advertisement from 10.252.200.36 has an incorrect group 10 id for interface g1/0                
    *Jan 11 00:01:50.323: VRRP: Advertisement from 10.252.200.34 has an incorrect group 10 id for interface g1/0
    *Jan 11 00:01:51.707: VRRP: Advertisement from 10.252.200.36 has an incorrect group 10 id for interface g1/0
    *Jan 11 00:01:52.079: VRRP: Advertisement from 10.252.200.34 has an incorrect group 10 id for interface g1/0
    *Jan 11 00:01:53.079: VRRP: Advertisement from 10.252.200.34 has an incorrect group 10 id for interface g1/0
    If cisco and huawei cannot interconnect with each other?

    Can you post the interface config from the huawei and cisco device?
    HTH,
    John
    *** Please rate all useful posts ***

  • A problem about Chinese encoding

    When i access portal by SSL,I find one or two problems about encoding.
    reshow these problems:
    1. Locale be set to Chinese(zh_CN)
    2. access portal by SSL
    3. Administration/create portlet
    Then the popup window's title will show a bad encoding.
    otherwise,if i search chinese, then only have bad encoding shown in the searchbox and i can't get anything.
    MY running enviroment:
    windows 2003
    plumtree foundation v6.0
    plumtree publisher v6.2
    tomcat 5.0.58 with jre_1.4.2.08
    MSSql 2000 sp4
    and I have tried other BEA ALUI newer version,I can get these problems.
    I'm appreciated for any help.

    ANSI 0xFF is NBSP. NBSP in Unicode is 0x00A0... so neither 0x00FF (which is �) nor 0xF5F8 (which is in the "private use" range) is correct. Something really weird is going on.We are talking about CP1252 and in CP1252 0xFF is �
    (see http://czyborra.com/charsets/iso8859.html for example) and thus is \u00FF correct.
    btw. I would never use windows notepad as reference application.

Maybe you are looking for

  • Firefox crashes on loading; it's trying to restore a previous session. Can't retrieve crash report.

    When I try to open Firefox, I briefly see the program trying to open -- the address line says "restore session." Then it crashes. I get a screen saying "We're sorry" "Firefox had a problem and crashed. We'll try to restore your tabs and windows when

  • Adobe Media Encoder Does Not Get out of wait state

    Processor: Intel Core(TM)2 Quad CPU queue 6600 At 2.40 GH Z Memory:  8.00 GB System Type:     64 – bit Operating System Operating System:      Microsoft System 7 Ultra When transferring a 1 min. 11 second video from Adobe Premier Pro 5.5 to Adobe Med

  • How can i do the servlet to servlet communicaion usingservlet context

    public void doGet(HttpServletRequest request, HttpServletResponse response)                throws ServletException, IOException {           response.setContentType("text/html");           //ServletContext context = null;           PrintWriter out = r

  • Creating a ListOfValue for a MessageLovInput at runtime

    Hi ! i am traying to create a Message Lov Input at runtime. The fact is that i don't want to use an external ListOfValue region, lovInput.setLovRegion(<path>, 0); i mean, i want to create it also at runtime. Does anybody has idea of how to do this? T

  • Aliases and not mailboxes for virtual domain

    I know that virtual domains are broken in 10.5.1 and I'm not sure I want to upgrade to 10.5.2 yet until I know everyone else who has done it is working fine. My question is our OSX Mail Server primary domain is xpmedia.com. We have an old mail server