Initialization - Urgent
Hi All,
We have this situation in our project. Our client has already performed an Init and deltas running for it for the past one year or so. Now we have designed objects for the further reports which they needed. We performed an init for that again. There is an error in our init and it is the situation where we have to delete our init request. In the infopackage in the Scheduler menu -> Intialization options for Source system, there are two init requests one ours and other is clients. When trying to delete ours it tells that it shall delete both init requests. For your information the version in which we are in is 3.1c.
Can somebody help me out in this situation...???
Thanks in advance,
Hudson.
No I didn't mean two inits for same Data target and i know it is not possible. The client have build a Data target for which they used a data source and the data target which we have built also uses the same data source. So they have already performed an init and deltas running for them but in our case now we have done init and scenario is we have re do the init for which we have to delete our previous init request in the scheduler menu. In the scheduler menu it shows the init request of both ours and client's which they did long back. So when trying to delete ours it is saying that it shall delete theirs also. So I want a solution for this. Hope you get what i said. Please help me with a solution.
Regards,
Fanie.
Similar Messages
-
Urgent: Catalog BOM in initialization class
Hi All,
I am using SAP R/3 internet Sales 5.0. I am trying to initialize some class with the application startup.
I have modified init-config.xml to call my customized class.
I am facing problem in getting creating metaBOM or BOM. It throws an exception saying
"An exception occurred in extended configuration management .#1#Error reading configuration information for [key]='null'"
and
"Error#1#/Applications/BusinessLogic#Java###Business Object Manager Type unknown. "
What i am trying to achieve is to call the Catalog BOM with the metaBOM object.
MetaBusinessObjectManager metaBOM = new MetaBusinessObjectManager(
env.getMessageResources(),
mbomProps);
//get catalog business object managers
//via the meta business object manager
CatalogBusinessObjectManager catBOM = (CatalogBusinessObjectManager)metaBOM.getBOMbyName(
CatalogBusinessObjectManager.CATALOG_BOM);
Does anybody has any idea how can i get the BOM object in the intialization classes.
Thanks in anticipation!!!!
PrashilYou could do this:
File f = new File("c:/saira/NewMessages/saira2.wav");
URL u = f.toURL(); -
How to disable VO initialization on page render for MessgeChoice *URGENT*
Gurus,
I've got a poplist that is getting initialized when page is being rendered. This is causing quite a bit of lag when the page initially renders. The VO is also being called through an EVENT, at which time, an extra condition is applied. This is the valid way this VO should be called.
How do you avoid the blind query when the page initially renders?
Please help deadline has passed.
Thanks,
Scott
P.S. I must assign setWhereClause bind variable in VOImpl because value is being derived by user.
Edited by: sreese on Oct 8, 2009 3:32 PMScott,
If you don't want to initialize the value of MesssageChoice at page render then when you want to intialize it.
explain & what is the issue if you initialize in PR.
Thanks
--Anil -
Failed to initialize the orb--please reply its urgent
hi im using a stand alone java application to access a jndi data source configured on websphere 6.1
im getting the following error
failed to initialize the ORB...
most of the solutions i got suggest to change from sun jdk to ibm jdk.BUT BUT how do we do that and what are the steps to be followed.
he code im using is given below:
//WebsphereJNDI.java
import java.sql.*;
import java.util.*;
import javax.sql.*;
import javax.naming.*;
import javax.rmi.*;
public class WebSphereJNDI
private String websphere_server;
private String jndi_datasource;
private String sql_query;
WebSphereJNDI(String serverpath, String jndiname, String query)
websphere_server = serverpath;
jndi_datasource = jndiname;
sql_query = query;
public ResultSet get_data() throws Exception
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, websphere_server);
InitialContext ctx = new InitialContext(env);
DataSource ds = (DataSource) ctx.lookup(jndi_datasource);
Connection conn = ds.getConnection();
Statement stm = conn.createStatement();
ResultSet res = stm.executeQuery(sql_query);
// moving cursor to first row
res.next();
return res;
// ResultSetTester.java
import java.sql.*;
import java.util.*;
import javax.sql.*;
import javax.naming.*;
import javax.rmi.*;
public class ResultSetTester {
public static void main(String[] args) throws Exception {
WebSphereJNDI test = new WebSphereJNDI(
"http://hostname:port no.", "jdbc/mydatasource",
"SELECT * FROM pubs.dbo.authors");
System.out.println(dump_data(test.get_data()));
public static String dump_data(java.sql.ResultSet rs)
throws Exception {
int rowCount = 0;
String result = "";
result += "<P ALIGN='center'><TABLE BORDER=1>";
ResultSetMetaData rsmd = rs.getMetaData();
int columnCount = rsmd.getColumnCount();
// table header
result += "<TR>";
for (int i = 0; i < columnCount; i++) {
result += "<TH>" +
rsmd.getColumnLabel(i + 1) + "</TH>";
result += "</TR>";
// the data
while (rs.next()) {
rowCount++;
result += "<TR>";
for (int i = 0; i < columnCount; i++) {
result += "<TD>" +
rs.getString(i + 1) + "</TD>";
result += "</TR>";
result += "</TABLE></P>";
return result;
Im an amateur...Please help its urgentThanks Anuj.
We use OSB apps (exported as jars only).
We place the jars in domain/lib to be available for all services in this domain.
Is there another place we can put our jars in it?? and how can we solve the problem of soa infra with using Spring 3.2 ??
Thanks in advance. -
URGENT! Critical WebLogicServer 000364 Server failed during initialization
Hello,
My weblogic server was running fine but when I tried to restart it is givin me
the following error.
I am not able to figure it out.I have not done any changes to any of files.
Failed to find host: java.net.UnknownHostException: -i
<Aug 5, 2003 3:16:24 PM CDT> <Critical> <WebLogicServer> <000364> <Server failed
during initialization. Exception:java.l
ang.NullPointerException
java.lang.NullPointerException
at com.bea.utils.misc.Process.isValidIP(Process.java:670)
at com.bea.utils.misc.ProcessManager.otherItemCheck(ProcessManager.java:724)
at com.bea.utils.misc.ProcessManager.otherItemCheck_wrapper(ProcessManager.java:704)
at com.bea.utils.misc.ProcessManager.memCheck(ProcessManager.java:659)
at weblogic.t3.srvr.T3Srvr.checkAccess(T3Srvr.java:414)
at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:622)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:589)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:277)
at weblogic.Server.main(Server.java:32)
>
Thanks
sandhyaI got it it was IP address confusion.
Thanks
sandhya
"Karthik V" <[email protected]> wrote:
Check the <Server> configuration in your config.xml.
If you have specified the "ListenAddress" attribute, remove it and try
starting your server.
/k
"sandhya" <[email protected]> wrote in message
news:[email protected]..
Hello,
My weblogic server was running fine but when I tried to restart itis
givin me
the following error.
I am not able to figure it out.I have not done any changes to any offiles.
Failed to find host: java.net.UnknownHostException: -i
<Aug 5, 2003 3:16:24 PM CDT> <Critical> <WebLogicServer> <000364> <Serverfailed
during initialization. Exception:java.l
ang.NullPointerException
java.lang.NullPointerException
at com.bea.utils.misc.Process.isValidIP(Process.java:670)
atcom.bea.utils.misc.ProcessManager.otherItemCheck(ProcessManager.java:724)
atcom.bea.utils.misc.ProcessManager.otherItemCheck_wrapper(ProcessManager.java
:704)
atcom.bea.utils.misc.ProcessManager.memCheck(ProcessManager.java:659)
at weblogic.t3.srvr.T3Srvr.checkAccess(T3Srvr.java:414)
at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:622)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:589)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:277)
at weblogic.Server.main(Server.java:32)
>
Thanks
sandhya -
FUNCTION IS NOT WORKING WHEN RUN IN SRW.RUN_REPORT, URGENT
Hi,
I have a report. it has got 1 Query and 2 groups.
Q1
|
|
__G1__
|F1 |
|F2 |
|F3 |
|
|
|
__G2__
|Items|
|Sales|
| Qty|
|Store|
|Func4|
|Func5|
|Func6|
The Query looks like above. Now In the report I have a 3 User parameters . For Each record in G2 the functions Func4,Func5 and Func6 adds the value to the user parameters at the report level.
Now the Func1,Func2,Func3 takes the value of last 4 record for each item at each G1 Level and devides it by 4 and prints . As an example given below
ITEMS-----SALES-------QTY-----------STORE
10001-----10000-------200-------------100
10001-----20000-------500-------------200
10001-----15000-------350-------------175
10001-----45000-------650-------------225
10001-----50000-------700-------------300
AVERAGE==>32500-------550-------------225 ==> Calculated by F1,F2,F3
20001-----70000-------900-------------400
20001-----30000-------600-------------350
20001-----20000-------500-------------300
20001-----25000-------450-------------275
20001-----35000-------550-------------225
20001-----65000-------800-------------400
AVERAGE==>36250-------650-------------300 ==> Avg of last 4 records
This report takes an parameter which is part of the Where condition of the Query Q1. If I run this report from the report builder and provide the value for the parameter then the report runs fine printing the exact values. If I run the report from another report(which I have to do, due to circumstances) using SRW.Run_Report and pass the parameter in the same command. The the function FUNC4, FUNC5, FUNC6 does not do the addition, as a result the Func1,Func2,Func3 returns 0. I dont know why this is happenning .
This is very very URGENT, My project manager is on my head to finish it ASAP. Please help.
Thanks
FerozHi Toby and Danny,
Thanks for the quick reply. I dont think I am having an interdependancy of the functions. Here is an sample what two functions do at each level
Func6 =========> This function at group level G2
begin
-- To initialize the user parameter for each new item.
If :CNT = 1 Then
:Wk4_Pos_Qty := 0;
End If;
-- to add the qty value to the user parameter for last 4 records. Uchange is the no of records for each item
If :CNT >= :UCHANGE - 3 Then
:Wk4_Pos_Qty := :Wk4_Pos_Qty + :Qty;
End If;
return 0;
end;
Func3 ======> this function at group level G1
Begin
-- if no of records are less than 4 then devide by the no of records or devide by 4.
If :UChange < 4 Then
return((:Wk4_Pos_Qty + :Qty) / :UChange);
Else
return((:Wk4_Pos_Qty + :Qty)/ 4);
End If;
end;
Here Wk4_Pos_Qty is the User parameter created to hold the calue for the Um of last 4 records Qty.
I tried to modify the Func3 so that it looks like this
Func3
begin
srw.reference(:Wk4_Pos_Qty);
If :UChange < 4 Then
return((:Wk4_Pos_Qty + :Qty) / :UChange);
Else
return((:Wk4_Pos_Qty + :Qty)/ 4);
End If;
end;
But it does not effect anything. I mean its the same. The Wk4_Pos_Qty returns 0 and Func3 returns 0.
Any Suggestions .
Thanks
Feroz -
Re open the closed Posting Periods - Very Urgent
Dear Experts,
We have an urgent problem to solve.The company code currently we are configuring uses fiscal year (oct - Sept) and the other company codes in our client site uses (jan -Dec). So by mistake we closed posting periods using MMPV upto 2007 03 but it should be 2006 06(correct me if i am wrong).
As we are still in baseline configuration we don't have any material document in the current company code. From this forum I got some solution to intialize the posting period using MMPI(which directed me to use SAP Note 487381).
Now if I do MMPI with the directions mentioned in SAP Note 487381, will i face any problem now & in future.
Please suggest me and help me as has become hurdle for the test process.
Thanks in Advance...
Nagesh AswarthaHi Aswartha
As you do not have any material documents , pl go ahead and initialize the periods. Should not be a problem.
I normally do this to avoid errors:
In MMPV, never give a period. Enter the current date(or first date of the month) in the date field and execute closing program.
Best regards
Ramki -
Open items for purchase order its very urgent
hi
my requirement is to write extract program for purchase order(me21) to extract only open items.
please provide sample code its very urgent.
thanks in advance.
points will be rewarded.
thanks
hari prasad reddycheck the below report :
REPORT ZMM_OPEN_PO_REPORT no standard page heading
line-size 255
message-id zwave.
======================================================================
Program Name : ZMM_OPEN_PO_REPORT *
Description : This report displays all Open PO Items and output *
would be PO Number,Material number and so on *
Author : Seshu *
Date : 01/24/2007 *
MODIFICATION HISTORY *
DATE | AUTHOR | CHANGE # | DESCRIPTION OF MODIFICATION *
--|||--
01/24/07| Seshu | DEVK921979 | Initial *
D A T A D E C L A R A T I O N P A R T ***
type-pools
type-pools : slis.
Tables
tables : ekko, " Purchase order Header
ekpo, " Purchase order Item
marc. " Material with Plant data
Internal table for output.
data : begin of i_output occurs 0,
ebeln like ekko-ebeln,
matnr like ekpo-matnr,
end of i_output.
ALV Data declaration.
data : v_repid like sy-repid.
ALV Function Module Variables
DATA: gs_layout type slis_layout_alv,
g_exit_caused_by_caller,
gs_exit_caused_by_user type slis_exit_by_user.
DATA: gt_fieldcat type slis_t_fieldcat_alv,
gs_print type slis_print_alv,
gt_events type slis_t_event,
gt_list_top_of_page type slis_t_listheader,
g_status_set type slis_formname value 'PF_STATUS_SET',
g_user_command type slis_formname value 'USER_COMMAND',
g_top_of_page type slis_formname value 'TOP_OF_PAGE',
g_top_of_list type slis_formname value 'TOP_OF_LIST',
g_end_of_list type slis_formname value 'END_OF_LIST',
g_variant LIKE disvariant,
g_save(1) TYPE c,
g_tabname_header TYPE slis_tabname,
g_tabname_item TYPE slis_tabname,
g_exit(1) TYPE c,
gx_variant LIKE disvariant.
data : gr_layout_bck type slis_layout_alv.
Ranges
ranges r_eindt for eket-eindt.
initialization.
v_repid = sy-repid.
start-of-selection.
Get the data from EKKO ,EKPO and MARC Table
perform get_data_tables.
end-of-selection.
display the data in the form of ALV
perform display_data.
*& Form get_data_tables
Get the data from EKKO,EKPO and MARC Table
FORM get_data_tables.
clear : i_output.
refresh : i_output.
fill the dates in ranges
r_eindt-low = sy-datum - 7.
r_eindt-high = sy-datum + 14.
r_eindt-option = 'BT'.
r_eindt-sign = 'I'.
append r_eindt.
Get the data from EKKO,EKPO and EKET Tables
select aebeln bmatnr into table i_output
from ekko as a inner join
ekpo as b on aebeln = bebeln
inner join marc as c on cmatnr = bmatnr
inner join mara as d on dmatnr = bmatnr
inner join eket as e on eebeln = aebeln
and eebelp = bebelp
where c~beskz = 'E'
and c~werks = '1000'
and d~mtart = 'FERT'
and b~loekz = space
and b~elikz = space
and e~eindt in r_eindt.
if sy-subrc ne 0.
message e000(zwave) with 'No open purchase order found'.
endif.
ENDFORM. " get_data_tables
*& Form display_data
text
FORM display_data.
Fill the Fiedlcat
PERFORM fieldcat_init using gt_fieldcat[].
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = g_user_command
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = gr_layout_bck
IT_FIELDCAT = gt_fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = g_save
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = i_output
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " display_data
*& Form fieldcat_init
text
-->P_GT_FIELDCAT[] text
FORM fieldcat_init USING e01_lt_fieldcat type slis_t_fieldcat_alv.
DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
Purchase order number
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'EBELN'.
LS_FIELDCAT-ref_fieldname = 'EBELN'.
LS_FIELDCAT-ref_tabname = 'EKKO'.
LS_FIELDCAT-TABNAME = 'I_OUTPUT'.
ls_fieldcat-seltext_L = 'Purchase Order'.
ls_fieldcat-seltext_M = 'Purchase Order'.
ls_fieldcat-seltext_S = 'Purchase Order'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Material #
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'MATNR'.
LS_FIELDCAT-ref_fieldname = 'MATNR'.
LS_FIELDCAT-ref_tabname = 'EKPO'.
LS_FIELDCAT-TABNAME = 'I_OUTPUT'.
ls_fieldcat-seltext_L = 'Material'.
ls_fieldcat-seltext_M = 'Material'.
ls_fieldcat-seltext_S = 'Material'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
ENDFORM. " fieldcat_init -
URGENT!!! Extraction by FM is not working after entering No_MORE_DATA
Hi Experts,
We are trying to extract data from a custom table and look up cdhdr and cdpos table for change log for recrods in that custom table. I created a generic datasource with an abaper who defined a self defined FM below which is a copy of the RSAX_BIW_GET_DATA_SIMPLE and added code to it as necessary to meet the requirements above. It was extracting data fine but the job in ECC was hanging forever and bringing down the server. Then we added the code for RAISE NO_MORE_DATA. Now it is not extracting any data at all. Please help as this is really urgent. Following is the code. pleae tell me what i am doing wrong.
Thanks in advance.
FUNCTION zrsax_get_cd_data .
""Local Interface:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR
*" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
*" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY OPTIONAL
*" VALUE(I_REMOTE_CALL) TYPE SBIWA_FLAG DEFAULT SBIWA_C_FLAG_OFF
*" TABLES
*" I_T_SELECT TYPE SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
*" I_T_FIELDS TYPE SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
*" E_T_DATA STRUCTURE ZDIRUPDTE OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
DataSource tables
TABLES: zdirupdte.
Auxiliary Selection criteria structure
DATA: l_s_select TYPE srsc_s_select.
Maximum number of lines for DB table
STATICS: s_s_if TYPE srsc_s_if_simple,
counter
s_counter_datapakid LIKE sy-tabix,
cursor
s_cursor TYPE cursor.
IF i_initflag = sbiwa_c_flag_on.
Initialization: check input parameters
buffer input parameters
prepare data selection
Check DataSource validity
CASE i_dsource.
WHEN 'Z_DE2110_DIRUPDATE'.
WHEN OTHERS.
IF 1 = 2. MESSAGE e009(r3). ENDIF.
this is a typical log call. Please write every error message like this
log_write 'E' "message type
'R3' "message class
'009' "message number
i_dsource "message variable 1
' '. "message variable 2
RAISE error_passed_to_mess_handler.
ENDCASE.
APPEND LINES OF i_t_select TO s_s_if-t_select.
Fill parameter buffer for data extraction calls
s_s_if-requnr = i_requnr.
s_s_if-dsource = i_dsource.
s_s_if-maxsize = i_maxsize.
APPEND LINES OF i_t_fields TO s_s_if-t_fields.
ELSE. "Initialization mode or data extraction ?
Select: Retrieve all rcords from Custom table, then get CD data.
IF sy-subrc = 0.
LOOP AT payrl_itab. " 1st loop to populate e_t_data with updatd values from custom table.
Add reoord from cusom table. Update with CD header info.
s_counter = s_counter + 1.
MOVE s_counter TO e_t_data-unq_rec_id. "Make record unique
MOVE-CORRESPONDING payrl_itab TO e_t_data.
PERFORM concatenate_key. " key for cdpos_UID
PERFORM select_cd_data. " select CDHDR/CDPOS data
PERFORM get_header_data.
MOVE-CORRESPONDING hdr_itab TO e_t_data.
APPEND e_t_data.
Add same record to datapacket but with old actv/civ type value from CD table.
s_counter = s_counter + 1.
MOVE s_counter TO e_t_data-unq_rec_id.
MOVE-CORRESPONDING payrl_itab TO e_t_data.
MOVE-CORRESPONDING hdr_itab TO e_t_data.
LOOP AT cdpos_itab.
CASE cdpos_itab-fname.
WHEN 'ACTV_TYP'.
MOVE cdpos_itab-value_old TO e_t_data-actv_typ.
WHEN 'CIV_TYP'.
MOVE cdpos_itab-value_old TO e_t_data-civ_typ.
WHEN OTHERS. " Only need ACTV & CIV Types for 1.2.
ENDCASE.
ENDLOOP.
APPEND e_t_data.
CLEAR: hdr_itab[], cdpos_itab[], cdhdr_itab[].
ENDLOOP.
ELSE.
MESSAGE e185.
ENDIF. "First data package
ENDIF.
s_counter_datapakid = s_counter_datapakid + 1.
RAISE NO_MORE_DATA.
ENDIF. "Initialization mode or data extraction ?
ENDFUNCTION.Hi,
Where is the first select statement - that is select statement on the custom table ?
You should open cursor on this table and subsequently fetch package by package.
After each fetch you will check whether any data is retrieved and raise the exception no more data
something like
OPEN CURSOR WITH HOLD s_cursor_doc FOR
SELECT docnr FROM xxxxxx
WHERE racct BETWEEN '0000200000' AND '0000200999'
AND cpudt IN xxxxxx.
ENDIF. "First data package ?
**fetching required PCA documents into ranges table
FETCH NEXT CURSOR s_cursor_doc
INTO TABLE itab_docnr
PACKAGE SIZE s_s_if-maxsize.
IF sy-subrc NE 0.
CLOSE CURSOR s_cursor_doc.
RAISE no_more_data.
ENDIF. -
Sample code for sap hr program--pls treat this as urgent
Hi ,
This is the program on attendence incentive program, i have written
REPORT zhrpa0019 LINE-SIZE 270
LINE-COUNT 55(3)
NO STANDARD PAGE HEADING
MESSAGE-ID zm.
T A B L E S *
TABLES: pernr, pa2001, pa9002.
*Type-pools
TYPE-POOLS slis.
I N F O T Y P E S *
INFOTYPES: 0008, 0001, 0002,2001,9002,0041.
T Y P E S
DATA:BEGIN OF t_data1 OCCURS 0,
pernr LIKE pa0001-pernr,
ename LIKE pa0001-ename,
bukrs LIKE pa0001-bukrs,
werks LIKE pa0001-werks,
btrtl LIKE pa0001-btrtl,
persg LIKE pa0001-persg,
persk LIKE pa0001-persk,
begda LIKE pa0001-begda,
endda LIKE pa0001-endda,
amount LIKE pa0008-bet01,
cdate LIKE pa0041-dat01,
END OF t_data1.
D A T A * Internal table and working area
DATA: i_data1 LIKE t_data1 OCCURS 0 WITH HEADER LINE.
wa_data1 like line of t_data1 .
DATA : BEGIN OF i_date OCCURS 0,
pernr LIKE pa0041-pernr,
cdate LIKE pa0041-dat01,
END OF i_date.
*Data : i_pa0041 like pa0041 occurs 0 with header line,
wa_pa0041 like pa0041.
*Data : i_p0001 like p0001 occurs 0 with header line.
Constants
CONSTANTS: c_102007(6) VALUE '102007',
c_25 TYPE p DECIMALS 1 VALUE '25.0',
c_x VALUE 'X',
c_a value 'A',
c_mcnp(4) value 'MCNP'.
Variables
DATA : v_mvc like pa0008-bet01,
lv_bmonth TYPE char2,
lv_byear TYPE char4,
lv_date TYPE sy-datum.
Parameters Selection
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(31) text-001.
*PARAMETERS:: p_bmonth LIKE pv000-pabrp OBLIGATORY,
p_byear LIKE pv000-pabrj OBLIGATORY.
SELECTION-SCREEN COMMENT 45(10) text-002.
SELECTION-SCREEN END OF LINE.
PARAMETERS: p_mvc(2) TYPE p DECIMALS 1 DEFAULT c_25,
p_mctype TYPE pa2001-awart DEFAULT c_mcnp,
p_ditype TYPE c DEFAULT c_a,
rb_test RADIOBUTTON GROUP grp1 DEFAULT 'X',
rb_prod RADIOBUTTON GROUP grp1.
SELECTION-SCREEN END OF BLOCK b1.
Initialization *
INITIALIZATION.
pnpstat2-low = '3'.
pnpstat2-sign = 'I'.
pnpstat2-option = 'EQ'.
APPEND pnpstat2.
CLEAR pnpstat2.
pnpbukrs-low = 'SATS'.
pnpbukrs-sign = 'I'.
pnpbukrs-option = 'EQ'.
APPEND pnpbukrs.
CLEAR pnpbukrs.
pnppersg-low = 'N'.
pnppersg-sign = 'I'.
pnppersg-option = 'EQ'.
APPEND pnppersg.
CLEAR pnppersg.
pnpbtrtl-low = '2010'.
pnpbtrtl-high = '2050'.
pnpbtrtl-sign = 'I'.
pnpbtrtl-option = 'EQ'.
APPEND pnpbtrtl.
CLEAR pnpbtrtl.
**Clearing the variables
CLEAR : lv_byear, lv_bmonth,
lv_date.
Get previous month from current date
CALL FUNCTION 'CCM_GO_BACK_MONTHS'
EXPORTING
currdate = sy-datum
backmonths = 1
IMPORTING
newdate = lv_date.
lv_byear = lv_date(4).
lv_bmonth = lv_date+4(2).
MOVE lv_bmonth TO p_bmonth.
MOVE lv_byear TO p_byear.
AT Selection-screen *
AT SELECTION-SCREEN.
IF rb_prod = 'X' .
IF sy-uname NP 'HRBTCH*'.
MESSAGE e223(zhpa).
else.
UPDATE pa0015
SET begda = sy-datum
lgart = '216D'
bertg = P_MVC
WHERE pernr = p0001-pernr.
IF SY-SUBRC EQ 0.
message i224(zhpa).
endif.
COMMIT WORK.
ENDIF.
ENDIF.
T O P O F P A G E *
TOP-OF-PAGE.
PERFORM f_top_of_page.
E N D O F P A G E *
END-OF-PAGE.
B E G I N S E L E C T I O N *
START-OF-SELECTION.
GET pernr.
pnp-sw-ignorelockedrecords = 'N'.
PERFORM f_get_hr_data.
E N D S E L E C T I O N *
END-OF-SELECTION.
sort i_data1 by werks ascending
btrtl ascending
persg ascending
persk ascending
pernr ascending.
check for test mode.
if rb_test = 'X'.
clear: i_data1.
loop at i_data1 .
perform f_fill_bdc.
perform f_bdc_transaction using c_pa30.
endloop.
endif.
perform f_display_report.
*& Form f_top_of_page
text
--> p1 text
<-- p2 text
FORM f_top_of_page.
WRITE: text-t11, sy-repid ,
65 text-t12,
150 text-t13,
158 sy-datum.
IF rb_test = c_x.
WRITE:/ text-t21, sy-mandt,
75 text-t22,
150 text-t23,
158 sy-uzeit.
ELSE.
WRITE:/ text-t21, sy-mandt,
117 text-t24,
150 text-t23,
158 sy-uzeit.
ENDIF.
WRITE:/ text-t31, sy-uname,
150 text-t32,
158 sy-pagno.
ULINE.
ENDFORM. " f_top_of_page
*& Form f_get_hr_data
text
--> p1 text
<-- p2 text
FORM f_get_hr_data.
rp-provide-from-last p0001 space pn-begda pn-endda.
IF pnp-sw-found = 1.
PERFORM f_get_data_pa0008.
ENDIF.
ENDFORM. " f_get_hr_data
*& Form f_get_data_pa0008
text
--> p1 text
<-- p2 text
FORM f_get_data_pa0008.
PERFORM f_get_confirm_date.
rp-provide-from-last p0008 space pn-begda pn-endda..
v_mvc = p_mvc.
IF pnp-sw-found = 1.
i_data1-cdate = i_date-cdate.
MOVE p0001-pernr TO i_data1-pernr.
MOVE p0001-ename TO i_data1-ename.
MOVE p0001-werks TO i_data1-werks.
MOVE p0001-btrtl TO i_data1-btrtl.
MOVE p0001-persg TO i_data1-persg.
MOVE p0001-bukrs TO i_data1-bukrs.
MOVE p0001-persk TO i_data1-persk.
MOVE i_date-cdate TO i_data1-cdate.
MOVE v_mvc TO i_data1-amount.
APPEND i_data1.
CLEAR i_data1.
ENDIF.
ENDFORM. " f_get_data_pa0008
*& Form f_display_report
text
--> p1 text
<-- p2 text
FORM f_display_report.
perform alv_display.
*Output to a list
data : lv_stotal(5) type n,
lv_utotal(5) type n,
lv_format.
constants : c_l value '|'.
clear: i_data1.
format color col_total intensified on.
write: /, / 'Successfully Updated to Database:'.
write: /.
format reset.
uline (200).
format color col_heading intensified off.
write : /1 c_l no-gap, (8) 'Pnumber' no-gap,
c_l no-gap, (35) 'Name' no-gap,
c_l no-gap, (5) 'PA' no-gap,
c_l no-gap, (5) 'PSA' no-gap,
c_l no-gap, (6) 'EE Grp' no-gap,
c_l no-gap, (9) 'EE Subgrp' no-gap,
c_l no-gap, (12) 'Amount' no-gap,
200 c_l.
uline (200).
format reset.
loop at i_data1 .
perform f_format_amount.
if lv_format = 'X'.
clear lv_format.
format color col_normal intensified off.
else.
lv_format = 'X'.
format color col_normal intensified on.
endif.
write :/1 c_l no-gap, (8) i_data1-pernr no-gap,
c_l no-gap, (35) i_data1-ename no-gap,
c_l no-gap, (5) i_data1-werks no-gap,
c_l no-gap, (5) i_data1-btrtl no-gap,
c_l no-gap, (6) i_data1-persg no-gap,
c_l no-gap, (9) i_data1-persk no-gap,
c_l no-gap , (12) i_data1-amount no-gap.
endloop.
ENDFORM . "f_display_report
*& Form get_confirm_date
text
--> p1 text
<-- p2 text
FORM f_get_confirm_date .
rp-provide-from-last p0041 space pn-begda pn-endda.
IF pnp-sw-found = 1.
CLEAR i_date.
i_date-pernr = p0041-pernr.
APPEND i_date.
PERFORM f_populate_date USING : p0041-pernr
p0041-dar01 p0041-dat01,
p0041-pernr
p0041-dar02 p0041-dat02,
p0041-pernr
p0041-dar03 p0041-dat03,
p0041-pernr
p0041-dar04 p0041-dat04,
p0041-pernr
p0041-dar05 p0041-dat05,
p0041-pernr
p0041-dar06 p0041-dat06,
p0041-pernr
p0041-dar07 p0041-dat07,
p0041-pernr
p0041-dar08 p0041-dat08,
p0041-pernr
p0041-dar09 p0041-dat09,
p0041-pernr
p0041-dar10 p0041-dat10,
p0041-pernr
p0041-dar11 p0041-dat11,
p0041-pernr
p0041-dar12 p0041-dat12.
ENDIF.
ENDFORM. " get_confirm_date
*& Form f_populate_date
text
-->P_PERNR text
-->P_DAR text
-->P_DAT text
FORM f_populate_date USING p_pernr p_dar p_dat.
CLEAR i_date.
READ TABLE i_date WITH KEY pernr = p_pernr.
IF sy-subrc = 0.
IF p_dar = 'A3'.
i_date-cdate = p_dat.
MODIFY i_date INDEX sy-tabix.
ENDIF.
ENDIF.
endform.
i need to add the logic , could you pls help as this is very urgent.........
IF test run = X
Display the report
IF production run = X
1. Batch user ID HRBTCH* performed the execution.
Create new record based on the following parameters:
- PA0015-BEGDA = System Date (date of origin)
- PA0015-LGART = 216D (wage type)
- PA0015-BETRG = IAP amount (25)
Display the report.
2. Program was not executed by Batch user ID HRBTCH*
Display information message Only batch user ID can run actual mode.
Display the report
No update will be done.
ENDIF.
how to addd in the above code.....REPORT ZHR_ATTENDANCE_RPT MESSAGE-ID ZHR.
T Y P E P O O L S *
TYPE-POOLS : SLIS.
T A B L E *
TABLES : TEVEN,
PA0000,
PA0001,
T503K,
T500P.
I N T E R N A L T A B L E D E C L A R A T I O N *
DATA : BEGIN OF IT_PA0001 OCCURS 0,
PERNR TYPE PA0001-PERNR,
ENDDA TYPE PA0001-ENDDA,
WERKS TYPE PA0001-WERKS,
BTRTL TYPE PA0001-BTRTL,
ORGEH TYPE PA0001-ORGEH,
PERSK TYPE T503T-PERSK,
ENAME TYPE PA0001-ENAME,
END OF IT_PA0001.
DATA : BEGIN OF IT_PA0000 OCCURS 0,
PERNR TYPE PA0000-PERNR,
END OF IT_PA0000.
DATA : BEGIN OF IT_TEVEN OCCURS 0,
PERNR TYPE TEVEN-PERNR,
LDATE TYPE TEVEN-LDATE,
LTIME TYPE TEVEN-LTIME,
SATZA TYPE TEVEN-SATZA,
END OF IT_TEVEN.
DATA : IT_TEVEN1 LIKE IT_TEVEN OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF IT_T527X OCCURS 0,
ORGEH LIKE T527X-ORGEH,
ORGTX LIKE T527X-ORGTX,
END OF IT_T527X.
DATA : BEGIN OF IT_T503T OCCURS 0,
PERSK TYPE T503T-PERSK,
PTEXT TYPE T503T-PTEXT,
END OF IT_T503T.
DATA : BEGIN OF IT_FINAL OCCURS 0,
PERNR LIKE PA0001-PERNR,
ENAME LIKE PA0001-ENAME,
LDATE LIKE TEVEN-LDATE,
TPROG LIKE PTPSP-TPROG,
LTIMEI LIKE TEVEN-LTIME,
LTIMEO LIKE TEVEN-LTIME,
ORGTX LIKE T527X-ORGTX,
PTEXT TYPE T503T-PTEXT,
ATEXT TYPE ABWTXT,
END OF IT_FINAL.
DATA : IT_PTPSP LIKE PTPSP OCCURS 0 WITH HEADER LINE.
*Table to get Holiday
DATA : IT_ISCAL_DAY LIKE ISCAL_DAY OCCURS 0 WITH HEADER LINE.
DATA : IT_T554T TYPE T554T OCCURS 0 WITH HEADER LINE.
*ALV data declarations
DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV,
X_FIELDCATALOG TYPE SLIS_FIELDCAT_ALV,
GD_LAYOUT TYPE SLIS_LAYOUT_ALV,
GD_REPID LIKE SY-REPID.
*For ALV Events
DATA : IT_EVENT1 TYPE SLIS_T_EVENT.
*For ALV Events
DATA : IT_EVENT TYPE SLIS_ALV_EVENT.
*For ALV top of page
DATA : IT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
*For top of page heading
DATA : IT_LINE TYPE SLIS_LISTHEADER.
Variables declaration *
DATA : V_SHIFT LIKE PTPSP-TPROG,
V_TEMP TYPE I,
V_DATE TYPE DATUM,
V_LDATE TYPE SY-DATUM,
V_MODIF TYPE HIDENT,
V_SUBTY TYPE PA2002-SUBTY,
V_ENDDA TYPE CHAR10.
SELECTION SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_PERNR FOR TEVEN-PERNR,
S_DATE FOR TEVEN-LDATE no-extension,
S_ORGEH FOR PA0001-ORGEH,
S_WERKS FOR PA0001-WERKS,
S_BTRTL FOR PA0001-BTRTL,
S_PERSK FOR PA0001-PERSK,
S_STAT2 FOR PA0000-STAT2.
SELECTION-SCREEN END OF BLOCK B1.
A T S E L E C T I O N S C R E E N *
*validatating Selection Screen
AT SELECTION-SCREEN ON S_PERNR.
*Validate the User entered year
PERFORM VALIDATE_PERNR.
AT SELECTION-SCREEN ON S_DATE.
*Validate the User entered date
PERFORM VALIDATE_DATE_LOW.
AT SELECTION-SCREEN ON S_ORGEH.
*Validate the User entered year
PERFORM VALIDATE_ORGEH.
AT SELECTION-SCREEN ON S_PERSK.
*Validate the User entered year
PERFORM VALIDATE_PERSK.
AT SELECTION-SCREEN ON S_WERKS.
*Validate the User entered Personnel area
PERFORM VALIDATE_WERKS.
START OF SELECTION *
START-OF-SELECTION.
*Get data
PERFORM GET_DATA.
*Process data
PERFORM PROCESS_DATA.
E N D O F S E L E C T I O N *
END-OF-SELECTION.
PERFORM BUILD_FIELDCATALOG.
PERFORM BUILD_LAYOUT.
*For ALV Events
PERFORM ALV_EVENTS.
PERFORM DISPLAY_ALV_REPORT.
*& Form VALIDATE_YEAR
Validating the year
FORM VALIDATE_PERNR .
IF NOT S_PERNR IS INITIAL.
SELECT SINGLE * FROM PA0001 WHERE PERNR IN S_PERNR. "#EC *
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'Enter valid Employee Number'(002).
ENDIF.
ENDIF.
ENDFORM. " VALIDATE_pernr
*& Form VALIDATE_YEAR
Validating the year
FORM VALIDATE_ORGEH .
DATA: V_ORGEH LIKE T527X-ORGEH.
IF NOT S_ORGEH IS INITIAL.
SELECT SINGLE ORGEH FROM T527X INTO V_ORGEH WHERE ORGEH IN S_ORGEH.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'Enter Valid Organization Unit'(003).
ENDIF.
ENDIF.
ENDFORM. " VALIDATE_orgeh
*& Form GET_DATA
Get data
FORM GET_DATA.
SELECT PERNR
FROM PA0000
INTO TABLE IT_PA0000
WHERE PERNR IN S_PERNR
AND ENDDA GE S_DATE-LOW
AND BEGDA LE S_DATE-HIGH
AND STAT2 IN S_STAT2.
IF SY-SUBRC = 0.
DELETE ADJACENT DUPLICATES FROM IT_PA0000 COMPARING PERNR.
SORT IT_PA0000.
ENDIF.
IF NOT IT_PA0000[] IS INITIAL.
SELECT PERNR
ENDDA
WERKS
BTRTL
ORGEH
PERSK
ENAME
FROM PA0001
INTO TABLE IT_PA0001
FOR ALL ENTRIES IN IT_PA0000
WHERE PERNR = IT_PA0000-PERNR
AND ENDDA GE S_DATE-LOW
AND BEGDA LE S_DATE-HIGH
AND ORGEH IN S_ORGEH
AND WERKS IN S_WERKS
AND PERSK IN S_PERSK
AND BTRTL IN S_BTRTL.
IF SY-SUBRC = 0.
SORT IT_PA0001 BY PERNR ENDDA DESCENDING.
DELETE ADJACENT DUPLICATES FROM IT_PA0001 COMPARING PERNR.
SORT IT_PA0001 BY PERNR.
ENDIF.
ENDIF.
IF NOT IT_PA0001[] IS INITIAL.
SELECT PERNR
LDATE
LTIME
SATZA
FROM TEVEN
INTO TABLE IT_TEVEN
FOR ALL ENTRIES IN IT_PA0001
WHERE PERNR = IT_PA0001-PERNR
AND SATZA = 'P10'
AND LDATE IN S_DATE
AND STOKZ NE 'X'.
IF SY-SUBRC = 0.
SORT IT_TEVEN BY PERNR LDATE.
ENDIF.
ENDIF.
IF NOT IT_PA0001[] IS INITIAL.
v_date = s_date-high + 1.
SELECT PERNR
LDATE
LTIME
SATZA
FROM TEVEN
INTO TABLE IT_TEVEN1
FOR ALL ENTRIES IN IT_PA0001
WHERE PERNR = IT_PA0001-PERNR
AND SATZA = 'P20'
AND ( LDATE IN S_DATE or ldate = v_date )
AND STOKZ NE 'X'.
IF SY-SUBRC = 0.
SORT IT_TEVEN1 BY PERNR LDATE.
ENDIF.
ENDIF.
IF NOT IT_PA0001[] IS INITIAL.
SELECT ORGEH
ORGTX
FROM T527X
INTO TABLE IT_T527X
FOR ALL ENTRIES IN IT_PA0001
WHERE ORGEH = IT_PA0001-ORGEH.
IF SY-SUBRC = 0.
SORT IT_T527X BY ORGEH.
ENDIF.
ENDIF.
IF NOT IT_PA0001[] IS INITIAL.
SELECT PERSK
PTEXT
FROM T503T
INTO TABLE IT_T503T
FOR ALL ENTRIES IN IT_PA0001
WHERE PERSK = IT_PA0001-PERSK
AND SPRSL = 'E'.
IF SY-SUBRC = 0.
SORT IT_T503T BY PERSK.
ENDIF.
ENDIF.
SELECT *
FROM T554T
INTO TABLE IT_T554T
WHERE SPRSL = 'EN'
AND MOABW = '40'.
ENDFORM. " GET_DATA
*& Form PROCESS_DATA
Process data
FORM PROCESS_DATA .
V_TEMP = S_DATE-HIGH - S_DATE-LOW.
V_TEMP = V_TEMP + 1.
LOOP AT IT_PA0001.
V_DATE = S_DATE-LOW.
DO V_TEMP TIMES.
*Get employee work schedule
IF IT_PTPSP[] IS INITIAL.
PERFORM GET_SCHEDULE.
ENDIF.
*Get holiday calendar
IF IT_ISCAL_DAY[] IS INITIAL.
PERFORM GET_HOLIDAY.
ENDIF.
CLEAR : V_SUBTY.
SELECT SINGLE SUBTY
FROM PA2001
INTO V_SUBTY
WHERE PERNR = IT_PA0001-PERNR
AND ENDDA GE V_DATE
AND BEGDA LE V_DATE.
IF SY-SUBRC = 0.
READ TABLE IT_T554T WITH KEY AWART = V_SUBTY.
IT_FINAL-ATEXT = IT_T554T-ATEXT.
ENDIF.
IF V_SUBTY IS INITIAL.
SELECT SINGLE SUBTY
FROM PA2002
INTO V_SUBTY
WHERE PERNR = IT_PA0001-PERNR
AND ENDDA GE V_DATE
AND BEGDA LE V_DATE.
IF SY-SUBRC = 0.
IF V_SUBTY = '1000' OR V_SUBTY = '2000'.
IT_FINAL-ATEXT = 'Training'.
ELSEIF V_SUBTY = '3000'.
IT_FINAL-ATEXT = 'Tour'.
ENDIF.
ENDIF.
ENDIF.
*Get the employee shift schedule for that date
CLEAR : V_SHIFT.
READ TABLE IT_PTPSP WITH KEY DATUM = V_DATE.
IF SY-SUBRC = 0.
V_SHIFT = IT_PTPSP-TPROG.
IF IT_PTPSP-TAGTY = '1'.
V_SHIFT = 'NOFF'.
ENDIF.
ENDIF.
IF V_SHIFT = ''.
CLEAR IT_FINAL.
CONTINUE.
ENDIF.
*Check for holiday
IT_FINAL-TPROG = V_SHIFT.
READ TABLE IT_ISCAL_DAY WITH KEY DATE = V_DATE.
IF SY-SUBRC = 0.
IT_FINAL-TPROG = 'H'.
ENDIF.
IT_FINAL-PERNR = IT_PA0001-PERNR.
IT_FINAL-ENAME = IT_PA0001-ENAME.
IT_FINAL-LDATE = V_DATE.
*To get the organization unit
READ TABLE IT_T527X WITH KEY ORGEH = IT_PA0001-ORGEH
BINARY SEARCH.
IF SY-SUBRC = 0.
IT_FINAL-ORGTX = IT_T527X-ORGTX.
ENDIF.
CLEAR IT_T503T.
READ TABLE IT_T503T WITH KEY PERSK = IT_PA0001-PERSK
BINARY SEARCH.
IF SY-SUBRC = 0.
IT_FINAL-PTEXT = IT_T503T-PTEXT.
ENDIF.
V_LDATE = v_DATE + 1.
*To get Punch-in.
READ TABLE IT_TEVEN WITH KEY PERNR = IT_PA0001-PERNR
LDATE = V_DATE
BINARY SEARCH.
IF SY-SUBRC = 0.
IT_FINAL-LTIMEI = IT_TEVEN-LTIME.endif.
*To get Punch-out
READ TABLE IT_TEVEN1 WITH KEY PERNR = IT_PA0001-PERNR
LDATE = v_DATE
BINARY SEARCH.
IF SY-SUBRC = 0.
IF IT_TEVEN1-LTIME > IT_FINAL-LTIMEI.
IT_FINAL-LTIMEO = IT_TEVEN1-LTIME.
ELSE.
SELECT SINGLE LTIME
FROM TEVEN
INTO IT_FINAL-LTIMEO
WHERE PERNR = IT_PA0001-PERNR
AND LDATE = v_DATE
AND LTIME > IT_TEVEN1-LTIME
AND SATZA = 'P20'
AND STOKZ NE 'X'.
ENDIF.
ENDIF.
IF IT_FINAL-LTIMEO IS INITIAL.
IF V_SHIFT = 'NNIG' OR V_SHIFT = 'NAFT'..
READ TABLE IT_TEVEN1 WITH KEY PERNR = IT_PA0001-PERNR
LDATE = V_LDATE
BINARY SEARCH.
IF SY-SUBRC = 0.
IT_FINAL-LTIMEO = IT_TEVEN1-LTIME.
ENDIF.
ENDIF.
ENDIF.
if ( V_SHIFT = 'NOFF' OR IT_FINAL-TPROG = 'H' )
and it_final-ltimei is initial and it_final-ltimeo is not initial.
clear: it_final-ltimeo.endif.
APPEND IT_FINAL.
ELSE.
*If holiday or OFF or Tour or Absent
IF V_SHIFT = 'NOFF' OR IT_FINAL-TPROG = 'H'
or it_final-atext is not initial or
( it_final-ltimei is not initial and it_final-ltimeo is not initial ).
APPEND IT_FINAL.
ELSEIF IT_FINAL-ATEXT IS NOT INITIAL.
APPEND IT_FINAL.
ELSE.
IT_FINAL-ATEXT = 'Absent'.
APPEND IT_FINAL.
ENDIF.
ENDIF.
APPEND IT_FINAL.
CLEAR : IT_FINAL.
V_DATE = V_DATE + 1.
ENDDO.
CLEAR : IT_PTPSP[],
IT_ISCAL_DAY[].
ENDLOOP.
SORT IT_FINAL BY PERNR LDATE.
LOOP AT IT_FINAL.
TRANSLATE IT_FINAL-ATEXT TO UPPER CASE.
MODIFY IT_FINAL INDEX SY-TABIX.
ENDLOOP.
ENDFORM. " PROCESS_DATA
*& Form GET_SCHEDULE
Get employee work schedule
FORM GET_SCHEDULE.
CALL FUNCTION 'HR_PERSONAL_WORK_SCHEDULE'
EXPORTING
PERNR = IT_PA0001-PERNR
BEGDA = S_DATE-LOW
ENDDA = S_DATE-HIGH
TABLES
PERWS = IT_PTPSP
EXCEPTIONS
ERROR_OCCURED = 1
ABORT_OCCURED = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " GET_SCHEDULE
*& Form build_fieldcatalog
FORM BUILD_FIELDCATALOG .
X_FIELDCATALOG-COL_POS = 1.
X_FIELDCATALOG-FIELDNAME = 'PERNR'.
X_FIELDCATALOG-SELTEXT_L = 'Personnel No'(006).
X_FIELDCATALOG-DDICTXT = 'L'.
APPEND X_FIELDCATALOG TO FIELDCATALOG.
CLEAR X_FIELDCATALOG.
X_FIELDCATALOG-COL_POS = 2.
X_FIELDCATALOG-FIELDNAME = 'ENAME'.
X_FIELDCATALOG-SELTEXT_L = 'Employee Name'(007).
X_FIELDCATALOG-DDICTXT = 'L'.
APPEND X_FIELDCATALOG TO FIELDCATALOG.
CLEAR X_FIELDCATALOG.
X_FIELDCATALOG-COL_POS = 5.
X_FIELDCATALOG-FIELDNAME = 'LDATE'.
X_FIELDCATALOG-SELTEXT_L = 'Date'(008).
X_FIELDCATALOG-DDICTXT = 'L'.
APPEND X_FIELDCATALOG TO FIELDCATALOG.
CLEAR X_FIELDCATALOG.
X_FIELDCATALOG-COL_POS = 6.
X_FIELDCATALOG-FIELDNAME = 'TPROG'.
X_FIELDCATALOG-SELTEXT_L = 'Planned Shift'(009).
X_FIELDCATALOG-DDICTXT = 'L'.
APPEND X_FIELDCATALOG TO FIELDCATALOG.
CLEAR X_FIELDCATALOG.
X_FIELDCATALOG-COL_POS = 7.
X_FIELDCATALOG-FIELDNAME = 'LTIMEI'.
X_FIELDCATALOG-SELTEXT_L = 'Attended Time-In'(010).
X_FIELDCATALOG-DDICTXT = 'L'.
APPEND X_FIELDCATALOG TO FIELDCATALOG.
CLEAR X_FIELDCATALOG.
X_FIELDCATALOG-COL_POS = 8.
X_FIELDCATALOG-FIELDNAME = 'LTIMEO'.
X_FIELDCATALOG-SELTEXT_L = 'Attended Time-Out'(011).
X_FIELDCATALOG-DDICTXT = 'L'.
APPEND X_FIELDCATALOG TO FIELDCATALOG.
CLEAR X_FIELDCATALOG.
X_FIELDCATALOG-COL_POS = 3.
X_FIELDCATALOG-FIELDNAME = 'ORGTX'.
X_FIELDCATALOG-SELTEXT_L = 'Organization Unit'(005).
X_FIELDCATALOG-DDICTXT = 'L'.
APPEND X_FIELDCATALOG TO FIELDCATALOG.
CLEAR X_FIELDCATALOG.
X_FIELDCATALOG-COL_POS = 4.
X_FIELDCATALOG-FIELDNAME = 'PTEXT'.
X_FIELDCATALOG-SELTEXT_L = 'Emp Subgroup'(016).
X_FIELDCATALOG-DDICTXT = 'L'.
APPEND X_FIELDCATALOG TO FIELDCATALOG.
CLEAR X_FIELDCATALOG.
X_FIELDCATALOG-COL_POS = 9.
X_FIELDCATALOG-FIELDNAME = 'ATEXT'.
X_FIELDCATALOG-SELTEXT_L = 'Leaves/Tours'(015).
X_FIELDCATALOG-DDICTXT = 'L'.
X_FIELDCATALOG-OUTPUTLEN = '25'.
APPEND X_FIELDCATALOG TO FIELDCATALOG.
CLEAR X_FIELDCATALOG.
ENDFORM. " build_fieldcatalog
*& Form build_layout
FORM BUILD_LAYOUT.
GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
GD_LAYOUT-ZEBRA = 'X'.
ENDFORM. " build_layout
*& Form ALV_EVENTS
For ALV Events
FORM ALV_EVENTS .
IT_EVENT-NAME = 'TOP_OF_PAGE'.
IT_EVENT-FORM = 'TOP_OF_PAGE'.
APPEND IT_EVENT TO IT_EVENT1.
ENDFORM. " ALV_EVENTS
*& Form TOP_OF_PAGE
ALV TOP-OF-PAGE
FORM TOP_OF_PAGE. "#EC CALLED
REFRESH : IT_LIST_TOP_OF_PAGE.
CLEAR : IT_LINE.
IT_LINE-TYP = 'H'.
IT_LINE-INFO = 'Attendance Report for the Period'(013).
APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
CONCATENATE S_DATE-LOW6(2) '.' S_DATE-LOW4(2) '.' S_DATE-LOW+0(4)
INTO IT_LINE-INFO.
CONCATENATE S_DATE-HIGH6(2) '.' S_DATE-HIGH4(2) '.' S_DATE-HIGH+0(4) INTO V_ENDDA.
CONCATENATE IT_LINE-INFO '-' V_ENDDA INTO IT_LINE-INFO SEPARATED BY SPACE.
APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LIST_TOP_OF_PAGE.
ENDFORM. "TOP_OF_PAGE
*& Form display_alv_report
FORM DISPLAY_ALV_REPORT.
GD_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GD_REPID
IT_EVENTS = IT_EVENT1
IS_LAYOUT = GD_LAYOUT
IT_FIELDCAT = FIELDCATALOG
TABLES
T_OUTTAB = IT_FINAL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "display_alv_report
*& Form VALIDATE_PERSK
text
--> p1 text
<-- p2 text
FORM VALIDATE_PERSK .
IF NOT S_PERSK IS INITIAL.
SELECT SINGLE * FROM T503K WHERE PERSK IN S_PERSK. "#EC *
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'Enter valid Employee subgroup'(012).
ENDIF.
ENDIF.
ENDFORM. " VALIDATE_PERSK
*& Form VALIDATE_WERKS
Validate user Entered Personnel area
FORM VALIDATE_WERKS .
IF S_WERKS[] IS NOT INITIAL.
SELECT SINGLE * FROM T500P WHERE PERSA IN S_WERKS.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'Enter valid Personnel Area'(014).
ENDIF.
ENDIF.
ENDFORM. " VALIDATE_WERKS
*& Form VALIDATE_DATE_LOW
Validate user Entered Date
FORM VALIDATE_DATE_LOW .
IF S_DATE-LOW IS INITIAL.
MESSAGE E000 WITH 'Enter Date'(004).
ENDIF.
IF S_DATE-HIGH IS INITIAL.
MESSAGE E000 WITH 'Enter Date'(004).
ENDIF.
ENDFORM. " VALIDATE_DATE_LOW
*& Form GET_HOLIDAY
Get Holiday
FORM GET_HOLIDAY .
CLEAR V_MODIF.
SELECT SINGLE MOFID
FROM T001P
INTO V_MODIF
WHERE WERKS = IT_PA0001-WERKS
AND BTRTL = IT_PA0001-BTRTL.
CALL FUNCTION 'HOLIDAY_GET'
EXPORTING
HOLIDAY_CALENDAR = V_MODIF
DATE_FROM = S_DATE-LOW
DATE_TO = S_DATE-HIGH
TABLES
HOLIDAYS = IT_ISCAL_DAY
EXCEPTIONS
FACTORY_CALENDAR_NOT_FOUND = 1
HOLIDAY_CALENDAR_NOT_FOUND = 2
DATE_HAS_INVALID_FORMAT = 3
DATE_INCONSISTENCY = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " GET_HOLIDAY
<b>Reward Points if useful.</b> -
URGENT FIX MY Connect Four game for Wednsday PLEASE HELP
I am using an APPLET and i want to use JOptionpane it didnt work when i used it in the paint method. So i want to make a runner to make the program work. I don't know why the Graphics g = new Graphics isnt working PLEASE HELP. Email the revised code to my email at [email protected]. URGENT FOR TOMORROW PLEASE HELP. should i have a spearate class for the runner, just email me please if you can help.
import javax.swing.JApplet;
import java.applet.*;
import java.awt.Graphics;
import java.awt.Color;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.JOptionPane;
public class Board extends JApplet
// the grid used for storing the game layout.
private int[][] grid;
// the player whose turn it is.
private int currentPlayer;
public final int player1=1;
public final int player2=2;
private int place1=5;
private int place2=5;
private int place3=5;
private int place4=5;
private int place5=5;
private int place6=5;
private int place7=5;
public static void main()
int column1;
int column2;
String name1;
String name2;
Graphics g=new Graphics();
Board test= new Board();
boolean wait=true;
while(wait)
String starts=JOptionPane.showInputDialog("Are you ready? \n (yes or no)");
starts.toLowerCase();
if(starts.equals("yes"))
wait=false;
name1=JOptionPane.showInputDialog("Enter Player 1's Name");
name2 = JOptionPane.showInputDialog("Enter Player 2's Name");
test.paintBoard(true,g);
while(!test.done() || !test.hasWon(g,player1) || !test.hasWon(g,player2))
column1=0;
while(column1>0 && column1<8)
column1=Integer.parseInt(JOptionPane.showInputDialog(name1+" what column do you choose?"));
test.place(player1, column1,g);
if(!test.done() || !test.hasWon(g,player1))
column2=0;
while(column2>0 && column2<8)
column2=Integer.parseInt(JOptionPane.showInputDialog(name1+" what column do you choose?"));
test.place(player2, column2,g);
public Board()
// create the grid
grid = new int[7][6];
// initialize the gridc
for (int row=0; row<6; row++)
for (int column=0; column<7; column++)
// set the position to a default value
grid[column][row] = 0;
public boolean done()
boolean flags =true;
for (int row=0; row<6; row++)
for (int column=0; column<7; column++)
if(grid[column][row] == 0)
flags=false;
return flags;
public void paint(Graphics g)
public void paintBoard(boolean flag, Graphics g)
int index= 0;
g.setColor(Color.YELLOW);
g.fillRect(0, 80, 700,700);
g.setColor(Color.WHITE);
//draws spaces
for(int y =100; y<700; y=y+100)
for(int x =10; x<700; x=x+100)
if(flag==false)
index++;
if(index%2==0)
g.setColor(Color.RED);
else
g.setColor(Color.BLACK);
else
g.setColor(Color.WHITE);
g.fillOval(x,y,80,80);
TextField column =new TextField(10);
if(flag==false)
g.setFont(new Font("Times New Roman", Font.BOLD,24));
g.setColor(Color.YELLOW);
g.drawString("C",45,245);
g.drawString("O",145,245);
g.drawString("N",245,245);
g.drawString("N",345,245);
g.drawString("E",445,245);
g.drawString("C",545,245);
g.drawString("T",645,245);
g.drawString("F",145,145);
g.drawString("U",145,345);
g.drawString("R",145,445);
g.setColor(Color.BLUE);
g.drawString("START",512,548);
public void paintFinish(Graphics g, int player)
int index= 0;
g.setColor(Color.YELLOW);
g.fillRect(0, 80, 700,700);
g.setColor(Color.WHITE);
//draws spaces
for(int y =100; y<700; y=y+100)
for(int x =10; x<700; x=x+100)
index++;
if(player==1)
g.setColor(Color.RED);
else
g.setColor(Color.BLACK);
g.fillOval(x,y,80,80);
public boolean hasWon(Graphics g, int player)
boolean status = false;
// check for a horizontal win
for (int row=0; row<6; row++)
for (int column=0; column<4; column++)
if (grid[column][row] != 0 &&
grid[column][row] == grid[column+1][row] &&
grid[column][row] == grid[column+2][row] &&
grid[column][row] == grid[column+3][row] &&
grid[column][row] == player)
status = true;
// check for a vertical win
for (int row=0; row<3; row++)
for (int column=0; column<7; column++)
if (grid[column][row] != 0 &&
grid[column][row] == grid[column][row+1] &&
grid[column][row] == grid[column][row+2] &&
grid[column][row] == grid[column][row+3]&&
grid[column][row] == player)
status = true;
// check for a diagonal win (positive slope)
for (int row=0; row<3; row++)
for (int column=0; column<4; column++)
if (grid[column][row] != 0 &&
grid[column][row] == grid[column+1][row+1] &&
grid[column][row] == grid[column+2][row+2] &&
grid[column][row] == grid[column+3][row+3]&&
grid[column][row] == player)
status = true;
// check for a diagonal win (negative slope)
for (int row=3; row<6; row++)
for (int column=0; column<4; column++)
if (grid[column][row] != 0 &&
grid[column][row] == grid[column+1][row-1] &&
grid[column][row] == grid[column+2][row-2] &&
grid[column][row] == grid[column+3][row-3]&&
grid[column][row] == player)
status = true;
if(status)
paintFinish(g, player);
return status;
public void place(int player, int column, Graphics g)
int index=0;
if(column==1)
index=place1;
if(column==2)
index=place2;
if(column==3)
index=place3;
if(column==4)
index=place4;
if(column==5)
index=place5;
if(column==6)
index=place6;
if(column==7)
index=place7;
grid[column-1][index]=player;
if(player==player1)
g.setColor(Color.RED);
if(player==player2)
g.setColor(Color.BLACK);
g.fillOval((column*100)+10,(index+1)*100,80,80);
if(column==1)
place1--;
if(column==2)
place2--;
if(column==3)
place3--;
if(column==4)
place4--;
if(column==5)
place5--;
if(column==6)
place6--;
if(column==7)
place7--;
}gamefreak1192 wrote:
I am using an APPLET and i want to use JOptionpane it didnt work when i used it in the paint method. So i want to make a runner to make the program work. I don't know why the Graphics g = new Graphics isnt working PLEASE HELP. Email the revised code to my email at [email protected] URGENT FOR TOMORROW PLEASE HELP. should i have a spearate class for the runner, just email me please if you can help.
This is bloody ridiculous. You want somebody to do your work for you, you can't be bothered to carry on a discussion here and ask for private email, and you expect somebody else to make your urgency (i.e. lousy time management) their problem. You got big brass ones, kid. -
1 of my HD partition suddenly can't mount and want me to initialize! HELP!!
Hi,
If anyone who frequented these kind of problems before please let me know your solutions solving these problems. Thanks very much!!
I'm a musician and a frequent mac user,I have a Power Mac G4 dual 800 with 1.25GMhz ram running on Mac Os 9.21 but with Mac OS X installed (I need to use Mac OS classic due to some of my music softwares still need to be updated before I upgrade to OS X),I've put the Hard Disk in 2 other sub partition HD at the beginning and have been using it to put all my important audio files and songs files. No problems at all before these nightmare started!
The serious problem I'm having now is I suddenly can't mount one of my partition HD anymore.
-I heard weird sound when starting & re-starting the Mac. (Heard some Hard Disk weird sound like sound "crutch" sound" and since the partition can't be mounted, the first thing shows up after I boot the computer is asking me if I wanna Initialize the Hard Disk because it's unreadable. There is 2 choices for me "Cancel" & "Initialize" But there is no effect when I choose "Cancel" so I use the Force Quit.
2 little message saying my Main Hard Disk & the other partition are damaged but they still showing up properly and still running dangerously I think.
-I have tried to start-up by using the installer Disk came with the computer and runs the First Aid Kit to verify the disk. I can see the partition and can see the icon of it but it's just different from others (in a black tone basic classic icon) and after running the verification some following messages appears:
"Mountcheck found serious errors" (in red) then "Overlapped extent allocation,2.60" (in red) and "Hard disk need to be repaired" so I run the Repair mode and it just can't fix because it says it's not been mounted.
I've also checked the main HD and the other partition which sometimes had some problems with it but no problems been found.
-There was few times my computer do Freeze or appears a Bomb asking me to restart when I recording something using the partition for saving the data and a weird sound of hard disk comes before freezing. It seems it's always the same place of the hard disk. Also When I inserted a blank CD-R disk into the drive it just freeze and appears a Bomb message instead asking me if I wanna use the Toast or i-tunes for preparing the disk which I always used to do.
I really hope the computer can hang on just for 1 more month before I have a break to fix everything and backup everything inside or initialize everything inside.
P.S. I've another Powerbook G4 running on OS Tiger but it's mainly for my internet use. ( I don't use internet connection for my PowerMac G4)
And the Combo super Drive is DOWN,I just can't insert any Disk inside anymore. So if having another Mac is helpful for my issue,anything I would try.
Due To I'm having some urgent important jobs now so I really can't initialize or setup other new computers for my works now.
HELP! Thanks!!!Just because you can't find them does not mean they aren't there.
Freeing Up Space on The Hard Drive
1. See Lion/Mountain Lion/Mavericks' Storage Display.
2. You can remove data from your Home folder except for the /Home/Library/ folder.
3. Visit The XLab FAQs and read the FAQ on freeing up space on your hard drive.
4. Also see Freeing space on your Mac OS X startup disk.
5. See Where did my Disk Space go?.
6. See The Storage Display.
You must Empty the Trash in order to recover the space they occupied on the hard drive.
You should consider replacing the drive with a larger one. Check out OWC for drives, tutorials, and toolkits.
Try using OmniDiskSweeper 1.8 or GrandPerspective to search your drive for large files and where they are located. -
Urgent: Problems in Generic Extraction by Function Module
Hi BW Gurus,
I am new to SDN and also new to generic extraction using function module. My requirement is to extract long text(142 char) from CRM to BW as the text is not stored in database table I used function module read_text with in another ZXXX function module copy of (RSAX_BIW_GET_DATA_SIMPLE). In my extract structure I used GUID(char,32), Langu, long text(142 char) and 2 placeholders. Text can be extracted by passing STXH table fields(Tdname, Tdid, Tdobject, Tdspars) to read_text as parameters and i also need to use CRMD_ORDERADM_H field GUID(32 char) to compare 1st 32 chars of tdname(70 char) with Guid to select Guids and loop thru this Guids and for each Guid i need to append lines of text to e_t_data but as i donot know ABAP i unable to write the code for this. Through my friends help i wrote code when i check in RSA3 it is displaying the text but when i replicate into BW and load into data target in monitor the status is red with records initially but afterwards it will be red status again with 0 from 0 records for initial load again.when i check on job logs the errors i have are:
The background job has created a job log file of 2Gb size and it is currently on a infinite loop writing entries into the SAP System Log that it cannot write to the Job log file due to Error 22 for write/read access to a file this is because of the datasource i have created. Please find my Function module and if anyone would please correct FM and send me that will be really great.I appreciate it in advance.
MY Function Module is:
FUNCTION Z_CRMORDERH_STR_TXT.
""Local Interface:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR
*" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
*" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY OPTIONAL
*" VALUE(I_REMOTE_CALL) TYPE SBIWA_FLAG DEFAULT SBIWA_C_FLAG_OFF
*" TABLES
*" I_T_SELECT TYPE SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
*" I_T_FIELDS TYPE SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
*" E_T_DATA STRUCTURE YCRM_TEXT_STR OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
***" EXCEPTIONS NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
Tables: CRMD_ORDERADM_H, STXH.
Auxiliary Selection criteria structure
data: l_s_select type srsc_s_select.
Maximum number of lines for DB table
Statics: s_s_if type srsc_s_if_simple,
counter
s_counter_datapakid like sy-tabix,
Cursor
s_cursor type cursor.
data: i_crmtext type standard table of TLINE .
types: begin of xsreph ,
GUID type CRMD_ORDERADM_H-guid,
end of xsreph.
data: i_guid type standard table of xsreph.
data: I_TEXT type STXH-TDNAME.
data: xempl like YCRM_TEXT_STR occurs 0 with header line.
data: t_tab like dd03l-tabname.
Select ranges
ranges: l_r_guid for CRMD_ORDERADM_H-guid.
l_r_connid for sflight-connid.
Initialization mode (first call by SAPI) or data transfer mode
(following calls) ?
if i_initflag = sbiwa_c_flag_on.
Initialization: check input parameters
buffer input parameters
prepare data selection
Check DataSource validity
case i_dsource.
when 'yCRM_TEXT'. " for S_SREPH1
when others.
if 1 = 2. message e009(r3). endif.
this is a typical log call. Please write every error message like this
log_write 'E' "message type
'R3' "message class
'009' "message number
i_dsource "message variable 1
' '. "message variable 2
raise error_passed_to_mess_handler.
endcase.
append lines of i_t_select to s_s_if-t_select.
Fill parameter buffer for data extraction calls
s_s_if-requnr = i_requnr.
s_s_if-dsource = i_dsource.
s_s_if-maxsize = i_maxsize.
Fill field list table for an optimized select statement
(in case that there is no 1:1 relation between InfoSource fields
and database table fields this may be far from beeing trivial)
append lines of i_t_fields to s_s_if-t_fields.
we will do our selection based on what is in the p table for the
infoobject
else. "Initialization mode or data extraction ?
Data transfer: First Call OPEN CURSOR + FETCH
Following Calls FETCH only
First data package -> OPEN CURSOR
if s_counter_datapakid = 0.
Fill range tables BW will only pass down simple selection criteria
of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'GUID'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_GUID.
APPEND L_R_GUID.
ENDLOOP.
case i_dsource.
when 'YCRM_TEXT'. " for S_SREPH1
t_tab = 'CRMD_ORDERADM_H'.
endcase.
select GUID
from (t_tab)
into table i_guid where PROCESS_TYPE = 'ZACI' and ( OBJECT_ID < '0000000042').
select tdname from stxh into i_text where tdobject = 'TEXT'.
if sy-subrc ne 0.
message e009(r3).
this is a typical log call. Please write every error message like this
log_write 'E' "message type
'R3' "message class
'009' "message number
i_dsource "message variable 1
'No master data found'. "message variable 2
raise error_passed_to_mess_handler.
endif.
Determine number of database records to be read per FETCH statement
from input parameter I_MAXSIZE. If there is a one to one relation
between DataSource table lines and database entries, this is trivial.
In other cases, it may be impossible and some estimated value has to
be determined.
open cursor with hold s_cursor for
select (s_s_if-t_fields) from CRMD_ORDERADM_H
where GUID in L_R_GUID .
ENDIF.
Fetch records into interface table.
named E_T_'Name of extract structure'.
fetch next cursor s_cursor
appending corresponding fields
of table e_t_data
package size s_s_if-maxsize.
IF SY-SUBRC <> 0.
CLOSE CURSOR S_CURSOR.
RAISE NO_MORE_DATA.
ENDIF.
as we are doing this only once can use the select statement.
***data: crmtext like tline occurs 0 with header line.
**data: i_crmtext type standard table of TLINE.
**data: i_guid type standard table of xsreph.
data: l_guid type THEAD-TDNAME.
data: st_guid type xsreph.
data: st_crmtext type TLINE.
data: lan type THEAD-TDSPRAS.
lan = 'E'.
loop at i_guid into st_guid.
l_guid = st_guid-guid.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'A002'
LANGUAGE = lan
NAME = l_guid
OBJECT = 'CRM_ORDERH'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = i_crmtext.
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
e_t_data-guid = l_guid.
loop at i_crmtext into st_crmtext.
move lan to e_t_data-langu.
move st_crmtext-tdline to e_t_data-description.
append e_t_data.
endif.
endloop.
clear: st_guid,l_guid.
refresh: i_crmtext.
endloop.
S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
endif.
ENDFUNCTION.
please Gurus as I donot know ABAP i appreciate if anyone would write a FM based on requirement and send me that will be really great this is my request. I gurantee of award points for good answers.
Regards
KishoreHi,
The statement <b>RAISE NO_MORE_DATA</b> should be active (uncommented) in your code. Otherwise, the infinte loop occurs.
See also, the Siggi's blog:
/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
BTW, was it your thread here:
Re: Urgent: problems in extracting Long Text
Best regards,
Eugene -
guys, i need help.... is anyone there have an idea about opengl...? ill attach 4 files that needs to be enhanced or debug for possible errors. to see the canvas... you should have atleast all the needed lib and jar of opengl in your pc.
its urgent, its for our thesis actually....ill be dividing the codes with the use of (" **** ")sign...
* Main.java
* Created on 29 January 2007, 08:12
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package longgong;
* @author welcome
public class Main {
/** Creates a new instance of Main */
public Main() {
* @param args the command line arguments
public static void main(String[] args) {
// TODO code application logic here
frmMain f = new frmMain();
* frmMain.java
* Created on November 10, 2006, 10:52 AM
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package longgong; // create a floder named longgong and add the class inside
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
* @author all user
public class frmMain extends JFrame implements ActionListener, ChangeListener, ItemListener{
JPanel pnlWest, pnlEast, pnlCenter, pnlSouth, pnlTitle, pnlSlider, pnlPlayers;
JSlider slrSpeed;
JList lstResults;
String varResults [] = new String[31];
JLabel lblPlayers, lblTitle;
JCheckBox lblPlayer1, lblPlayer2, lblPlayer3, lblPlayer4, lblPlayer5, lblPlayer6;
ImageIcon imgDice1;
MyCanvas canvas;
JButton btnStart, btnStop;
JMenuBar menuBar;
JMenu menuFile, menuView, menuHelp;
JMenuItem menuNew, menuExit, menuIn, menuOut, menuHigh, menuPlay, menuAbout;
boolean isNew = false;
/** Creates a new instance of frmMain */
public frmMain() {
setLayout(new BorderLayout());
setTitle("Longgong");
setSize(780,600);
canvas = new MyCanvas(getSize().width, getSize().height);
imgDice1 = new ImageIcon("c:\\java\\images\\one.png");
menuBar = new JMenuBar();
menuFile = new JMenu("File");
menuView = new JMenu("View");
menuHelp = new JMenu("Help");
menuNew = new JMenuItem ("New Game");
menuNew.addActionListener(this);
menuExit = new JMenuItem ("Exit");
menuExit.addActionListener(this);
menuIn = new JMenuItem ("Zoom In");
menuIn.addActionListener(this);
menuOut = new JMenuItem ("Zoom Out");
menuOut.addActionListener(this);
menuHigh = new JMenuItem ("High Score");
menuPlay = new JMenuItem ("How To Play");
menuPlay.addActionListener(this);
menuAbout = new JMenuItem ("About");
menuAbout.addActionListener(this);
menuFile.add(menuNew);
menuFile.add(menuExit);
menuView.add(menuIn);
menuView.add(menuOut);
menuView.add(menuHigh);
menuHelp.add(menuPlay);
menuHelp.add(menuAbout);
menuBar.add(menuFile);
menuBar.add(menuView);
menuBar.add(menuHelp);
setJMenuBar(menuBar);
varResults[0] = "Dice Results";
varResults[1] = "1. 3-4-2";
varResults[2] = "2. 3-1-4";
varResults[3] = "3. 3-6-5";
slrSpeed = new JSlider(0, 100, 0);
slrSpeed.setPaintTicks(true);
slrSpeed.setMinorTickSpacing(1);
slrSpeed.setPaintLabels(true);
slrSpeed.setSnapToTicks(true);
slrSpeed.addChangeListener(this);
slrSpeed.setEnabled(false);
btnStart = new JButton("Start");
btnStart.addActionListener(this);
btnStop = new JButton("Stop");
btnStop.addActionListener(this);
pnlWest = new JPanel();
pnlEast = new JPanel();
pnlCenter = new JPanel();
pnlSouth = new JPanel();
pnlTitle = new JPanel();
pnlSlider = new JPanel();
pnlPlayers = new JPanel();
pnlWest.setLayout(new BorderLayout());
pnlEast.setLayout(new BorderLayout());
pnlEast.setPreferredSize(new Dimension(100,400));
pnlCenter.setLayout(new BorderLayout());
pnlSouth.setLayout(new FlowLayout());
pnlTitle.setLayout(new FlowLayout());
pnlSlider.setLayout(new FlowLayout());
pnlPlayers.setLayout(new BoxLayout(pnlPlayers,BoxLayout.Y_AXIS));
pnlPlayers.setPreferredSize(new Dimension(150,400));
lblPlayers = new JLabel(" Players: Choice (s)");
lblPlayer1 = new JCheckBox("None");
lblPlayer1.addItemListener(this);
lblPlayer2 = new JCheckBox("None");
lblPlayer2.addItemListener(this);
lblPlayer3 = new JCheckBox("None");
lblPlayer3.addItemListener(this);
lblPlayer4 = new JCheckBox("None");
lblPlayer4.addItemListener(this);
lblPlayer5 = new JCheckBox("None");
lblPlayer5.addItemListener(this);
lblPlayer6 = new JCheckBox("None");
lblPlayer6.addItemListener(this);
lstResults = new JList(varResults);
pnlPlayers.add(lblPlayers);
pnlPlayers.add(lblPlayer1);
pnlPlayers.add(lblPlayer2);
pnlPlayers.add(lblPlayer3);
pnlPlayers.add(lblPlayer4);
pnlPlayers.add(lblPlayer5);
pnlPlayers.add(lblPlayer6);
pnlSlider.add(slrSpeed);
pnlSlider.add(btnStart);
pnlSlider.add(btnStop);
pnlEast.add(BorderLayout.CENTER, lstResults);
pnlCenter.add(BorderLayout.SOUTH, pnlSlider);
pnlCenter.add(BorderLayout.CENTER, canvas);
lblTitle = new JLabel("LONGGONG DICE GAME SIMULATION");
pnlTitle.add(lblTitle);
getContentPane().add(BorderLayout.NORTH,pnlTitle);
getContentPane().add(BorderLayout.WEST,pnlPlayers);
getContentPane().add(BorderLayout.EAST,pnlEast);
getContentPane().add(BorderLayout.CENTER, pnlCenter);
getContentPane().add(BorderLayout.SOUTH,pnlSouth);
setResizable(false);
canvas.start();
show();
//name change when player is selected
public void itemStateChanged(ItemEvent e) {
Object source = e.getItemSelectable();
int choice;
if (source == lblPlayer1) {
if (lblPlayer1.isSelected()) {
frmChoices fchoices = new frmChoices(lblPlayer1);
if (source == lblPlayer2) {
if (lblPlayer2.isSelected()) {
frmChoices fchoices = new frmChoices(lblPlayer2);
if (source == lblPlayer3) {
if (lblPlayer3.isSelected()) {
frmChoices fchoices = new frmChoices(lblPlayer3);
if (source == lblPlayer4) {
if (lblPlayer4.isSelected()) {
frmChoices fchoices = new frmChoices(lblPlayer4);
if (source == lblPlayer5) {
if (lblPlayer5.isSelected()) {
frmChoices fchoices = new frmChoices(lblPlayer5);
if (source == lblPlayer6) {
if (lblPlayer6.isSelected()) {
frmChoices fchoices = new frmChoices(lblPlayer6);
// if (e.getStateChange() == ItemEvent.DESELECTED)
//...make a note of it...
//slider speed change
public void stateChanged(ChangeEvent e){
canvas.speed(slrSpeed.getValue());
public void actionPerformed (ActionEvent e){
if (e.getActionCommand().equals ("Exit")){
System.exit (0);
//connects to frmNew
if (e.getActionCommand().equals ("New Game")){
frmNew n = new frmNew(this);
lblPlayer1.setText("None");
lblPlayer2.setText("None");
lblPlayer3.setText("None");
lblPlayer4.setText("None");
lblPlayer5.setText("None");
lblPlayer6.setText("None");
isNew = true;
lblPlayer1.setSelected(false);
lblPlayer2.setSelected(false);
lblPlayer3.setSelected(false);
lblPlayer4.setSelected(false);
lblPlayer5.setSelected(false);
lblPlayer6.setSelected(false);
if (e.getActionCommand().equals ("Start")){
slrSpeed.setEnabled(true);
canvas.setRandomDicePosition();
if (e.getActionCommand().equals ("Stop")){
slrSpeed.setValue(0);
slrSpeed.setEnabled(false);
//ADDED
if (e.getActionCommand().equals ("New Game")){
frmNew n = new frmNew(this);
if (e.getActionCommand().equals ("Zoom In")){
canvas.zoomIn();
if (e.getActionCommand().equals ("Zoom Out")){
canvas.zoomOut();
if (e.getActionCommand().equals ("How To Play")){
frmPlay p = new frmPlay();
if (e.getActionCommand().equals ("About")){
frmAbout a = new frmAbout();
package longgong;
// Java classes
import java.awt.*;
import java.awt.event.*;
import java.net.URL;
// GL4Java classes
import gl4java.GLContext;
import gl4java.awt.GLAnimCanvas;
import gl4java.utils.textures.*;
class MyCanvas extends GLAnimCanvas implements KeyListener, MouseListener
// holds information on which keys are held down.
boolean[] keys=new boolean[256];
float xrot; // X Rotation ( NEW )
float yrot; // Y Rotation ( NEW )
float zrot; // Z Rotation ( NEW )
float[] diceRotX = new float[3];
float[] diceRotY = new float[3];
float[] diceRotZ = new float[3];
float[] diceTranX = new float[3];
float[] diceTranY = new float[3];
float[] diceTranZ = new float[3];
float speedValue;
Dice[] D;
float zoom = -15.0f;
public MyCanvas(int w, int h)
super(w, h);
//Registers this canvas to process keyboard events, and Mouse events
addKeyListener(this);
addMouseListener(this);
setAnimateFps(60); // seemed to be essential in getting any performance
speedValue=0.0f;
diceTranX[0] = -2.0f;
diceTranY[0] = 2.0f;
diceTranZ[0] = zoom;
diceTranX[1] = 2.0f;
diceTranY[1] = 1.0f;
diceTranZ[1] = zoom;
diceTranX[2] = 0.0f;
diceTranY[2] = -2.0f;
diceTranZ[2] = zoom;
public void zoomIn(){
zoom=zoom+1.0f;
public void zoomOut(){
zoom=zoom-1.0f;
public void speed(float s){
speedValue=s/100;
/** void reshape(int width, int height) Called after the first paint command. */
public void reshape(int width, int height)
if(height==0)height=1;
gl.glViewport(0, 0, width, height); // Reset The Current Viewport And Perspective Transformation
gl.glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
gl.glLoadIdentity(); // Reset The Projection Matrix
glu.gluPerspective(45.0f, width / height, 0.1f, 100.0f); // Calculate The Aspect Ratio Of The Window
gl.glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
gl.glLoadIdentity(); // Reset The ModalView Matrix
/** void preInit() Called just BEFORE the GL-Context is created. */
public void preInit()
{ doubleBuffer = true; stereoView = false; // buffering but not stereoview
public void setRandomDicePosition(){
for (int i=0; i<3; i++){
D.setCoordinates(diceRotX[i],diceRotY[i],diceRotZ[i],diceTranX[i],diceTranY[i],diceTranZ[i]);
D[i].getRandomDice();
/** void init() Called just AFTER the GL-Context is created. */
public void init()
//float width = (float)getSize().width;
//float height = (float)getSize().height;
D = new Dice[5];
D[0] = new Dice(this);
D[1] = new Dice(this);
D[2] = new Dice(this);
//initialize dice location
for (int i=0; i<3; i++){
D[i].setCoordinates(diceRotX[i],diceRotY[i],diceRotZ[i],diceTranX[i],diceTranY[i],diceTranZ[i]);
D[i].getRandomDice();
gl.glEnable(GL_TEXTURE_2D); //Enable Texture Mapping ( NEW )
gl.glShadeModel(GL_SMOOTH); //Enables Smooth Color Shading
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); //This Will Clear The Background Color To Black
gl.glClearDepth(1.0); //Enables Clearing Of The Depth Buffer
gl.glEnable(GL_DEPTH_TEST); //Enables Depth Testing
gl.glDepthFunc(GL_LEQUAL); //The Type Of Depth Test To Do
gl.glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); //Really Nice Perspective Calculations
public void DrawBoundaries(){
double x,y;
double radius = 5.0f;
gl.glLoadIdentity(); // Reset The View
gl.glTranslatef(0.0f,0.0f,zoom-1.0f);
gl.glRotatef(90.0f,0.0f,0.0f,1.0f);
gl.glColor3f(0.6f,0.3f,0.3f);
gl.glBegin(gl.GL_POLYGON);
// angle is
// x = radius * (cosine of angle)
// y = radius * (sine of angle)
for (double a=0; a<360; a++) {
x = radius * (Math.cos(a));
y = radius * (Math.sin(a));
gl.glVertex3d(x, y, 0.0f);
gl.glEnd();
gl.glColor3f(1.0f,1.0f,1.0f);
public void DrawGLScene()
gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
DrawBoundaries();
for (int i=0; i<3; i++){
D[i].startDiceMovement();
D[i].setTz(zoom);
D[i].setSpeed(speedValue);
D[i].drawDice();
for (int i=0; i<3; i++){
//start of loop
if(i!=0){
if (D[0].getMoveLeft()==true){
if ( (D[0].getTx()>=D[i].getTx()-1.0f) && (D[0].getTx()<=D[i].getTx()) ){
if (D[0].getMoveLeft()== true) D[0].setMoveLeft(false);
else D[0].setMoveLeft(true);
}else{
if ( (D[0].getTx()-1<=D[i].getTx()) && (D[0].getTx()-1>=D[i].getTx()-1) ){
if (D[0].getMoveLeft()== true) D[0].setMoveLeft(false);
else D[0].setMoveLeft(true);
if (D[0].getMoveUp()==true){
if ( (D[0].getTy()>=D[i].getTy()-1.0f) && (D[0].getTy()<=D[i].getTy()) ){
if (D[0].getMoveUp()== true) D[0].setMoveUp(false);
else D[0].setMoveUp(true);
}else{
if ( (D[0].getTy()-1<=D[i].getTy()) && (D[0].getTy()-1>=D[i].getTy()-1) ){
if (D[0].getMoveUp()== true) D[0].setMoveUp(false);
else D[0].setMoveUp(true);
}//end of if i!=0
if(i!=1){
if (D[1].getMoveLeft()==true){
if ( (D[1].getTx()>=D[i].getTx()-1.0f) && (D[1].getTx()<=D[i].getTx()) ){
if (D[1].getMoveLeft()== true) D[1].setMoveLeft(false);
else D[1].setMoveLeft(true);
}else{
if ( (D[1].getTx()-1<=D[i].getTx()) && (D[1].getTx()-1>=D[i].getTx()-1) ){
if (D[1].getMoveLeft()== true) D[1].setMoveLeft(false);
else D[1].setMoveLeft(true);
if (D[1].getMoveUp()==true){
if ( (D[1].getTy()>=D[i].getTy()-1.0f) && (D[1].getTy()<=D[i].getTy()) ){
if (D[1].getMoveUp()== true) D[1].setMoveUp(false);
else D[1].setMoveUp(true);
}else{
if ( (D[1].getTy()-1<=D[i].getTy()) && (D[1].getTy()-1>=D[i].getTy()-1) ){
if (D[1].getMoveUp()== true) D[1].setMoveUp(false);
else D[1].setMoveUp(true);
}//end of if i!=1
if(i!=2){
if (D[2].getMoveLeft()==true){
if ( (D[2].getTx()>=D[i].getTx()-1.0f) && (D[2].getTx()<=D[i].getTx()) ){
if (D[2].getMoveLeft()== true) D[2].setMoveLeft(false);
else D[2].setMoveLeft(true);
}else{
if ( (D[2].getTx()-1<=D[i].getTx()) && (D[2].getTx()-1>=D[i].getTx()-1) ){
if (D[2].getMoveLeft()== true) D[2].setMoveLeft(false);
else D[2].setMoveLeft(true);
if (D[2].getMoveUp()==true){
if ( (D[2].getTy()>=D[i].getTy()-1.0f) && (D[2].getTy()<=D[i].getTy()) ){
if (D[2].getMoveUp()== true) D[2].setMoveUp(false);
else D[2].setMoveUp(true);
}else{
if ( (D[2].getTy()-1<=D[i].getTy()) && (D[2].getTy()-1>=D[i].getTy()-1) ){
if (D[2].getMoveUp()== true) D[2].setMoveUp(false);
else D[2].setMoveUp(true);
}//end of if i!=2
//end of loop for i
/** void display() Draw to the canvas. */
// Purely a Java thing. Simple calls DrawGLScene once GL is Initialized
public void display()
for(int i=0;i<3;i++){
glj.gljMakeCurrent(); //Ensure GL is initialised correctly
DrawGLScene();
glj.gljSwap(); //Swap buffers
glj.gljFree(); // release GL
// Key Listener events
public void keyTyped(KeyEvent e){
public void keyPressed(KeyEvent e){
switch(e.getKeyCode())
//Kill app
case KeyEvent.VK_ESCAPE:
System.exit(0);
break;
default :
if(e.getKeyCode()<250) // only interested in first 250 key codes, are there more?
keys[e.getKeyCode()]=true;
break;
public void keyReleased(KeyEvent e){
if(e.getKeyCode()<250) // only interested in first 250 key codes, are there more?
keys[e.getKeyCode()]=false;
// mouse listener events
public void mouseEntered( MouseEvent evt )
Component comp = evt.getComponent();
if( comp.equals(this ) )
//requestFocus();
public void mouseExited( MouseEvent evt ){
public void mousePressed( MouseEvent evt ){
public void mouseReleased( MouseEvent evt ){
public void mouseClicked( MouseEvent evt )
Component comp = evt.getComponent();
if( comp.equals(this ) )
requestFocus();
* Dice.java
* Created on 08 February 2007, 22:26
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package longgong;
import java.net.URL;
import gl4java.GLContext;
import gl4java.awt.GLAnimCanvas;
import gl4java.utils.textures.*;
* @author welcome
public class Dice {
GLAnimCanvas glCanvas ;
URL codeBase;
int[]texture1 = new int[1]; //Storage for one texture ( NEW )
int[]texture2 = new int[1]; //Storage for one texture ( NEW )
int[]texture3 = new int[1]; //Storage for one texture ( NEW )
int[]texture4 = new int[1]; //Storage for one texture ( NEW )
int[]texture5 = new int[1]; //Storage for one texture ( NEW )
int[]texture6 = new int[1]; //Storage for one texture ( NEW )
float rx;
float ry;
float rz;
float tx;
float ty;
float tz;
float speed;
boolean txMoveLeft;
boolean tyMoveUp;
boolean tzMoveFront;
/** Creates a new instance of Dice */
public Dice(GLAnimCanvas g) {
glCanvas = g;
if(!LoadGLTexture("c:\\java\\images\\one.png",texture1)){
System.out.println("Failed to load Textures,Bailing!");
System.exit(0);
if(!LoadGLTexture("c:\\java\\images\\two.png",texture2)){
System.out.println("Failed to load Textures,Bailing!");
System.exit(0);
if(!LoadGLTexture("c:\\java\\images\\three.png",texture3)){
System.out.println("Failed to load Textures,Bailing!");
System.exit(0);
if(!LoadGLTexture("c:\\java\\images\\four.png",texture4)){
System.out.println("Failed to load Textures,Bailing!");
System.exit(0);
if(!LoadGLTexture("c:\\java\\images\\five.png",texture5)){
System.out.println("Failed to load Textures,Bailing!");
System.exit(0);
if(!LoadGLTexture("c:\\java\\images\\six.png",texture6)){
System.out.println("Failed to load Textures,Bailing!");
System.exit(0);
txMoveLeft = true;
tyMoveUp = true;
public boolean inCircleBoundaries(float x, float y, float radius)
float r;
r = (float)Math.sqrt((x*x) + (y*y));
if (r <= radius)
return true;
else
return false;
public void setCoordinates(float corRx,float corRy,float corRz,float corTx,float corTy,float corTz){
rx = corRx;
ry = corRy;
rz = corRz;
tx = corTx;
ty = corTy;
tz = corTz;
public void getRandomDice(){
int num = (int)(Math.random() * 6);
if (num==1){
rx=0.0f;
ry=0.0f;
rz=0.0f;
else if (num==2){
rx=90.0f;
ry=0.0f;
rz=0.0f;
else if (num==3){
rx=0.0f;
ry=-90.0f;
rz=0.0f;
else if (num==4){
rx=0.0f;
ry=90.0f;
rz=0.0f;
else if (num==5){
rx=-90.0f;
ry=0.0f;
rz=0.0f;
else{
rx=180.0f;
ry=0.0f;
rz=0.0f;
public float getTx(){
return tx+0.5f;
public float getTy(){
return ty+0.5f;
public float getTz(){
return tz+0.5f;
public void setTz(float z){
tz=z;
public boolean getMoveLeft(){
return txMoveLeft;
public boolean getMoveUp(){
return tyMoveUp;
public void setMoveLeft(boolean m){
txMoveLeft = m;
public void setMoveUp(boolean m){
tyMoveUp = m;
public void startDiceMovement(){
if (txMoveLeft==true) {
tx+=speed;
else {
tx-=speed;
if (tyMoveUp==true) {
ty+=speed;
else {
ty-=speed;
ry+=(speed*4);
rx+=(speed*4);
//rz+=(speed*2);
//tx+=speed;
//ty+=speed;
//tz+=speed;
if (inCircleBoundaries(tx,ty,3.5f)==false) {
if (tx>=3.0f) txMoveLeft = false;
if (tx<=-3.0f) txMoveLeft = true;
if (ty>=3.0f) tyMoveUp = false;
if (ty<=-3.0f) tyMoveUp = true;
public void setSpeed(float s){
speed = s;
public void drawDice(){
glCanvas.gl.glLoadIdentity(); // Reset The View
glCanvas.gl.glTranslatef(tx,ty,tz);
glCanvas.gl.glRotatef(rx,1.0f,0.0f,0.0f);
glCanvas.gl.glRotatef(ry,0.0f,1.0f,0.0f);
glCanvas.gl.glRotatef(rz,0.0f,0.0f,1.0f);
glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture1[0]);
glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);
// Front Face
glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f, 1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f, 1.0f, 1.0f);
glCanvas.gl.glEnd();
glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture6[0]);
glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);
// Back Face
glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f, 1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f, 1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, -1.0f);
glCanvas.gl.glEnd();
glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture2[0]);
glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);
// Top Face
glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f, 1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, 1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, 1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f, 1.0f, -1.0f);
glCanvas.gl.glEnd();
glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture5[0]);
glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);
// Bottom Face
glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, 1.0f);
glCanvas.gl.glEnd();
glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture3[0]);
glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);
// Right face
glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f, 1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f, 1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, 1.0f);
glCanvas.gl.glEnd();
glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture4[0]);
glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);
// Left Face
glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f, 1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f, 1.0f, -1.0f);
glCanvas.gl.glEnd();
public boolean LoadGLTexture(String fileName, int textureNumber[])
PngTextureLoader texLoader = new PngTextureLoader(glCanvas.gl, glCanvas.glu);
if(codeBase!=null)
texLoader.readTexture(codeBase, fileName);
else
texLoader.readTexture(fileName);
if(texLoader.isOk())
//Create Texture
glCanvas.gl.glGenTextures(1, textureNumber);
glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, textureNumber[0]);
glCanvas.gl.glTexParameteri(glCanvas.gl.ill attach 4 files that needs to be
enhanced or debug for possible errors. i hate to break it to you, but even if you post this for the seventh time, finding and fixing errors in your code remains your task. -
Error while using OWSM File based authentication - URGENT
Hi ,
We have the requirement to invoke the gateway protected webservice from the client.
PLEASE GIVE ME A SOLUTION. IT IS URGENT.
I have protected a webservice via OWSM Gateway.The webservice was devloped with the jdev RPC-ENC format and deployed on a Oracle AS.
I tried testing the webservice with the OWSM-Test Tool without any issues.
But when i created a webservice proxy client and test the code with the userid/passwrd ,am getting the following error.
calling http://localhost:8888/gateway/services/SID0003001
javax.xml.rpc.soap.SOAPFaultException: Invalid username or password
at oracle.j2ee.ws.client.StreamingSender._raiseFault(StreamingSender.java:555)
at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:396)
at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:112)
at project1.proxy.runtime.RpcEncWSSoapHttp_Stub.getStringReturnCust(RpcEncWSSoapHttp_Stub.java:78)
at project1.proxy.RpcEncWSSoapHttpPortClient.getStringReturnCust(RpcEncWSSoapHttpPortClient.java:45)
at project1.proxy.RpcEncWSSoapHttpPortClient.main(RpcEncWSSoapHttpPortClient.java:31)
Process exited with exit code 0.
I wonder ,whats the mode of difference between the OWSM-Test tools client and the Java WS proxy client.
Has any body encountered this kind of behaviour.
Your feed back is highly appreciated.
AG
Edited by: user555285 on May 29, 2009 10:42 AM
Edited by: user555285 on May 29, 2009 10:42 AMYes, The originial web service also has authentication and i did it via OWSM but I did not initialize it in authentication in the webservice proxy.
Now i did it and works fine.
Thanks AJochems (Redora) .
--AG
Maybe you are looking for
-
I found the below description from the help of BlackBerry Link, however i never get it work. Any one know whats wrong or what i need to set? About deleting music, pictures, videos, and documents? After you sync your music, picture, video, or document
-
Where do I get apps for a PowerPC? Do the ones from the App Store work on it?
I bought this computer for my dad from someone and had no idea it was a PowerPC or what that meant. I found out it was different when I bought a program for it and it didnt work because it was a PowerPC. Where do I get apps for this computer? It is a
-
Hi all, I'm using the code below to generate a pdf form ('ZPDF_TEST_FORM'). When the function in FM_NAME is called, it returns with SY-SUBRC eq 2 and this error message: Adobe document services error: SOAP Runtime Exception: CSoapExceptionFault : SOA
-
Problem with opening new tab, 4 rc
hi, my "open new tab" button disappears form tab bar. (its there when i am in "customize..." mode). also, when there is no menu bar. double click on tab bar does not open a new tab either but it minimizes the window. so there is no short way to open
-
Expand all and collapse all in page
Hi all, I need to implement* expand all and collapse all *in a custom page where I have some Link beans generated dynamically to show the allowable responsibilities.I have added the link beans and respective hide show regions in a stack layout.How to