Any sample code for an Extractor to read in a flat file?
Hi SAP gurus,
Are there any sample code for an extractor to read in a flat file?
Are there any documentation on custom coding an extractor to dump
information into an info source?
Are there any documentation on the pit falls and contraints using Solution
Manager, the BI tools, particularly on the Info Source?
Thanks,
Steve
Thanks Muppet Mark
I forgot to mention that I had also tried just fileObject.read() as well and it didn't work either. It was the same run on sentence result I got with the script I showed above. Seems odd. However, the \r instead of \n did the trick. I had some recollection of another line feed character but couldn't remember what it was, so thanks for that.
Doug
Similar Messages
-
Any Sample code for recording+playing streaming live video?
Hi all,
I'm new to FMS3,
I wanna create a page for webcam live recording and playing,
is there any sample code for reference (i can only found the code
for live recording but do not have live record+play)?
Many thanks.
I have installed FMS3.0 and FME2.0 on my machine, so is it
capable to do so?
Many thanks.Thanks for your reply, but I have another question:
My live file (test.flv) is recorded under this path:
C:\xxxx\FMS3\applications\path\streams\_definst_\
But seems FMS3 can only play video under this path:
C:\xxxx\FMS3\applications\vod\media\
My only success is on this source path rtmp://ip/vod/test in
the component FLVPlayBack.
So is it happen to all free version of FMS3 or I have to type
sth more?
Many thanks. -
Sample code for connect to database
Hi
like to know if there is any sample code for me to follow through to connect to database using ODBC.
I am currently writing a program in visual c++.
like to know how to connect database to store image in the database
using visual c++ code.....
hope that is not too difficult.in JSTL pratical guide for JSP programmers by Sue Spielman
<sql:setDataSource var="datasource"
driver="org.gjt.mm.mysql.driver"
url="jdbc:mysql://localhost/db"
user="guest"
password="guest" />
<sql:query datasource="${datasource}...
<html>
<head>
<title>
Display Results
</title>
</head>
<body>
<c:catch var="sqlError">
<sql:query var="bookList" dataSource="${datasource}">
SELECT * FROM books WHERE title LIKE 'J%' ORDER BY author
</sql:query>
</c:catch>
<c:if test="${not empty sqlError}" >
Make sure you have already run the databaseinit.jsp file
</c:if>
<h2>Listing all books that start with a 'J', ordered by author</h2>
<br>
<table>
<th>Title</th>
<th>Author</th>
<c:forEach var="book" items="${bookList.rows}">
<tr>
<td><c:out value="${book.title}" /></td>
<td><c:out value="${book.author}" /></td>
</tr>
</c:forEach>
</table>
</table>
<h2>Show using choose/when/otherwise conditional to display results</h2>
<table>
<tr><th>Title</th></tr>
<c:forEach var="book" varStatus="current" items="${bookList.rows}">
<tr>
<c:choose>
<c:when test="${current.first}" >
<td><font color="#0000FF"><c:out value="${book.title}"/></font></td>
</c:when>
<c:when test="${current.count % 2 == 1 }" >
<td><font color="#FF0000"><c:out value="${book.title}"/></font></td>
</c:when>
<c:otherwise>
<td><c:out value="${book.title}"/></td>
</c:otherwise>
</c:choose>
</tr>
</c:forEach>
</table>
</body>
</html> -
Routine sample code for reading 2 fields from existing DSO
Hi Gurus,
I am a monkey when it comes to write ABAP code. I have one DSO-A where we store accounting info of purchading (from DS 2lis_02_acc) and one DSO-B getting data from 2lis_02_scl data source.
We need to write a rountine to read DSO-A for G/L account and populate DSO-B G/L account field.
Please provide me the sample code for this.
Warm Regards,
AnilHi anil,
Create a local table this is type of you source,
Data : LV_table TYPE XXXX
use the select statement to read the table of DSO .You have to use th active table for the dso that you want to read data from.
Select xxxfieldxxx FROM /BIC/A..........50
into lv_table where
filed name of of scheule line probably order no and item no .
<soruce-fields>-IOBELN = IOBELN
and <source-fields>-IOBELP = IOBELP.
Checke the techinal name i am not sure about it. It will be something like that.
Cheers mate -
Hi all,
This is what I want to achieve. I have an attribute for an IO, but the values for that has to be decided at the transfer structure level. I want to write a routine in the transfer rules to populate the field.
I have another field that gets populated from R/3. I need to write a routine which would take this value and see if it falls in the range and have to decide the value and populate.
I have gl_account coming in, and in the routine I need to take that value of the gl_account and see if it falls in the range of 1 5000 or 6700 - 8130 if so assign a + sign and if not assign a sign to the new field.
Any sample code would be appreciated and rewarded.
Thanks,
SriGlobal code used by conversion rules
$$ begin of global - insert your declaration only below this line -
TABLES: ...
DATA: ...
$$ end of global - insert your declaration only before this line -
$$ begin of routine - insert your code only below this line -
DATA: l_s_errorlog TYPE rssm_s_errorlog_int.
Data: temp1 TYPE RANGE OF TRAN_STRUCTURE-ZDEBITCREDIT,
Data: temp1_line LIKE LINE OF temp1.
temp1_line-sign = 'I'.
temp1_line-option = 'BT'.
temp1_line-low = '001'.
temp1_line-high = '5000'.
APPEND temp1_line TO temp1
Data: temp2 TYPE RANGE OF TRAN_STRUCTURE-ZDEBITCREDIT,
Data: temp2_line LIKE LINE OF temp2.
temp2_line-sign = 'I'.
temp2_line-option = 'BT'.
temp2_line-low = '5001'.
temp2_line-high = '8000'.
APPEND temp2_line TO temp2
Data: temp(1) char.
if TRAN_STRUCTURE-0glaccnt IN temp1.
temp3 = '+'.
elseif TRAN_STRUCTURE-0glaccnt IN temp2.
temp 3= '-'.
endif
RESULT = temp3 .
returncode <> 0 means skip this record
RETURNCODE = 0.
abort <> 0 means skip whole data package !!!
ABORT = 0.
$$ end of routine - insert your code only before this line - -
Any sample code on XML parsing
Hi,
I am writing an application that has to read and to generate XML (using schemas). Unfortuantely, I cannot find any sample code on how to do it using the Oracle supplied libraries (packages oracle.xml.* . Can anyone point me to some sample code, documentation or alternative?
Thanks a lot!Hello Bert,
I didnt get your question very clearly.
1) Do you want to generate XML using Java classes based on XSD?
or
2) You want to parse XML that has a XSD specified with it?
For both these thing, we have sample codes. For the first option, there are Class Generators that does this for you. There are some samples provided with the XDK download. Look into the folder <xdk_home>xdk\demo\java\classgen.
For option 2, there are many samples on OTN itself. To name one.... AQSample downloaded from http://otn.oracle.com/sample_code/tech/dataint/content.html.
There is a sample with the JDK download also. The folder is <xdk_home>\xdk\demo\java\schema
Hope this helps. -
Is there any transaction code for uploding logo in ALV reports.
is there any transaction code for uploding logo in ALV reports.
hi,
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_header.
i_logo = 'Z_LOGO'.
endform.
Upload Logo for REUSE_ALV_COMMENTARY_WRITE
For those who wish to upload and use a picture in your ALV abap reports.
Steps for uploading Logo :-:
1. Goto the transaction OAER
2. Enter the class name as 'PICTURES'
3. Enter the class type as 'OT'
4. Enter the object key as the name of the logo you wish to give
5. Execute
6. Then in the new screen select Standard doc. types in bottom window
Click on the Screen icon
Now, it will ask for the file path where you have to upload the logo
7. Now you can use this logo in REUSE_ALV_COMMENTARY_WRITE
or
Import Logo and Background Picture for Reporting
In this step, you can import a customer-specific logo and a background picture into the R/3 System. These will be displayed in the header area of reports in HR Funds and Position Management.
From the SPRO:
HR Funds and Position Management --> Dialog Control --> Customize Reporting Interface --> Import Logo and Background Picture for Reporting.
Activities
1. Enter the Name of your logo/background picture as an object key in the initial screen.
2. Make sure that the class name is PICTURES, and the class type is OT.
3. Choose Execute.
4. Double-click the document type Picture on the Create tab page. A dialog box will appear in which you can enter the path in which the logo/background picture can be found.
5. Enter the path and choose Open. The logo will be uploaded into the current R/3 System. If the logo/background picture is to be transported into other systems as well, choose Transport.
6. Return to the initial screen and repeat the procedure after having entered the Name of your background picture as an object key.
Please note that the logo/background picture can only be displayed in ALV-based reports with an HTML header. Manually programmed reports such as business distribution plans are not based on the ALV.
If you have selected several initial objects, ALV-based reports in HR Funds and Position Management will automatically use a hiearchical-sequential display. A logo is not displayed here either. Note also that the logo cannot be printed (see print preview in program).
Make sure that the logo does not exceed a height of 100 pixels because it would mean that the header of the report will be scrollable. -
ABAP Sample code for HR_MAINTAIN_MASTERDATA
Hi folks,
I want to delimit a record in the HR master Table wi the help of Function Module HR_MAINTAIN_MASTERDATA, but its not updating HR master table correctly so please send me some sample code for that function module.
usefull points will rewarded.
Reg,
Hariharanhi
good
check with this code
Call update function module:
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
EXPORTING
PERNR = SS300_0001T-PERNR
ACTIO = OPERATION
BEGDA = VALIDITYBEGIN
ENDDA = '99991231'
SUBTY = SPACE
NO_ENQUEUE = SPACE
IMPORTING
RETURN1 = RETURN
TABLES
PROPOSED_VALUES = VALUES
MODIFIED_KEYS =
EXCEPTIONS
OTHERS = 1.
IF RETURN IS INITIAL.
CONCATENATE SS300_0002-VORNA SS300_0002-NACHN
INTO ENAME SEPARATED BY SPACE.
CONDENSE ENAME.
MESSAGE S006 WITH ENAME SPACE.
ELSE.
MESSAGE ID RETURN-ID
TYPE 'S'
NUMBER RETURN-NUMBER
WITH RETURN-MESSAGE_V1 RETURN-MESSAGE_V2
RETURN-MESSAGE_V3 RETURN-MESSAGE_V4.
ENDIF.
http://help.sap.com/saphelp_nw04/helpdata/en/f1/0ce464dc8b11d2803800c04f99fbf0/content.htm
reward point if helpful.
thanks
mrutyun^ -
Need case studies and sample code for all concept of ABAP
Hello,
Can anybody provide me the case studies and sample code for learning different concepts in ABAP programming like: module pool, ALV, interactive reports, BDC, Smart Form etc.? As I want to do some practical application by which i can learn more.
Thanks & Regards,
Vikram RawalIn this link You can find Step by Step Scren Shot document :
http://www.201interviewquestions.com/docs/User%20exits.ppt
http://erpgenie.com/abaptips/component/option,com_docman/task,doc_details/gid,27/
<b>
Reprots</b>
http://www.sapgenie.com/abap/reports.htm
http://www.allsaplinks.com/material.html
http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
<b>Dictionary</b>
http://sapabap.iespana.es/sapabap/manuales/learnabap/
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb6e446011d189700000e8322d00/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ea31446011d189700000e8322d00/frameset.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCDWBDIC/BCDWBDIC.pdf
<b>ABAP objects</b>
Please check this online document (starting page 1291).
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf
Also check this links as well.
http://help.sap.com/saphelp_nw2004s/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
http://www.futureobjects.de/content/intro_oo_e.html
http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm
/people/ravikumar.allampallam/blog/2005/02/11/abap-oo-in-action
<b>
SAPScripts</b>
http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf
http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
SAP SCRIPT FIELDS
http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/8033ea454211d189710000e8322d00/content.htm
scripts easy material
http://www.allsaplinks.com/sap_script_made_easy.html
Check these step-by-step links
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501-0010-ee84-de050a6cc287
https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301-0010-eabe-82149bcc292e
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
<b>Smartforms material</b>
http://www.sap-basis-abap.com/sapsf001.htm
http://www.sap-press.com/downloads/h955_preview.pdf
http://www.ossincorp.com/Black_Box/Black_Box_2.htm
http://www.sap-img.com/smartforms/sap-smart-forms.htm
http://www.sap-img.com/smartforms/smartform-tutorial.htm
http://www.sapgenie.com/abap/smartforms.htm
How to trace smartform
http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
http://www.sap-img.com/smartforms/smart-006.htm
http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
Re: Need FAQ's
check most imp link
http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
step by step good ex link is....
http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
<b>
BAPI</b>
http://help.sap.com/saphelp_46c/helpdata/en/9b/417f07ee2211d1ad14080009b0fb56/frameset.htm
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
Checkout !!
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
http://techrepublic.com.com/5100-6329-1051160.html#
http://www.sap-img.com/bapi.htm
http://www.sap-img.com/abap/bapi-conventions.htm
http://www.sappoint.com/abap/bapiintro.pdf
http://www.sapgenie.com/abap/bapi/example.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
<b>List of all BAPIs</b>
http://www.planetsap.com/LIST_ALL_BAPIs.htm
http://www.sappoint.com/abap/bapiintro.pdf
http://www.sappoint.com/abap/bapiprg.pdf
http://www.sappoint.com/abap/bapiactx.pdf
http://www.sappoint.com/abap/bapilst.pdf
http://www.sappoint.com/abap/bapiexer.pdf
http://service.sap.com/ale
http://service.sap.com/bapi
http://www.planetsap.com/Bapi_main_page.htm
http://www.topxml.com/sap/sap_idoc_xml.asp
http://www.sapdevelopment.co.uk/
http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
<b>ALV programs.</b>
http://www.geocities.com/mpioud/Abap_programs.html
. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
<b>ALV</b>
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - http://www.sapgenie.com/abap/reports.htm
http://www.allsaplinks.com/material.html
http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
<b>Top-of-page in ALV</b>
selection-screen and top-of-page in ALV
<b>ALV Group Heading</b>
http://www.sap-img.com/fu037.htm
<b>ALV</b>
http://www.geocities.com/mpioud/Abap_programs.html
<b>
RFC Destination</b>
Re: SM59
<b>
ALE/ IDOC</b>http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
http://www.sapgenie.com/sapedi/index.htm
http://www.sappoint.com/abap/ale.pdf
http://www.sappoint.com/abap/ale2.pdf
http://www.sapgenie.com/sapedi/idoc_abap.htm
http://www.allsaplinks.com/idoc_sample.html
http://www.sappoint.com/abap.html
http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
http://www.sapgenie.com/sapedi/index.htm
http://www.allsaplinks.com/idoc_sample.html
<b>Table Control</b>
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/table%20control%20in%20abap.pdf
<b>
ABAP transactions</b>
http://www.easymarketplace.de/transactions-a-e.php?Area=4soi&name=volker&pw=vg&
Regards,
Priyanka. -
Need sample code for Using BADI ME_PROCESS_REQ_CUST
Dear all,
Initially my requirement is to Validate the Document Type of Purchase Request ion as per material.
I have created a implementation for BADI : ME_PROCESS_REQ_CUST .
im new to OOPS-ABAP, so pls send *sample code for how to use these methods PROCESS_ITEM,
like declarations, assignment of data into internal table for further validation*.
Regards,
NIranjan.GHi,
get the item data ....
*DATA : lt_item TYPE MEREQ_ITEM,
ls_item liek line of it_item*
CALL METHOD im_item->GET_DATA
RECEIVING
RE_DATA = lt_item .
you will get the data in lt_item.. table
Thanks,
Shailaja Ainala. -
Kindly write some sample code for this scenario
Kindly write some sample code for the below Logic.
For a set of Deliveries entered on the selection screen get the relevant data from LIKP & LIPS.
for all the deliveries selected get the sales order data from VBAK & VBAP based on the VGBEL & VGPOS in LIPS.
The Output internal table should contain only deliveries which are created with reference to a sales order.
Thanx in Advance.
Akshitha.Hi,
Select avbeln bposnr bmatnr blfimg bvgbel bvgpos into table ITAB
from likp as a join lips as b on Avbeln = bvbeln
where a~vbeln in s_vbeln..
if not itab[] is initial.
select avbeln bposnr b~matnr ... into table itab1 from vbak as a join vbap as b
on avbeln = bvbeln
for all entries in itab where avbeln = itab-vgbel and bposnr = itab-vgpos.
endif.
loop at itab.
read table itab1 with key vbeln = itab-vgbel posnr = itab-vgpos.
if sy-subrc <> 0.
delete itab index sy-tabix.
endif.
endloop.
Now ITAB will have only deliveries created against Sales orders.
reward points if useful
regards,
Anji -
Where Can the Sample Code for That Balloon Game Demoed on WWDC for Swift Be Downloaded
Hi. I can't find the balloon game sample code used in the WWDC in the Sample Code for iOS or OS X (assuming it's available for download). If it is available for download by Apple, where can it be downloaded?
Thank you in advance.
God bless, Cor. 13The assets are in the .playground file's file package. Select the .playground file in the Finder, right-click, and choose Show Package Contents to browse the file package. The graphics files are in the Resources folder inside the file package.
-
Do you have any sample program for HRPIQ00AUTHORITY Badi [ urgent]
do you have any sample program for HRPIQ00AUTHORITY Badi and would be appreciated if you have over t me.
regards,
jin dalThanks for the help.
-
Exception in running the sample code for XA
Hi,
I'm trying out sample code for XA with Two-phase commit operation - X4.java provided in "Oracle8i JDBC Developer's Guide and Reference"
http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/a83724/samapp9.htm#1012235
I'm getting the following exception.
java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00201: identifier 'JAVA_XA.XA_START' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1900)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:407)
at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:156)
at orajta.XA4.main(XA4.java:126)
oracle.jdbc.xa.OracleXAException
at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:498)
at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:190)
at orajta.XA4.main(XA4.java:126)
What's the reason for the above exception and can someone help me with a possible fix for the same? Your help is greatly appreciated.
Thanks,
HajaHi,
I dont have access to a 8i db, but i ran the sample between two oracle9i db and it ran successfully.
Regards
Elango. -
Sample code for Org Management
Hi,
I am new to Org Management coding in HR ABAP.
Can anybody post some simple sample code for Org. Management so that I can understand the flow of coding..
Thanks and Regards,
RamHi
see the sample code using Orgn management infotypes like HRP1000 etc
report zporgr0040
line-size 108
line-count 60(1)
no standard page heading
message-id zndc.
Database Tables
tables: hrp1001, " HR Master Record (Orgn. Assignment)
pa0002, " Personal Data
t528t, " Position Texts
t527x, " Org Unit Text
t528b, " Positions
csks, " Cost Center
cskt. " Cost Center Texts
Declaration of Internal Tables
Internal Table for Orgn Object Data HRP1000
data: begin of obj_tab occurs 0,
otype like hrp1000-otype, " Object Type
objid like hrp1000-objid, " Object ID
plvar like hrp1000-plvar, " Plan Version
istat like hrp1000-istat, " Planning Status
begda like hrp1000-begda, " Begin date
endda like hrp1000-endda, " End date
end of obj_tab.
Internal Table for Active Employees data PA0000
data: begin of stat_tab occurs 0,
pernr like pa0000-pernr, " Object Type
begda like pa0000-begda, " Begin date
endda like pa0000-endda, " End date
stat2 like pa0000-stat2, " Employment Status
end of stat_tab.
Internal Table for Actual Orgn Assignment Data PA0001
data: begin of act_tab occurs 0,
pernr like pa0001-pernr, " Object Type
begda like pa0001-begda, " Begin date
endda like pa0001-endda, " End date
kostl like pa0001-kostl, " Cost Center
orgeh like pa0001-orgeh, " Org Unit
plans like pa0001-plans, " Position
natio like pa0002-natio, " Nationality
end of act_tab.
Internal Table for Orgn Data HRP1001
data: begin of org_tab occurs 0,
otype like hrp1001-otype, " Object Type
objid like hrp1001-objid, " Object ID
plvar like hrp1001-plvar, " Plan Version
istat like hrp1001-istat, " Planning Status
begda like hrp1001-begda, " Begin date
endda like hrp1001-endda, " End date
subty like hrp1001-subty, " Sub Type
sclas like hrp1001-sclas, " Type of Related Object
sobid like hrp1001-sobid, " Id of Related Object
kostl like pa0001-kostl, " Cost Center
plstx like t528t-plstx, " Position Text
orgtx like t527x-orgtx, " Org Unit Text
end of org_tab.
Internal Table for Position Calculations
data: begin of org1_tab occurs 0,
kostl like pa0001-kostl, " Cost Center
objid like hrp1001-objid, " Object ID
end of org1_tab.
Internal Table for Position Calculations
data: begin of org2_tab occurs 0,
kostl like pa0001-kostl, " Cost Center
count type i, " No of Positions
end of org2_tab.
Internal Table for Actual Manpower Calculations
data: begin of act1_tab occurs 0,
kostl like pa0001-kostl, " Cost Center
natio like pa0002-natio, " Nationality
plans like pa0001-plans, " Position
end of act1_tab.
Internal Table for Actual Manpower Calculations(UAE)
data: begin of act2_tab occurs 0,
kostl like pa0001-kostl, " Cost Center
natio like pa0002-natio, " Nationality
end of act2_tab.
Internal Table for Actual Manpower Calculations(Others)
data: begin of act3_tab occurs 0,
kostl like pa0001-kostl, " Cost Center
natio like pa0002-natio, " Nationality
end of act3_tab.
Internal Table for Actual Manpower Calculations(UAE)
data: begin of act4_tab occurs 0,
kostl like pa0001-kostl, " Cost Center
count1 type i, " No of Positions(UAE)
end of act4_tab.
Internal Table for Actual Manpower Calculations(OTHERS)
data: begin of act5_tab occurs 0,
kostl like pa0001-kostl, " Cost Center
count2 type i, " No of Positions(Others)
end of act5_tab.
Internal Table for Vaccancies Data
data: begin of vac_tab occurs 0,
plvar like hrp1007-plvar, " Plan Version
otype like hrp1007-otype, " Object Type
objid like hrp1007-objid, " Object ID
istat like hrp1007-istat, " Planning Status
begda like hrp1007-begda, " Begin date
endda like hrp1007-endda, " End date
vacan like hrp1007-vacan, " Vacancy Indicator
status like hrp1007-status, " Status of Vacancy
end of vac_tab.
Internal Table to store the Report Output data
data : begin of rep_tab occurs 0 ,
kostl(10) type n, " Cost Cente
plans like pa0001-plans, " Position
vacan like hrp1007-vacan, " Vacancy Indicator
status like hrp1007-status, " Status of Vacancy
plstx like t528t-plstx, " Position Text
orgtx like t527x-orgtx, " Org Unit Text
end of rep_tab.
Internal Table to store the Report Output data
data : begin of rep1_tab occurs 0 ,
kostl(10) type n, " Cost Cente
cnt type i, " No of Vacancies
end of rep1_tab.
Internal Table to store the Report Output data
data : begin of rep2_tab occurs 0 ,
kostl(10) type n, " Cost Cente
app_no type i, " Approved
nat_no type i, " National
exp_no type i, " Expatriate
tot_no type i, " Total
vac_no type i, " Vacancies
end of rep2_tab.
Declaration of Variables
data: v_sobid like hrp1001-sobid, " Object Id
v_sobid1 like hrp1001-sobid, " Object Id
v_sobid2 like hrp1001-sobid, " Object Id
v_sclas like hrp1001-sclas, " Related Obj Type
v_subty like hrp1001-subty, " Related Object Id
v_otype like hrp1007-otype, " Object Type
v_str(9) type c, " Text
v_str1(10) type c, " Text
v_cnt like sy-tabix. " Table Index
Declaration of Constants
constants : c_x type c value 'X', " Flag
c_stat1 like pa0000-stat2 value '3', " Emp Status
c_plan like hrp1001-plvar value '01', " Plan Version
c_name like hrp1000-uname value 'SAP', " Uname
c_uae like pa0002-natio value 'AE', " Country
c_type like hrp1007-otype value 'O', " Object Type
c_otype like hrp1007-otype value 'S', " Object Type
c_stat like hrp1007-status value '0', " Status
c_pstat like hrp1007-istat value '1', " Plang Status
c_sclas like hrp1001-sclas value 'K', " Rel. Obj Type
c_subty like hrp1001-subty value 'A002', " Related ObjId
c_subty2 like hrp1001-subty value 'A003', " Related ObjId
c_sclas1 like hrp1001-sclas value 'O', " Rel.Obj Type
c_subty1 like hrp1001-subty value 'A011', " Rel.Object Id
c_kokrs like coej-kokrs value '1000'. " Controlling Area
Selection Screen
selection-screen begin of block b1 with frame title text-001.
parameters :
p_date like pa0001-begda obligatory default sy-datum. " Date
select-options :
s_kostl for csks-kostl, " Cost Center
s_plans for t528b-plans. " Position ID
selection-screen end of block b1.
At selection-screen
at selection-screen.
Validate the Selection Screen fields
perform validate_screen.
Start-of-Selection
start-of-selection.
Get the Orgn data from database Table HRP1001
perform get_org_data.
Get the Actual Manpower from PA0001
perform get_act_data.
Get the Vaccancies data from database Table HRP1007
perform get_vac_data.
Append the data into final Internal Table
perform append_data.
Top-of-page
top-of-page.
Write the Report and Column Headings
perform top_of_page.
End-of-Page
end-of-page.
write /1(108) sy-uline.
End-of-Selection
end-of-selection.
Display the Output Report.
perform display_report.
Form-Routines
*& Form validate_screen
Validation of selection Screen fields
form validate_screen.
Validation of Position ID
clear t528b.
if not s_plans[] is initial.
select single plans
into t528b-plans
from t528b
where plans in s_plans.
if sy-subrc <> 0.
message e999 with 'Invalid Position ID'(009).
endif.
endif.
Validation of Cost Center
clear csks.
if not s_kostl[] is initial.
select single kostl
into csks-kostl
from csks
where kostl in s_kostl.
if sy-subrc <> 0.
message e999 with 'Invalid Cost Center'(008).
endif.
endif.
endform. "validate_screen
*& Form get_org_data
Get the Orgn Data from Database Table HRP1001
form get_org_data.
v_str = 'Developee'(002).
v_str1 = 'Deployment'(003).
Select All the Positions from HRP1000
select otype " Object Type
objid " Object ID
plvar " Plan Version
istat " Planning Status
begda " Begin date
endda " End date
into table obj_tab
from hrp1000
where otype = c_otype and
plvar = c_plan and
istat = c_pstat and
begda le p_date and
endda ge p_date and
objid in s_plans and
uname ne c_name.
sort obj_tab by otype objid.
Get the Orgn and Cost Center for all the above Positions
if not obj_tab[] is initial.
select otype " Object Type
objid " Object ID
plvar " Plan Version
istat " Planning Status
begda " Begin date
endda " End date
subty " Sub Type
sclas " Type of Related Object
sobid " Id of Related Object
into table org_tab
from hrp1001
for all entries in obj_tab
where otype = c_otype and
plvar = c_plan and
istat = c_pstat and
begda le p_date and
endda ge p_date and
sclas eq c_sclas1 and
subty eq c_subty2 and
objid eq obj_tab-objid.
endif.
sort org_tab by otype objid.
Get the Cost Center
loop at org_tab.
v_otype = c_otype. " S
v_sclas = c_sclas. " K
v_subty = c_subty1. " A011
v_sobid = org_tab-objid.
perform get_org using v_otype v_sclas v_subty
v_sobid.
if sy-subrc = 0.
org_tab-kostl = hrp1001-sobid+0(10).
else.
v_otype = c_otype. " S
v_sclas = c_sclas1. " O
v_subty = c_subty2. " A003
v_sobid = org_tab-objid.
perform get_org using v_otype v_sclas v_subty
v_sobid.
if sy-subrc = 0.
v_otype = c_type. " O
v_sclas = c_sclas. " K
v_subty = c_subty1. " A011
v_sobid1 = v_sobid.
perform get_org using v_otype v_sclas v_subty
v_sobid.
if sy-subrc <> 0.
v_otype = c_type. " O
v_sclas = c_sclas1. " O
v_subty = c_subty. " A002
v_sobid = v_sobid1.
perform get_org using v_otype v_sclas v_subty
v_sobid.
if sy-subrc = 0.
v_otype = c_type. " O
v_sclas = c_sclas. " K
v_subty = c_subty1. " A011
v_sobid2 = v_sobid.
perform get_org using v_otype v_sclas v_subty
v_sobid.
if sy-subrc <> 0.
v_otype = c_type. " O
v_sclas = c_sclas1. " O
v_subty = c_subty. " A002
v_sobid = v_sobid2.
perform get_org using v_otype v_sclas v_subty
v_sobid.
else.
org_tab-kostl = hrp1001-sobid+0(10).
endif.
endif.
else.
org_tab-kostl = hrp1001-sobid+0(10).
endif.
else.
v_otype = c_otype. " S
v_sclas = c_otype. " S
v_subty = c_subty. " A002
v_sobid = org_tab-objid.
perform get_org using v_otype v_sclas v_subty
v_sobid.
if sy-subrc = 0.
v_otype = c_otype. " S
v_sclas = c_sclas. " K
v_subty = c_subty1. " A011
v_sobid1 = v_sobid.
perform get_org using v_otype v_sclas v_subty
v_sobid.
if sy-subrc <> 0.
v_otype = c_otype. " S
v_sclas = c_sclas1. " O
v_subty = c_subty2. " A003
v_sobid = v_sobid1.
perform get_org using v_otype v_sclas v_subty
v_sobid.
if sy-subrc = 0.
v_otype = c_type. " O
v_sclas = c_sclas. " K
v_subty = c_subty1. " A011
v_sobid2 = v_sobid.
perform get_org using v_otype v_sclas v_subty
v_sobid.
if sy-subrc <> 0.
v_otype = c_type. " O
v_sclas = c_sclas1. " O
v_subty = c_subty. " A002
v_sobid = v_sobid2.
perform get_org using v_otype v_sclas v_subty
v_sobid.
else.
org_tab-kostl = hrp1001-sobid+0(10).
endif.
endif.
else.
org_tab-kostl = hrp1001-sobid+0(10).
endif.
endif.
endif.
endif.
Get the Position Text
clear t528t.
select single plstx from t528t into t528t-plstx
where sprsl = sy-langu and
otype = c_otype and
plans = org_tab-objid.
org_tab-plstx = t528t-plstx.
Get the Org Unit Text
clear t527x.
select single orgtx from t527x into t527x-orgtx
where sprsl = sy-langu and
orgeh = org_tab-sobid+0(8).
org_tab-orgtx = t527x-orgtx.
modify org_tab index sy-tabix.
clear v_sobid.
endloop.
sort org_tab by otype objid.
Calculate the Approved No of Positions
loop at org_tab.
if org_tab-kostl in s_kostl.
move-corresponding org_tab to org1_tab.
append org1_tab.
clear org1_tab.
endif.
endloop.
sort org1_tab by kostl objid.
clear v_cnt.
loop at org1_tab.
at end of kostl.
sy-tabix = sy-tabix - v_cnt.
org2_tab-kostl = org1_tab-kostl.
org2_tab-count = sy-tabix.
v_cnt = v_cnt + sy-tabix.
append org2_tab.
clear:org2_tab.
endat.
endloop.
sort org2_tab by kostl.
endform. "get_org_data
*& Form get_act_data
Get the Actual Manpower Data from Database Table PA0001
form get_act_data.
clear : stat_tab, act_tab.
refresh: stat_tab, act_tab.
Get all the Active Employees
select pernr " Object Type
begda " Begin date
endda " End date
stat2 " Emp Status
into table stat_tab
from pa0000
where stat2 eq c_stat1 and
begda le p_date and
endda ge p_date.
sort act_tab by pernr.
if not stat_tab[] is initial.
select pernr " Object Type
begda " Begin date
endda " End date
kostl " Cost Center
orgeh " Org Unit
plans " Position
into table act_tab
from pa0001
for all entries in stat_tab
where pernr eq stat_tab-pernr and
kostl in s_kostl and
plans in s_plans and
persg eq '1' and
begda le p_date and
endda ge p_date.
endif.
sort act_tab by pernr.
loop at act_tab.
move-corresponding act_tab to act1_tab.
clear pa0002-natio.
select single natio into pa0002-natio from pa0002
where pernr = act_tab-pernr.
if sy-subrc = 0.
act1_tab-natio = pa0002-natio.
endif.
append act1_tab.
clear act1_tab.
endloop.
sort act1_tab by kostl natio.
Calculate the Local and Expatriate Manpower
loop at act1_tab.
if act1_tab-natio = c_uae.
act2_tab-kostl = act1_tab-kostl.
act2_tab-natio = act1_tab-natio.
else.
act3_tab-kostl = act1_tab-kostl.
act3_tab-natio = act1_tab-natio.
endif.
append: act2_tab, act3_tab.
clear : act2_tab,act3_tab.
endloop.
sort act2_tab by kostl.
sort act3_tab by kostl.
Actual UAE Manpower
clear v_cnt.
loop at act2_tab.
at end of kostl.
sy-tabix = sy-tabix - v_cnt.
act4_tab-kostl = act2_tab-kostl.
act4_tab-count1 = sy-tabix.
v_cnt = v_cnt + sy-tabix.
append act4_tab.
clear:act4_tab.
endat.
endloop.
sort act4_tab by kostl.
Other Countries
clear v_cnt.
loop at act3_tab.
at end of kostl.
sy-tabix = sy-tabix - v_cnt.
act5_tab-kostl = act3_tab-kostl.
act5_tab-count2 = sy-tabix.
v_cnt = v_cnt + sy-tabix.
append act5_tab.
clear:act5_tab.
endat.
endloop.
sort act5_tab by kostl.
endform. "get_act_data
*& Form get_org
Get the Cost Center from Parent Org Id
form get_org using p_v_otype p_v_sclas p_v_subty p_v_sobid.
clear hrp1001.
select single * from hrp1001
where otype = p_v_otype and
plvar = c_plan and
istat = c_pstat and
begda le p_date and
endda ge p_date and
sclas eq p_v_sclas and
subty eq p_v_subty and
objid eq p_v_sobid.
v_sobid = hrp1001-sobid+0(8).
endform. " get_org
*& Form get_vac_data
Get the Vaccancies Data from Database Table HRP1007
form get_vac_data.
if not org_tab[] is initial.
select plvar " Plan Version
otype " Object Type
objid " Object ID
istat " Planning Status
begda " Begin date
endda " End date
vacan " Vacancy Indicator
status " Status of Vacancy
into table vac_tab
from hrp1007
for all entries in org_tab
where plvar = c_plan and
otype = c_otype and
istat eq c_pstat and
objid = org_tab-objid and
begda le p_date and
endda ge p_date and
vacan eq c_x and
status eq c_stat.
endif.
sort vac_tab by plvar otype objid.
Get the HR data into the rep_tab Internal Table
loop at vac_tab.
rep_tab-plans = vac_tab-objid.
rep_tab-vacan = vac_tab-vacan.
rep_tab-status = vac_tab-status.
read table org_tab with key objid = vac_tab-objid.
if sy-subrc = 0.
rep_tab-kostl = org_tab-kostl.
rep_tab-plstx = org_tab-plstx.
rep_tab-orgtx = org_tab-orgtx.
endif.
append rep_tab.
clear rep_tab.
endloop.
loop at rep_tab.
if not rep_tab-kostl in s_kostl.
delete rep_tab index sy-tabix.
endif.
endloop.
sort rep_tab by kostl plans.
delete rep_tab where plstx cs v_str.
delete rep_tab where orgtx cs v_str1.
Calculate the Count of Vacancies in each Division
clear v_cnt.
loop at rep_tab.
at end of kostl.
sy-tabix = sy-tabix - v_cnt.
rep1_tab-kostl = rep_tab-kostl.
rep1_tab-cnt = sy-tabix.
v_cnt = v_cnt + sy-tabix.
append rep1_tab.
clear:rep1_tab.
endat.
endloop.
sort rep1_tab by kostl.
endform. "get_vac_data
*& Form append_data
Append the data into final Internal Table
form append_data.
loop at org2_tab.
rep2_tab-kostl = org2_tab-kostl.
rep2_tab-app_no = org2_tab-count.
read table act4_tab with key kostl = org2_tab-kostl
binary search.
if sy-subrc = 0.
rep2_tab-nat_no = act4_tab-count1.
endif.
read table act5_tab with key kostl = org2_tab-kostl
binary search.
if sy-subrc = 0.
rep2_tab-exp_no = act5_tab-count2.
endif.
read table rep1_tab with key kostl = org2_tab-kostl
binary search.
if sy-subrc = 0.
rep2_tab-vac_no = rep1_tab-cnt.
endif.
rep2_tab-tot_no = rep2_tab-nat_no + rep2_tab-exp_no.
append rep2_tab.
clear rep2_tab.
endloop.
sort rep2_tab by kostl.
endform. "append_data
*& Form top_of_page
Write the Report and Column Headings
form top_of_page.
skip.
format color col_heading on.
write: /1(108) 'NATIONAL DRILLING COMPANY'(010) centered,
/1(108) 'Summary of Manning Level Report'(011) centered.
format color off.
skip.
write: /2 'Key Date :'(013), p_date,
75 'Report Run Date:'(041), sy-datum.
if not s_kostl[] is initial.
if s_kostl-high is initial.
write: /2 'Cost Center :'(023), s_kostl-low,
75 'Time :'(042), sy-uzeit.
else.
write: /2 'Cost Center From:'(024), s_kostl-low+7(3),
'To'(022), s_kostl-high,
75 'Time :'(042), sy-uzeit.
endif.
else.
write: /75 'Time :'(042), sy-uzeit.
endif.
if not s_plans[] is initial.
if s_plans-high is initial.
write: /2 'Position Id :'(019), s_plans-low,
75 'User :'(043), sy-uname.
else.
write: /2 'Position Id From:'(021), s_plans-low,
'To'(022), s_plans-high,
75 'User :'(043), sy-uname.
endif.
else.
write: /75 'User :'(043), sy-uname.
endif.
write: /75 'Page No :'(044), sy-pagno.
skip.
write /1(108) sy-uline.
format color col_heading.
write:/1 sy-vline,
12 sy-vline, 53 sy-vline,
64 sy-vline, 65(32) 'Actual'(018) centered,
97 sy-vline,108 sy-vline.
write:/1 sy-vline, 2(10) 'CostCenter'(014),
12 sy-vline, 13(40) 'Description'(026) centered,
53 sy-vline, 54(10) 'Approved'(025) centered,
64 sy-vline, 65(32) sy-uline,
97 sy-vline, 98(10) 'Vacancies'(017),
108 sy-vline.
write:/1 sy-vline,
12 sy-vline, 53 sy-vline,
64 sy-vline, 65(10) 'National'(015) centered,
75 sy-vline, 76(10) 'Expatriate'(020) centered,
86 sy-vline, 87(10) 'Total'(016) centered,
97 sy-vline,108 sy-vline.
format color off.
write /1(108) sy-uline.
endform. "top_of_page
*& Form Display_report
Write the Report Output
form display_report.
if rep2_tab[] is initial.
message i999 with
'No Data found for the entered Selection'(035).
else.
loop at rep2_tab.
Authorization Check for the Orgn and Cost Centers
perform auth_check_org.
if sy-subrc = 0.
clear cskt.
select single ltext into cskt-ltext from cskt
where spras = sy-langu and
kokrs = c_kokrs and
kostl = rep2_tab-kostl.
format color col_normal.
write: /1 sy-vline, 2(10) rep2_tab-kostl+7(3),
12 sy-vline, 13(40) cskt-ltext,
53 sy-vline, 54(10) rep2_tab-app_no,
64 sy-vline, 65(10) rep2_tab-nat_no,
75 sy-vline, 76(10) rep2_tab-exp_no,
86 sy-vline, 87(10) rep2_tab-tot_no,
97 sy-vline, 98(10) rep2_tab-vac_no,
108 sy-vline.
format color off.
at last.
sum.
format color 3.
write /1(108) sy-uline.
write: /1 sy-vline, 2(10) 'Total'(027),
12 sy-vline,
53 sy-vline, 54(10) rep2_tab-app_no,
64 sy-vline, 65(10) rep2_tab-nat_no,
75 sy-vline, 76(10) rep2_tab-exp_no,
86 sy-vline, 87(10) rep2_tab-tot_no,
97 sy-vline, 98(10) rep2_tab-vac_no,
108 sy-vline.
format color off.
endat.
endif.
endloop.
endif.
write /1(108) sy-uline.
endform. " Display_report
*& Form auth_check_org
Authorization Check for the Orgn and Cost Center
form auth_check_org.
authority-check object 'ZNDCHROM'
id 'PLVAR' dummy
id 'OTYPE' dummy
id 'KOSTL' field rep2_tab-kostl.
endform. "auth_check_org
<b>Reward points for useful Answers</b>
Regards
Anji
Maybe you are looking for
-
At home I have two Macs, one for work and another which acts as a sort of entertainment hub storing all my music, podcasts and videos as well as being for the family to use. Is it possible to sync my one iPhone to both Macs, with the work one just sy
-
Ipad 1 and iOS5 find my iPad no longer working
Since upgrading to iOS5 my iPad 1 can't be found using "Find my iPad" via iCloud. The find option is switched on in the settings panel, and location services are also on. There's no problem with finding my location on the map though, so I don't think
-
hi iam satya sri completed my mba in fianace . now iam new to sap fi/co module .i wamt a help from any one how to go through this module. please help in this aspect.
-
Hi all Tried to install Flashpaper 2 (trial) and while it says it's installed successfully I get the Flashprinter not installed msg, I have checked teh printer and teh port for flashprinter is checked , I have no icon or flashpaper access via MS Word
-
A must read. http://www.javaworld.com/javaworld/jw-02-2001/jw-0223-extremescale.html Quote: "Overall BEA WebLogic Server 6.0 has the most robust and well thought-out clustering implementation. HP Bluestone Tota