Read structure from main program class??

Hi all,
I know that i can read the structures from the main program with (program)structure
But now the structure is in a class or form... How can i do this?
regards

Hi,
I want to use BADI WORKORDER_CONFIRM_CUST_SUBSCR and I have created my own subscreen.
The fields are displayed in the transaction CO11N but the fields are not transfered to the table AFRU where i have created the fields...
And the BADI is already implemented by SAP.. No multiple use possible...
I don't know how the data from the screen can be inserted in the table AFRU without modification.
regards

Similar Messages

  • Executing code modules (seperate jars) from main program (main.jar)

    Hi all
    Sorry if i am crossposting, but i dont think that is the case.
    I have a main program ( in a jar ) and some modules to be executed and run in the main program.
    Theese components are packed a module in a single jar, and all theese jars are located in the same folder as the main program.
    The main classes in the module jars implement a interface known to the main tool, so that i can use them.
    My problem are, how to load the modules?
    I know i can use JarFile to get the manifests, and thereby get the name of the main class in each jar (they get obfuscated before launch, so no hardcoding of names).
    But how do i instanciate the mainclasses in the modules from the main tool ?
    hope you can help out.
    -Anders

    You can't. I understand the module approach as many others have similar designs. The first problem is that you need to add all the JARs to your classpath so that these JARs are known during starttime. There is no other solution to this if you don't write your own classloader that fetches classes during runtime and work peacefully with the other classloaders of the VM (it's a pain in the ass!). So, your main application needs to know the JAR files. Then it's a small step to also register the modules that your main app should know. Our approach is to have a small database table that holds the fully referenced class names of the modules that are available and can be used via Class.forName(). With this solution, we just need to stop the main app, copy the new JAR, adjust the classpath to add the new JAR, and restart the main app. After adding the new module names to the config table, the main app automatically uses them. Instead of a database table you can use e.g. a properties file.

  • Accessing Var from main Nib/Class - [global variables]

    I'm sure this is a simple solution and the problem is I'm just not thinking right. I just started programming in Objective C but have come a long way in the past 2 weeks. Pretty extensive knowledge in C# and some java.
    Anyways, I've been creating an app and have streams working, CFNetwork working, network services discovery working and a tab bar with a custom View controller linking to one of the tab-bar buttons.
    So when you click on one of the tab bar items it opens a new nib file. That nib loads a table view. When nib loads it hits a method which starts looking for network services and updates the table when it finds some.
    Now the idea is is to have a selector on the cell and when you choose the service it adds same variable info, ip and port, back to a global variable which can be used through the entire app and all extra loaded nib files.
    Out of all this, I don't know how to access global variables....prob should be the simplest thing to do out of all I've done. I have ideas of how it should be done but don't know how to access it.
    Idea would be:
    MainWindowNib has NSString var that is public with a getter setter. But how can I access that MainWindowNib var from a SecondView.nib file/class. There a way to get the parent of the secondView.Nib? I have no clue.
    Any help would be great!
    Thanks!

    I'm still a bit confused how you access that method.
    Main.nib class : UIApplication
    NSString *port
    SetupView.nib : NSViewController
    view
    -TableView added to view
    -Seperate NSObject for TableViewDelegates
    -When item selcted, pass NSString to [main port]
    How do I get a pointer to port. I don't really understand how to do this with objective C.
    In C# I would be something like: [Not exact syntax but u get the idea]
    public Main : Form
    public string port{get;set;}
    Main()
    sView SeconddForm = new SecondForm(this);
    public SecondForm : Form
    SecondView(Main main)
    main.Port = "8080";
    Message was edited by: Clarke76
    Message was edited by: Clarke76

  • Screen does not seem to reflect changes when called from main program.....

    Hi all,
            here's an issue that i've been trying to solve for a few days now,
    i had created a screen in the screen painter, inside which i've included a table control (screen number 100: ).
    i, then created a second screen pointing to the same program as screen 100 and assigned screen number 200 to it. so both scrn 100 and scrn 200 has got table controls and the validations occur in modules from the same program.
    the issue i face is that, while any changes i make in screen 100 works fine when i call screen 100 from the main program;  it does not work when i try to modify the table control in screen 200. for example, if i were to add a new column, it messes up the allignment of the other columns in screen 200, i can't seem to assign fixed colums, etc....
    has anyone come across similar issues? if so how can i solve it? could it be an error with the SAP GUI?
    any response will be appreciated. points will be rewarded as well... if that's how things work here.
    Thanks,
    David.
    Edited by: david joseph on Aug 14, 2008 2:33 AM

    >
    david joseph wrote:
    > Hi all,
    >         here's an issue that i've been trying to solve for a few days now,
    > i had created a screen in the screen painter, inside which i've included a table control (screen number 100: ).
    >  i, then created a second screen pointing to the same program as screen 100 and assigned screen number 200 to it. so both scrn 100 and scrn 200 has got table controls and the validations occur in modules from the same program.
    >
    > the issue i face is that, while any changes i make in screen 100 works fine when i call screen 100 from the main program;  it does not work when i try to modify the table control in screen 200. for example, if i were to add a new column, it messes up the allignment of the other columns in screen 200, i can't seem to assign fixed colums, etc....
    >
    > has anyone come across similar issues? if so how can i solve it? could it be an error with the SAP GUI?
    >
    > Thanks,
    > David.
    >
    > Edited by: david joseph on Aug 14, 2008 2:33 AM
    Hi David,
    The description of the problem is not so clear.
    Let me know where I'm wrong, you have 2 screens and 2 different tablecontrols ? When you do any changes from the sapgui to the screen 100 there is no problem. But when you do that to the screen 200 is messes up ?
    My logic with table controls
    if you want 2 screens to share the same control then add the control to a subscreen
    when you want to have 2 screens with 2 differents controls :
    in main program
    CONTROLS : tc_100 type TABLEVIEW USING SCREEN 100.
    CONTROLS : tc_200 type TABLEVIEW USING SCREEN 200.
    In screen 100 / 200 assure the name of the controls are tc_100 / tc_200....
    Using this method I never have any problem....

  • Create logical file path and read it in main program

    Hello Experts,
    My requirement is, I have to read files from application server.
    File path/ Directory is different in different system (systid). i have to read all files starting with (xyz*) from mentioned directory.
    This path i must define in logical path.
    Following are the steps i followed.
    1)   In FILE (TCODE) i have created a logical path and assigned a physical path to it.
    2)   I have created logical file ( I am not sure about this, as i dont have to create logical file, i just need to read file from above path starting with xyz*,  but FM FILE_GET_NAME requires logical file name so i have created it).
    3) I will pass logical file name to FM FILE_GET_NAME and recieve physical file path(with file name which i can ignore).
    these all steps i found on SDN. but its not working.
    FM FILE_GET_NAME is always returning same file path ( Not even close to what i have defined ).
    I can not read data from Table path as it will return physical path as it is, but i need it replaced with system id.
    Any suggestion will be really helpful.
    Thanks in Advance.
    Regards,
    Amar

    Hi Amar,
    one difficulty defining physical path name is to know the right Syntax group.
    For example if you habe OS Linux, you need Syntax Group UNIX here. In Table OPSYSTEM you can see, which OS (OPSYS) needs which FILESYS (Syntax Group).
    If you always get a wrong physical path, this may be caused ba a wrong choice of the Syntax Group. Only the correct one will lead to the correct path.
    Regards,
    Klaus

  • Reading files from within helper classes

    From within a servlet, I can get the servlet context to get a path to the "web" directory of my project and easily access properties files for my project. If I create another package in my project to hold helper classes that perform some specific function and want to create and/or read from a properties file, I get a path to the bin directory of my servlet container:
    Servlet Path: D:\Documents and Settings\Josh\My Documents\Josh\Projects\ServletSandBox\build\web\
    Helper Class File Path: D:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.14\bin\test
    I'd like to develop my helper packages as reusable APIs, so they're not tied directly to my project or to a servlet in general, but I'd like the properties files to stay somewhere in my project folder, preferably in the WEB-INF directory with the servlet's own specific properties file.
    I can't figure out the best way to handle this. I wanted to just be able to pass the helper class a String if somebody wanted to specify a filename other than the default filename. Does it make sense to specify a file URL instead? Is there any other way to get the calling servlet's context path without having to pass in a variable?
    Thanks

    It seems that the helper API shouldn't need to be given a path to its own config file. I would like to have code that will load the file regardless of whether or not its in a stand alone java app or a servlet. Whenever the helper API is jarred up and imported into my servlet, it can't find the config file unless it's in the "D:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.14\bin\test" directory. OR, if I use the current thread to get the loader, it will locate it in the "classes" folder, which is the only solution I can come up with that will let me write code to load the file that will work, regardless of its implementation.
    The "project" folder I'm talking about is just the NetBeans "project" folder for the servlet, or the "ServetSandBox" folder in my example. I guess that doesn't really matter in the context of the servlet though.
    So is using the current thread the appropriate way to do this? When you say that code will work if I put the resource in the WEB-INF directory, that seems to only be true if I try to load it from the servlet itself, not the helper class. The helper class doesn't find the resource in the WEB-INF directory.
    Also, I would like to be able to write the default values to a new config file if one doesn't exist. How in the heck do I get a pointer to the "classes" folder, or any other folder that I can also read from using the classloader, so I can write to a new file?

  • Reading CATALINA_HOME from java program

    Hi ,
    IN one of my application i have to create a file from the java program under my webapp.
    How do i do that , if i give the whole path i am able to do that , but this application has to run on both windows and unix machines.
    And i am really not looking to edit the source files.
    Is there any way i can give like
    CATALINA_HOME/webapps/MyWebapp/<filename>
    Thanks

    you could try with $catalina.home/webapps/MyWebapp/<filename> could work depending on how your application loads/saves the file.

  • Separating objects in a collection structure from its original class

    This is an example of my code and will better illustrate what i'm trying to do. The problem is in the List class.
    public interface ItemInterface {
      public java.util.HashMap map ;
      public void setMap(String in) ;
    public abstract class AbstractItem implements ItemInterface {
      java.util.HashMap map ;
      public AbstractItem() {
        map = new java.util.HashMap();
      public void setMap(String in) {
      public java.util.HashMap getMap() {
        return map ;
    public class GeneralItem extends AbstractItem {
      public void setMap(String in) {
    public class List {
    public void process() {
      AbstractItem item ;
      if (condition) {
        item = new GeneralItem() ;
      else if (condition) {
        item = new GeneralItem2() ; // etc, etc
      ArrayList list = new ArrayList() ;
      while (condition) {
        item.setMap(someString) ;
        list.add(item) ;
       /* here i want to reinstantiate item, but i do not want to go through the
          conditions again to determine the correct class */
    }So let me try to explain the problem i'm experiencing.
    With the code as is, when item changes, all prior items that were added to the list change with it. If I had the conditions in the while loop i would be able to just call new ClassThatWillBeDetermined();I'm am trying to find a way around this so that I don't need to constantly determine the class in every step of the loop.
    I am familar with PHP and I understand that in PHP it is possible to do the following:
    function myFunction() {
      return 5 + 2 ;
    var myfunc = myFunction ;
    echo myfunc() ;Is that possible to do in Java?

    I'm afraid no one would understand your code and the description of the problem.
    Post a small demo code that is generally compilable, runnable and could reproduce the 'problem'.
    And restate your requirement more clearly, please.

  • Pass Parameter ID from Main Program into Function Module

    For material, there is a fileds product hierarcy (MARA-PRDHA) on Basic view, but we also append the same field in materail sales view (MVKE-PRDHA) and put on the screen of sales view, so the user want the PRDHA on sales view could be updated automatically when it has been changed on Basic view. On the screen of basic view, the field MARA-PRDHA is set as parameter ID 'VPR', the sales views are updated in function module MVKE_SET_DATA, so how can I get the value of parameter ID 'VPR' in MVKE_SET_DATA to populate the value in Sales View?!
    Does parameter IDs and their values locate in global memory?!
    if yes, why i can't get it with: GET PARAMETER ID "VPR' <f>?
    Any idea?!
    Thanks

    Yes, this is SAP standard program for MM41/MM42 (Article material), I can't change the program and the screens are different for basis and sales views. So, I am just wondering whether there is a way to pass the parameter value of product hierarchy on basic view to any other screen process when it's updated on basic view.
    The problem is the program check every single table (views) in individual function module, so it's hard to pass any updating (not updated) value from any other views.
    Thanks

  • Read data from SAP R/3 Class-System

    Hello,
    first of all sorry when I posted this into the wrong subforum, but I wasn't sure about that. My Question is how to read data from the Classystem I have specified in my ABAP report.
    The goal is to read data from my individual class-system as well as data from MM and write them to a table that is to be read by another report. But right now I can't find information about the class system and abap. Maybe you know some tutorials or blogs about right that topic you can suggest?

    What class system have you specified in your report?
    Normally a class can be used by declaring a variable of type of the class in question, if this class can be instantiated this is. If your class can't be instantiated, but it has only class methods, you can call this method directly.
    But there is a lot more to this ABAP Object Oriented Programming, than just this short explanation. Search on SDN for some ABAP OO Tutorials.
    some links:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c3/225b5654f411d194a60000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b6cae890-0201-0010-ef8b-f970a9c41d47
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1591ec90-0201-0010-3ba8-cdcd500b17cf
    Transacation ABAPDOCU.

  • How to stop a while loop of event structure from a main vi

    Hello;
    sorry for my english
    I have to stop a subvi from my main vi, the subvi contains a while loop and an event structure so I need to stop this loop while directly from my main vi I have tried global variable but it did not work
    any help please or example !!!   
    Solved!
    Go to Solution.
    Attachments:
    stop a while loop and event structure from main vi.png ‏16 KB

    IYED wrote:
    Hello;
    sorry for my english
    I have to stop a subvi from my main vi, the subvi contains a while loop and an event structure so I need to stop this loop while directly from my main vi I have tried global variable but it did not work
    any help please or example !!!   
    If this is an example of how your code looks, I'd clean it up before the developer who has to work on it next hits you over the head with his LabVIEW Style Book. 
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • How to read in director protected movie from main director variable

    Hi All
    Please help me. I'm beginer in director.
    I made a project with director movie.
    I've main director movie and other movie are protected.
    I'm declare global variable in main director movie. I want to
    read variable from main movie within director protected movie.
    In main movie
    on exitFrame me
    global DirVal
    DirVal = "1234"
    end
    In Protected director movie
    on exitFrame me
    If DirVal = "1234" Then
    goToFrame(10)
    Else
    goToFrame(1)
    End If
    end
    But it's doesn't work in Protected director movie. Can you
    please write to me.

    you need to declare the variable as global in the protected
    movie :
    on exitFrame me
    global DirVal
    If DirVal = "1234" Then
    goToFrame(10)
    Else
    goToFrame(1)
    End If
    end
    hth
    Ned

  • How to continue to read Object from a file?

    At some program I write an object into a file. This program will be called again and again so that there are many objects which are saved to that file. And I write another program to read object from this file. I can read the first object but can not read the second. However if I delete the object in that file (using editplus, by manually) I can read the second. Because now the second object is the first object. (Delete first object).
    The exception when I read the second object is below:
    java.io.StreamCorruptedException: Type code out of range, is -84
         at java.io.ObjectInputStream.peekCode(ObjectInputStream.java:1607)
         at java.io.ObjectInputStream.refill(ObjectInputStream.java:1735)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:319)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:272)
         at LogParser.main(LogParser.java:42)
    Exception in thread "main" The read object from file program is below:
         public static void main(String[] args) throws Exception {
            FileInputStream fis = new FileInputStream(path + File.separator + "ErrorApp21config2.log");
            ObjectInputStream ois = new ObjectInputStream(fis);
            ErrorLog errorLog = (ErrorLog)ois.readObject();
            System.out.println(errorLog.getErrorDate());
            FIFData fifData = (FIFData)errorLog.getErrorDescription();
            CommRegistration commRegistration = (CommRegistration)
                                     fifData.getDataObject(FIFData.REGISTRATION_DATA);
            String ic = commRegistration.getPatient().getPatExtID();
            System.out.println(ic);
            CommQueue commQueue = (CommQueue) fifData.getDataObject(FIFData.QMS_DATA);
            String location = commQueue.getLocation();
            System.out.println(location);
            ois.readObject();  //will throw above exception
            fis.close();
         }Can anyone tell me how to continue to read object? Or I should do some special things when I write object into file?

    Thanks Jos.
    Perhaps you are correct.
    There are some code in a SessionBean to log an object. Write file code is below.
         private void logPreRegError(
              byte[] strOldFifData,
            byte[] strNewFifData,
              String requestID)
              throws TTSHException {
              if (requestID.equals(RequestConstants.ADMIT_PATIENT)){
                String runtimeProp = System.getProperty("runtimeproppath");
                FileOutputStream fos = null;
                   try {
                        fos = new FileOutputStream(
                            runtimeProp + File.separator + "Error.log", true);
                    BufferedOutputStream bos = new BufferedOutputStream(fos);
                    bos.write(strOldFifData);
                    bos.write(strNewFifData);
                    bos.flush();
                   } catch (FileNotFoundException e) {
                        log(e);
                   } catch (IOException e) {
                    log(e);
                   } finally{
                    if (fos != null){
                             try {
                                  fos.close();
                             } catch (IOException e1) {
                                  log(e1);
         }strOldFifData and strNewFifData are the byte[] of an object. Below is the code to convert object to byte[].
         private byte[] getErrorData(FIFData fifData, boolean beforeException, String requestID) {
            ErrorLog errorLog = new ErrorLog();
            errorLog.setErrorDate(new Date());
            errorLog.setErrorDescription(fifData);
            errorLog.setErrorModule("Pre Reg");
            if (beforeException){
                errorLog.setErrorSummary("RequestID = " + requestID +" Before Exception");
            }else{
                errorLog.setErrorSummary("RequestID = " + requestID +" After Exception");
              ByteArrayOutputStream baos = null;
              ObjectOutputStream oos = null;
              byte[] bytErrorLog = null;
              try {
                  baos = new ByteArrayOutputStream();
                   oos = new ObjectOutputStream(baos);
                  oos.writeObject(errorLog);
                  oos.flush();
                  bytErrorLog = baos.toByteArray();
              } catch (IOException e) {
                   log(e);
              } finally {
                if (baos != null){
                        try {
                             baos.close();
                        } catch (IOException e1) {
                             log(e1);
              return bytErrorLog;
         }I have two questions. First is currently I have got the log file generated by above code. Is there any way to continue to read object from log file?
    If can't, the second question is how to write object to file in such suitation (SessionBean) so that I can continue to read object in the future?

  • Passing Text From Class to Main Program

    I am trying to write three separate strings from the class
    file into three separate TEXT boxes within the main program. It
    works using three separate functions. Is there a way to change the
    code so it all can happen from within but one and the same function
    in the class file.
    package Edit
    public class Texter
    public var i:int;
    public static var result:String;
    public function Greeter()
    public function sayHello():String
    result = "This is the first idea I have. ";
    return result;
    public function sayGoodbye():String
    result = "Here is the second idea, like. ";
    return result;
    public function sayHi):String
    result = "Here is the third city disco. ";
    return result;
    Thanks,
    BudHud

    You can use a parametrized function which will display the
    information according to your given data
    like
    public function saySomething(data:String):String
    return data;
    }

  • How to get return values from a button to main program.

    hello,
    I have a main program which has a button Authenticate. On click of authenticate open a form for auth which has USERNAME FIELS AND PASSWORD.
    If entered fields are true then enable editing of jtable in main program..
    Basically something like this :
    //main program
    Authenticate.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    UpdateAuth ua=new UpdateAuth();// opens form which has username and pass for authentication
    ua.setVisible(true);
    //need code here for enabling table
    if(s=="mactus")
    enable table editing
    //table.repaint();
    // form open for auth..(class UpdateAuth )
    private String SigninMouseClicked(java.awt.event.MouseEvent evt) {
    String aname=Aname.getText();
    String apass=Apassword.getText();
    if(aname.equals("") && apass.equals(""))
    JOptionPane.showMessageDialog(null,"Enter login name or password","Error",JOptionPane.ERROR_MESSAGE);
    if(!(aname.equals("") && apass.equals("")))
    if(aname.equals("harshil") && apass.equals("harshil123"))
    String s="mactus"; /// if username and password is success enable table editing in main program
    return s;
    else if (!aname.equals("mactus") && !apass.equals("mactus123"))
    Aname.setText("");
    Apassword.setText("");     
    return null;
    }

    986154 wrote:
    hello,
    I have a main program which has a button Authenticate. On click of authenticate open a form for auth which has USERNAME FIELS AND PASSWORD.
    If entered fields are true then enable editing of jtable in main program..Well, you might be in over your head.
    //need code here for enabling table
    if(s=="mactus") If you don't know how to correctly test for String equality, you will have no chance of getting this to work.
    You need to hit the tutorials. First the basic one, then the Swing one.

Maybe you are looking for

  • Bridge crashes when applying metadata

    I'm seeking guidance, but let me preface this post with some information: CS6 via Creative Cloud All applications up to date via Adobe Application Manager All Windows Updates applied including drivers. Currently running Bridge 5.0.2.4 Computer is: Wi

  • SWC_GET_ELEMENT problem in RH_GET_STRUCTURE function

    Hi all, i use RH_GET_STRUCTURE function and it don't work fine because i've a problem with macro SWC_GET_ELEMENT. My container (table's RH_GET_STRUCTURE function) is : ELEMENT  TAB_INDEX  ELEMLENGTH  TYPE  VALUE OTYPE      000000      001       C    

  • Companion CD Corrupt File

    The checksum never matches for this file from OTN for DB 10.2.0.1 on linux x86 64 bit. Are these files ever checked by Oracle ? 10201_companion_linux_x86_64.cpio.gz

  • Serial number won't work

    trying to install lightroom 4 on my laptop. The serial number won't work, doesn't even seem like the right number of digits.

  • Project is unviewable

    I developed an Access 2010 app for a client a few months ago, which is stored on a network drive. Each user has a downloaded copy on their C-drive. The app is an accdb and is not password-protected. Their IT guy just downloaded a copy for a new user