Executing C program in a Java Program
How can I execute a C program in a JAVA program!
Runtime.getRuntime().exec("yourProgramName.exe");
Or maybe you wann use JNI (Java Native Interface) if you want interaction between the C program and the Java program...
Similar Messages
-
How to compile and execute lex,yac,c and java programs
its the 3rd day on my New MacBook pro..
as i just migrated from windows to mac i love to work on this..
The main problem is i DON't know .......
how to compile and execute
1) lex and yac programs
2) c program
3) java program
so please help me
THIS is the error i got a1.l is a program
i got the same error when i used gcc
$ lex a1.l
$ cc lex.yy.c
Undefined symbols:
"_yywrap", referenced from:
_yylex in cc8QDQjW.o
_input in cc8QDQjW.o
ld: symbol(s) not found
collect2: ld returned 1 exit statusIs the problem that you don't know how to compile and execute these programs on a Mac, or just that you don't know how to compile and execute them?
Mac OS X is really just a version of BSD Unix, as far as programs like like bison, flex and gcc are concerned...and even when Apple specific versions are provided in the Developer Tools, there are symlinks in the usual places in the Unix file hierarchy.
For problems with lex and yacc, I suggest you start with their own references, for example, here.
Or you could just use %option noyywrap, if you only have one file to scan.
Or you could link to libfl.a using -lfl and use the default version from that library.
But you really should (as Keith Barkley was subtly hinting at) learn how these tools work and why they work that way. -
Executing external program (non-java)
Hello,
I just started programming Java. I installed SunForum3.2 on SunRay some days ago and I was faced with the problem that all that the people who are registered with the GateKeeper-Software are not shown anywhere. So I developed a small app, that read out a file containing the output of the command "registrar -q" ( displays all registered users including their SunForum-name ). Now some people not working on the SunRay-platform would like to connect as well to the SunForum-users. For this reason I'd like to execute "registrar -q" periodically and directly use the output from and within a Java-app but I couldn't find a way to execute the program "registrar -q" so far.
Thanks for your help.
ThomasProcess p = Runtime.getRuntime().exec( "registrar -q" );
Then read the Process's input stream, which should give you the stdout of your command. There are plenty of full code examples of how to do this floating about, and you should have no problem with it. -
Execute a .exe from a Java program
How can i execute a program though Java (e.g. the program could be a scandisk or disk defragmenter or paint etc.)
Is there a possibility to do that?Yes, Runtime.getRuntime().exec(). this is for java 1.4.*
and this is for java 1.5Process p = new ProcessBuilder("path_To_EXE").start(); -
Executing C-program inside Java
Hello, my situation is that I am using an open source which is written in C.
I execute this program using the following code.
Process proc=null;
try{
proc=Runtime.getRuntime().exec(cmds);
System.out.println("Execute");
catch(IOException ioex){
System.out.println(ioex);
try{
proc.waitFor();
catch(InterruptedException irex){
System.out.println(irex);
if(proc.exitValue()==0){
System.out.println("The command is normally and sucessfully terminated.");
}where the "cmds" is a normal command line argument using for executing the open source program.
For example,
prompt>./osprogram<input_fileok
-
Getting errors when trying to execute CRUD programs
Hi All
I am trying to execute one of the CRUD programs for creating , updatying or deleting data in MDM server and a m getting a few errors .Could anybody advise.
Created on Jun 6, 2007
package com.sap.nw.mdm.rig;
import com.sap.nw.mdm.rig.programs.data.blobs.BLOBDataProgram;
import com.sap.nw.mdm.rig.programs.data.checkout_checkin_rollback.CheckOutCheckInRecordsProgram;
import com.sap.nw.mdm.rig.programs.data.crud.CRUDDataProgram;
import com.sap.nw.mdm.rig.programs.data.crud.bulk.BulkCRUDDataProgram;
import com.sap.nw.mdm.rig.programs.data.keymapping.KeyMappingProgram;
import com.sap.nw.mdm.rig.programs.data.search.SearchProgram;
import com.sap.nw.mdm.rig.programs.data.search.attribute.AttributeSearchProgram;
import com.sap.nw.mdm.rig.programs.data.search.field.FieldSearchProgram;
import com.sap.nw.mdm.rig.programs.data.syndication.SyndicationProgram;
import com.sap.nw.mdm.rig.programs.data.workflow.WorkflowProgram;
import com.sap.mdm.data.RegionProperties;
import com.sap.nw.mdm.rig.repository.Repository;
import com.sap.nw.mdm.rig.server.Server;
This class is the starting point to execute all sample programs.
To see a description of the various programs you can execute, please have a look at the
documentation for the following classes. There are static variables in each of these
classes that point to the various programs that can be executed with a description of
what the program does.
<ul>
<li>{@link com.sap.nw.mdm.rig.programs.data.blobs.BLOBDataProgram}
<li>{@link com.sap.nw.mdm.rig.programs.data.checkout_checkin_rollback.CheckOutCheckInRecordsProgram}
<li>{@link com.sap.nw.mdm.rig.programs.data.crud.CRUDDataProgram}
<li>{@link com.sap.nw.mdm.rig.programs.data.crud.bulk.BulkCRUDDataProgram}
<li>{@link com.sap.nw.mdm.rig.programs.data.keymapping.KeyMappingProgram}
<li>{@link com.sap.nw.mdm.rig.programs.data.search.SearchProgram}
<li>{@link com.sap.nw.mdm.rig.programs.data.search.attribute.AttributeSearchProgram}
<li>{@link com.sap.nw.mdm.rig.programs.data.search.field.FieldSearchProgram}
<li>{@link com.sap.nw.mdm.rig.programs.data.syndication.SyndicationProgram}
<li>{@link com.sap.nw.mdm.rig.programs.data.workflow.WorkflowProgram}
</ul>
@author Richard LeBlanc
public class Application {
private Application() {
Starts the application and executes a program
@param args - not required
static public void main(String[] args) {
System.out.println("876876");
Application app = new Application();
System.out.println("11111");
Program program = null;
System.out.println("22222");
Simply uncomment the line that contains the program you wish to execute and run this class.
Blob Programs
// program = BLOBDataProgram.RETRIEVE_AND_WRITE_IMAGE_TO_FILE;
// program = BLOBDataProgram.RETRIEVE_AND_WRITE_PDF_TO_FILE;
Checkout/Checkin Data Programs
// program = CheckOutCheckInRecordsProgram.CHECK_OUT_NEW_CHECK_IN;
// program = CheckOutCheckInRecordsProgram.CHECK_OUT_NEW_ROLLBACK;
// program = CheckOutCheckInRecordsProgram.CHECK_OUT_EXISTING_CHECK_IN;
// program = CheckOutCheckInRecordsProgram.CHECK_OUT_EXISTING_ROLLBACK;
Create Read Update Delete (CRUD) Data Programs
// program = CRUDDataProgram.CRUD_HIERARCHY_TABLE;
program = CRUDDataProgram.CRUD_MAIN_TABLE;
// program = CRUDDataProgram.CRUD_MAIN_TABLE_WITH_FLAT_AND_HIERARCHY_LOOKUP_FIELDS;
// program = CRUDDataProgram.CRUD_MAIN_TABLE_WITH_QUALIFIED_LOOKUP_FIELD;
// program = CRUDDataProgram.CRUD_MAIN_TABLE_WITH_TAXONOMY_LOOKUP_FIELD;
// program = CRUDDataProgram.CRUD_TAXONOMY_TABLE_WITH_ATTRIBUTES;
System.out.println("333333");
Bulk Create Read Update Delete (CRUD) data programs
(many records at once)
// program = BulkCRUDDataProgram.BULK_CRUD_MAIN_TABLE;
KeyMapping Programs
// program = KeyMappingProgram.RETRIEVE;
Search Programs
// program = SearchProgram.DRILL_DOWN_SEARCH;
// program = SearchProgram.KEYWORD;
// program = SearchProgram.MASK;
// program = SearchProgram.NAMED_SEARCH;
// program = SearchProgram.QUALIFIER;
Attribute Search Programs
// program = AttributeSearchProgram.COUPLED_NUMERIC;
// program = AttributeSearchProgram.NUMERIC;
// program = AttributeSearchProgram.TEXT;
Field Search Programs
// program = FieldSearchProgram.BOOLEAN;
// program = FieldSearchProgram.CURRENCY;
// program = FieldSearchProgram.LITERAL_DATE;
// program = FieldSearchProgram.LOOKUP;
// program = FieldSearchProgram.TEXT;
Syndication Programs
// program = SyndicationProgram.SYNDICATE_PORT;
Workflow Programs
// program = WorkflowProgram.EXECUTE;
//TODO enter MDS name
String mdsName = "172.18.139.200"; //the name of the Master Data Server
String repositoryName = "GDS_1"; //make sure this is the name you use when unarchiving
//the repository otherwise change it to reflect the name
//of your repository
String regionName = "English [US]";
String userName = "Admin"; //there is an admin user with no password in the provided repository
String password = ""; //there is an admin user with no password in the provided repository
System.out.println("67r86587");
app.start(mdsName, repositoryName, regionName, userName, password, program);
Establishes a connection to the given server and logs in to the given repository
with the given logon information and executes the given program
private void start(String serverName, String repositoryName, String regionName,
String user, String password, Program program) {
//Create an instance of the MDS
Server server = Server.getInstance(serverName);
System.out.println("444444");
//Get the list of running repositories from the server
Repository[] repositories = server.getRepositories();
System.out.println("5555");
Repository repository = null;
//Go through the list of repositories and see if any match the
//given repository name
for(int i=0, j=repositories.length; i<j; i++){
System.out.println("666666bbye");
if(repositories<i>.getIdentifier().getName().equals(repositoryName)) {
System.out.println(" hello" +repositoryName);
repository = repositories<i>;
System.out.println(" hi" + repository);
//Get the list of regions for the repository
RegionProperties[] regions = repository.getRegions();
RegionProperties region = null;
//Go through the list of regions and see if any match the given
//repository name
for(int i=0, j=regions.length; i<j; i++){
System.out.println(" hello");
if(regions<i>.getName().equals(regionName)) {
region = regions<i>;
System.out.println(" 99999" +region);
//Login to the repository as you would using the Data Manager
//This creates a user and repository session that are available using
//repository.getSession()
repository.login(region, user, password);
//execute the program from the list above
program.execute(repository);
System.out.println(" finally");
//destroy the session (destroys the repository and user sessions)
repository.getSession().destroy();
//close the connection to the MDS
repository.getServer().closeConnection();
I am getting the following errors:
Exception in thread "main" java.lang.IllegalArgumentException: Table with Code 'Products' does not exist in the repository 'GDS_1'
at com.sap.mdm.internal.schema.RepositorySchemaImpl.getTableSchema(RepositorySchemaImpl.java:136)
at com.sap.nw.mdm.rig.programs.data.crud.CRUDMainTableRecordProgram.execute(CRUDMainTableRecordProgram.java:33)
at com.sap.nw.mdm.rig.Application.start(Application.java:211)
at com.sap.nw.mdm.rig.Application.main(Application.java:157)Hi Stephen,
I assume that a super admin user does not get these error messages, right? If so, this behaviour might come due to missing permissions on PCD objects for the user rubinmd. Please apply note 792370 which explains how to set end user permission on the pcd folder com.sap.ip.collaboration/Rooms
Kind regards,
Roland -
Error in executing ABAP program. Error occurred when creating dataset
hi,
when I use LKM SAP ERP to Oracle (SQLLDR) to extract data from SAP ERP server. I execute my interface, and it's stop at extract data step.
This is message:
java.lang.RuntimeException: Error occured in open tool execute method...Error in executing ABAP program...Error in executing ABAP program...Error occurred when creating dataset/abc/ZODI_13001_6001_GLOBAL.txt
I tried others path name, tried slash or backslash. This is content in code tab
OdiSAPAbapExecute "-UPLOAD=1" "-EXECUTE=1" "-EXECUTEBASE_RKM=0" "-ZRFC_RUN_INSTALL=1" "-ABAP_PROGRAM_NAME=ZODI_13001_6001" "-HOST=10.86.87.24" "-USER=sv_hoa" "-PASSWORD=<@=snpRef.getInfo("SRC_PASS") @>" "-SAP_CLIENT=800" "-SAP_LANGUAGE=EN" "-SAP_SYSTEM_NUMBER=02" "-SAP_FUNCTION_GROUP_NAME=ZODI_FGR_13001" "-CONNECTION_POOL_NAME=SAP_ODI_ERP_POOL_10.86.87.24" "-CONNECTION_POOL_SIZE=10" "-FILE_DELIMITER=<@=""+(char)8@>" "-FILE_NAME=ZODI_13001_6001_GLOBAL.txt" "-FTP_HOST=10.86.82.108" "-FTP_USER=anh" "-FTP_PASSWORD=<@=sFtpPassword@>" "-FTP_PASSIVE_MODE=1" "-FTP_TRANSFER_TIMEOUT=100000" "-ODI_VARIABLE_NAMES=" "-ODI_VARIABLE_VALUES=" "-USER_ABAP_PARAMETER_NAMES=IV_DELIMITER,CHAR3;IV_FILENAME,CHAR255;IV_USER,CHAR35;IV_PWD,CHAR35;IV_HOST,CHAR35;IV_HASHVALUE,CHAR35;IV_PATH,CHAR35;IV_MAX_ROW_CNT,SYTABIX;IV_FETCH_BATCH_SIZE,SYTABIX;" "-USER_ABAP_PARAMETER_VALUES=<Value>" "-USER_ABAP_PARAMETER_SEPARATOR=<Value>" "-ABAP_TABLE_PARAMETERS=RETURN,BAPIRETURN;ET_FILE_RETURN,BAPIRET2" "-ABAP_EXPORT_PARAMETERS=ERRORMESSAGE;SY-MSGV1" "-LOG_FILE_NAME=C:\Users\anh\AppData\Local\Temp\SapAbapExecuteOpenTool_13001.log" "-FTP_PATH=/abc/" "-DEV_CLASS=ZODI_DEVCLASS" "-MAX_ROW_COUNT=" "-FETCH_BATCH_SIZE=100000" "-HASH_VALUE_MARKER=HVM" "-ABAP_PROGRAM_BODY=
*Final Type declarations
TYPES : BEGIN OF ty_final,
Y03HOCSINH_HOCSINH_ID TYPE
Y03HOCSINH-HOCSINH_ID,
Y03HOCSINH_MA_HOC_SINH TYPE
Y03HOCSINH-MA_HOC_SINH,
Y03HOCSINH_TEN_HOC_SINH TYPE
Y03HOCSINH-TEN_HOC_SINH,
Y03HOCSINH_GIOI_TINH TYPE
Y03HOCSINH-GIOI_TINH,
Y03HOCSINH_DIA_CHI TYPE
Y03HOCSINH-DIA_CHI,
Y03HOCSINH_GHI_CHU TYPE
Y03HOCSINH-GHI_CHU,
END OF ty_final.
*Final Temp Type Declarations
TYPES : BEGIN OF ty_final_tmp,
Y03HOCSINH_HOCSINH_ID TYPE
Y03HOCSINH-HOCSINH_ID ,
Y03HOCSINH_MA_HOC_SINH TYPE
Y03HOCSINH-MA_HOC_SINH ,
Y03HOCSINH_TEN_HOC_SINH TYPE
Y03HOCSINH-TEN_HOC_SINH ,
Y03HOCSINH_GIOI_TINH TYPE
Y03HOCSINH-GIOI_TINH ,
Y03HOCSINH_DIA_CHI TYPE
Y03HOCSINH-DIA_CHI ,
Y03HOCSINH_GHI_CHU TYPE
Y03HOCSINH-GHI_CHU ,
END OF ty_final_tmp.
*Final Target Type Declarations
TYPES : BEGIN OF ty_final_target,
C0_Y03HOCSINH_HOCSINH_ID TYPE
Y03HOCSINH-HOCSINH_ID,
C1_Y03HOCSINH_MA_HOC_SINH TYPE
Y03HOCSINH-MA_HOC_SINH,
C2_Y03HOCSINH_TEN_HOC_SINH TYPE
Y03HOCSINH-TEN_HOC_SINH,
C3_Y03HOCSINH_GIOI_TINH TYPE
Y03HOCSINH-GIOI_TINH,
C4_Y03HOCSINH_DIA_CHI TYPE
Y03HOCSINH-DIA_CHI,
C5_Y03HOCSINH_GHI_CHU TYPE
Y03HOCSINH-GHI_CHU,
END OF ty_final_target.
* Table type for Y03HOCSINH
TYPES : BEGIN OF ty_Y03HOCSINH,
HOCSINH_ID TYPE
Y03HOCSINH-HOCSINH_ID,
MA_HOC_SINH TYPE
Y03HOCSINH-MA_HOC_SINH,
TEN_HOC_SINH TYPE
Y03HOCSINH-TEN_HOC_SINH,
GIOI_TINH TYPE
Y03HOCSINH-GIOI_TINH,
DIA_CHI TYPE
Y03HOCSINH-DIA_CHI,
GHI_CHU TYPE
Y03HOCSINH-GHI_CHU,
END OF ty_Y03HOCSINH.
TYPES: BEGIN OF gs_text,
line(843) TYPE c,
END OF gs_text.
*Structure Declarations
DATA: wa_final_string TYPE string,
wa_final TYPE ty_final,
wa_final_target TYPE ty_final_target,
wa_Y03HOCSINH TYPE ty_Y03HOCSINH,
*Table Declarations
tt_final TYPE STANDARD TABLE OF ty_final,
tt_Y03HOCSINH TYPE STANDARD TABLE OF ty_Y03HOCSINH,
tt_final_target TYPE STANDARD TABLE
OF ty_final_target,
tt_final_tmp TYPE STANDARD TABLE OF ty_final_tmp,
tt_final_tmp1 TYPE STANDARD TABLE OF ty_final,
gt_result TYPE STANDARD TABLE OF gs_text,
*Variable Declarations
lv_path TYPE string,
lv_flag TYPE char1,
C0_Y03HOCSINH_HOCSINH_ID TYPE
STRING,
C1_Y03HOCSINH_MA_HOC_SINH TYPE
STRING,
C2_Y03HOCSINH_TEN_HOC_SINH TYPE
STRING,
C3_Y03HOCSINH_GIOI_TINH TYPE
STRING,
C4_Y03HOCSINH_DIA_CHI TYPE
STRING,
C5_Y03HOCSINH_GHI_CHU TYPE
STRING,
wa_final_tmp TYPE ty_final_tmp,
lv_file TYPE string,
lv_datum TYPE sy-datum,
lv_date TYPE char10,
wa_result TYPE string,
lv_delimiter type string,
lv_cnt TYPE sytabix,
*-Cursor Declaration
lv_Y03HOCSINH_dbcur TYPE cursor,
lv_tabix_frm TYPE sy-tabix.
lv_delimiter = iv_delimiter.
IF iv_hashvalue = 'HVM'.
*Open/delete output file
CONCATENATE iv_path iv_filename INTO lv_path.
*Check for file existence, if found, delete it
OPEN DATASET lv_path FOR INPUT
IN TEXT MODE
ENCODING DEFAULT.
IF sy-subrc EQ 0.
DELETE DATASET lv_path.
ENDIF.
*Open/create output file
OPEN DATASET lv_path FOR APPENDING
IN TEXT MODE
ENCODING DEFAULT.
IF sy-subrc EQ 0.
*Batch Processing
OPEN CURSOR WITH HOLD lv_Y03HOCSINH_dbcur FOR
SELECT HOCSINH_ID
MA_HOC_SINH
TEN_HOC_SINH
GIOI_TINH
DIA_CHI
GHI_CHU
FROM Y03HOCSINH.
DO.
*Check for the counter, only for first batch
*process new line is required...
lv_cnt = lv_cnt + 1.
REFRESH tt_Y03HOCSINH.
FETCH NEXT CURSOR lv_Y03HOCSINH_dbcur
APPENDING TABLE tt_Y03HOCSINH
PACKAGE SIZE IV_FETCH_BATCH_SIZE.
IF NOT tt_Y03HOCSINH IS INITIAL.
ELSE.
EXIT.
ENDIF.
LOOP AT tt_Y03HOCSINH INTO wa_Y03HOCSINH.
MOVE wa_Y03HOCSINH-HOCSINH_ID
TO wa_final_tmp-Y03HOCSINH_HOCSINH_ID.
MOVE wa_Y03HOCSINH-MA_HOC_SINH
TO wa_final_tmp-Y03HOCSINH_MA_HOC_SINH.
MOVE wa_Y03HOCSINH-TEN_HOC_SINH
TO wa_final_tmp-Y03HOCSINH_TEN_HOC_SINH.
MOVE wa_Y03HOCSINH-GIOI_TINH
TO wa_final_tmp-Y03HOCSINH_GIOI_TINH.
MOVE wa_Y03HOCSINH-DIA_CHI
TO wa_final_tmp-Y03HOCSINH_DIA_CHI.
MOVE wa_Y03HOCSINH-GHI_CHU
TO wa_final_tmp-Y03HOCSINH_GHI_CHU.
APPEND wa_final_tmp TO tt_final_tmp.
ENDLOOP.
free : tt_Y03HOCSINH.
LOOP AT tt_final_tmp INTO wa_final_tmp.
MOVE wa_final_tmp-Y03HOCSINH_HOCSINH_ID
TO wa_final_target-C0_Y03HOCSINH_HOCSINH_ID.
MOVE wa_final_tmp-Y03HOCSINH_MA_HOC_SINH
TO wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH.
MOVE wa_final_tmp-Y03HOCSINH_TEN_HOC_SINH
TO wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH.
MOVE wa_final_tmp-Y03HOCSINH_GIOI_TINH
TO wa_final_target-C3_Y03HOCSINH_GIOI_TINH.
MOVE wa_final_tmp-Y03HOCSINH_DIA_CHI
TO wa_final_target-C4_Y03HOCSINH_DIA_CHI.
MOVE wa_final_tmp-Y03HOCSINH_GHI_CHU
TO wa_final_target-C5_Y03HOCSINH_GHI_CHU.
Append wa_final_target to tt_final_target.
ENDLOOP.
free : tt_final_tmp.
Clear wa_final_target.
IF NOT iv_max_row_cnt IS INITIAL.
Loop at tt_final_target into
wa_final_target TO iv_max_row_cnt.
MOVE wa_final_target-C0_Y03HOCSINH_HOCSINH_ID
TO C0_Y03HOCSINH_HOCSINH_ID.
MOVE wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH
TO C1_Y03HOCSINH_MA_HOC_SINH.
MOVE wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH
TO C2_Y03HOCSINH_TEN_HOC_SINH.
MOVE wa_final_target-C3_Y03HOCSINH_GIOI_TINH
TO C3_Y03HOCSINH_GIOI_TINH.
MOVE wa_final_target-C4_Y03HOCSINH_DIA_CHI
TO C4_Y03HOCSINH_DIA_CHI.
MOVE wa_final_target-C5_Y03HOCSINH_GHI_CHU
TO C5_Y03HOCSINH_GHI_CHU.
CONCATENATE
C0_Y03HOCSINH_HOCSINH_ID
C1_Y03HOCSINH_MA_HOC_SINH
C2_Y03HOCSINH_TEN_HOC_SINH
C3_Y03HOCSINH_GIOI_TINH
C4_Y03HOCSINH_DIA_CHI
C5_Y03HOCSINH_GHI_CHU
INTO wa_final_string
SEPARATED BY lv_delimiter.
IF sy-tabix EQ 1 AND lv_cnt EQ 1.
CONCATENATE wa_final_string
lv_delimiter INTO wa_final_string.
ELSE.
CONCATENATE '<@=""+(char)8@>' lv_delimiter wa_final_string
lv_delimiter INTO wa_final_string.
ENDIF.
APPEND wa_final_string TO gt_result.
CLEAR : C0_Y03HOCSINH_HOCSINH_ID,
C1_Y03HOCSINH_MA_HOC_SINH,
C2_Y03HOCSINH_TEN_HOC_SINH,
C3_Y03HOCSINH_GIOI_TINH,
C4_Y03HOCSINH_DIA_CHI,
C5_Y03HOCSINH_GHI_CHU.
ENDLOOP.
ELSE.
Loop at tt_final_target into wa_final_target.
MOVE wa_final_target-C0_Y03HOCSINH_HOCSINH_ID
TO C0_Y03HOCSINH_HOCSINH_ID.
MOVE wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH
TO C1_Y03HOCSINH_MA_HOC_SINH.
MOVE wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH
TO C2_Y03HOCSINH_TEN_HOC_SINH.
MOVE wa_final_target-C3_Y03HOCSINH_GIOI_TINH
TO C3_Y03HOCSINH_GIOI_TINH.
MOVE wa_final_target-C4_Y03HOCSINH_DIA_CHI
TO C4_Y03HOCSINH_DIA_CHI.
MOVE wa_final_target-C5_Y03HOCSINH_GHI_CHU
TO C5_Y03HOCSINH_GHI_CHU.
CONCATENATE
C0_Y03HOCSINH_HOCSINH_ID
C1_Y03HOCSINH_MA_HOC_SINH
C2_Y03HOCSINH_TEN_HOC_SINH
C3_Y03HOCSINH_GIOI_TINH
C4_Y03HOCSINH_DIA_CHI
C5_Y03HOCSINH_GHI_CHU
INTO wa_final_string
SEPARATED BY lv_delimiter.
IF sy-tabix EQ 1 AND lv_cnt EQ 1.
CONCATENATE wa_final_string
lv_delimiter INTO wa_final_string.
ELSE.
CONCATENATE '<@=""+(char)8@>' lv_delimiter wa_final_string
lv_delimiter INTO wa_final_string.
ENDIF.
APPEND wa_final_string TO gt_result.
CLEAR : C0_Y03HOCSINH_HOCSINH_ID,
C1_Y03HOCSINH_MA_HOC_SINH,
C2_Y03HOCSINH_TEN_HOC_SINH,
C3_Y03HOCSINH_GIOI_TINH,
C4_Y03HOCSINH_DIA_CHI,
C5_Y03HOCSINH_GHI_CHU.
ENDLOOP.
ENDIF.
free : tt_final_target.
IF NOT gt_result IS INITIAL.
CLEAR wa_result.
LOOP AT gt_result INTO wa_result.
TRANSFER wa_result TO lv_path.
ENDLOOP.
ENDIF.
REFRESH gt_result.
*End of main loop for batching
ENDDO.
*Close dataset
CLOSE DATASET lv_path.
CLOSE CURSOR lv_Y03HOCSINH_dbcur.
ELSE.
DATA: lv_mesg TYPE string.
CLEAR et_file_return.
et_file_return-type = 'E'.
CONCATENATE
'Error occurred when creating dataset' lv_path
INTO lv_mesg.
et_file_return-message = lv_mesg.
Append et_file_return.
ENDIF.
ELSE.
CLEAR et_file_return.
et_file_return-type = 'E'.
et_file_return-message =
'Installed ABAP program does not match interface definition'.
APPEND et_file_return.
ENDIF.
Thanks for helpr u able to figure it out..........i got the same error .......can someone help me fix this issue
-
Error while executing FP_TEST_00 program
Hi,
I configured ADS, it was working fine,i'am able to take all the PDF documents from SAP.
But now when i execute FP_TEST_00 program i got an error message that
"ADS: SOAP Runtime Exception: CSoapExceptionFault : SOAP(100102)
Message no. FPRUNX001"
But when i run FP_PDF_TEST_00 program it is giving me the Version information.
I'am unable to find a solution.Please guide me
With Regards,
Pradeep.checkout #944221 in particular:
4. Check the settings for the destination service
To use the destination service on AS Java, settings are required on AS ABAP and AS Java. Therefore, this test contains several steps.
4. 1 In your ABAP system (transaction SA38), call the FP_CHECK_DESTINATION_SERVICE program (available as of NW2004s SPS 08).
a) First of all, execute the program without selecting the option "With Destination Service".
The system processes a test form in the background and displays the size of the generated PDF. It does not use the destination service in the process.
b) Now select the option "With Destination Service" and execute the program again. The system processes the test form, using the destination service.
If the system displays the same message (file size of generated PDF) as it does in a), the configuration of the destination service is correct.
-> Proceed to the next point (5).
If the system issues an error message, the configuration of the destination service is incorrect.
-> Carry out tests 4.2 to 4.4.
4. 2 Check whether the /default_host/sap/bc/fp and /default_host/sap/bc/fpads ICF services are active. (transaction SICF). If this service is not active, activate it. Note: As of NW2004s Support Package Stack 12, when you bundle in distributed systems (in other words, for "non-double-stack installations"), it is optional to use the fpads ICF service
4.3 Check the settings for the ICF service.
a) Enter the following URL in your Web browser:
http://<server>:<port>/sap/bc/fp/form/layout/fp_test_00.xdp
< server> is the AS ABAP, <port> is the HTTP port of the AS ABAP. (you can determine this information using transaction SICF).
b) In the dialog box for the user, enter ADS_AGENT and the relevant password.
If the ICF service settings are correct, the browser displays the layout information of the FP_TEST_00 form in XML format.
-> Proceed with point 4.4.
If the browser displays an error message instead of the XML file, a configuration error occurred.
-> Check whether the user ADS_AGENT exists on the AS ABAP, and if the user has the required authorizations and roles (SAP_BC_FP_ICF).
4.4. Check the settings for the destination service on AS Java
a) Call Visual Administrator and navigate to Services -> Destinations
(detailed instructions are available on the Help Portal at: http://help.sap.com/saphelp_nw2004s/helpdata/en/37/504b8cbc2848a494facfdc09a359b1/frameset.htm ->Adobe Document Services Configuration Guide -> Configuring the Web Service -> Securing Access to the Web Service -> Creating or Changing the Destination Service)
b) Extend the setting in field URLunder Connection Settings to:
http://<server>:<port>/sap/bc/fp/form/layout/fp_test_00.xdp
(The <server> and <port> that are already available refer to the AS ABAP.)
c) Choose 'Save and Test'
d) The system calls the ABAP system that stores the form templates.
If the settings are correct, the system issues the message: "HTTP GET response code 200 Content Type/xml."
-> Proceed with point 5.
If the system issues an error message, the configuration of the destination service is incorrect.
-> Contact your system administrator and ask them to correct the settings for the destination service.
e) Do not forget to change the URL back to http://<server>:<port>. -
Profile Parameter to execute Abap Program at user logon.
Hi Experts
I've written a small printer selection program to change the users profile parameter.
Is there another profile parameter that can be given to execute this program automatically
when the user logs on.....The reason why I'm looking for a profile parameter to do this is, that only
certain users need to have this happen at logon.
Kind Regards
VicHi Javi,
I don't think you need a custom process chain for this. You can use delivered Process Chain for logic and hard-code your script name in the package. In that script you can call BADI that has your ABAP program inside.
You can find guides how to build BADI here:[How to Pass Parameters to Custom Logic BADI using START_BADI|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20f4252d-98ca-2b10-e689-f85085ae2d12] or here [Creating Custom Script Logic Keyword BADI's - BPC NW|Creating Custom Script Logic Keyword BADI's - BPC NW;.
Method IF_UJ_CUSTOM_LOGIC~EXECUTE has IT_CV as one of parameters. In your script you probably have to use *XDIM_MEMBERSET to get parameters from DM prompt. IT_CV will have all XDIM members.
Please let me know if you have any other questions.
Regards,
Gersh -
Problem in executing the Program
When I execute my program , it shows
opencard.core.util.OpenCardPropertyLoadingException: property file not found
at opencard.opt.util.OpenCardPropertyFileLoader.loadProperties<OpenCardPropertyFileLoader.java:158>
at opencard.core.service.SmartCard.start<SmartCard.java:520>
at samples.readfile.ReadFile.main<ReadFile.java:15>
What the problem of my program??
Thank for help~~Whoops.I ment environment Path ! I used to put it in the same directory as the .class files
-
i want to execute another program through my java program. Now my win98 platform always signals an error when I attempt to do it using Runtime and Process also if i try to compile a java file during my run time through a similar process, it is compiled during compilation of my program or signals an error. How do I do it?
I use some programs and shell commands in my java applications and it works well. If you are using Windows 9x, no problems. If you aure use some unices or Windows NT/2000/XP, be sure to have the good rights on the commands (execute bit set...) For unices, for exemple LINUX, you have to specifie the shell by a "#!/bin/bash" on the first line to use sell commands scripts (if it is a bash script ;-))
cheers, JFB -
I'm having problems getting set up to run my java programs on my pc. Here's what I've done so far:
I set my path in user variables to C:\j2sdk1.4.2_05\bin (I have XP).
When I go to execute my program I run javac dinner.java.
After this, I run dinner.java. At this point I'm getting my code printed out in notepad.
Can anyone help me get this straightened out. It would be much appreciated.
Thanksjavac dinner.java will not execute yr programme but it will compile yr java programme and if sucessed then it will generate dinner.class file which is byte code which can be executed by runtime and can run with following command..
java dinner
and u should not give .java x'tention while running.. that is how u can run it... -
Help on How to compile and execute awt programs
can any1 say how to compile and execute awt programs
Edited by: 863765 on Jul 18, 2011 3:29 AMEJP wrote:
The answer is the same for anycode.Oh, but it's not. If he starts with MyClass.java, and we tell him
javac MyClass.java
java -cp . MyClassthen that advice won't work when he creates MyClass2. The poor guy will be left lost and alone, with no clue how to proceed! {noformat};-){noformat} -
Can someone execute this program?
Can someone execute this program for me and tell me if it works correctly? My DOS is acting funny.
look for these things:
- accepts input from keyboard and places them into an array
- continues to accept names until a blank name is entered
- array can contain up to 15 names
- after all names are entered, it displays the contents of the array
and writes them to a file
- output should be in 2 columns
if you see a problem, please tell me how to fix it.
import java.io.*;
* the purpose of this program is to read data from the keyboard
* and put it into a sequential file for processing by ReadFile
* @author Maya Crawford
public class Lab0
* this function will prompt and receive data from the keyboard
* @return String containing the data read from the keyboard
* @param BufferedReader that is connected to System.in
*/ (keyboard)
public static String getData(BufferedReader infile)
throws IOException
System.out.println("enter a name");
return infile.readLine();
* this is the main program which will read from the keyboard and
* display the given input onto the screen and also write the data
* to a file
* @param Array of Strings (not used in this program)
public static void main(String[] args)
throws IOException
int i;
String[] outString = new String[16];
DataOutputStream output=null;
// this code assigns the standard input to a datastream
BufferedReader input= new BufferedReader(new InputStreamReader(System.in));
// this code opens the output file...
try
output= new DataOutputStream(new FileOutputStream("javaapp.dat"));
// handle any open errors
catch (IOException e)
System.err.println("Error in opening output file\n"
+ e.toString());
System.exit(1);
// priming read......
for(i=0;i<outString.length;i++)
outString=getData(input);
// this is the loop to continue while nnonblank data is entered
while (!outString.equals(""))
for(i=0;i<outString.length;i++)
outString[i]=getData(input);
outString[i] = input.readLine();
System.out.println("Name entered was:"+ outString[i]);
output.writeBytes(outString[i]+"\r\n");
int rcol=(outString.length+1)/2;
for(i=0;i<(outString.length)/2;i++)
System.out.println(outString[i]+"\t"+outString[rcol++]);
// flush buffers and close file...
try
output.flush();
output.close();
catch (IOException e)
System.err.println("Error in closing output file\n"
+ e.toString());
// say goodnight Gracie...
System.out.println("all done");Ok, here is what I came up with. I commented most of what I changed and gave a reason for changing it. My changes aren't perfect and it still needs to be tweeked. When you run the program you have to hit the enter key every time once before you type a name. When you are done typing names hit the enter key twice and it will output the names entered into the array. Like I said, it isn't perfect, and that part you will need to fix.
import java.io.*;
* the purpose of this program is to read data from the keyboard
* and put it into a sequential file for processing by ReadFile
* @author Maya Crawford
public class Lab0
* this function will prompt and receive data from the keyboard
* @return String containing the data read from the keyboard
* @param BufferedReader that is connected to System.in
*/ //(keyboard)
//On the above line where you have (keyboard), it wasn't commented out in your
//program and it was throwing a error.
public static String getData(BufferedReader infile)
throws IOException
System.out.println("enter a name");
return infile.readLine();
* this is the main program which will read from the keyboard and
* display the given input onto the screen and also write the data
* to a file
* @param Array of Strings (not used in this program)
public static void main(String[] args)
throws IOException
int i;
String testString; // Created to hold the string entered by the user, because your
// outString array wasn't working for that.
String[] outString = new String[16];
DataOutputStream output=null;
// this code assigns the standard input to a datastream
BufferedReader input= new BufferedReader(new InputStreamReader(System.in));
// this code opens the output file...
try
output= new DataOutputStream(new FileOutputStream("javaapp.dat"));
// handle any open errors
catch (IOException e)
System.err.println("Error in opening output file\n"
+ e.toString());
System.exit(1);
// priming read......
testString = " "; // Initialize testString
int placeMark = 0; // to input the String entered by the user into the outString
// array, it needs to know which position to enter it into.
while (!testString.equals(""))
testString=getData(input);
testString = input.readLine();
System.out.println("Name entered was:"+ testString);
// Put the testString into the outString[] array.
// A lot of the time when you used outString you forgot to use the [x] to indicate
// which position you wanted to access.
outString[placeMark] = testString;
output.writeBytes(testString+"\r\n");
placeMark++;
// Created a do/while loop to display the list of outString.
int nextEntry = 0;
do
System.out.println(outString[nextEntry]);
nextEntry++;
}while(!outString[nextEntry].equals(""));
// flush buffers and close file...
try
output.flush();
output.close();
catch (IOException e)
System.err.println("Error in closing output file\n"
+ e.toString());
// say goodnight Gracie...
System.out.println("all done");
} -
Executing external programs from PL/SQL?
Hi All,
Is it possible to execute external
programs (i.e. shell scripts, or
perl scripts) from a stored procedure
or trigger?
I know that typically it is the other
way around, but hey try telling that
to my boss.
Thanksyou cant execute any operating system commands from plsql
procedures. but you can achieve result by using either java
stored procedure or pro*C program .
Suresh Vemulapalli -
Hi...
I have a swing application, and I execute it with a call to java run time like this:
java PACKAGENAME.CLASSNAME in a .BAT file who open a console...
But I want to execute the program without open the console... �can I do it ?
Thaks a lot....
PS- > Another question. How can I do it a jar file and what is the syntax of call ??
java -jar PACKAGENAME.CLASSNAME ???
Really ThanksWhen I try to execute my application (in a jar), the console window tell me
Exception in thread "main" java.util.zip.ZipException:
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
I�ve created the jar file with eclipse, and I�ve specified the main class.
What�s the problem now ??
Java is too dificult for me...
Maybe you are looking for
-
ALV top of page - heading depending upon list output
Hi All, My alv grid report shows the report containing vendor account group and some other details. My requirement is to get the page break for every new vendor account group and also print the vendor account group description at the top of the list
-
How do i save my finished project as a avi file?
I've finished my movie, and im ready to put it on dvd, youtube, etc, but how do i save it as a avi file?
-
Transitions between external swf
I borrowed some code to create menu transition swfs in which as a button is pushed, it will look to see if the current swf is at midframe and if so, play the exiting animation of that swf and then load and play the intor for the swf for that button s
-
Import Visual Composer iView to portal
Hi experts, My question is: how can I import the VC generated iView into the portal as a fix iView? To give you an example: When I am in the portal I would like to access the VC generated iView by clicking on a fix navigation item, in order to be abl
-
Urgent!! Help me - Read formatted data from file
Hi, I have a file which contains(line by line) : [0.0577, 0.0769, 0.0385, 0.0, 0.0] [0.0577, 0.1346, 0.0962, 0.0, 0.0] [0.0192, 0.0, 0.0577, 0.1154, 0.0962] How can i read the file line by line(exluded "[" and "]" symbols) and assign each line to an