Objectid stringize functionality
Hi --
I've moved to 2.2.4 and it has fixed several problems that I've had. It
seems much better!
One thing that puzzles me in the new feature "Added support for
serialization/deserialization of an object id to/from a String." I
don't seem to be able to find any documentation on it. Can you direct
me to where to look and an example?
Thanks,
Dan
Dan-
In a servlet/jsp environment, you are correct. We may change the String
serialization in the future to not use characters that are illegal for a
URL, thus bypassing this problem.
Dan Finkelstein <[email protected]> wrote:
Thanks for your pointers... It worked just fine.
(As a side note, after calling the objectId.toString() method, it is
required that URLEncoder.encode() also be called. Then, a string is
produced which will be accepted by the ObjectIds.Id() method. It seems
you should have called URLEncoder.encode() from within
objectId.toString() so that the produced string is exactly what the
ObjectIds.Id() ctor expects...)
Thanks much,
Dan
Marc Prud'hommeaux wrote:
Dan-
There is a (brief) mention of it at:
http://www.solarmetric.com/Software/Documentation/2.2.4/manual.html#jdo_object_id_values
You can see an example of it's usage in the samples/jsp/ directory of
the 2.2.4 distribution. In general, you can do something like:
String myIdString = pm.getObjectId (myPersistentObject).toString ();
Object myId = new com.solarmetric.kodo.util.ObjectIds.Id (myIdString);
Object myOriginalObject = pm.getObjectById (myId);
Note that the recommended API will change once the final 1.0 version of
the JDO spec is released and we then release a 1.0 compliant version of
Kodo (since this feature is now part of the spec).
Dan Finkelstein <[email protected]> wrote:
Hi --
I've moved to 2.2.4 and it has fixed several problems that I've had. It
seems much better!
One thing that puzzles me in the new feature "Added support for
serialization/deserialization of an object id to/from a String." I
don't seem to be able to find any documentation on it. Can you direct
me to where to look and an example?
Thanks,
Dan
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com
Kodo Java Data Objects Full featured JDO: eliminate the SQL from your code
Similar Messages
-
Read positions of Objectid with function module
Hi experts!,
I would like to read User Id, First name and position number fields by ObjectId.
RH_READ_INFTY only show part of data.
Could you say me another Function Module to do this?
A lot of thanks in advance.
Best Regards.Hi Juan,
So now u have the org unit ID.
Use the same FM RH_STRUC_GET now to get all the position IDs which are belongs to that org unit.
Pass act_otype = 'O',act_objid = ourg unit ID that u have,act_wegid = 'B003' and in the result_tab u will get all the positions under this org unit.
Now u use the same FM to get the pernr which holds these positions.
Loop in the result tab."as u need to get pernr for all those positions
Use the FM RH_READ_OBJECT to get the position validity begin date and validity end date.
Pas the values in the same order as above 'S',result_tab-objid,'A008' and in the result tab u will get pernrs.
Now use the FM HR_READ_INFOTYPE to get first name for IT0002-VORNA by providing the pernr.
Now use the FM HR_READ_SUBTYPE to get user ID from IT0105 subtype 0001 field USRID by providing the pernr.
Populate all these data to final itab.
Endloop.
Thanks
Hafizul -
Class or Function Module to display PERNR based on OBJECTID
Hello All,
I have a requirement where i need to find out the Personnel Number based on the ObjectID provided in the HRP5102 infotype table.
I have tried with the CLASS CL_HRRCF_CANDIDATE and method used is GET. But the PERNR Number gettng after the execution of method is not avaialble in the database.
Could anybody help me out in finding the relationship.Any FM or Class provided is helpful.....
ThanksHi Sravan,
You can get data from a cube,with mere database 'SELECT' statements. please find the following suggestions,
All Cube related data, you can find in the tables with the naming convention ' /BIC/F*CUBENAME'. Typical nomenclature of the database table is '/BIC/F' followed by name of the cube. if your cube name is 'ZALMPOS' then the corresponding name of the fact table will be /BIC/FZALMPOS.
The data is stored in this table with all keys of DIMENSION tables. If you have to map the keys to dimension tables to get the values of the characteristics. Typical, nomenclature of Dimension tables is '/BIC/D*Characteristicname'.
Note: Check in RSA1 if all your characteristics are mapped as dimensions in your cube.
Thanks,
Santosh KB. -
How to define null or empty value in BAPI function modules?
Hi,
I have problem with BAPI functions, where some parameters are mandatory.
For example: when I try to use HR BAPI's(BAPI_PERSDATA_CHANGE, etc.) I have to insert parameters like SUBTYPE,OBJECTID,LOCKINDICATOR. The PA0002 table that is used from this BAPI doesn't have SUBTYPE, OBJECTID, LOCKINDICATOR, for any of the records that I would like to select.
So what I tried, was to put a ' ', to indicate that is empty. It returned an error message saying "Make an entry in all required fields". Next tried to put in some values for these fields -- and it returned an error message saying "No data selected from 0002 for this period".
I also tried to run BAPI_FAMILY_CHANGE that uses data from table PA0021. Here I found some records with SUBTYPE, OBJECTID fields that were not empty, but LOCKINDICATOR was still missing. So I tried to put LOCINDICATOR value directly in to database (with MS SQL Enterprise Manager). After that I was able to use BAPI_FAMILY_CHANGE.
I think that manually inserting data in database is not normal procedure.
Is there something that I have missed out?
I mean -- how can I get this to work without inserting data directly in database?
How can I define null or empty value in BAPI function modules?
Thank you in advance.
Best regards,
MihailDefining an empty value for a parm in a table is easy.
First get the function's definition from the SAP system
Second only populate the fields for which you have a value to set
Third execute the function.
The JCO takes care of the rest.
Enjoy -
How to use Change doc Function Module?
Fn mod:ZSUBTESTCHG_WRITE_DOCUMENT
Import parameters Value
OBJECTID ZSUBTESTCHG
TCODE SE37
UTIME 00:00:00
UDATE 09.03.2009
USERNAME 'TESTUSER'
PLANNED_CHANGE_NUMBER
OBJECT_CHANGE_INDICATOR I
PLANNED_OR_REAL_CHANGES R
NO_CHANGE_POINTERS
UPD_ICDTXT_ZSUBTESTCHG I
N_ZSUBTEST 2 TEST
O_ZSUBTEST 2 TEST
UPD_ZSUBTEST I
Tables Value
ICDTXT_ZSUBTESTCHG 0 Entries
I have a ztable 'ZSUBTEST' with 2 fields DEPTID and DEPNAME and ticked "change document" for data element.
I have created the above change doc write fn module. I am trying to insert a new reocrd into table.
How to use ZSUBTESTCHG_WRITE_DOCUMENT so that even if i try to change an existing record in ztable the old and new values for a particulat ztable will be filled in CDPOS Table.
Would appreciate if you can suggest me how to use in1) Update and 2) Insert scenarios.
Thanks,
Subbahi check this,
Types Declaration***
types: BEGIN OF X_audit,
Field of ZAUDIT TABLE OR a custom created table------
END OF X_audit.
Data Declaration***
Data: w_newvalues type X_audit,
w_oldvalues type X_audit.
DATA: BEGIN OF t_cdtxt OCCURS 0.
INCLUDE STRUCTURE cdtxt.
DATA: END OF t_cdtxt.
DATA: l_tcode type cdhdr-tcode ,
l_time type cdhdr-utime,
l_usnam type cdhdr-username,
l_date type cdhdr-udate.
**Constants****
CONSTANTS : l_objectid TYPE cdhdr-objectid VALUE 'ZAUDIT_CD'.
Initialization.
Clear: l_tcode,l_time, l_usnam, l_date.
Clear: w_newvalues, w_oldvalues.
**Start-Of-Selection**
Start-of-selection.
*Populating w_oldvalues workarea with old values from the table
Select single * from zaudit_t
Into w_oldvalues
Where belnr eq belnr_1
And gjahr eq gjahr_1
And bukrs eq bukrs_1. u201C where, belnr_1, gjahr_1, bukrs_1 are the fields on selection screen.
here we are populating w_newvalues workarea with new values
W_newvalues-f1 = w_oldvalues-f1
f2 = u2018XXXXXXXu2019 -
f3 = u2018YYYYYYYu2019
f4 = u2018ZZZZZZZu2019
l_tcode = sy-tcode.
l_time = sy-uzeit.
l_usnam = sy-uname.
l_date = sy-datum.
modify the table with new values***
MODIFY zaudit_t FROM w_submit.
IF sy-subrc EQ 0.
MESSAGE 'Document Updated' TYPE 'S'.
call function 'ZAUDIT_CD1_WRITE_DOCUMENT'
exporting
objectid = l_objectid
tcode = l_tcode
utime = l_time
udate = l_date
username = l_usnam
PLANNED_CHANGE_NUMBER = ' '
object_change_indicator = 'U' u201CU-update, I-insert, D-delete
PLANNED_OR_REAL_CHANGES = ' '
NO_CHANGE_POINTERS = ' '
upd_icdtxt_zaudit_cd = 'U'
n_zaudit_t = w_newvalues u201Cpass the work area containing new values
o_zaudit_t = w_oldvalues u201Cpass the work area containing old values
upd_zaudit_t = 'U' u201C this parameter gives the values in the columns(new value, old value and changed field name) of table CDPOS.
tables
icdtxt_zaudit_cd = t_cdtxt
ELSE.
MESSAGE 'Document Not Updated' TYPE 'S'.
ENDIF. u201CIF sy-subrc EQ 0. -
Delta error in GE-Function Module
Hi ,
my GE-delta is based on UDATE ( chenged date) from CDHDR table.
i created datasource in RS02 and i defined delta based in UDATE with upper limit 1 day and lower limit is '0'..
i created FM based on RSAX_BIW_GEDATA_SIMPLE.
for full load it working fine.
i put some extra code for delta.
it is not take any records...
i dont know much ABAP.
plz tell me where is wrong in my code for delta..
code ...
FUNCTION ZXBWMM_INV_POT_ID.
""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 ZVSAIPID OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
Example: DataSource for table SFLIGHT
TABLES: SFLIGHT.
TABLES: EBAN , CDPOS , CDHDR , ZVSAPR.
TYPES : BEGIN OF TY_OBJDATE ,
OBJECTID TYPE CDHDR-OBJECTID,
VALUE_NEW TYPE CDPOS-VALUE_NEW,
VALUE_OLD TYPE CDPOS-VALUE_OLD,
UDATE TYPE CDHDR-UDATE,
MINBE TYPE MARC-MINBE,
BSTMA TYPE MARC-BSTMA,
WERKS TYPE MARC-WERKS,
VERPR TYPE MBEW-VERPR,
STPRS TYPE MBEW-STPRS,
LBKUM TYPE MBEW-LBKUM,
BUDAT TYPE MKPF-BUDAT,
MBLNR TYPE MSEG-MBLNR,
MENGE TYPE MSEG-MENGE,
DMBTR TYPE MSEG-DMBTR,
END OF TY_OBJDATE.
data : int_cdhdr type table of cdhdr with header line,
int_cdpos type table of cdpos with HEADER LINE,
INT_OBJDATE TYPE TABLE OF TY_OBJDATE WITH HEADER LINE.
int_marc type table of marc with header line.
*DATA: int_pr1 TYPE TABLE OF ZVSAIPID WITH HEADER LINE.
DATA : BEGIN OF INT_MATNR OCCURS 10,
MAtnr like mara-matnr,
end of int_matnr.
DATA : BEGIN OF INT_MARC OCCURS 10,
matnr like marc-matnr,
MINBE like marC-mINBE,
BSTMA LIKE Marc-bstma,
WERKS LIKE MARC-WERKS,
end of int_marc.
DATA : BEGIN OF INT_MBEW OCCURS 10,
MATNR LIKE MBEW-MATNR,
VERPR LIKE MBEW-VERPR,
STPRS LIKE MBEW-STPRS,
LBKUM LIKE MBEW-LBKUM,
end of int_MBEW.
DATA : BEGIN OF INT_MKPF OCCURS 10,
MBLNR LIKE MKPF-MBLNR,
BUDAT LIKE MKPF-BUDAT,
END OF INT_MKPF.
DATA : BEGIN OF INT_MSEG OCCURS 10,
MATNR LIKE MSEG-MATNR,
MBLNR LIKE MSEG-MBLNR,
MENGE LIKE MSEG-MENGE,
DMBTR LIKE MSEG-DMBTR,
END OF INT_MSEG.
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.
Select ranges
RANGES: L_R_CARRID FOR SFLIGHT-CARRID,
L_R_CONNID FOR SFLIGHT-CONNID.
RANGES : ra_OBJECTID FOR E_T_DATA-OBJECTID.
RA_UDATE FOR E_T_DATA-UDATE.
Initialization mode (first call by SAPI) or data transfer mode
(following calls) ?
IF I_INITFLAG = SBIWA_C_FLAG_ON.
IF NOT G_FLAG_INTERFACE_INITIALIZED IS INITIAL.
IF 1 = 2. MESSAGE E008(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'008' "message number
' ' "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ENDIF.
Initialization: check input parameters
buffer input parameters
prepare data selection
Check DataSource validity
CASE I_DSOURCE.
WHEN 'ZOI_MM_INVENTORY_IPID'.
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.
Check for supported update mode
CASE I_UPDMODE.
WHEN 'F'.
WHEN 'D'.
WHEN 'R'.
WHEN OTHERS.
IF 1 = 2. MESSAGE E011(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'011' "message number
I_UPDMODE "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ENDCASE.
READ TABLE I_T_SELECT INTO L_S_SELECT
WITH KEY FIELDNM = 'UDATE'.
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.
G_S_INTERFACE-INITFLAG = I_INITFLAG.
G_S_INTERFACE-UPDMODE = I_UPDMODE.
G_S_INTERFACE-DATAPAKID = I_DATAPAKID.
G_FLAG_INTERFACE_INITIALIZED = SBIWA_C_FLAG_ON.
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.
ELSE. "Initialization mode or data extraction ?
Data transfer: First Call OPEN CURSOR + FETCH
Following Calls FETCH only
First data package -> OPEN CURSOR
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT
WHERE FIELDNM = 'UDATE'.
ENDLOOP
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 = 'CARRID'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_CARRID.
APPEND L_R_CARRID.
ENDLOOP.
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CONNID'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_CONNID.
APPEND L_R_CONNID.
ENDLOOP.
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 SFLIGHT
WHERE CARRID IN L_R_CARRID AND
CONNID IN L_R_CONNID.
IF L_S_SELECT-LOW = '' AND L_S_SELECT-HIGH = ''. "FULL or INIT
OPEN CURSOR WITH HOLD S_CURSOR FOR
select * from cdhdr where OBJECTCLAS = 'MATERIAL' AND TCODE = 'MM02'.
ELSE. "DELTA
OPEN CURSOR WITH HOLD G_CURSOR FOR
select * from cdhdr where OBJECTCLAS = 'MATERIAL'
AND TCODE = 'MM02'
AND UDATE >= L_S_SELECT-LOW
AND UDATE <= L_S_SELECT-HIGH.
ENDIF.
ENDIF.
ENDIF.
"First data package ?
FETCH NEXT CURSOR S_CURSOR
APPENDING TABLE int_cdhdr
PACKAGE SIZE S_S_IF-MAXSIZE.
into table int_cdhdr
IF SY-SUBRC <> 0.
CLOSE CURSOR S_CURSOR.
RAISE NO_MORE_DATA.
ENDIF.
SELECT * FROM CDPOS INTO TABLE INT_CDPOS
FOR ALL ENTRIES IN INT_CDHDR
WHERE OBJECTID = INT_CDHDR-OBJECTID
AND TABNAME = 'MARC'
AND ( FNAME = 'BSTMA' OR FNAME = 'MINBE' ).
LOOP AT int_cdpos.
int_matnr-matnr = int_cdpos-objectid.
APPEND int_matnr.
ENDLOOP.
SELECT matnr MINBE BSTMA WERKS FROM MARC INTO TABLE INT_marc
FOR ALL ENTRIES IN int_matnr
WHERE MATNR = INT_matnr-matnr.
SELECT matnr VERPR STPRS LBKUM FROM MBEW INTO TABLE INT_MBEW
FOR ALL ENTRIES IN int_matnr
WHERE MATNR = INT_matnr-matnr.
SELECT matnr MBLNR MENGE DMBTR FROM MSEG INTO TABLE INT_MSEG
FOR ALL ENTRIES IN int_matnr
WHERE MATNR = INT_matnr-matnr.
LOOP AT int_MSEG.
int_MKPF-MBLNR = int_MSEG-MBLNR.
APPEND int_MKPF.
ENDLOOP.
SELECT MBLNR BUDAT FROM MKPF INTO TABLE INT_MKPF
FOR ALL ENTRIES IN int_MKPF
WHERE MBLNR = INT_MKPF-MBLNR.
*BREAK-POINT.
LOOP AT INT_CDPOS.
READ TABLE INT_CDHDR WITH KEY OBJECTID = INT_CDPOS-OBJECTID .
IF SY-SUBRC = 0.
INT_OBJDATE-OBJECTID = INT_CDPOS-OBJECTID.
INT_OBJDATE-VALUE_NEW = INT_CDPOS-VALUE_NEW.
INT_OBJDATE-VALUE_OLD = INT_CDPOS-VALUE_OLD.
INT_OBJDATE-UDATE = INT_CDHDR-UDATE.
READ TABLE INT_MARC WITH KEY MATNR = INT_CDPOS-OBJECTID .
IF SY-SUBRC = 0.
INT_OBJDATE-MINBE = INT_MARC-MINBE.
INT_OBJDATE-BSTMA = INT_MARC-BSTMA.
INT_OBJDATE-WERKS = INT_MARC-WERKS.
ENDIF.
READ TABLE INT_MBEW WITH KEY MATNR = INT_CDPOS-OBJECTID .
IF SY-SUBRC = 0.
INT_OBJDATE-VERPR = INT_MBEW-VERPR.
INT_OBJDATE-STPRS = INT_MBEW-STPRS.
INT_OBJDATE-LBKUM = INT_MBEW-LBKUM.
ENDIF.
READ TABLE INT_MSEG WITH KEY MATNR = INT_CDPOS-OBJECTID .
IF SY-SUBRC = 0.
INT_OBJDATE-MBLNR = INT_MSEG-MBLNR.
INT_OBJDATE-MENGE = INT_MSEG-MENGE.
INT_OBJDATE-DMBTR = INT_MSEG-DMBTR.
ENDIF.
READ TABLE INT_MKPF WITH KEY MBLNR = INT_MSEG-MBLNR .
IF SY-SUBRC = 0.
INT_OBJDATE-MBLNR = INT_MKPF-MBLNR.
INT_OBJDATE-BUDAT = INT_MKPF-BUDAT.
ENDIF.
APPEND INT_OBJDATE.
ENDIF.
ENDLOOP.
*SELECT * FROM EBAN
INTO CORRESPONDING FIELDS OF TABLE INT_PR1
FOR ALL ENTRIES IN INT_OBJDATE
WHERE BAnfn = int_objdate-objectid.
*ZZPRREL
LOOP AT INT_OBJDATE.
E_T_DATA-OBJECTID = INT_OBJDATE-OBJECTID.
E_T_DATA-UDATE = INT_OBJDATE-UDATE.
E_T_DATA-VALUE_NEW = INT_OBJDATE-VALUE_NEW.
E_T_DATA-VALUE_OLD = INT_OBJDATE-VALUE_OLD.
E_T_DATA-MINBE = INT_OBJDATE-MINBE.
E_T_DATA-BSTMA = INT_OBJDATE-BSTMA.
E_T_DATA-WERKS = INT_OBJDATE-WERKS.
E_T_DATA-VERPR = INT_OBJDATE-VERPR.
E_T_DATA-STPRS = INT_OBJDATE-STPRS.
E_T_DATA-LBKUM = INT_OBJDATE-LBKUM.
E_T_DATA-MBLNR = INT_OBJDATE-MBLNR.
E_T_DATA-MENGE = INT_OBJDATE-MENGE.
E_T_DATA-DMBTR = INT_OBJDATE-DMBTR.
E_T_DATA-BUDAT = INT_OBJDATE-BUDAT.
APPEND E_T_DATA.
CLEAR E_T_DATA.
ENDLOOP.
Fetch records into interface table.
named E_T_'Name of extract structure'.
S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
ENDIF. "Initialization mode or data extraction ?
ENDFUNCTION.
i assign points....
Regards,
PSR.Hi ,
i am not find any sollution for this..
any body help me for this problum...
i assign points..
Regards,
PSR -
Function module for displaying customer address changes detail
Hi ,
Can anyone tell me any code or function module which gives me customer addresses before changes or after changes customer address.
Regards,
Gaurav T.GT,
First check acustomer in 'XD04' which has got some change doc history. See all changes in XD04 for that customer.
Then go to CDHDR table,
OBJECTCLAS = 'DEBI'.
OBJECTID = Customer Number (10 digit with 0 padding).
UDATE = Update/change date (Take from XD04).
Run the table & put the same values in CDPOS along with the CDHDR-CHANGENR & get the field wise changes in Customer with new & old values.
Try this out or else call me.
Regards,
SP. -
How do you "Instantiate" a Nested Table from within a FUNCTION?
, I managed to compile and create the FUNCTION.
But when I invoked it,
ORA-06531: Reference to uninitialized collection
ORA-06512: at "DEV.SPGETPARENTSTABLE", line ...
I think I need to somehow *"Instantiate"* the Nested Table and I didn't:
CREATE OR REPLACE FUNCTION spGetParentsTable
ObjectId number,
ObjectClassifier varchar2
RETURN types.TmpHiearchyMapTableType
IS
TmpHierarchyMap types.TmpHiearchyMapTableType;
ThisTempId varchar2(32);
CURSOR spGetParents_cursor IS
SELECT
ReferencedId Id,
ParentId,
ChildId,
FROM TMP_HIERARCHYMAP
WHERE TmpUID = ThisTempId;
BEGIN
SELECT sys_guid() INTO ThisTempId FROM dual;
spRecursiveGetParents(ObjectId, ObjectClassifier, ThisTempId);
FOR oMap in spGetParents_cursor LOOP
TmpHierarchyMap.Extend(); **** BUT I haven't "Instantiate" the Nested Table yet ****
TmpHierarchyMap(TmpHierarchyMap.Count) := TmpHierarchyMapObjType( oMap.Id
, oMap.ParentId
, oMap.ChildId
END LOOP;
DELETE FROM TMP_HIERARCHYMAP WHERE TmpUID = ThisTempId;
RETURN TmpHierarchyMap;
END spGetParentsTable;It's annonyingly trivial to fix. In your declaration section try
TmpHierarchyMap types.TmpHiearchyMapTableType := types.TmpHiearchyMapTableType();
...Cheers, APC
blog: http://radiofreetooting.blogspot.com -
How to use Function module generated to update CDHDR CDPOS
Hi,
I have a Z-table, and I want to tracks the value changes in some fields,
the data elements for those specific fields are marked for "Change document".
I created a Change document object using the transaction SCDO and I got the function module.
now can any one tell me how to use these function modules like ( what values need to be passed to function module. what value do we need to pass for OBJECTID,..value for tables ...etc )
I have a custom program to update/delete entries in the custom table so should I use the function module in my custom program to result an entry in CDHDR & CDPOS.
how to display the old value and new values for the fields specified to changes.
Regards,
Nagu.check in SE37
RV_ORDER_FLOW_INFORMATION
SD_SALES_DOCUMENT_READ
SD_SALES_DOCUMENT_READ_POS
SD_DOCUMENT_PARTNER_READ
SD_DETERMINE_CONTRACT_TYPE
SD_SALES_DOCUMENT_COPY
SD_SALES_DOCUMENT_SAVE
SD_SALES_DOCUMENT_ENQUEUE
SD_PARTNER_READ
RV_DELIVERY_PRINT_VIEW
SD_PACKING_PRINT_VIEW
SD_DELIVERY_VIEW
RV_BILLING_PRINT_VIEW
RV_PRICE_PRINT_HEAD
RV_PRICE_PRINT_ITEM
Rewards if useful...........
Minal -
How to use CHANGEDOCU functions for audit trail?
Hi,
I have a report screen that requires audit trails on the changes made to the data dic fields on the screen.
Which CHANGEDOCU functions should I use for audit trail? And where should I implement the functions? In the 'save' subrountine that I create?
Any samples? Thanks.Hi Kian,
You should wtite the change docu functions in the "SAVE" subroutine. The following changedocu functions should be used. I am attaching an example if it below.
CALL FUNCTION 'CHANGEDOCUMENT_OPEN'
EXPORTING
OBJECTCLASS = 'ZSCHEMES'
OBJECTID = OBJECTID
PLANNED_CHANGE_NUMBER = PLANNED_CHANGE_NUMBER
PLANNED_OR_REAL_CHANGES = PLANNED_OR_REAL_CHANGES
EXCEPTIONS
SEQUENCE_INVALID = 1
OTHERS = 2.
CASE SY-SUBRC.
WHEN 0. "OK.
WHEN 1. MESSAGE A600 WITH 'SEQUENCE INVALID'.
WHEN 2. MESSAGE A600 WITH 'OPEN ERROR'.
ENDCASE.
IF UPD_ZIRD_P_SCHEMES NE SPACE.
CALL FUNCTION 'CHANGEDOCUMENT_SINGLE_CASE'
EXPORTING
TABLENAME = 'ZIRD_P_SCHEMES'
WORKAREA_OLD = O_ZIRD_P_SCHEMES
WORKAREA_NEW = N_ZIRD_P_SCHEMES
CHANGE_INDICATOR = UPD_ZIRD_P_SCHEMES
DOCU_DELETE = 'X'
EXCEPTIONS
NAMETAB_ERROR = 1
OPEN_MISSING = 2
POSITION_INSERT_FAILED = 3
OTHERS = 4.
CASE SY-SUBRC.
WHEN 0. "OK.
WHEN 1. MESSAGE A600 WITH 'NAMETAB-ERROR'.
WHEN 2. MESSAGE A600 WITH 'OPEN MISSING'.
WHEN 3. MESSAGE A600 WITH 'INSERT ERROR'.
WHEN 4. MESSAGE A600 WITH 'SINGLE ERROR'.
ENDCASE.
ENDIF.
CALL FUNCTION 'CHANGEDOCUMENT_CLOSE'
EXPORTING
OBJECTCLASS = 'ZSCHEMES'
OBJECTID = OBJECTID
DATE_OF_CHANGE = UDATE
TIME_OF_CHANGE = UTIME
TCODE = TCODE
USERNAME = USERNAME
OBJECT_CHANGE_INDICATOR = OBJECT_CHANGE_INDICATOR
NO_CHANGE_POINTERS = NO_CHANGE_POINTERS
EXCEPTIONS
HEADER_INSERT_FAILED = 1
OBJECT_INVALID = 2
OPEN_MISSING = 3
NO_POSITION_INSERTED = 4
OTHERS = 5.
CASE SY-SUBRC.
WHEN 0. "OK.
WHEN 1. MESSAGE A600 WITH 'INSERT HEADER FAILED'.
WHEN 2. MESSAGE A600 WITH 'OBJECT INVALID'.
WHEN 3. MESSAGE A600 WITH 'OPEN MISSING'.
WHEN 4. MESSAGE A600 WITH 'NO_POSITION_INSERTED'.
do not abort, if positions are not inserted!!!
WHEN 5. MESSAGE A600 WITH 'CLOSE ERROR'.
ENDCASE.
Reward me points if you found it useful.
Thanks
Abhishek Raj. -
How to access the function in loaded application using swfloader?
Hi,
I have a main flex application which has a view stack, panel
and swfloader in the below hierarchy.
Flex main app --> Canvas1(Viewstack) --> Panel1 -->
Swfloader
Please view
http://www.probe7.com/flex_ques.gif
for better understanding.
I have a function in the loaded application which has to be
called from a function within the main application. I am not sure
of the syntax to access the swfloader content which is placed in a
canvas -> panel.
I tried this example (
http://livedocs.adobe.com/flex/3/html/help.html?content=controls_15.html),
it works when the swfloader is placed in the main application
without the viewstack or panel. How can I do this, Is there a way
to access all the running applictaions, regardless of the
hierarchy? Any help will be greatly appreciated.
Also any links for quick reference on various components and
their access will be helpful.
Thanks for your time.You are probably seeing the deferred instantiation behavior
which is the default for ViewStack.
The Swfloader component does not exist until a user navigates
to the View that contains it.
Use events to determine when the swfloader content is ready
for interaction. Here is an example:
http://www.cflex.net/showFileDetails.cfm?ObjectID=690
Tracy -
Error message in function module HR_INFOTYPE_OPERATION
Hi experts,
I need to update the data in the table pa0762 . I am using the function moudle HR_INFOTYPE_OPERATION to do that. i am passing infty,number,SUBTYPE,OBJECTID,validityend,validitybegin , the data to be inserted in wa_0762 this is of type p0762
When i execute the function i am getting a error message in return as 'Fill in all required entry fields'.
Can anyone provide help about this Topic . I would be really greatful to any help .
Thanks in advanceIt seems that the time constraint defined for the custom infotype requires the existence without gaps.
change time constraint or create the infotype with ENDDA = 99991231 -
URGENT: Regarding CALL FUNCTION 'GET_FIELDNAME_TEXT_1
hi,
i have made a report in which i am displaying changes to material and it is giving runtime error and it is saying :-
A RAISE statement in the program "SAPLMASS_GENERAL_UTILITIES" raised the
exception
condition "NOT_FOUND".
Since the exception was not intercepted by a superior
program, processing was terminated..
as i am using FUNCTION 'GET_FIELDNAME_TEXT_1.
plzz help me out by providing solution of it as help will be definately rewarded.hi venkat,
i had tried what u said but it is still giving runtime error.
here is code which i had developed and letme know is dere any problem ? It is displaying the changes made to material ina month.
*& Report ZNEW02
REPORT ZNEW02 no standard page heading LINE-SIZE 200.
TABLES: MARA,CDHDR,CDPOS.
DATA: BEGIN OF ITSTPO OCCURS 0,
MATNR LIKE STPO-STLNR,
WERKS LIKE MAST-WERKS,
MATNR LIKE MARA-MATNR,
MAKTX LIKE MAKT-MAKTX,
WERKS LIKE MARC-WERKS,
objectid like cdhdr-objectid,
changenr like cdhdr-changenr,
udate like cdhdr-udate,
TCODE LIKE CDHDR-TCODE,
USERNAME LIKE CDHDR-USERNAME,
NEW_VALUE LIKE CDPOS-VALUE_NEW,
OLD_VALUE LIKE CDPOS-VALUE_OLD,
FNAME LIKE CDPOS-FNAME,
DDTEXT LIKE DD04V-DDTEXT,
TABNAME LIKE CDPOS-TABNAME,
END OF ITSTPO.
DATA: E_DD04V LIKE DD04V OCCURS 0 WITH HEADER LINE.
DATA: E_DD03L LIKE DD03L OCCURS 0 WITH HEADER LINE.
data: begin of itcdhdr occurs 0,
objectid like cdhdr-objectid,
changenr like cdhdr-changenr,
udate like cdhdr-udate,
TCODE LIKE CDHDR-TCODE,
USERNAME LIKE CDHDR-USERNAME,
end of itcdhdr.
DATA: BEGIN OF ITCDPOS OCCURS 0,
OBJECTID LIKE CDPOS-OBJECTID,
CHANGENR LIKE CDPOS-CHANGENR,
NEW_VALUE LIKE CDPOS-VALUE_NEW,
OLD_VALUE LIKE CDPOS-VALUE_OLD,
FNAME LIKE CDPOS-FNAME,
TABNAME LIKE CDPOS-TABNAME,
END OF ITCDPOS.
****************end of all internal table declarations************************************************
parameters: werks like MARC-werks obligatory.
select-options: date for cdhdr-udate obligatory.
select objectid changenr udate TCODE USERNAME into table itcdhdr from cdhdr
where objectclas = 'MATERIAL'AND UDATE IN DATE and ( tcode = 'MM02').
or tcode = 'MM01' ).
if sy-subrc <> 0.
message 'No record exist' type 'E'.
endif.
DELETE ADJACENT DUPLICATES FROM ITCDHDR COMPARING CHANGENR.
SELECT OBJECTID CHANGENR VALUE_NEW VALUE_OLD FNAME TABNAME FROM CDPOS INTO TABLE ITCDPOS
FOR ALL ENTRIES IN ITCDHDR WHERE OBJECTID = ITCDHDR-OBJECTID AND CHANGENR = ITCDHDR-CHANGENR AND FNAME NOT IN ('AENDERER', 'AEDAT', 'AEUZEIT','AENDERDAT').
WRITE: / 'ITEMID DESCRIPTION CHG.PERSON CHG.DATE TCODE NEW VALUE OLD VALUE CHANGE MADE TO'.
ULINE.
DATA V_STLNR LIKE MARA-MATNR.
LOOP AT ITCDPOS.
CLEAR V_STLNR.
V_STLNR = ITCDPOS-OBJECTID+4(11).
READ TABLE ITCDHDR WITH KEY OBJECTID = ITCDPOS-OBJECTID CHANGENR = ITCDPOS-CHANGENR.
SELECT SINGLE AMATNR BMAKTX C~WERKS FROM MARA AS A
INNER JOIN MAST AS B ON BSTLNR = ASTLNR
INNER JOIN MAKT AS B ON BMATNR = AMATNR
INNER JOIN MARC AS C ON CMATNR = AMATNR
INTO ITSTPO
WHERE A~MATNR = V_STLNR.
ITSTPO-OBJECTID = ITCDPOS-OBJECTID.
ITSTPO-CHANGENR = ITCDPOS-CHANGENR.
ITSTPO-NEW_VALUE = ITCDPOS-NEW_VALUE.
ITSTPO-OLD_VALUE = ITCDPOS-OLD_VALUE.
ITSTPO-UDATE = ITCDHDR-UDATE.
ITSTPO-TCODE = ITCDHDR-TCODE.
ITSTPO-USERNAME = ITCDHDR-USERNAME.
ITSTPO-FNAME = ITCDPOS-FNAME.
ITSTPO-TABNAME = ITCDPOS-TABNAME.
IF ITCDPOS-FNAME <> 'KEY'.
clear e_dd04v.
CALL FUNCTION 'GET_FIELDNAME_TEXT_1'
EXPORTING
I_AS4LOCAL = 'A'
I_AS4VERS = '0000'
I_FIELDNAME = ITCDPOS-FNAME
I_TABNAME = ITCDPOS-TABNAME
TABLES
E_DD03L = E_DD03L
E_DD04V = E_DD04V
EXCEPTIONS
ERROR_IN_PARAMETERS = 1
NOT_FOUND = 2
OTHERS = 3
ENDIF.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
CLEAR E_DD04V-DDTEXT.
ENDIF.
IF ITCDPOS-FNAME = 'KEY'.
ITSTPO-DDTEXT = 'New Entry Made'.
ELSE.
ITSTPO-DDTEXT = E_DD04V-DDTEXT.
ENDIF.
CLEAR E_DD04V.
APPEND ITSTPO.
SORT ITSTPO BY MATNR OBJECTID CHANGENR FNAME.
DELETE ADJACENT DUPLICATES FROM ITSTPO COMPARING MATNR OBJECTID CHANGENR FNAME.
*DELETE ITSTPO WHERE MATNR EQ SPACE.
WRITE : / ITSTPO-OBJECTID+11(11),16 ITSTPO-MAKTX,66 ITSTPO-USERNAME,83 ITSTPO-UDATE,97 ITSTPO-TCODE,110 ITSTPO-OLD_VALUE,164 ITSTPO-NEW_VALUE,184 ITSTPO-DDTEXT.
ENDLOOP. -
Use of function module RHPD_SEARCH_PEOPLE_WITH_QUAL
Hello Gurus,
I am currently working on HR module. I want to know how RHPD_SEARCH_PEOPLE_WITH_QUAL is used. I am not able to figure out as i don't have system to work on. Just conceptual information is enough(code will be handy too). but a rough draft will do.
Thanks in advance.
Thanks and Regards,
Saurabh ChhatreHi,
The code is below
* CORRECTIONS
* DATE CORRECTION NOTE DESCRIPTION
* 06.03.2001 L9CK045041 0387320 Selection of applicants
* 11.06.2001 L9CK055799 0411739 Wrong search for Applicants in TA: PBAP
FUNCTION rhpd_search_people_with_qual .
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(PLVAR) LIKE HRP1000-PLVAR
*" VALUE(BEGDA) LIKE HRP1000-BEGDA DEFAULT SY-DATUM
*" VALUE(ENDDA) LIKE HRP1000-ENDDA DEFAULT SY-DATUM
*" VALUE(SUBTY) LIKE HRP1001-SUBTY DEFAULT 'B032'
*" VALUE(GET_PERS_NAME) LIKE SY-INPUT DEFAULT 'X'
*" VALUE(ONLY_ESSENTIAL) TYPE ESSENTIAL OPTIONAL
*" VALUE(CONSIDER_ALTQ) TYPE SUBSTITUTE OPTIONAL
*" VALUE(TARGET_AP_IEA) LIKE SY-INPUT DEFAULT ' '
*" TABLES
*" QUALI_TAB STRUCTURE QUALI_PROF
*" IMP_PERS_TAB STRUCTURE HRSOBID OPTIONAL
*" PERS_TAB STRUCTURE PERSQ_PROF
*" ALTQ_TAB STRUCTURE ALTQ_STRU OPTIONAL
*" APSTA_RANGE STRUCTURE RANGE_APSTA OPTIONAL
*" TARGET_OTYPE_TAB STRUCTURE HROTYPE OPTIONAL
*" EXCEPTIONS
*" NO_QUALIFICATION
*" NO_PERSON_FOUND
DATA: adata.
DATA: objects LIKE hrobject OCCURS 1 WITH HEADER LINE.
DATA: sobjects LIKE hrsobid OCCURS 1 WITH HEADER LINE.
DATA: i1001 LIKE p1001 OCCURS 1 WITH HEADER LINE.
DATA: sobid LIKE i1001-sobid.
DATA: BEGIN OF persons OCCURS 1,
sclas LIKE i1001-sclas,
sobid LIKE i1001-sobid.
DATA: END OF persons.
DATA: pad31 LIKE pad31.
DATA: ok_flag.
DATA: l_otype like hrobject-otype.
DATA: conditions LIKE hrcond OCCURS 1 WITH HEADER LINE.
DATA: condition_id LIKE hrrhdb-condition.
DATA: h_no_persons.
ranges: only_otype for objec-otype.
DATA: h_tabix like sy-tabix.
DATA: t77eo_prog LIKE t77eo-prog.
data: l_function_module like rs38l-name.
Field-symbols: <i1001-adata>. "LudwigUNI
* read t77s0 parameters
PERFORM read_t77s0_parameters_for_pe.
* nur bei "erfüllt"-Verknüpfung Zusatzdaten (Ausprägung) lesen
IF subty+1(3) = $ownsb+1(3). " '032' erfüllt
adata = 'X'.
ENDIF.
* Tabelle für read_infty füllen
LOOP AT quali_tab.
objects-plvar = plvar.
objects-otype = $quali.
objects-objid = quali_tab-qualid.
APPEND objects.
ENDLOOP.
IF sy-subrc > 0.
RAISE no_qualification.
ENDIF.
* Export-Tabelle leeren
CLEAR pers_tab.
REFRESH pers_tab.
* Wenn der Paramter target_iea gesetzt ist, wird die Tabelle
* Target_otype_tab entsprechend gefüllt ( Doku zu Parameter beachten )
IF NOT target_ap_iea IS INITIAL.
READ TABLE target_otype_tab WITH KEY otype = $pernr.
IF sy-subrc NE 0.
h_no_persons = 'X'.
ENDIF.
IF target_ap_iea EQ 'A' OR target_ap_iea EQ 'I'
OR target_ap_iea EQ 'E'.
target_otype_tab-otype = $pernr.
APPEND target_otype_tab.
ENDIF.
IF target_ap_iea EQ 'A' OR target_ap_iea EQ 'E'.
target_otype_tab-otype = $applk.
APPEND target_otype_tab.
ENDIF.
SORT target_otype_tab BY otype.
DELETE ADJACENT DUPLICATES FROM target_otype_tab.
ENDIF.
* Für binary search
SORT target_otype_tab.
* INSERT by XSC *****
* READ TABLE imp_pers_tab INDEX 1 TRANSPORTING NO FIELDS.
* IF sy-subrc = 0.
* Falls Zielpersonen schon bekannt sind, Bedingungen aufbauen
* REFRESH conditions.
* CLEAR conditions.
* Einschränkung auf Zielobjekttypen
* LOOP AT imp_pers_tab.
* READ TABLE target_otype_tab WITH KEY otype = imp_pers_tab-otype
* BINARY SEARCH.
* IF sy-subrc EQ 0.
* conditions-field = 'SCLAS'.
* conditions-opera = 'EQ'.
* conditions-low = imp_pers_tab-otype.
* APPEND conditions.
* conditions-field = 'SOBID'.
* conditions-opera = 'EQ'.
* conditions-low = imp_pers_tab-sobid.
* APPEND conditions.
* ELSE.
* is there any entry in target otype table
* READ TABLE target_otype_tab INDEX 1 TRANSPORTING NO FIELDS.
* IF sy-subrc <> 0.
* there is no entry -> TAKE ALL object types !!!
* conditions-field = 'SCLAS'.
* conditions-opera = 'EQ'.
* conditions-low = imp_pers_tab-otype.
* APPEND conditions.
* conditions-field = 'SOBID'.
* conditions-opera = 'EQ'.
* conditions-low = imp_pers_tab-sobid.
* APPEND conditions.
* ENDIF. "any entry in target otype ?
* ENDIF. "allowed in target otype table ?
* ENDLOOP.
* INSERT by XSC *****
READ TABLE imp_pers_tab INDEX 1 TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
* Falls Zielpersonen schon bekannt sind, Bedingungen aufbauen
REFRESH conditions.
CLEAR conditions.
* INSERT by Ludwig *****
Loop at imp_pers_tab.
if l_otype = imp_pers_tab-otype.
continue.
else. "l_otype <> im_pers_tab-otype = new objecttype
only_otype-sign = 'I'.
only_otype-option = 'EQ'.
only_otype-low = imp_pers_tab-otype.
append only_otype.
l_otype = imp_pers_tab-otype.
endif.
endloop.
delete target_otype_tab where not otype in only_otype.
LOOP AT target_otype_tab.
conditions-field = 'SCLAS'.
conditions-opera = 'EQ'.
conditions-low = target_otype_tab-otype.
APPEND conditions.
ENDLOOP.
* Verknüpfungsart:
conditions-field = 'SUBTY'.
conditions-opera = 'EQ'.
conditions-low = subty.
APPEND conditions.
* Zeitraumeingrenzung übernehmen
conditions-field = 'BEGDA'.
conditions-opera = 'LE'.
conditions-low = endda.
APPEND conditions.
conditions-field = 'ENDDA'.
conditions-opera = 'GE'.
conditions-low = begda.
APPEND conditions.
* Bedingungstabelle für select generieren
CALL FUNCTION 'RH_CONDITION_BUILD'
EXPORTING
infty = '1001'
IMPORTING
condition = condition_id
TABLES
condtab = conditions
EXCEPTIONS
empty_condtab = 1
no_db_field = 2
unknown_infty_db = 3
wrong_condition = 4
unknown_pad_db = 5
OTHERS = 6.
IF sy-subrc NE 0.
RAISE no_person_found.
ENDIF.
* Passende Objekte suchen. Extend = 'D' -> Conditions beachten
CALL FUNCTION 'RH_READ_INFTY_1001'
EXPORTING
* AUTHORITY = 'DISP'
* WITH_STRU_AUTH = 'X'
* ISTAT = ' '
extend = 'D'
* subty = subty
* begda = begda
* endda = endda
condition = condition_id
* SORT = 'X'
* WITH_EV = ' '
adata = adata
TABLES
i1001 = i1001
objects = objects
EXCEPTIONS
nothing_found = 1
wrong_condition = 2
OTHERS = 3.
IF sy-subrc NE 0.
RAISE no_person_found.
ENDIF.
* Bedingung wieder löschen
CALL FUNCTION 'RH_CONDITION_DELETE'
EXPORTING
condition = condition_id
EXCEPTIONS
OTHERS = 0.
* INSERT by Ludwig *****
read table imp_pers_tab index 1 transporting no fields.
if sy-subrc = 0.
* The found persons in the table persons are all persons which
* have a valid qualification.
* Delete persons out of table persons which not belong to the
* organization_unit.
* Sort table persons by otype objectid objecttext qualiid and date
sort imp_pers_tab by plvar otype sobid.
clear h_tabix.
loop at i1001.
h_tabix = sy-tabix.
read table imp_pers_tab with key otype = i1001-sclas
sobid = i1001-sobid
binary search.
if sy-subrc <> 0. "person not in the organzation_unit
delete i1001 index h_tabix. "delete person out of i1001
endif.
endloop.
endif. "imported persons
* INSERT by XSC *****
ELSEIF ( target_ap_iea EQ 'I' ) OR
( target_ap_iea EQ 'E' ) OR
( target_ap_iea EQ 'A' ).
* Sonderbehandlung für Bewerber, falls da : (für Bewerberverwaltung)
LOOP AT target_otype_tab. "Correction L9CK055799 0411739 11.06.2001
* Dynamisches Form zur Bewerberstatuseinschränkung lesen:
SELECT SINGLE * FROM t77eo WHERE otype = $applk.
t77eo_prog = t77eo-prog.
* Status der Bewerber beim RH_READ_OBJECT berücksichtigen:
READ TABLE apsta_range INDEX 1 TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
PERFORM set_apsta IN PROGRAM (t77eo_prog) TABLES apsta_range
USING begda endda IF FOUND.
ENDIF.
ENDLOOP.
* Bedingungen aufbauen
REFRESH conditions.
CLEAR conditions.
* Einschränkung auf Zielobjekttyp:
* IF target_ap_iea eq 'A' or "Alle Bewerber selektieren
* target_ap_iea = 'E'. "externe Bewerber selektieren
* conditions-field = 'SCLAS'.
* conditions-opera = 'EQ'.
* conditions-low = $applk. "Bewerber:
* APPEND conditions.
* ENDIF.
* IF target_ap_iea eq 'A' or "Alle Bewerber selektieren
* target_ap_iea = 'I'. "interne Bewerber selektieren
* conditions-field = 'SCLAS'.
* conditions-opera = 'EQ'. "Personen auslesen: ! Rollen-
* conditions-low = $pernr. "interner Bewerber ! konzept
* APPEND conditions.
* ENDIF.
LOOP AT target_otype_tab.
conditions-field = 'SCLAS'.
conditions-opera = 'EQ'.
conditions-low = target_otype_tab-otype.
APPEND conditions.
ENDLOOP.
* Verknüpfungsart:
conditions-field = 'SUBTY'.
conditions-opera = 'EQ'.
conditions-low = subty.
APPEND conditions.
* Zeitraumeingrenzung übernehmen - Anfang Quali vor Ende Zeitraum
conditions-field = 'BEGDA'.
conditions-opera = 'LE'.
conditions-low = endda.
APPEND conditions.
conditions-field = 'ENDDA'.
conditions-opera = 'GE'.
conditions-low = begda.
APPEND conditions.
CALL FUNCTION 'RH_CONDITION_BUILD'
EXPORTING
infty = '1001'
IMPORTING
condition = condition_id
TABLES
condtab = conditions
EXCEPTIONS
empty_condtab = 1
no_db_field = 2
unknown_infty_db = 3
wrong_condition = 4
unknown_pad_db = 5
OTHERS = 6.
IF sy-subrc NE 0.
RAISE no_person_found.
ENDIF.
* Extend = 'D' -> Conditions beachten
CALL FUNCTION 'RH_READ_INFTY_1001'
EXPORTING
* AUTHORITY = 'DISP'
* WITH_STRU_AUTH = 'X'
* ISTAT = ' '
extend = 'D'
* subty = subty
* begda = begda
* endda = endda
condition = condition_id
* SORT = 'X'
* WITH_EV = ' '
adata = adata
TABLES
i1001 = i1001
objects = objects
EXCEPTIONS
nothing_found = 1
wrong_condition = 2
OTHERS = 3.
* applicant selection !
l_function_module = 'RHPD_DC_INTERPRET_TARGET_IEA'.
CALL FUNCTION 'FUNCTION_EXISTS' "XSC DC
EXPORTING
FUNCNAME = l_function_module
EXCEPTIONS
FUNCTION_NOT_EXIST = 1
OTHERS = 2.
IF SY-SUBRC = 0.
* HR SYSTEM
CALL FUNCTION l_function_module
EXPORTING
TARGET_AP_IEA = TARGET_AP_IEA
TABLES
I1001 = i1001.
else.
* NO HR SYSTEM
* -> no applicant selection or determination
ENDIF.
ELSE.
* Einschränkung auf Zielobjekttypen ungleich Bewerber:
* Ist jetzt nahezu das gleiche wie bei target_ap_iea ne space. Aber
* weil's dann übersichtlicher bleibt, steht's halt nochmal extra.
* Bedingungen aufbauen
CLEAR conditions.
REFRESH conditions.
* Einschränkung auf Zielobjekttypen: ( Sobids sind nicht bekannt )
LOOP AT target_otype_tab.
conditions-field = 'SCLAS'.
conditions-opera = 'EQ'.
conditions-low = target_otype_tab-otype.
APPEND conditions.
ENDLOOP.
* Verknüpfungsart:
conditions-field = 'SUBTY'.
conditions-opera = 'EQ'.
conditions-low = subty.
APPEND conditions.
* Zeitraumeingrenzung übernehmen
conditions-field = 'BEGDA'.
conditions-opera = 'LE'.
conditions-low = endda.
APPEND conditions.
conditions-field = 'ENDDA'.
conditions-opera = 'GE'.
conditions-low = begda.
APPEND conditions.
CALL FUNCTION 'RH_CONDITION_BUILD'
EXPORTING
infty = '1001'
IMPORTING
condition = condition_id
TABLES
condtab = conditions
EXCEPTIONS
empty_condtab = 1
no_db_field = 2
unknown_infty_db = 3
wrong_condition = 4
unknown_pad_db = 5
OTHERS = 6.
IF sy-subrc NE 0.
RAISE no_person_found.
ENDIF.
CALL FUNCTION 'RH_READ_INFTY_1001'
EXPORTING
* AUTHORITY = 'DISP'
* WITH_STRU_AUTH = 'X'
* ISTAT = ' '
extend = 'D'
subty = subty
begda = begda
endda = endda
condition = condition_id
* SORT = 'X'
* WITH_EV = ' '
adata = adata
TABLES
i1001 = i1001
objects = objects
EXCEPTIONS
nothing_found = 1
wrong_condition = 2
OTHERS = 3.
IF sy-subrc NE 0.
RAISE no_person_found.
ENDIF.
ENDIF.
* Die Bedingungen wieder löschen
CALL FUNCTION 'RH_CONDITION_DELETE'
EXPORTING
condition = condition_id
EXCEPTIONS
OTHERS = 0.
* Wenn nur Personen gefunden werden sollen, die auf jeden Fall einen
* Teil der Qualis (Mußanforderungen) haben,
* müssen die Personen wieder rausgeschmissen werden, die nicht diese
* Qualifikationen erfüllen.
IF only_essential = 'X'.
* Zunächst alle gefundenen Personen ermitteln:
LOOP AT i1001.
persons-sclas = i1001-sclas.
persons-sobid = i1001-sobid.
APPEND persons.
ENDLOOP.
SORT persons BY sclas sobid. "Schneller als
DELETE ADJACENT DUPLICATES FROM persons. "collect
* Dann die Personen wieder rausschmeißen, die nicht alle MußQ's haben:
LOOP AT persons.
LOOP AT quali_tab WHERE essential = 'X'.
READ TABLE i1001 WITH KEY objid = quali_tab-qualid
sclas = persons-sclas
sobid = persons-sobid.
IF sy-subrc > 0. "Person hat Quali nicht
IF consider_altq IS INITIAL. "ErsatzQ nicht beachten
DELETE persons. "also Person rausscheißen
EXIT.
ELSE. " consider_altq = 'X' SUCHE NACH ERSATZQUALIFIKATIONEN
CLEAR ok_flag.
LOOP AT altq_tab WHERE robid = quali_tab-qualid.
READ TABLE i1001 WITH KEY objid = altq_tab-tobid
sclas = persons-sclas
sobid = persons-sobid.
IF sy-subrc = 0. "Person hat ErsatzQ
ok_flag = 'X'.
EXIT.
ENDIF.
ENDLOOP.
IF ok_flag IS INITIAL.
DELETE persons.
EXIT.
ENDIF.
ENDIF. "consider_altq is initial. "ErsatQ beachten
ENDIF. "sy-subrc > 0. "Person hat Quali nicht
ENDLOOP. " at quali_tab
ENDLOOP. " at persons.
* Und noch die i1001 bereinigen:
LOOP AT i1001.
READ TABLE persons WITH KEY sclas = i1001-sclas
sobid = i1001-sobid.
IF sy-subrc > 0. "Person nicht in persons => in i1001 löschen
DELETE i1001.
ENDIF.
ENDLOOP.
ENDIF. " only_essential = 'X'
* Wenn Namen gewünscht, Text_buffer füllen.
IF NOT get_pers_name IS INITIAL.
LOOP AT i1001.
sobjects-plvar = plvar.
sobjects-otype = i1001-sclas.
sobjects-sobid = i1001-sobid.
APPEND sobjects.
ENDLOOP.
CALL FUNCTION 'RH_TEXT_BUFFER_FILL_EXTERNAL'
* EXPORTING
* CHECK_STRU_AUTH = 'X'
TABLES
objects = sobjects
EXCEPTIONS
OTHERS = 0.
ENDIF. " get_pers_name = 'X'. .
* Fülle Pers_tab.
LOOP AT i1001.
CLEAR pers_tab.
pers_tab-otype = i1001-sclas.
pers_tab-sobid = i1001-sobid.
IF get_pers_name = 'X'.
sobid = i1001-sobid.
CALL FUNCTION 'RH_READ_OBJECT'
EXPORTING
plvar = plvar
otype = i1001-sclas
* objid = objid
realo = sobid
* ISTAT = ' '
begda = begda
endda = endda
* LANGU = SY-LANGU
* OINTERVAL = 'X'
* STORE = 'X'
* CHECK_STRU_AUTH = 'X'
* READ_DB = ' '
IMPORTING
* obeg =
* oend =
* ostat =
* histo =
short = pers_tab-short
stext = pers_tab-stext
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc > 0.
CONTINUE.
ENDIF.
ENDIF.
IF pers_tab-stext IS INITIAL.
pers_tab-stext = pers_tab-short.
ENDIF.
pers_tab-qualid = i1001-objid(8).
READ TABLE quali_tab WITH KEY qualid = i1001-objid(8).
pers_tab-qualstxt = quali_tab-qualstxt.
pers_tab-essential = quali_tab-essential.
assign i1001-adata to <i1001-adata> casting type c. "LudwigUNI
pad31 = <i1001-adata>.
* get proficiency for the qualification in the future:
* profile-profcy = pad31-chara / 10000000 "for NUMC8
pers_tab-profcy = pad31-chara.
* Verknüpfungszeitraum füllen:
pers_tab-vbegda = i1001-begda.
pers_tab-vendda = i1001-endda.
APPEND pers_tab.
ENDLOOP.
* Einschränkung des Bewerberstatus zurücknehmen:
IF target_ap_iea EQ 'I' OR
target_ap_iea EQ 'E' OR
target_ap_iea EQ 'A'.
LOOP AT target_otype_tab WHERE otype = $applk.
PERFORM reset_apsta IN PROGRAM (t77eo_prog) IF FOUND.
ENDLOOP.
ENDIF.
ENDFUNCTION.
Regards,
Shailaja -
Hi,
CALL FUNCTION 'Z_BAPI_LEAVE_DELETE_TAB1' in update task
EXPORTING
employeenumber = '1989'
subtype = '0400'
OBJECTID =
LOCKINDICATOR =
validitybegin = '20050704'
validityend = '20050704'.
RECORDNUMBER =
NOCOMMIT =
FIRSTDAY =
SECONDDAY =
But it is not updating any values. Is there any problem.
rgds
p.kpHi again,
1. It means there some error
while posting the data.
2. Try with the same parameters
with the ORIGINAL Fm (which u have copied)
3. ALSO DO NOT USE
ANY COMMIT
INSIDE YOUR Z FM.
(OTHER WISE IT WILL GIVE ERROR
ERROR : COMMIT_ON_POSTING
regards,
amit m.
Message was edited by: Amit Mittal
Maybe you are looking for
-
My ipad sound is not working after cold weather
Please help if there is any way to fix this i have been to a country where it was aroun 10-20 degrees celcius and after i came back from hollidays my sound turns off and i cant turn the volume up or down it just shows the sound icon then after a afte
-
KSH3 is cost center froup , which tabbles data is stroing
Hi Experts, what ever data is appearing in KSH3 hierarchy, In which tables data can i get , here in my controlling group having 5 hierarchys. those 5 levels data storing in which table? Thanks.
-
New Build hangs at VERIFYING DMI POOL DATA
I put it all together and try to load the XP OS, but it hangs at Verifying DMI Pool Data.......(NTLDR is missing) Have rechecked the cables and connections a half dozen times. (All new cables) Checked and rechecked the boot order. Disconnected the fl
-
Can not down load up date for flash player..I tried removing my original flash player and this did not work...and now i have no flask player! A firefox window opens for down load and only reads "save" or "cancel" it does not have a "RUN" button. When
-
Symptoms: You select an Azure RemoteApp collection in the Azure portal and then click Update. The result is a pop-up like the following: Unexpected error An expected error occurred. Check the management portal for related information, and then try