on 04-05-2007 6:51 AM
How to loop in JCO.Structure?
if i have a structure which reference to internal table that parse to java program..
how do i loop thru the JCO.Structure.
pls advice...
i only know how to loop in JCO.Table...
Hi,
You should use enumeration to loop through the fields of a structure.
JCO.Structure myStruct = function.getExportParameterList().getStructure("name");
for (JCO.FieldIterator e = myStruct.fields(); e.hasMoreElements(); ) {
JCO.Field field = e.nextField();
String fieldName = field.getName();
String fieldValue = field.getString();
}
Regards,
Satyajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if i am not mistaken....your method is to loop the list of field in the structure...
yet ....what i want is like this...
MAILID TLINENO CONTE
00001 1 HALLO
2 HOW ARE YOU
3 WAT ARE YOU DOING
4 THANKS
the SAP parse this as a structure....that reference to internal table...
if i get the structure...how should i loop thru the things inside....
JCO.Structure input = function.getImportParameterList().getStructure("OBIMAIL");
how am i going to loop thru the sturcture....
if i not mistaken..using your method..will only get 1 line of records right....the method is loop thru the field ?
the result will be this ??
MAILID TLINENO CONTE
00001 4 thanks
Yzme,
Please read JCO tutorial (www.winfobase.de/lehre/lv_materialien.nsf/intern01/FB09D79A41930E34C125709F0046180C/$FILE/JCo%20Tutorial.pdf) by Thomas G. Schuessler from arasoft.de
This is the best tutorial on subject I've ever read.
Unfortunately, I see no direct link on his site any more, so try the one above. Otherwise google by keywords <b>ARASoft JCO filetype:pdf</b>
Valery Silaev
SaM Solutions
my question is simple as i have stated as above...? i have read this tutorial...
i doubt that my question is still not answer.....
can i really do that ...
loop thru a structure that reference a table ....It is in ImportParameterList eg: OBIMail (Structure) > reference type -internal table--
meaning i am not loop thru the field...but the records...
if the OBIMail is in TableParameterList..i am sure i can loop thru each records...
Yzme,
Confirmed!
JCO.Structure is single record. JCO.Table is multiple records.
Interesting enough, both JCO.Table and JCO.Structure extends extends so JCO.Table works at same time as records container (table) and "cursor" over records.
Valery Silaev
SaM Solutions
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.