How to read ABAP return parameter into java code

Hi all,
How JAVA environment can trap an error returned from abap code?
E.g.:
From a BAPI wrapper written like this:
"function zpm_gi_create .
""Interfaccia locale:
*"  IMPORTING
*"     VALUE(ZBAPIGOODSMVT) TYPE  ZBAPIGOODSMVT
*"  EXPORTING
*"     VALUE(RETURN) TYPE  BAPIRET2
*"     VALUE(PO_NUMBER_ES) TYPE  ZBAPIEKKO-PO_NUMBER
*"  TABLES
*"      GOODSMVT_ITEM STRUCTURE  ZGOODSMVT_ITEM
  data: goodsmvt_header type bapi2017_gm_head_01,
        return2         type bapiret2 occurs 0 with header line,
  call function 'BAPI_GOODSMVT_CREATE'
    exporting
      goodsmvt_header             = goodsmvt_header
      goodsmvt_code               = zbapigoodsmvt-gm_code
      testrun                     = 'X'
importing
  GOODSMVT_HEADRET   GM         =
    materialdocument              = matdoc
    matdocumentyear               = matyear
tables
    goodsmvt_item                 = gm_item
  GOODSMVT_SERIALNUMBER       =
      return                      = return2.
Our return (for istance is):
"EBM                  312The (internal) unit xx has not been maintained in
the unit table"
How JAVA environment can trap this error or interpret the BAPIRET2 structure?
Is there something to do in the corresponding syncBO?
regards,
eliana

Hi elina ,
these topic is already discussed in forum.
Jo has replied to this doubt in these links.
Re: Return messages in SyncBo
Can't see RETURN parameter in SyncBO
Return messages in SyncBo
just note this..
have to change like this , when u follow the help.
if (messageReply.getType() == MessageReplyType.SYNC_BEGIN) {
          if (messageReply.getType() == MessageReplyType.SYNC_END) {
            Regards
              Kishor Gopinathan

Similar Messages

  • How to read XI Data type in Java code and populate as array list, using UDF

    Hi,
    How to read XI Data type in Java code and populate as array list, using UDF?
    Is there any API using which  the XI data types can be read?
    Kindly reply.
    Richa

    Input Structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:CustomerCreateResp xmlns:ns0="urn:bp:xi:up:re:cust_mdm:cmdm:pr5:100">
       <CUSTOMER>
          <item>
             <CUSTOMERNO/>
             <MDMCUSTOMER/>
             <CREATE_DATE/>
             <RETURN>
                <TYPE/>
                <MESSAGE/>
             </RETURN>
             <PT_CONTPART_RETURN>
                <item>
                   <MDM_CONTACT/>
                   <CONTACT/>
                </item>
             </PT_CONTPART_RETURN>
             <PARTNERS>
                <item>
                   <CUSTOMERNO/>
                   <PARTNER_FUNCTION/>
                   <PARTNER_NUMBER/>
                   <DEFAULT_PARTNER/>
                </item>
             </PARTNERS>
          </item>
       </CUSTOMER>
    </ns0:CustomerCreateResp>
    Output structure
    (Sample output structure.This actually needs to be mapped and generated using UDF)
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:updateCustomer xmlns:ns1="urn:xiSericeVi"><ns1:customer><ns2:ArrayList xmlns:ns2="java:sap/standard">[]</ns2:ArrayList></ns1:customer><ns1:name>2344566</ns1:name></ns1:updateCustomer>

  • How to read and map schema into Java objects

    I'm new to JNDI and LDAP<br>
    How can I read the schema from a directory into Java objects?<br>
    I need access to the object classes and get all the required and optional attributes... then details about the attributes themselves like its type, cardinality (single or multivalued), etc.

    Hi naidu,
    1. We can use this type of path
    computername
    folder
    file.ext
    2. We can use this in GUI_UPLOAD
       and it will run on presentation server,
       connect to
    computer
       and read the file contents.
    regards,
    amit m.

  • How to pass in a parameter into a report viewer on a jsp - and hidden

    Hi, I've built a php application and am using the java environment to enable the crystal report/viewer.  The developer was looking how to pass in a parameter into a report viewer on a jsp. Ultimately the end product we need is to get an HTML report viewer loading a report file with hidden parameters so to not expose other customer data (it's a shared database for multiple customers) preferably loaded from php using maybe the php java bridge. Would anyone happen to have any sample code or any guidance?
    <%@ page contentType="text/html; charset=UTF-8"
       pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="/crystal-tags-reportviewer.tld" prefix="crviewer"%>
    <%
    // just a test to grab rpt name from GET
    String rptFile = "report_files/" + request.getParameter("rpt");
    %>
    <crviewer:viewer reportSourceType="reportingComponent" viewerName=""
    isOwnPage="true">
       <crviewer:report reportName="<%= rptFile %>" />
    </crviewer:viewer>
    Many thanks in advance!
    Mark

    I am not aware of any html tags you can pass to the viewer for parameter values.  Normally, you would load the report in code and then use the SDK with the report object to pass parameter values.

  • How to read a text file using Java

    Guys,
    Good day!
    Please help me how to read a text file using Java and create/convert that text file into XML.
    Thanks and God Bless.
    Regards,
    I-Talk

         public void fileRead(){
                 File aFile =new File("myFile.txt");
             BufferedReader input = null;
             try {
               input = new BufferedReader( new FileReader(aFile) );
               String line = null;
               while (( line = input.readLine()) != null){
             catch (FileNotFoundException ex) {
               ex.printStackTrace();
             catch (IOException ex){
               ex.printStackTrace();
         }This code is to read a text file. But there is no such thing that will convert your text file to xml file. You have to have a defined XML format. Then you can read your data from text files and insert them inside your xml text. Or you may like to read xml tags from text files and insert your own data. The file format of .txt and .xml is far too different.
    cheers
    Mohammed Jubaer Arif.

  • How to transform this pascal code into java code!

    I want to transform this pascal code into java code . Please tel me how to do it because I really don't know how to do it!
    Thanks!
    {CALCULATE HOHN-LONDON FACTORS}
    var kk:tab4;
    PROCEDURE INTENS(var kk:tab4);
    begin
    for n:=0 to nr+2 do
    begin
    kk^[1,n]:=sqrt(lup*lup*yg*(yg-4)+4*sqr(n+1)) +lup*(yg-2);
    kk^[2,n]:= sqrt(lup*lup*yg*(yg-4)+4*sqr(n+1))-lup*(yg-2);
    kk^[3,n]:=0.5*(kk^[1,n]*kk^[1,n]+4*(sqr(n+1)-lup*lup));
    kk^[4,n]:= 0.5*(kk^[2,n]*kk^[2,n]+4*(sqr(n+1)-lup*lup));
    kk^[5,n]:= sqrt(ldown*ldown*yd*(yd-4)+4*sqr(n+1)) +ldown*(yd-2);
    end;
    end;
    BEGIN
    new (kk);
    intens(kk);
    writeln(f2,' ','N ','V','branch ','H-L');
    for n:=1 to np do
    begin
    fp1[n,v]:=(n-ldown)*(n+ldown+1)*sqr(kk^[2,n-1]*kk^[6,n]+4*(n+ldown)*(n-ldown+1));
    fp1[n,v]:=fp1[n,v]/(4*(n+0.5)*kk^[4,n-1]*kk^[8,n]) ;
    writeln(f2,' ',n,' ',v,' fp1 ',fp1[n,v]:10:2);
    end;
    for n:=1 to nq do
    begin
    fq1[n,v]:=sqr(kk^[2,n]*kk^[6,n]*(ldown+0.5)+4*(n-ldown+1)*(n+ldown+1)*(ldown-0.5)) ;
    fq1[n,v]:=fq1[n,v]/(2*(n+0.5)*kk^[4,n]*kk^[8,n]*(n+1.5));
    fq1[n,v]:=fq1[n,v]*(n+1);
    writeln(f2,' ',n,' ',v,' fq1 ',fq1[n,v]:10:2);
    end;
    for n:=1 to nr do
    begin
    fr1[n,v]:=sqr(kk^[2,n+1]*kk^[6,n]+4*(n-ldown+2)*(n+ldown+1));
    fr1[n,v]:=fr1[n,v]/(4*kk^[4,n+1]*kk^[8,n]*(n+1.5));
    fr1[n,v]:=fr1[n,v]*(n-ldown+1)*(n+ldown+2) ;
    writeln(f2,' ',n,' ',v,' fr1 ',fr1[n,v]:10:2);
    end;

    Basically it looks like this:
    public class KK{
         private your_type[][] kk = new your_type[length][length];
         private void intens(your_type[] kk){
              for(int n= 0; n<nr+2; n++){
                   kk[1][n] = Math.sqrt(lup*lup*yg*(yg-4)+4*Math.pow((n+1), 2)) +lup*(yg-2);
                   kk[2][n] = Math.sqrt(lup*lup*yg*(yg-4)+4*Math.pow((n+1), 2))-lup*(yg-2);
                   kk[3][n] = 0.5*(kk[1][n]*kk[1][n]+4*(Math.pow((n+1), 2)-lup*lup));
                   kk[4][n] = 0.5*(kk[2][n]*kk[2][n]+4*(Math.pow((n+1), 2)-lup*lup));
                   kk[5][n] = Math.sqrt(ldown*ldown*yd*(yd-4)+4*Math.pow((n+1), 2)) +ldown*(yd-2);
         public static void main(String args[]){
              KK k = new KK();
              k.intens(kk);
              System.out.println(f2  + ' ' + 'N ' + 'V' + 'branch ' + 'H-L');
              for(int n=1; n < np; n++){
                   fp1[n][v] = (n-ldown)*(n+ldown+1)*Math.pow((kk[2][n-1]*kk[6][n]+4*(n+ldown)*(n-ldown+1)), 2);
                   fp1[n][v] = fp1[n][v]/(4*(n+0.5)*kk[4][n-1]*kk[8][n]) ;
                   System.out.println(f2 + ' ' + n + ' ' + v + ' fp1 ' + fp1[n][v]:10:2);
              for(int n=1; n< nq;n++){
                   fq1[n][v] = Math.pow((kk[2][n]*kk[6][n]*(ldown+0.5)+4*(n-ldown+1)*(n+ldown+1)*(ldown-0.5)), 2);
                   fq1[n][v] = fq1[n][v]/(2*(n+0.5)*kk[4][n]*kk[8][n]*(n+1.5));
                   fq1[n][v] = fq1[n][v]*(n+1);
                   System.out.println(f2 + ' ' + n + ' ' + v + ' fq1 ' + fq1[n][v]:10:2);
              for(int n=1; n < nr; n++){
                   fr1[n][v] = Math.pow((kk[2][n+1]*kk[6][n]+4*(n-ldown+2)*(n+ldown+1)), 2);
                   fr1[n][v] = fr1[n][v]/(4*kk[4][n+1]*kk[8][n]*(n+1.5));
                   fr1[n][v] = fr1[n][v]*(n-ldown+1)*(n+ldown+2) ;
                   System.out.println(f2 + ' ' + n + ' ' + v + ' fr1 ' + fr1[n][v]:10:2); //fr1[n][v]:10:2 --> Here you must use the BigDecimal class
    }I'm not very sure because my pascal knowledge is extremely "dated".
    What about the converter I told you about?

  • How to Read a CAB File from JAVA?

    Hi,
    Anyone knows how to read a CAB File from java. I need to read a property file of txt file that is packaged in CAB file & then based on that, I have to do processing. Is there anyway to do it.
    I had tried using java.util.zip.ZipFile Class, but it does work for JAR, but not for CAB.
    siva.

    Perhaps there's something in the Cabinet SDK that will help:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncabsdk/html/cabdl.asp

  • How to read an ARPA file in java

    Hi
    Im new in java and dont know many thing about it, I want to know how can read an ARPA file in java.
    pleas describ it step bye step and esy to understand.
    Edited by: 836719 on Feb 14, 2011 8:15 PM

    836719 wrote:
    ok i explain what i want to do maybe u can help me more,
    i want to read an arpa file and search it to find for example a word.so u think which method that u mentioned above is beter???
    It will be pleasure if u have any tip that can help me.1. Learn the basics of programming as well as how to logically construct and deconstruct a problem domain.
    2. Learn the basics of programming java.
    3. Learn about java.io.*
    4. Learn about java swing
    5. Find documentation that describes the format of the ARPA file.
    6. Read the documentation and understand it.
    7. Find a source for ARPA files (if this is online then there is more java to learn as well.)
    8. Use 1,2 and 3 to write java code that consumes the ARPA file.
    9. Use 4 to ask the user for a word.
    10. Use 1 and 2 to write code that 'searches' what you read in 8.

  • How to read and XSD file in java prospective in NWDS

    Hi !!
    anybody can help me that
    how to read and XSD file in java prospective in Netweaver developer Studio
    Regards
    Abhishek Agrahari

    I guess you can make it more clear...

  • How to get af:commandbutton id in java code when it is triggered?

    Hi All
    In my application's homepage, I am using 2 af:commandbuttons and each using action attribute to call a method. Both are calling the same method, and based on its id, it should perform different operations. Could anyone please tell me how to get command buttons id in java code, when it is triggered.
    Regards
    Venkat

    Venkat,
    why not call different methods from each button?
    public String actionButton1()
    return doAction("button1");
    public String actionButton2()
    return doAction("button2");
    public String doAction(String aBuuton)
    if ("button1".equalsIgnoreCase(aButton))
    // do work for button 1
    return "abc";
    }else {
    // do work for button 2
    return "abc";
    }Now you user actionbutton1 for the first button and actionButton2 for the second.
    Or you directly implement two different methods in the bean and call each one directly from the button.
    Timo

  • How to use .properties files in Webdynpro Java code?

    Hi all,
      I want to use a logon.properties file when I initial a JCO connection pool in my webdynpro DC (JCO.addClientPool()),but  I found when I deployed this DC to the server, it always giv e me an FileNotFoundException. So I donot know how to deploy a .properties file to the server and how to access this file in my Java code?
    Thans and Best regards
    Deyang

    Hi,
    1) put .properties file to your packege under src\packages folder (src\packages\com\sdn\properties\jco.properties)
    2) load property:
         final InputStream is = getClass().getClassLoader().getResourceAsStream("com/sdn/properties/jco.properties");
         final Properties properties = new Properties();
         try
              properties.load(is);
         catch(Exception e)
              wdComponentAPI.getMessageManager().reportException(new WDNonFatalException(e), false);
    Regatds Maxim R.

  • Access ABAP tables using NWDS Java Code

    All,
    I am planning to write a program to autmatically update is_url entries in sxmb_admin using a Java program.
    Is there a way we can access the ABAP tables using standalone Java Code? would it something like dblookup that we use in the mappings?
    Your Thoughts....
    Thanks.

    Hi Vicky - Interesting..Seems like you are trying to automate every single thing
    However you can make use of Jco to connect to ABAP tables..
    Check the below thread..
    Help on accessing tables of SAP from the Java Application
    I assume the table name is "SXMSCONFVLV" which you might have to update but not sure..

  • How to find the  System Dbtype in java code

    How to find the System Dbtype in java code
    I need various Db connection my project (oracle, sq l,sybase,db2),So How to find the System Dbtype in java code

    Welcome to the Forums.
    Please go through the FAQ of the Forum.
    You has posted your query in the wrong Forum, this one is dedicated to Oracle Forms.
    Please try {forum:id=1050}.
    Regards,

  • "embed" image data into java code

    I have a mind that is it possible embed image file into java code?
    That mean an image file information already store in java code, thus no need using the image file in run-time. Then can prevent user change other image file instead.
    Do anyone try before, are there technologies required?
    I just want to know is it possible or not....thanks.

    technologies? The solution you are asking for is all about storing your data in static variables such as byte[][] used to build your image instance. I guess you should have a look at the different constructors of BufferedImage.

  • Pythagors into java-code (i got the idea, i think,  but need it simplified)

    Goodday all :),
    I have been trying to turn the forumula | a^2 + b^2 = c^2 | into java code.
    To clear it up a little more;
    1. Define unknown variable
    2. Define values of other two variables
    3. Program calculates
    x1. unkown variable is 'a'
    x2. b = 20 , c = 40
    x3. a = [(40^2) - (20^2)] ^0.5 (sorry couldnt figure out superscript)
    What i was thinking as a concept;
    1. Java asks for uknown value -> user defines as 'a' , 'b' or 'c'.
    2. Java If else statement
    2.1 if 'd' -> java asks again
    2.2 else 'e' --> java asks again etc (if else statemenst from d - z)
    import java.io.*;
    public class example {
         public static void main(String[] args) {
              System.out.println("define uknown value");
              BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
              boolean running = true;
              while(running) {
                        String line = reader.readLine();
                        if (line.startsWith("d")) {
                             System.out.println("wrong input, define unknown value");
                             running = true;
                             } else      if (line.startsWith("e")) {
                             System.out.println("wrong input, define unknown value");
                             running = true;
                             } else      if (line.startsWith("f")) {
                             System.out.println("wrong input, define unknown value");
                             running = true;
                             } else      if (line.startsWith("g")) {
                             System.out.println("wrong input, define unknown value");
                             running = true;and furter i was thinking;
    If a, b or c is pressed it will ask for the values of the other two
    and it will be such a code as above, repeating itself;
                        String line = reader.readLine();
                        if (line.startsWith("a")) {
                             System.out.println("please define b");
                             running = true;
                             if (line.startsWith("1")) {
                             int x = 1;
                             System.out.println("b=1");
                             running = true;
                             } else      if (line.startsWith("2")) {
                             int x = 2;
                             System.out.println("b=2");
                             running = true;
                             } else      if (line.startsWith("3")) {
                             int x = 3;
                             System.out.println("b=3");
                             running = true;and so on till, lets say 1000?
    Now my question is;
    Is this the right way to make this program?
    I would have like a .java file of severel megebytes if i wanted the values to get up to 10000 or something >.<

    Aargh! No. This code snippet might be of help.
    try {
       int x = Integer.parseInt("42");
       System.out.println("X = " + x);
    } catch( NumberFormatException e ) {
       System.err.println("Not a number: " + e);
       e.printStackTrace();
    }You would probably also find it useful to read about "regular expressions" if you always expect the formula to have exactly the same form.

Maybe you are looking for

  • AMD Trinity A10-5800K with MSI FM2-A85XA-G65! OC'ed on Air

    Here is something to share with you guys today, the new APU “Trinity” Processor together with the latest FM2 Socket Motherboard from MSI “FM2-A85XA-G65”.  Let us start with the Trinity. The APU’s cores are composed of 2nd Generation Bulldozer core or

  • Tandberg Duo Video

    Hi, We are having a major issue with this H.239 implementation from Tandberg called Duo Video. For those that don't know, it's the ability to put a presentation from the PC side-by-side or Picture-in-Picture with a Videoconference. The problem we are

  • Three issues since SN

    1) Preferences are set for RichText. Still hitting reply to an email cancels Rich Text. (also voids my signature since it's uses colors) - But it Never Happened before. 2) Few video movies play directly in Mail. All have to be dragged to QT icon in D

  • I want to learn SOA .

    Hi , I want to learn SOA please guide me. Do let me know the bellow things 1. Where to start from. 2. Weather there are any training available online or in oracle sites. Please don't discourage i have to start do let me know where to start from.

  • GTS - Export License: not allow return process

    Hi All, We have a export license setting in the system that allow US company ship to on CN customer for some products. But we want to configure the system "not allow" reversal path:  CN customer ship back those products to US company. How we can set