ABAP programming concept
I have created a program with its name not beginning with letter 'z' or 'y' and it ran perfectly without any error. Though it prompted error in other cases as in objects, structures etc.So i want to know what can be the cause of it? Is it a bug in the software.? Please explain. I repeat it is only the case with the program name and not anything else?
No problem, we were all beginners at one time.
MY... and MZ... are actually in the customer name range, these are supposed to be includes for module pools SAPMY... and SAPMZ...
Thomas
P.S. [check this out|http://help.sap.com/saphelp_nw70/helpdata/EN/2a/6b0b1f547a11d189600000e829fbbd/frameset.htm]
Similar Messages
-
Hi Masters,
Can you please let me know the perfect reason for infotypes concept in HR-ABAP.
1 Why we are using infotypes and exactly what is purpose?
2.Why we are using LDB's why cannot we extract data directly from database tables?
3.Can you please give me clear explanations about these infotypes.Hi
Infotype(s) are used in the Personnel Management (PA) module primarily. This is where personnel master data is stored. Data is grouped according to subject matter. The Human Resources component aims to enable the user to process employee data in an effective structure in accordance with business requirements. The data structure of infotypes mirrors a logical set of data records. Infotypes can be identified by their four-digit keys, for example, the Addresses infotype (0006). To facilitate reporting on past employee data, infotypes can be saved for specific periods.
Some people use the term HR ABAP to describe the method of managing the infotype data. Typically HR logical databases are used which offers more secure methods of accessing the infotype data. Once the infotypes are declared, you can use standard macros to access the data. Table TRMAC holds the macro name and the code behind it. This makes developing HR programs much quicker and easy to turn around.
HR uses INFOTYPES instead of tables.
There are different sub modules exist in HR.
For Personal Admn the Infotypes start with PA0000 to PA1999
Time Related Infotypes start with PA2000 to PA2999.
Orgn related Infotypes start with HRP1000 to HRP1999.
All custom developed infotypes stsrat with PA9000 onwards.
In payroll processing we use Clusters like PCL1,2,3 and 4.
Instead of Select query we use PROVIDE and ENDPROVIDE..
You have to assign a Logical Database in the attributes PNP.
Go through the SAp doc for HR programming and start doing.
http://www.sapdevelopment.co.uk/hr/hrhome.htm
See:
http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
http://help.sap.com/saphelp_47x200/helpdata/en/bb/bdb041575911d189240000e8323d3a/frameset.htm
see this link you would get information about types of infotypes
Logical databases are special ABAP programs that retrieve data and make it available toapplication programs. The most common use of logical databases is still to read data fromdatabase tables by linkin them to executable ABAP programs.
Logical databases contain Open SQL statements that read data from the database.You do not therefore need to use SQL in your own programs. The logical database reads theprogram, stores them in the program if necessary, and then passes them line by line to theapplication program or the function module LDB_PROCESS using an interface work area .
For further info
check link http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm
1. A logical database is in fact
a program only.
2. This LDB provides two main things :
a) a pre-defined selection screen
which handles all user inputs and validations
b) pre defined set of data
based upon the user selection.
3. So we dont have to worry about from
which tables to fetch data.
4. Moreover, this LDB Program,
handles all user-authorisations
and is efficient in all respects.
5. tcode is SLDB.
/people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases
<b>REward fi suefull</b> -
How to Revoke an older request of an ABAP program
Dear All,
I wish an older version (before the last three modifications) of my ABAP program to be revoked on the production server. In other words I wish an older request of my current program to overwrite the current request, in between these two requests there are three more requests.
Please tell how to go about it.
Regards,
Alok.Hi...
You can get back the Older Version....
If your program is deleted, but a version of it still exists.....
then go to <b>Utilities---->Versions----->Version Management</b>
There you can find all the Versions of your deleted program....of which choose any one version you want to retrieve....( check that checkbox ) and click on the retrieve pushbutton.. You will get a pop window....
Indicating that
The current version of the program
will be overwritten by an older version
This only applies to source code
Before it is overwritten, a temporary
version will be created.
So you just press enter on this window.....
Go back to SE38 and give the Program Name, an Inactive Version is retained...
You can now activate that and use it.....
This is the way how you can revert the changes made by you.....
Generally the concept of Version Management is very helpful whenever you go for Upgradation say for example from 4.6c to ECC 6.
Hope this solves your problem....
Reward if it helps you..... -
ABAP program to load an infocube
Hello All,
I am new to BW and have learnt the basic concepts only. I now have to write an ABAP program to load one of the infocube after receiving the data in the form of a flat file from an external system. Any ideas on how I can go about this will be greatly appreciated and rewarded! Thanks in advance.
Regards
VeenaHi,
I guess you can try to raise an event to trigger the PC or IP to load the cube.
You should raise the event through your ABAP code and schedule the PC or IP to run once this event is raised.
Create event in tcode SM62
Use FM: BP_EVENT_RAISE to raise an event
Use after event in the start variant of the process chain.
You create user events in SM62. In SM62, next to "User even names", click on Maintain and press Enter. Click on the Create icon to create a new event (let's call it ZEVENT).
Next, in your process chain, change the Start variant to be scheduled "After event", and put in ZEVENT for the event name. Also, click on the "Periodic job" at the bottom. This will automatically reschedule the jobs for the process chain after it executes.
Next, create an ABAP program (let's call it Z_EVENT_RAISE) to call the function module BP_EVENT_RAISE. You're code can look like this:
codeREPORT Z_EVENT_RAISE.
PARAMETERS: P_EVENT LIKE TBTCO-EVENTID.
CALL FUNCTION 'BP_EVENT_RAISE'
EXPORTING
EVENTID = P_EVENT.
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.[/code]
This ABAP program will prompt for an event name, so you will need to create a variant (let's call it ZEVENT) which will save the value of the event name (also ZEVENT). You will need the variant name to be able to trigger the event in a batch job.
Now all you need is the batch job. Use tcode SM36 to create a batch job where you call the ABAP program (Z_EVENT_RAISE) using the variant (ZEVENT).
Raise an event to trigger process chain in BI
http://sapbwneelam.blogspot.com/2007/09/how-to-start-process-chain-through.html
how do we raise an event to trigger process chain in BI
Hope this helps.
Thanks,
JituK -
can any one help as in at freshers level how much of java programing is needed as in in details which all topics and where do u use later, i just know basics of abap.......
Message was edited by: anu rajI think java will come in handy if you are developing Netweaver portals applications using Web dynpro java or jspdynpage applications. In the latter, it is very important to know java very well. With web dynpro, a lot of the coding is hidden from you, but you still need to know the basics of java and oo programming concepts.
I noticed that you have already marked your post as "solved on my own". I would suggest reversing that unitll your question has been answered completely. When people see the blue star, then usually don't bother to read the post, hence limiting your answers.
Once your question has been answered, award point accorindly. Welcome to SDN!!
Regards,
Rich Heilman -
Documentation in ABAP Programming for ECC 6.0
Can Anybody tell me how to do documentation in ABAP Programming in SAP ecc 6.0
What are the options there ?
Also please let me know if there is a concept called "C DOCS".
Thanks
NareshHI,
In se38 ..give ur program name.
In menu Goto --> Documentation --> Change.
and press save.
Thanx
bgan. -
How to call ABAP programs from Excel
Hello everyone,
Currently I'm investigating the integration of Excel and ABAP program. I find it's easy to call Excel from ABAP program, but does anyone of you know how I can first open and do some actions in an Excel sheet first, and then, for example, when I press the save button, the data will be transferred back to ABAP system? I think when openning the Excel, the logon of the backend system is needed.
I've ever seen this functionality in some BW-reporting tools, but I cannot remember the details.
Thank you very much and best regards,
Leonyes in BW we are having this concept of creating wookbooks & queries.
If u have BW server Go to Transaction RRMX - u will get a Microsoft Excel sheet.
Here it allows u to logon to the SAP system.
For details see this link.
<a href="https://forums.sdn.sap.com/click.jspa?searchID=561476&messageID=2553631">https://forums.sdn.sap.com/click.jspa?searchID=561476&messageID=2553631</a>
<a href="https://forums.sdn.sap.com/click.jspa?searchID=561476&messageID=519862">https://forums.sdn.sap.com/click.jspa?searchID=561476&messageID=519862</a> -
Download/Upload ABAP Programs, screens, texts, etc
Hi Experts,
Is there any standard program or any tool by which we can download/ upload ABAP programs, sapscripts, Screens, text-elements, Webdynpro for ABAP applications to a local file????
The Download to local server option in SE38 just gives a text copy of program without any screens, text eleemnts, etc which is not as per my requirement.
Points will be rewarded.
Regards,
Mansi.use This
REPORT ZDOWNLOAD.
*& Report ZDOWNLAOD
I N F O R M A T I O N *
Module :
FUNCTIONAL :
Developer :
Functional Spec# :
Date Of Creation :
Transport Request# :
Program NAME :
Transaction Code :
DEVELOPMENT CLASS :
DESCRIPTION :
Change History
FUNCTIONAL :
Developer :
Functional Spec# :
Date Of Change :
Transport Request# :
Change DESCRIPTION :
*======================================================================================================================
Direct Download Enterprise version 1.3.1.
THIS SOFTWARE IS FOR PERSONAL USE ONLY.
THIS PROGRAM IS FREEWARE AND IS PROVIDED ON AN AS-IS BASIS WITHOUT WARRANTY OF ANY KIND.
THE PROVIDER SPECIFICALLY DISCLAIMS ANY OTHER WARRANTY, EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY
OR FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL THE PROVIDER BE LIABLE FOR ANY CONSEQUENTIAL, INDIRECT, SPECIAL OR INCIDENTAL DAMAGES, EVEN IF PROVIDER
HAS BEEN ADVISED BY CLIENT OF THE POSSIBILITY OF SUCH POTENTIAL LOSS OR DAMAGE.
CLIENT AGREES TO HOLD PROVIDER HARMLESS FROM AND AGAINST ANY AND ALL CLAIMS, LOSSES, LIABILITIES AND EXPENSES. BY
INSTALLING OR RUNNING THIS PROGRAM YOU ARE AGREEING TO THE TERMS AND CONDITONS STATED ABOVE.
PROGRAM DESCRIPTION & USE
Allows a user to download programs, Functions, DD definitions, etc to the presentation server. This version searches
recursively for nested includes and function modules, and allows you to download the resulting code as standard text
or HTML web pages within a suitable directory structure.
You can either search by object name, using wildcards if you wish, or a combination of Author and object name. If
you want all objects returned for a particular author then select the author name and choose the most suitable
radiobutton. All objects will be returned if the fields to the right hand side of the radiobutton are left completely
blank.
Compatible with R/3 Enterprise only, for older versions of SAP you will need Direct Download version 5.xx.
This version removes the programming limitations imposed by developing across SAP releases 3 to 4.6.
In order to be able to download files to the SAP server you must first set up a logical filepath within transaction
'FILE', or use an existing one. You must also create a external operating system command in SM69 called ZMKDIR. This
will then be used to create any directories needed on the SAP server
This program is intended to allow a person to keep a visual representation of a program for backup purposes only as
has not been designed to allow programs to be uploaded to SAP systems.
author : E.G.Mellodew
program cont
SAP Tables
TABLES: TRDIR, SEOCLASS, TFDIR, ENLFDIR, DD02L.
Types
text element structure
TYPES: TTEXTTABLE LIKE TEXTPOOL.
GUI titles
TYPES: TGUITITLE LIKE D347T.
Message classes
TYPES: BEGIN OF TMESSAGE,
ARBGB LIKE T100-ARBGB,
STEXT LIKE T100A-STEXT,
MSGNR LIKE T100-MSGNR,
TEXT LIKE T100-TEXT,
END OF TMESSAGE.
Screen flow.
TYPES: BEGIN OF TSCREENFLOW,
SCREEN LIKE D020S-DNUM,
CODE LIKE D022S-LINE,
END OF TSCREENFLOW.
Holds a table\structure definition
TYPES: BEGIN OF TDICTTABLESTRUCTURE,
FIELDNAME LIKE DD03L-FIELDNAME,
POSITION LIKE DD03L-POSITION,
KEYFLAG LIKE DD03L-KEYFLAG,
ROLLNAME LIKE DD03L-ROLLNAME,
DOMNAME LIKE DD03L-DOMNAME,
DATATYPE LIKE DD03L-DATATYPE,
LENG LIKE DD03L-LENG,
DDTEXT LIKE DD04T-DDTEXT,
END OF TDICTTABLESTRUCTURE.
Holds a tables attributes + its definition
TYPES: BEGIN OF TDICTTABLE,
TABLENAME LIKE DD03L-TABNAME,
TABLETITLE LIKE DD02T-DDTEXT,
ISTRUCTURE TYPE TDICTTABLESTRUCTURE OCCURS 0,
END OF TDICTTABLE.
Include program names
TYPES: BEGIN OF TINCLUDE,
INCLUDENAME LIKE TRDIR-NAME,
INCLUDETITLE LIKE TFTIT-STEXT,
END OF TINCLUDE.
Exception class texts
TYPES: BEGIN OF TCONCEPT,
CONSTNAME TYPE STRING,
CONCEPT TYPE SOTR_CONC,
END OF TCONCEPT.
Method
TYPES: BEGIN OF TMETHOD,
CMPNAME LIKE VSEOMETHOD-CMPNAME,
DESCRIPT LIKE VSEOMETHOD-DESCRIPT,
EXPOSURE LIKE VSEOMETHOD-EXPOSURE,
METHODKEY TYPE STRING,
END OF TMETHOD.
Class
TYPES: BEGIN OF TCLASS,
SCANNED(1),
CLSNAME LIKE VSEOCLASS-CLSNAME,
DESCRIPT LIKE VSEOCLASS-DESCRIPT,
MSG_ID LIKE VSEOCLASS-MSG_ID,
EXPOSURE LIKE VSEOCLASS-EXPOSURE,
STATE LIKE VSEOCLASS-STATE,
CLSFINAL LIKE VSEOCLASS-CLSFINAL,
R3RELEASE LIKE VSEOCLASS-R3RELEASE,
IMETHODS TYPE TMETHOD OCCURS 0,
IDICTSTRUCT TYPE TDICTTABLE OCCURS 0,
ITEXTELEMENTS TYPE TTEXTTABLE OCCURS 0,
IMESSAGES TYPE TMESSAGE OCCURS 0,
ICONCEPTS TYPE TCONCEPT OCCURS 0,
TEXTELEMENTKEY TYPE STRING,
PUBLICCLASSKEY TYPE STRING,
PRIVATECLASSKEY TYPE STRING,
PROTECTEDCLASSKEY TYPE STRING,
TYPESCLASSKEY TYPE STRING,
EXCEPTIONCLASS TYPE I,
END OF TCLASS.
function modules
TYPES: BEGIN OF TFUNCTION,
FUNCTIONNAME LIKE TFDIR-FUNCNAME,
FUNCTIONGROUP LIKE ENLFDIR-AREA,
INCLUDENUMBER LIKE TFDIR-INCLUDE,
FUNCTIONMAININCLUDE LIKE TFDIR-FUNCNAME,
FUNCTIONTITLE LIKE TFTIT-STEXT,
TOPINCLUDENAME LIKE TFDIR-FUNCNAME,
PROGNAME LIKE TFDIR-PNAME,
PROGRAMLINKNAME LIKE TFDIR-PNAME,
MESSAGECLASS LIKE T100-ARBGB,
ITEXTELEMENTS TYPE TTEXTTABLE OCCURS 0,
ISELECTIONTEXTS TYPE TTEXTTABLE OCCURS 0,
IMESSAGES TYPE TMESSAGE OCCURS 0,
IINCLUDES TYPE TINCLUDE OCCURS 0,
IDICTSTRUCT TYPE TDICTTABLE OCCURS 0,
IGUITITLE TYPE TGUITITLE OCCURS 0,
ISCREENFLOW TYPE TSCREENFLOW OCCURS 0,
END OF TFUNCTION.
TYPES: BEGIN OF TPROGRAM,
PROGNAME LIKE TRDIR-NAME,
PROGRAMTITLE LIKE TFTIT-STEXT,
SUBC LIKE TRDIR-SUBC,
MESSAGECLASS LIKE T100-ARBGB,
IMESSAGES TYPE TMESSAGE OCCURS 0,
ITEXTELEMENTS TYPE TTEXTTABLE OCCURS 0,
ISELECTIONTEXTS TYPE TTEXTTABLE OCCURS 0,
IGUITITLE TYPE TGUITITLE OCCURS 0,
ISCREENFLOW TYPE TSCREENFLOW OCCURS 0,
IINCLUDES TYPE TINCLUDE OCCURS 0,
IDICTSTRUCT TYPE TDICTTABLE OCCURS 0,
END OF TPROGRAM.
Internal tables
Dictionary object
DATA: IDICTIONARY TYPE STANDARD TABLE OF TDICTTABLE WITH HEADER LINE.
Function modules.
DATA: IFUNCTIONS TYPE STANDARD TABLE OF TFUNCTION WITH HEADER LINE.
Tree display structure.
DATA: ITREEDISPLAY TYPE STANDARD TABLE OF SNODETEXT WITH HEADER LINE.
Message class data
DATA: IMESSAGES TYPE STANDARD TABLE OF TMESSAGE WITH HEADER LINE.
Holds a single message class an all of its messages
DATA: ISINGLEMESSAGECLASS TYPE STANDARD TABLE OF TMESSAGE WITH HEADER LINE.
Holds program related data
DATA: IPROGRAMS TYPE STANDARD TABLE OF TPROGRAM WITH HEADER LINE.
Classes
DATA: ICLASSES TYPE STANDARD TABLE OF TCLASS WITH HEADER LINE.
Table of paths created on the SAP server
DATA: ISERVERPATHS TYPE STANDARD TABLE OF STRING WITH HEADER LINE.
Table prototypes
DATA: DUMIDICTSTRUCTURE TYPE STANDARD TABLE OF TDICTTABLESTRUCTURE.
DATA: DUMITEXTTAB TYPE STANDARD TABLE OF TTEXTTABLE.
DATA: DUMIINCLUDES TYPE STANDARD TABLE OF TINCLUDE.
DATA: DUMIHTML TYPE STANDARD TABLE OF STRING.
DATA: DUMIHEADER TYPE STANDARD TABLE OF STRING .
DATA: DUMISCREEN TYPE STANDARD TABLE OF TSCREENFLOW .
DATA: DUMIGUITITLE TYPE STANDARD TABLE OF TGUITITLE.
DATA: DUMIMETHODS TYPE STANDARD TABLE OF TMETHOD.
DATA: DUMICONCEPTS TYPE STANDARD TABLE OF TCONCEPT.
Global objects
DATA: OBJFILE TYPE REF TO CL_GUI_FRONTEND_SERVICES.
DATA: OBJRUNTIMEERROR TYPE REF TO CX_ROOT.
Constants
CONSTANTS: VERSIONNO TYPE STRING VALUE '1.3.1'.
CONSTANTS: TABLES TYPE STRING VALUE 'TABLES'.
CONSTANTS: TABLE TYPE STRING VALUE 'TABLE'.
CONSTANTS: LIKE TYPE STRING VALUE 'LIKE'.
CONSTANTS: TYPE TYPE STRING VALUE 'TYPE'.
CONSTANTS: TYPEREFTO TYPE STRING VALUE 'TYPE REF TO'.
CONSTANTS: STRUCTURE TYPE STRING VALUE 'STRUCTURE'.
CONSTANTS: LOWSTRUCTURE TYPE STRING VALUE 'structure'.
CONSTANTS: OCCURS TYPE STRING VALUE 'OCCURS'.
CONSTANTS: FUNCTION TYPE STRING VALUE 'FUNCTION'.
CONSTANTS: CALLFUNCTION TYPE STRING VALUE ' CALL FUNCTION'.
CONSTANTS: MESSAGE TYPE STRING VALUE 'MESSAGE'.
CONSTANTS: INCLUDE TYPE STRING VALUE 'INCLUDE'.
CONSTANTS: LOWINCLUDE TYPE STRING VALUE 'include'.
CONSTANTS: DESTINATION TYPE STRING VALUE 'DESTINATION'.
CONSTANTS: IS_TABLE TYPE STRING VALUE 'T'.
CONSTANTS: IS_PROGRAM TYPE STRING VALUE 'P'.
CONSTANTS: IS_SCREEN TYPE STRING VALUE 'S'.
CONSTANTS: IS_GUITITLE TYPE STRING VALUE 'G'.
CONSTANTS: IS_DOCUMENTATION TYPE STRING VALUE 'D'.
CONSTANTS: IS_MESSAGECLASS TYPE STRING VALUE 'MC'.
CONSTANTS: IS_FUNCTION TYPE STRING VALUE 'F'.
CONSTANTS: IS_CLASS TYPE STRING VALUE 'C'.
CONSTANTS: IS_METHOD TYPE STRING VALUE 'M'.
CONSTANTS: ASTERIX TYPE STRING VALUE '*'.
CONSTANTS: COMMA TYPE STRING VALUE ','.
CONSTANTS: PERIOD TYPE STRING VALUE '.'.
CONSTANTS: DASH TYPE STRING VALUE '-'.
CONSTANTS: TRUE TYPE I VALUE 1.
CONSTANTS: FALSE TYPE I VALUE 0.
CONSTANTS: LT TYPE STRING VALUE '<'.
CONSTANTS: GT TYPE STRING VALUE '>'.
CONSTANTS: UNIX TYPE STRING VALUE 'UNIX'.
CONSTANTS: NON_UNIX TYPE STRING VALUE 'not UNIX'.
CONSTANTS: BACKGROUND_COLOUR TYPE STRING VALUE '#FFFFE0'.
CONSTANTS: COLOUR_WHITE TYPE STRING VALUE '#FFFFFF'.
CONSTANTS: COLOUR_BLACK TYPE STRING VALUE '#000000'.
CONSTANTS: COLOUR_YELLOW TYPE STRING VALUE '#FFFF00'.
CONSTANTS: COMMENT_COLOUR TYPE STRING VALUE '#0000FF'.
CONSTANTS: HTMLEXTENSION TYPE STRING VALUE 'html'.
CONSTANTS: TEXTEXTENSION TYPE STRING VALUE 'txt'.
Global variables
DATA: STATUSBARMESSAGE(100).
DATA: FORCEDEXIT TYPE I VALUE 0.
DATA: STARTTIME LIKE SY-UZEIT.
DATA: RUNTIME LIKE SY-UZEIT.
DATA: DOWNLOADFILEEXTENSION TYPE STRING.
DATA: DOWNLOADFOLDER TYPE STRING.
DATA: SERVERSLASHSEPARATOR TYPE STRING.
DATA: FRONTENDSLASHSEPARATOR TYPE STRING.
DATA: SLASHSEPARATORTOUSE TYPE STRING.
DATA: SERVERFILESYSTEM TYPE FILESYS_D.
DATA: SERVERFOLDER TYPE STRING.
DATA: FRONTENDOPSYSTEM TYPE STRING.
DATA: SERVEROPSYSTEM TYPE STRING.
DATA: CUSTOMERNAMESPACE TYPE STRING.
RANGES: SOPROGRAMNAME FOR TRDIR-NAME.
RANGES: SOAUTHOR FOR USR02-BNAME.
RANGES: SOTABLENAMES FOR DD02L-TABNAME.
RANGES: SOFUNCTIONNAME FOR TFDIR-FUNCNAME.
RANGES: SOCLASSNAME FOR VSEOCLASS-CLSNAME.
RANGES: SOFUNCTIONGROUP FOR ENLFDIR-AREA.
FIELD-SYMBOLS: <WADICTSTRUCT> TYPE TDICTTABLE.
Selection screen declaration
Author
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TBLOCK1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(23) TAUTH.
PARAMETERS: PAUTH LIKE USR02-BNAME MEMORY ID MAUTH.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(36) TPMOD.
PARAMETERS: PMOD AS CHECKBOX.
SELECTION-SCREEN END OF LINE.
Local objects
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(36) T$TMP.
PARAMETERS: P$TMP AS CHECKBOX DEFAULT ''.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN: END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TBLOCK2.
Tables
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: RTABLE RADIOBUTTON GROUP R1.
SELECTION-SCREEN COMMENT 5(15) TRTABLE.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(15) TPTABLE.
SELECT-OPTIONS: SOTABLE FOR DD02L-TABNAME.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(79) TTNOTE.
SELECTION-SCREEN END OF LINE.
Message classes
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: RMESS RADIOBUTTON GROUP R1.
SELECTION-SCREEN COMMENT 5(18) TPMES.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(18) TMNAME.
PARAMETERS: PMNAME LIKE T100-ARBGB MEMORY ID MMNAME.
SELECTION-SCREEN END OF LINE.
Function modules
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: RFUNC RADIOBUTTON GROUP R1.
SELECTION-SCREEN COMMENT 5(30) TRFUNC.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(15) TPFNAME.
SELECT-OPTIONS: SOFNAME FOR TFDIR-FUNCNAME.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(15) TFGROUP.
SELECT-OPTIONS: SOFGROUP FOR ENLFDIR-AREA.
SELECTION-SCREEN END OF LINE.
Classes
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: RCLASS RADIOBUTTON GROUP R1.
SELECTION-SCREEN COMMENT 5(30) TRCLASS.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(15) TPCNAME.
SELECT-OPTIONS: SOCLASS FOR SEOCLASS-CLSNAME.
SELECTION-SCREEN END OF LINE.
Programs / includes
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: RPROG RADIOBUTTON GROUP R1 DEFAULT 'X'.
SELECTION-SCREEN COMMENT 5(18) TPROG.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(15) TRPNAME.
SELECT-OPTIONS: SOPROG FOR TRDIR-NAME.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
Language
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(18) TMLANG.
PARAMETERS: PMLANG LIKE T100-SPRSL DEFAULT 'EN'.
SELECTION-SCREEN END OF LINE.
Package
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(18) TPACK.
PARAMETERS: PPACK LIKE TADIV-DEVCLASS MEMORY ID MPACK.
SELECTION-SCREEN END OF LINE.
Customer objects
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(27) TCUST.
PARAMETERS: PCUST AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN COMMENT 32(25) TNRANGE.
PARAMETERS: PCNAME TYPE NAMESPACE MEMORY ID MNAMESPACE.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN: END OF BLOCK B2.
Additional things to download.
SELECTION-SCREEN: BEGIN OF BLOCK B3 WITH FRAME TITLE TBLOCK3.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TPTEXT.
PARAMETERS: PTEXT AS CHECKBOX DEFAULT 'X' MEMORY ID MTEXT.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TMESS.
PARAMETERS: PMESS AS CHECKBOX DEFAULT 'X' MEMORY ID MMESS.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TPINC.
PARAMETERS: PINC AS CHECKBOX DEFAULT 'X' MEMORY ID MINC.
SELECTION-SCREEN COMMENT 40(20) TRECC.
PARAMETERS: PRECI AS CHECKBOX DEFAULT 'X' MEMORY ID MRECI.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TPFUNC.
PARAMETERS: PFUNC AS CHECKBOX DEFAULT 'X' MEMORY ID MFUNC.
SELECTION-SCREEN COMMENT 40(20) TRECF.
PARAMETERS: PRECF AS CHECKBOX DEFAULT 'X' MEMORY ID MRECF.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TDOC.
PARAMETERS: PDOC AS CHECKBOX DEFAULT 'X' MEMORY ID MDOC.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TPSCR.
PARAMETERS: PSCR AS CHECKBOX DEFAULT 'X' MEMORY ID MSCR.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TPDICT.
PARAMETERS: PDICT AS CHECKBOX DEFAULT 'X' MEMORY ID MDICT.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TSORTT.
PARAMETERS: PSORTT AS CHECKBOX DEFAULT ' ' MEMORY ID MSORTT.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN: END OF BLOCK B3.
File details
SELECTION-SCREEN: BEGIN OF BLOCK B4 WITH FRAME TITLE TBLOCK4.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) TPHTML.
PARAMETERS: PHTML RADIOBUTTON GROUP G1 DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(29) TCOMM.
PARAMETERS: PCOMM AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(29) TBACK.
PARAMETERS: PBACK AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) TPTXT.
PARAMETERS: PTXT RADIOBUTTON GROUP G1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
Download to SAP server
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(25) TSERV.
PARAMETERS: PSERV RADIOBUTTON GROUP G2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 8(20) TSPATH.
PARAMETERS: PLOGICAL LIKE FILENAME-FILEINTERN MEMORY ID MLOGICAL.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN COMMENT /28(60) TSDPATH.
Download to PC
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(25) TPC.
PARAMETERS: PPC RADIOBUTTON GROUP G2 DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 8(20) TPPATH.
PARAMETERS: PFOLDER LIKE RLGRAP-FILENAME MEMORY ID MFOLDER.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN: END OF BLOCK B4.
Display options
SELECTION-SCREEN: BEGIN OF BLOCK B5 WITH FRAME TITLE TBLOCK5.
Display final report
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TREP.
PARAMETERS: PREP AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
Display progress messages
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TPROMESS.
PARAMETERS: PPROMESS AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN: END OF BLOCK B5.
Display a directory picker window
AT SELECTION-SCREEN ON VALUE-REQUEST FOR PFOLDER.
DATA: OBJFILE TYPE REF TO CL_GUI_FRONTEND_SERVICES.
DATA: PICKEDFOLDER TYPE STRING.
DATA: INITIALFOLDER TYPE STRING.
IF SY-BATCH IS INITIAL.
CREATE OBJECT OBJFILE.
IF NOT PFOLDER IS INITIAL.
INITIALFOLDER = PFOLDER.
ELSE.
OBJFILE->GET_TEMP_DIRECTORY( CHANGING TEMP_DIR = INITIALFOLDER
EXCEPTIONS CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3 ).
ENDIF.
OBJFILE->DIRECTORY_BROWSE( EXPORTING INITIAL_FOLDER = INITIALFOLDER
CHANGING SELECTED_FOLDER = PICKEDFOLDER
EXCEPTIONS CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3 ).
IF SY-SUBRC = 0.
PFOLDER = PICKEDFOLDER.
ELSE.
WRITE: / 'An error has occured picking a folder'.
ENDIF.
ENDIF.
AT SELECTION-SCREEN.
CASE 'X'.
WHEN PPC.
IF PFOLDER IS INITIAL.
User must enter a path to save to
MESSAGE E000(OO) WITH 'You must enter a file path'.
ENDIF.
WHEN PSERV.
IF PLOGICAL IS INITIAL.
User must enter a logical path to save to
MESSAGE E000(OO) WITH 'You must enter a logical file name'.
ENDIF.
ENDCASE.
AT SELECTION-SCREEN ON PLOGICAL.
IF NOT PSERV IS INITIAL.
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
LOGICAL_FILENAME = PLOGICAL
IMPORTING
FILE_NAME = SERVERFOLDER
EXCEPTIONS
FILE_NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC = 0.
IF SERVERFOLDER IS INITIAL.
MESSAGE E000(OO) WITH 'No file path returned from logical filename'.
ELSE.
Path to display on the selection screen
TSDPATH = SERVERFOLDER.
Remove the trailing slash off the path as the subroutine buildFilename will add an extra one
SHIFT SERVERFOLDER RIGHT DELETING TRAILING SERVERSLASHSEPARATOR.
SHIFT SERVERFOLDER LEFT DELETING LEADING SPACE.
ENDIF.
ELSE.
MESSAGE E000(OO) WITH 'Logical filename does not exist'.
ENDIF.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOPROG-LOW.
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
OBJECT_TYPE = 'PROG'
OBJECT_NAME = SOPROG-LOW
SUPPRESS_SELECTION = 'X'
USE_ALV_GRID = ''
WITHOUT_PERSONAL_LIST = ''
IMPORTING
OBJECT_NAME_SELECTED = SOPROG-LOW
EXCEPTIONS
CANCEL = 1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOPROG-HIGH.
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
OBJECT_TYPE = 'PROG'
OBJECT_NAME = SOPROG-HIGH
SUPPRESS_SELECTION = 'X'
USE_ALV_GRID = ''
WITHOUT_PERSONAL_LIST = ''
IMPORTING
OBJECT_NAME_SELECTED = SOPROG-HIGH
EXCEPTIONS
CANCEL = 1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOCLASS-LOW.
CALL FUNCTION 'F4_DD_ALLTYPES'
EXPORTING
OBJECT = SOCLASS-LOW
SUPPRESS_SELECTION = 'X'
DISPLAY_ONLY = ''
ONLY_TYPES_FOR_CLIFS = 'X'
IMPORTING
RESULT = SOCLASS-LOW.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOCLASS-HIGH.
CALL FUNCTION 'F4_DD_ALLTYPES'
EXPORTING
OBJECT = SOCLASS-HIGH
SUPPRESS_SELECTION = 'X'
DISPLAY_ONLY = ''
ONLY_TYPES_FOR_CLIFS = 'X'
IMPORTING
RESULT = SOCLASS-HIGH.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOFNAME-LOW.
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
OBJECT_TYPE = 'FUNC'
OBJECT_NAME = SOFNAME-LOW
SUPPRESS_SELECTION = 'X'
USE_ALV_GRID = ''
WITHOUT_PERSONAL_LIST = ''
IMPORTING
OBJECT_NAME_SELECTED = SOFNAME-LOW
EXCEPTIONS
CANCEL = 1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOFNAME-HIGH.
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
OBJECT_TYPE = 'FUNC'
OBJECT_NAME = SOFNAME-HIGH
SUPPRESS_SELECTION = 'X'
USE_ALV_GRID = ''
WITHOUT_PERSONAL_LIST = ''
IMPORTING
OBJECT_NAME_SELECTED = SOFNAME-HIGH
EXCEPTIONS
CANCEL = 1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOFGROUP-LOW.
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
OBJECT_TYPE = 'FUGR'
OBJECT_NAME = SOFGROUP-LOW
SUPPRESS_SELECTION = 'X'
USE_ALV_GRID = ''
WITHOUT_PERSONAL_LIST = ''
IMPORTING
OBJECT_NAME_SELECTED = SOFGROUP-LOW
EXCEPTIONS
CANCEL = 1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOFGROUP-HIGH.
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
OBJECT_TYPE = 'FUGR'
OBJECT_NAME = SOFGROUP-HIGH
SUPPRESS_SELECTION = 'X'
USE_ALV_GRID = ''
WITHOUT_PERSONAL_LIST = ''
IMPORTING
OBJECT_NAME_SELECTED = SOFGROUP-HIGH
EXCEPTIONS
CANCEL = 1.
initialisation
INITIALIZATION.
Parameter screen texts.
TBLOCK1 = 'Author (Optional)'.
T$TMP = 'Programs only: include local objects'.
TBLOCK2 = 'Objects to download'.
TBLOCK3 = 'Additional downloads for programs, function modules and classes'.
TBLOCK4 = 'Download parameters'.
TBLOCK5 = 'Display options'.
TAUTH = 'Author name'.
TPMOD = 'Include programs modified by author'.
TCUST = 'Only customer objects'.
TNRANGE = 'Alt customer name range'.
TRTABLE = 'Tables / Structures'.
TPTABLE = 'Table name'.
TTNOTE = 'Note: tables are stored under the username of the last person who modified them'.
TRFUNC = 'Function modules'.
TPFNAME = 'Function name'.
TFGROUP = 'Function group'.
TRCLASS = 'Classes'.
TPCNAME = 'Class name'.
TMESS = 'Message class'.
TMNAME = 'Class name'.
TMLANG = 'Language'.
TPROG = 'Programs'.
TRPNAME = 'Program name'.
TPACK = 'Package'.
TPTXT = 'Text document'.
TPHTML = 'HTML document'.
TCOMM = 'Highlight comments'.
TBACK = 'Include background colour'.
TPTEXT = 'Text elements'.
TPINC = 'Include programs'.
TRECC = 'Recursive search'.
TPPATH = 'File path'.
TSPATH = 'Logical file name'.
TPMES = 'Message classes'.
TPFUNC = 'Function modules'.
TDOC = 'Function module documentation'.
TRECF = 'Recursive search'.
TPSCR = 'Screens'.
TPDICT = 'Dictionary structures'.
TSORTT = 'Sort table fields alphabetically'.
TSERV = 'Download to server'.
TPC = 'Download to PC'.
TREP = 'Display download report'.
TPROMESS = 'Display progress messages'.
Determine the frontend operating system type.
IF SY-BATCH IS INITIAL.
PERFORM DETERMINEFRONTENDOPSYSTEM USING FRONTENDSLASHSEPARATOR FRONTENDOPSYSTEM.
ENDIF.
PERFORM DETERMINESERVEROPSYSTEM USING SERVERSLASHSEPARATOR SERVERFILESYSTEM SERVEROPSYSTEM.
Determine if the external command exists. If it doesn't then disable the server input field
PERFORM FINDEXTERNALCOMMAND.
start-of-selection.
START-OF-SELECTION.
PERFORM CHECKCOMBOBOXES.
PERFORM FILLSELECTIONRANGES.
STARTTIME = SY-UZEIT.
Don't display status messages if we are running in the background
IF NOT SY-BATCH IS INITIAL.
PPROMESS = ''.
ENDIF.
Fool the HTML routines to stop them hyperlinking anything with a space in them
IF PCNAME IS INITIAL.
CUSTOMERNAMESPACE = '^'.
ELSE.
CUSTOMERNAMESPACE = PCNAME.
ENDIF.
Determine which operating slash and download directory to use
CASE 'X'.
WHEN PPC.
SLASHSEPARATORTOUSE = FRONTENDSLASHSEPARATOR.
DOWNLOADFOLDER = PFOLDER.
WHEN PSERV.
SLASHSEPARATORTOUSE = SERVERSLASHSEPARATOR.
DOWNLOADFOLDER = SERVERFOLDER.
ENDCASE.
Main program flow.
CASE 'X'.
Select tables
WHEN RTABLE.
PERFORM RETRIEVETABLES USING IDICTIONARY[]
SOTABLENAMES[]
SOAUTHOR[].
Select message classes tables
WHEN RMESS.
PERFORM RETRIEVEMESSAGECLASS USING IMESSAGES[]
SOAUTHOR[] "Author
PMNAME "Message class name
PMLANG "Message class language
PMOD. "Modified by author
Select function modules
WHEN RFUNC.
PERFORM RETRIEVEFUNCTIONS USING SOFUNCTIONNAME[] "Function name
SOFUNCTIONGROUP[] "Function group
IFUNCTIONS[] "Found functions
SOAUTHOR[] "Author
PTEXT "Get text elements
PSCR "Get screens
PCUST "Customer data only
CUSTOMERNAMESPACE. "Customer name range
LOOP AT IFUNCTIONS.
Find Dict structures, messages, functions, includes etc.
PERFORM SCANFORADDITIONALFUNCSTUFF USING IFUNCTIONS[]
PRECI "Search for includes recursively
PRECF "Search for functions recursively
PINC "Search for includes
PFUNC "Search for functions
PDICT "search for dictionary objects
PMESS "Search for messages
PCUST "Customer data only
CUSTOMERNAMESPACE. "Customer name range
ENDLOOP.
Select Classes
WHEN RCLASS.
PERFORM RETRIEVECLASSES USING ICLASSES[]
IFUNCTIONS[]
SOCLASSNAME[] "Class name
SOAUTHOR[] "Author
CUSTOMERNAMESPACE "Customer name range
PMOD "Also modified by author
PCUST "Customer object only
PMESS "Find messages
PTEXT "Text Elements
PDICT "Dictionary structures
PFUNC "Get functions
PINC "Get includes
PRECF "Search recursively for functions
PRECI "Search recursively for includes
'X' "Search recursively for classes
PMLANG. "Language
LOOP AT IFUNCTIONS.
Find Dict structures, messages, functions, includes etc.
PERFORM SCANFORADDITIONALFUNCSTUFF USING IFUNCTIONS[]
PRECI "Search for includes recursively
PRECF "Search for functions recursively
PINC "Search for includes
PFUNC "Search for functions
PDICT "search for dictionary objects
PMESS "Search for messages
PCUST "Customer data only
CUSTOMERNAMESPACE. "Customer name range
ENDLOOP.
Select programs
WHEN RPROG.
PERFORM RETRIEVEPROGRAMS USING IPROGRAMS[]
IFUNCTIONS[]
SOPROGRAMNAME[] "Program name
SOAUTHOR[] "Author
CUSTOMERNAMESPACE "Customer name range
PMOD "Also modified by author
PCUST "Customer object only
PMESS "Find messages
PTEXT "Text Elements
PDICT "Dictionay structures
PFUNC "Get functions
PINC "Get includes
PSCR "Get screens
PRECF "Search recursively for functions
PRECI "Search recursively for includes
P$TMP "local objects
PPACK. "Package
ENDCASE.
end-of-selection
END-OF-SELECTION.
IF FORCEDEXIT = 0.
Set the file extension and output type of the file
IF PTXT IS INITIAL.
DOWNLOADFILEEXTENSION = HTMLEXTENSION.
ELSE.
DOWNLOADFILEEXTENSION = TEXTEXTENSION.
ENDIF.
Decide what to download
CASE 'X'.
Download tables
WHEN RTABLE.
IF NOT ( IDICTIONARY[] IS INITIAL ).
PERFORM DOWNLOADDDSTRUCTURES USING IDICTIONARY[]
DOWNLOADFOLDER
HTMLEXTENSION
SPACE
PSORTT
SLASHSEPARATORTOUSE
PSERV
PPROMESS.
Free up any memory used for caching HTML versions of tables
LOOP AT IDICTIONARY.
FREE MEMORY ID IDICTIONARY-TABLENAME.
ENDLOOP.
Display donwload report
IF NOT PREP IS INITIAL.
GET TIME.
RUNTIME = SY-UZEIT - STARTTIME.
PERFORM FILLTREENODETABLES USING IDICTIONARY[]
ITREEDISPLAY[]
RUNTIME.
ENDIF.
CLEAR IDICTIONARY[].
ENDIF.
Download message class
WHEN RMESS.
IF NOT ( IMESSAGES[] IS INITIAL ).
SORT IMESSAGES ASCENDING BY ARBGB MSGNR.
LOOP AT IMESSAGES.
APPEND IMESSAGES TO ISINGLEMESSAGECLASS.
AT END OF ARBGB.
PERFORM DOWNLOADMESSAGECLASS USING ISINGLEMESSAGECLASS[]
IMESSAGES-ARBGB
DOWNLOADFOLDER
DOWNLOADFILEEXTENSION
PHTML
SPACE
PCOMM
CUSTOMERNAMESPACE
PINC
PDICT
PMESS
SLASHSEPARATORTOUSE
PSERV
PPROMESS.
CLEAR ISINGLEMESSAGECLASS[].
ENDAT.
ENDLOOP.
Display download report
IF NOT PREP IS INITIAL.
GET TIME.
RUNTIME = SY-UZEIT - STARTTIME.
PERFORM FILLTREENODEMESSAGES USING IMESSAGES[]
ITREEDISPLAY[]
RUNTIME.
ENDIF.
CLEAR IMESSAGES[].
ENDIF.
Download functions
WHEN RFUNC.
IF NOT ( IFUNCTIONS[] IS INITIAL ).
PERFORM DOWNLOADFUNCTIONS USING IFUNCTIONS[]
DOWNLOADFOLDER
DOWNLOADFILEEXTENSION
SPACE
PDOC
PHTML
PCOMM
-
Hi Experts,
How to assign ABAP programs and customized transactions to authorization groups. R3 4.71, oracle 9.2.0.7, Sun Solaris.
Can some one help me...
Thanks in advance. . .Hi Jalli,
Take a look at how SAP uses tcode S_ALR_87101286 to control the start of a report either via SE38 or via the tcode itself.
In that transaction you can also read the documentation on protecting and restoring ABAP reports using the program authorization group concept. Click on the "information" icon or start "transaction" .HE from the first screen S_ALR_87101286 for more detailed infos, or select "Documentation" in SE38.
Cheers,
Julius -
Hi All
Could any body tell me wat all ABAP related concepts should a SD consultant know when working in support and implementation projects?hi,
first and foremost is you should very comfortable in understanding the SD tables and how the data flows through them. Also you must be conversant with the important fields of these tables to start with.
check this link for SD table flows :
[sdtables|http://www.erpgenie.com/abap/tables_sd.htm]
the others things would be
1) to be able to prepare a good functional spec
2) Decision making skill whether to do somehting in config or go for customization depending on the implications of a particular scenario after discussing with abapers.
3) Understand output related developement work, in terms of driver program and screen layouts.
4) To be able to locate userexits for your requirements and give a proper logic to work with. Generally the problem comes when you try to hard code something which is not so advisable and to eliminate this, a good logic based on the business requirement needs to derived which you again need to translate it to the abaper.
regards
sadhu kishore -
Key/Text table - usage in an ABAP program
Hi Abapers!
I need help about usage of key and text tables.
I have created key and text table and now i want to use them in the abap program. My problem is, that i don't know how to properly read data into internal table from these two tables, so i can show these data in the table control. I also want to know how to save data from text boxes into key and text table (text boxes: txtid, txtlang, txttext).
Key Table:
name: ztbl1
fields: mandt, id
key fields: mandt, id
Text table:
name: ztbl2
fields: mandt, lang, id, text
key fields: mandt, lang, id
Tables are connected together as they should be.
And i don't want to use sm30 for editing table data.
Regards,
EgiMy Dear,
u are loosing the concept of Text table...
Text table are generally used for multi lingual F4 (i.e you enter vaious F4 list to be displayed for a perticular field when a user from differenct lang log on)
for eg...
in urr text table u have .. 2 key itemm
item_code || lang || text
10111 || E || Eng_Chicken
10111 || D || Chickeno (translation from eng to germen)
10111 || F || Ghoose..
so when a user with logon lang as 'E' will log on and when he press F4 on item_code he ill see Eng_chicken
but when a user with logon lang as 'D' will log on and when he press F4 on item_code he ill see Chickeno not Eng_chicken..
i hope u understood the whole concept...
No rewards Plz... -
I need hr abap programs and syntax?
i need hr abap programs and syntax?
Check with below one example :
REPORT ZPETROL_EXCLUDE .
TABLES SSCRFIELDS.
SELECTION-SCREEN BEGIN OF SCREEN 100.
SELECTION-SCREEN SKIP 9.
PARAMETERS NUMBER(200) TYPE C.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN:
BEGIN OF LINE,
PUSHBUTTON 2(10) TEXT-001 USER-COMMAND PROC,
END OF LINE.
SELECTION-SCREEN END OF SCREEN 100.
CALL SCREEN 100.
AT SELECTION-SCREEN.
CASE SSCRFIELDS.
WHEN 'PROC'.
SET PARAMETER ID: 'NUM' FIELD NUMBER.
CALL TRANSACTION 'ZP_PALLOWANCE'.
LEAVE TO SCREEN 0.
ENDCASE.
SECOND PRG
REPORT ZPR_PETROL_ALLOWANCE NO STANDARD PAGE
HEADING .
*-- Infotypes
INFOTYPES : 0000, "Actions
0002, "Personal Data
0008. "Basic pay details
*-- Tables
TABLES : PERNR, "Standard Selections for HR Master Data Reporting
PC207, "Payroll Results: Results Table
PCL1, "HR Cluster 1
PCL2, "HR Cluster 2
T510, "Pay scales
T549A, "Payroll areas
T549Q, "Payroll Periods
PA0002. "Personal details
*-- Internal Tables
*-- Internal Table Declaration For Holding The Data
DATA: BEGIN OF INT_PETROL OCCURS 0,
PERNR LIKE PA0008-PERNR, "Personnel Number
TRFST LIKE PA0008-TRFST, "Pay Scale Level
NAME(40), "Name of Employee
PALLOWANCE TYPE P DECIMALS 2, "Petrol Allowance Amount
END OF INT_PETROL.
DATA: BEGIN OF PA0015_DATA OCCURS 0,
PERNR LIKE PA0015-PERNR,
BETRG LIKE PA0015-BETRG,
END OF PA0015_DATA.
DATA:BEGIN OF INT_PETROL2 OCCURS 0,
PERNR LIKE PA0008-PERNR, "Personnel Number
VORNA LIKE PA0002-VORNA, "First Name
NACHN LIKE PA0002-NACHN, "Last Name
TRFST LIKE PA0008-TRFST, "Pay Scale Level
NAME(40), "Name of Employee
PALLOWANCE TYPE P DECIMALS 2, "Petrol Allowance Amount
END OF INT_PETROL2.
DATA : TITLE TYPE LVC_TITLE.
DATA: BEGIN OF PER_NO OCCURS 0,
PERNR LIKE PA0008-PERNR,
TRFST LIKE PA0008-TRFST,
END OF PER_NO.
DATA: BEGIN OF MSG OCCURS 0,
MSG1(100) TYPE C,
END OF MSG.
DATA: FLAG TYPE I VALUE '0',
DIS_FLAG TYPE I VALUE '0'.
DATA: INT_PETROL3 LIKE STANDARD TABLE OF INT_PETROL2 INITIAL SIZE 0
WITH HEADER LINE.
DATA: INT_PETROL1 LIKE STANDARD TABLE OF INT_PETROL INITIAL SIZE 0 WITH
HEADER LINE.
DATA: WA_PET_ALLOWANCE TYPE ZBPETROL_ALL. "WORKAREA FOR INSERTING
VALUES.
*DATA: P_LGART1 LIKE T512T-LGART VALUE '0010'. "CHANGE WAGE TYPE HERE
DATA: P_LGART1 LIKE T512T-LGART VALUE '0077'. "CHANGE WAGE TYPE HERE
DATA: BEGIN OF INT_0015 OCCURS 0,
PERNR(038),
BEGDA(010),
BETRG(018),
END OF INT_0015.
*-- Internal Table To Store Error Records.
DATA: E_INT_0015 LIKE INT_0015 OCCURS 0 WITH HEADER LINE.
*-- Batch Input Data of Single Transaction
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
*-- Internal Table For Export and Import Payroll Results
DATA: INT_RGDIR LIKE PC261 OCCURS 0 WITH HEADER LINE,
LGTXT LIKE T512T-LGTXT.
DATA: BEGIN OF EMP_NO OCCURS 0,
PERNR(4) TYPE C,
END OF EMP_NO.
DATA: BEGIN OF EMP_NO1 OCCURS 0,
PERNR TYPE I,
END OF EMP_NO1.
DATA EMPNO LIKE STANDARD TABLE OF EMP_NO INITIAL SIZE 0.
DATA EMPNO1 LIKE STANDARD TABLE OF EMP_NO1 INITIAL SIZE 0 WITH HEADER
LINE.
DATA LEN1 TYPE I.
DATA: ERR LIKE MESSAGE.
DATA TEMP_NUM(200) TYPE C.
*-- Includes
*-- International Include
INCLUDE RPC2CD09. "Cluster CD data definition
INCLUDE RPC2CA00. "Cluster CA Data-Definition
INCLUDE RPPPXD00. "Data Definition buffer PCL1/PCL2 Buffer INCLUDE RPPPXD10.
"Common part buffer PCL1/PCL2 INCLUDE RPPPXM00. "Buffer Handling routine
*-- Country Specific Include
INCLUDE PC2RXIN0. "Cluster IN data definition
INCLUDE RPC2RX09.
*-- ALV Declaration
TYPE-POOLS : SLIS.
DATA: INT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
INT_EVENTS TYPE SLIS_T_EVENT,
INT_LAYOUT TYPE SLIS_LAYOUT_ALV,
WS_EVENTS TYPE SLIS_ALV_EVENT,
WS_REPID LIKE SY-REPID.
*-- Initialization
INITIALIZATION.
WS_REPID = SY-REPID.
*-- At Selection-Screen
START-OF-SELECTION.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(30) TEXT-002.
SELECTION-SCREEN POSITION 33.
PARAMETERS: P_RATE TYPE P DECIMALS 2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-003.
SELECTION-SCREEN BEGIN OF BLOCK B3.
PARAMETERS: P_UPLOAD AS CHECKBOX,
P_FG RADIOBUTTON GROUP G1,
P_BG RADIOBUTTON GROUP G1.
SELECTION-SCREEN END OF BLOCK B3.
SELECTION-SCREEN BEGIN OF BLOCK B4.
PARAMETERS: P_DI AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK B4.
SELECTION-SCREEN END OF BLOCK B2.
AT SELECTION-SCREEN.
*-- Wate Type Text
SELECT SINGLE LGTXT INTO LGTXT FROM T512T WHERE SPRSL = 'E' AND
MOLGA = '40' AND LGART = P_LGART1 .
*-- Data Retrieval From Logical Database PNP
GET PERNR.
PROVIDE PERNR FROM P0000 VORNA NACHN FROM P0002 BETWEEN PN-BEGDA AND
PN-ENDDA.
INT_PETROL1-PERNR = P0000-PERNR.
CONCATENATE P0002-VORNA P0002-NACHN INTO INT_PETROL1-NAME SEPARATED
BY SPACE.
ENDPROVIDE.
*-- Clear Data
CLEAR: RGDIR, INT_RGDIR.
REFRESH: RGDIR, INT_RGDIR.
*-- Read All The Payroll Runs For An Employee
CD-KEY-PERNR = PERNR-PERNR.
RP-IMP-C2-CU.
CHECK RP-IMP-CD-SUBRC EQ 0.
*-- Clear Data
REFRESH: RT.
Read IN Cluster.
LOOP AT RGDIR WHERE FPBEG >= PN-BEGDA AND FPEND <= PN-ENDDA.
MOVE-CORRESPONDING RGDIR TO INT_RGDIR.
APPEND INT_RGDIR.
CLEAR INT_RGDIR.
ENDLOOP.
Read the last record.
SORT INT_RGDIR BY SEQNR DESCENDING.
READ TABLE INT_RGDIR INDEX 1.
RX-KEY-SEQNO = INT_RGDIR-SEQNR.
RX-KEY-PERNR = PERNR-PERNR.
RP-IMP-C2-IN.
CHECK RP-IMP-IN-SUBRC EQ 0.
READ TABLE RT WITH KEY LGART = P_LGART1.
IF SY-SUBRC = 0.
INT_PETROL1-PALLOWANCE = RT-BETRG.
ENDIF.
APPEND INT_PETROL1.
CLEAR INT_PETROL1.
SELECT TRFST PERNR
INTO CORRESPONDING FIELDS OF TABLE PER_NO
FROM PA0008
WHERE TRFST LIKE 'L%'
AND BET01 > 0.
SORT PER_NO.
DELETE ADJACENT DUPLICATES FROM PER_NO.
*-- END-OF-SELECTION.
END-OF-SELECTION.
LOOP AT INT_PETROL1.
READ TABLE PER_NO WITH KEY PERNR = INT_PETROL1-PERNR.
IF SY-SUBRC = 0.
INT_PETROL-TRFST = PER_NO-TRFST.
MODIFY INT_PETROL1 FROM INT_PETROL TRANSPORTING TRFST.
ENDIF.
ENDLOOP.
SORT INT_PETROL1.
DELETE ADJACENT DUPLICATES FROM INT_PETROL1.
CONCATENATE 'From' ' : ' PN-BEGDA6(2) '.' PN-BEGDA4(2) '.' PN-
BEGDA+0(4)
' To' ' : ' PN-ENDDA6(2) '.' PN-ENDDA4(2) '.' PN-ENDDA+0(4)
INTO TITLE.
IF P_DI = 'X'. "TO DISPLAY PETROL ALLOWANCE ONLY
IF PNPTIMRA = 'X'. "CHECK OTHER PERIOD CHECKED
DIS_FLAG = 1.
ENDIF.
IF PNPTIMR9 = 'X'. "CHECK TO SEE CURRENT PERIOD SELECTED
CASES - NO RATE GIVEN, RATE GIVEN
CURRENT PERIOD UPLOADED BUT PAYROLL NOT WRITTEN SO NO RESULT FROM LDB
SELECT RATE INTO P_RATE FROM ZBPETROL_ALL WHERE BEGDA = PN- BEGDA AND ENDDA = PN-ENDDA.
ENDSELECT.
IF SY-DBCNT = 0.
MESSAGE I455(0) WITH 'NO PETROL RATE EXSISTS'.
ELSE.
FLAG = 1.
ENDIF. "OF SY-DBCNT
IF P_RATE > 0 AND FLAG = 1. " PETROL RATE EXSISTS.
SELECT PERNR SUM( BETRG ) INTO TABLE PA0015_DATA
FROM PA0015
WHERE BEGDA BETWEEN PN-BEGDA AND PN-ENDDA
GROUP BY PERNR.
SELECT APERNR ATRFST BVORNA BNACHN
INTO CORRESPONDING FIELDS OF TABLE INT_PETROL3
FROM PA0008 AS A
INNER JOIN PA0002 AS B ON BPERNR = APERNR
WHERE A~TRFST LIKE 'L%'
AND A~BET01 > 0.
SORT INT_PETROL3.
DELETE ADJACENT DUPLICATES FROM INT_PETROL3.
REFRESH INT_PETROL1.
LOOP AT INT_PETROL3 INTO INT_PETROL2. "loop to transport
employee name
CONCATENATE INT_PETROL2-VORNA INT_PETROL2-NACHN INTO
INT_PETROL2-NAME SEPARATED BY SPACE.
MODIFY INT_PETROL3 FROM INT_PETROL2 TRANSPORTING NAME.
ENDLOOP.
LOOP AT INT_PETROL3 INTO INT_PETROL2. "loop to transport
one
table to another table
READ TABLE PA0015_DATA WITH KEY PERNR = INT_PETROL2-PERNR.
IF SY-SUBRC = 0.
INT_PETROL-PERNR = INT_PETROL2-PERNR.
INT_PETROL-TRFST = INT_PETROL2-TRFST.
INT_PETROL-NAME = INT_PETROL2-NAME.
INT_PETROL-PALLOWANCE = PA0015_DATA-BETRG.
APPEND INT_PETROL TO INT_PETROL1.
ENDIF.
ENDLOOP.
DIS_FLAG = 1.
ENDIF. "P_RATE > 0 AND FLAG = 1.
IF P_RATE > 0 AND FLAG = 0. "CURRENT PERIOD AND DATA NOT UPLOADED
SELECT APERNR ATRFST BVORNA BNACHN
INTO CORRESPONDING FIELDS OF TABLE INT_PETROL3
FROM PA0008 AS A
INNER JOIN PA0002 AS B ON BPERNR = APERNR
WHERE A~TRFST LIKE 'L%'
AND A~BET01 > 0.
SORT INT_PETROL3.
DELETE ADJACENT DUPLICATES FROM INT_PETROL3.
REFRESH INT_PETROL1.
LOOP AT INT_PETROL3 INTO INT_PETROL2. "loop to transport
employee name
CONCATENATE INT_PETROL2-VORNA INT_PETROL2-NACHN INTO
INT_PETROL2-NAME SEPARATED BY SPACE.
MODIFY INT_PETROL3 FROM INT_PETROL2 TRANSPORTING NAME.
ENDLOOP.
PERFORM GET_VALUE. "TO CONVERT THE FIRST SCREEN PERNR INTO
NUMBER FORMATE
LOOP AT INT_PETROL3 INTO INT_PETROL2. "loop to transport
one
table to another table
READ TABLE EMPNO1 WITH KEY PERNR = INT_PETROL2-PERNR.
IF SY-SUBRC <> 0.
INT_PETROL-PERNR = INT_PETROL2-PERNR.
INT_PETROL-TRFST = INT_PETROL2-TRFST.
INT_PETROL-NAME = INT_PETROL2-NAME.
APPEND INT_PETROL TO INT_PETROL1.
ENDIF.
ENDLOOP.
PERFORM CAL_ALLOWANCE.
ENDIF. " OF P_RATE > 0
DIS_FLAG = 1.
ENDIF. " OF CURRENT PERIOD CHECK.
ENDIF. " OF CHECK DISPLAY.
*----BDC
IF P_UPLOAD = 'X'.
IF PNPTIMRA = 'X'. "CHECK OTHER PERIOD CHECKED
MESSAGE I455(0) WITH 'Petrol Allowance cannot be uploaded'.
LEAVE SCREEN.
ENDIF.
IF P_RATE > 0.
IF P_RATE > 0 OR P_RATE = 0.
IF PNPTIMR9 = 'X'. "CHECK TO SEE CURRENT PERIOD SELECTED
WA_PET_ALLOWANCE-BEGDA = PN-BEGDA.
WA_PET_ALLOWANCE-ENDDA = PN-ENDDA.
WA_PET_ALLOWANCE-RATE = P_RATE.
WA_PET_ALLOWANCE-CURR = 'INR'.
INSERT INTO ZBPETROL_ALL VALUES WA_PET_ALLOWANCE.
SELECT A~PERNR A~TRFST B~VORNA B~NACHN
INTO CORRESPONDING FIELDS OF TABLE INT_PETROL3
FROM PA0008 AS A
INNER JOIN PA0002 AS B ON B~PERNR = A~PERNR
WHERE A~TRFST IN ('L1' , 'L2' , 'L3')
AND A~BET01 > 0.
SORT INT_PETROL3.
DELETE ADJACENT DUPLICATES FROM INT_PETROL3.
REFRESH INT_PETROL1.
LOOP AT INT_PETROL3 INTO INT_PETROL2. "loop to transport
employee name
CONCATENATE INT_PETROL2-VORNA INT_PETROL2-NACHN INTO
INT_PETROL2-NAME SEPARATED BY SPACE.
MODIFY INT_PETROL3 FROM INT_PETROL2 TRANSPORTING NAME.
ENDLOOP.
PERFORM GET_VALUE. "TO CONVERT THE FIRST SCREEN PERNR INTO
NUMBER FORMATE
LOOP AT INT_PETROL3 INTO INT_PETROL2. "loop to transport
one
table to another table
READ TABLE EMPNO1 WITH KEY PERNR = INT_PETROL2-PERNR.
IF SY-SUBRC <> 0.
INT_PETROL-PERNR = INT_PETROL2-PERNR.
INT_PETROL-TRFST = INT_PETROL2-TRFST.
INT_PETROL-NAME = INT_PETROL2-NAME.
APPEND INT_PETROL TO INT_PETROL1.
ENDIF.
ENDLOOP.
PERFORM CAL_ALLOWANCE.
DIS_FLAG = 1.
SORT INT_PETROL1.
LOOP AT INT_PETROL1.
MOVE: INT_PETROL1-PERNR TO INT_0015-PERNR,
INT_PETROL1-PALLOWANCE TO INT_0015-BETRG.
CONCATENATE PN-ENDDA6(2) PN-ENDDA4(2) PN-ENDDA+0(4) INTO
INT_0015-BEGDA SEPARATED BY '.'.
APPEND INT_0015.
CLEAR INT_0015.
ENDLOOP.
LOOP AT INT_0015.
PERFORM F_BDCDATA.
IF P_FG = 'X'.
CALL TRANSACTION 'PA30' USING BDCDATA MODE 'A' UPDATE 'S'.
ELSE.
CALL TRANSACTION 'PA30' USING BDCDATA MODE 'N' UPDATE 'S'.
ENDIF.
*-- Handling Error records.
IF SY-SUBRC <> 0.
*-- Handling Error Messages
PERFORM ERROR_MSG.
MOVE-CORRESPONDING INT_0015 TO E_INT_0015.
APPEND E_INT_0015.
CLEAR E_INT_0015.
ENDIF.
REFRESH BDCDATA.
ENDLOOP.
*-- Downloading Error Records.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'C:\Errors.Txt'
FILETYPE = 'ASC'
TABLES
DATA_TAB = E_INT_0015.
*-- Downloading Error Messages.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'C:\Err_Msg.Txt'
FILETYPE = 'ASC'
TABLES
DATA_TAB = MSG.
ENDIF. " FOR CURRENT PERIOD
ENDIF.
ELSE.
MESSAGE I455(0) WITH 'Enter Petrol Rate'.
LEAVE TO SCREEN 0.
ENDIF. " FOR PETROL RATE
ENDIF. " FOR UPLOAD
IF DIS_FLAG = 1.
INT_LAYOUT-SUBTOTALS_TEXT = TEXT-004.
INT_LAYOUT-TOTALS_TEXT = TEXT-004.
INT_LAYOUT-ZEBRA = 'X'.
PERFORM FILL_FIELDCAT.
PERFORM GET_EVENTS_ALV.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = WS_REPID
IS_LAYOUT = INT_LAYOUT
IT_FIELDCAT = INT_FIELDCAT[]
I_DEFAULT = 'X'
I_SAVE = 'X'
IT_EVENTS = INT_EVENTS
TABLES
T_OUTTAB = INT_PETROL1
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.
ENDIF.
*& Form GET_VALUE
text
FORM GET_VALUE.
GET PARAMETER ID: 'NUM' FIELD TEMP_NUM.
IF TEMP_NUM <> ''.
LEN1 = STRLEN( TEMP_NUM ).
PERFORM GET_PERNR.
APPEND TEMP_NUM TO EMPNO.
LOOP AT EMPNO INTO EMP_NO.
CALL FUNCTION 'CHECK_AND_CONVERT_NUMERICS'
EXPORTING
DFELD = ' '
DMZEI = ','
DTYPE = 'STRING'
DYPNO = ' '
EFELD = EMP_NO-PERNR
FNAME = ' '
PROGR = ' '
IMP_DECIMALS = '0'
IMPORTING
ERROR =
IFELD = EMP_NO1-PERNR
MESSG = ERR
MSGLN =
IF ( ERR-MSGID = '' ).
APPEND EMP_NO1 TO EMPNO1.
CLEAR EMP_NO1-PERNR.
ELSE.
MESSAGE I455(0) WITH 'Could not convert employee number'.
LEAVE TO SCREEN 0.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. "GET_VALUE
*& Form GET_PERNR
text
FORM GET_PERNR.
SPLIT TEMP_NUM AT ',' INTO EMP_NO TEMP_NUM.
APPEND EMP_NO TO EMPNO.
CLEAR EMP_NO.
SEARCH TEMP_NUM FOR ','.
IF SY-SUBRC = 0.
PERFORM GET_PERNR.
ENDIF.
ENDFORM. "GET_PERNR
*& Form ERROR_MSG
text
--> p1 text
<-- p2 text
FORM ERROR_MSG.
IF SY-SUBRC <> 0.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
LANG = SY-LANGU
IMPORTING
MSG = MSG-MSG1.
APPEND MSG.
CLEAR MSG.
ENDIF.
ENDFORM. "ERROR_MSG
*& Form F_BDCDATA
text
FORM F_BDCDATA.
PERFORM BDC_DYNPRO USING 'SAPMP50A' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=INS'.
PERFORM BDC_FIELD USING 'RP50G-PERNR'
INT_0015-PERNR.
PERFORM BDC_FIELD USING 'RP50G-TIMR6'
'X'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RP50G-CHOIC'.
PERFORM BDC_FIELD USING 'RP50G-CHOIC'
'0015'.
PERFORM BDC_DYNPRO USING 'MP001500' '2000'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'Q0015-BETRG'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'P0015-LGART'
'0077'. "CHANGE WAGE TYPE HERE
ALSO
PERFORM BDC_FIELD USING 'Q0015-BETRG'
INT_0015-BETRG.
PERFORM BDC_FIELD USING 'P0015-WAERS'
'INR'.
PERFORM BDC_FIELD USING 'P0015-BEGDA'
INT_0015-BEGDA.
PERFORM BDC_DYNPRO USING 'MP001500' '2000'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'P0015-LGART'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=UPD'.
PERFORM BDC_FIELD USING 'P0015-LGART'
'0077'. "CHANGE WAGE TYPE HERE
ALSO
PERFORM BDC_FIELD USING 'Q0015-BETRG'
INT_0015-BETRG.
PERFORM BDC_FIELD USING 'P0015-WAERS'
'INR'.
PERFORM BDC_FIELD USING 'P0015-BEGDA'
INT_0015-BEGDA.
ENDFORM. "F_BDCDATA
*& Form BDC_DYNPRO
text
-->P_0732 text
-->P_0733 text
FORM BDC_DYNPRO USING VALUE(P_0732) TYPE C
VALUE(P_0733) TYPE C.
CLEAR BDCDATA.
BDCDATA-PROGRAM = P_0732.
BDCDATA-DYNPRO = P_0733.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM. " BDC_DYNPRO
*& Form BDC_FIELD
text
-->P_0755 text
-->P_0756 text
FORM BDC_FIELD USING VALUE(P_0755) TYPE C
VALUE(P_0756) TYPE C.
CLEAR BDCDATA.
BDCDATA-FNAM = P_0755.
BDCDATA-FVAL = P_0756.
APPEND BDCDATA.
ENDFORM. " BDC_FIELD
*& Form CAL_ALLOWANCE
text
FORM CAL_ALLOWANCE.
LOOP AT INT_PETROL1 INTO INT_PETROL.
IF INT_PETROL-TRFST = 'L1'.
INT_PETROL-PALLOWANCE = P_RATE * 100. "CHANGE TO SELECT WHEN
DISPLAY
ELSEIF INT_PETROL-TRFST = 'L2'.
INT_PETROL-PALLOWANCE = P_RATE * 150.
ELSEIF INT_PETROL-TRFST = 'L3'.
INT_PETROL-PALLOWANCE = P_RATE * 150.
ELSEIF INT_PETROL-TRFST = 'L4'.
INT_PETROL-PALLOWANCE = P_RATE * 200.
ELSEIF INT_PETROL-TRFST = 'L5'.
INT_PETROL-PALLOWANCE = P_RATE * 250.
ENDIF.
MODIFY INT_PETROL1 FROM INT_PETROL TRANSPORTING PALLOWANCE.
ENDLOOP.
ENDFORM. "CAL_ALLOWANCE
*& Form FILL_FIELDCAT
text
--> p1 text
<-- p2 text
FORM FILL_FIELDCAT.
INT_FIELDCAT-COL_POS = 1.
INT_FIELDCAT-TABNAME = 'INT_PETROL1'.
INT_FIELDCAT-FIELDNAME = 'PERNR'.
INT_FIELDCAT-SELTEXT_L = TEXT-005.
INT_FIELDCAT-OUTPUTLEN = 10.
INT_FIELDCAT-KEY = 'X'.
APPEND INT_FIELDCAT.
CLEAR INT_FIELDCAT.
INT_FIELDCAT-COL_POS = 2.
INT_FIELDCAT-TABNAME = 'INT_PETROL1'.
INT_FIELDCAT-FIELDNAME = 'NAME'.
INT_FIELDCAT-SELTEXT_L = TEXT-006.
INT_FIELDCAT-OUTPUTLEN = 25.
INT_FIELDCAT-KEY = 'X'.
APPEND INT_FIELDCAT.
CLEAR INT_FIELDCAT.
INT_FIELDCAT-COL_POS = 3.
INT_FIELDCAT-TABNAME = 'INT_PETROL1'.
INT_FIELDCAT-FIELDNAME = 'TRFST'.
INT_FIELDCAT-SELTEXT_L = TEXT-007.
INT_FIELDCAT-OUTPUTLEN = 5.
INT_FIELDCAT-KEY = 'X'.
APPEND INT_FIELDCAT.
CLEAR INT_FIELDCAT.
INT_FIELDCAT-COL_POS = 4.
INT_FIELDCAT-TABNAME = 'INT_PETROL1'.
INT_FIELDCAT-FIELDNAME = 'PALLOWANCE'.
INT_FIELDCAT-SELTEXT_L = TEXT-008.
INT_FIELDCAT-OUTPUTLEN = 16.
INT_FIELDCAT-KEY = 'X'.
APPEND INT_FIELDCAT.
CLEAR INT_FIELDCAT.
ENDFORM. " FILL_FIELDCAT
*& Form GET_EVENTS_ALV
text
--> p1 text
<-- p2 text
FORM GET_EVENTS_ALV.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 1
IMPORTING
ET_EVENTS = INT_EVENTS[]
EXCEPTIONS
LIST_TYPE_WRONG = 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.
READ TABLE INT_EVENTS INTO WS_EVENTS WITH KEY NAME =
SLIS_EV_TOP_OF_PAGE.
IF SY-SUBRC = 0.
WS_EVENTS-FORM = 'TOP'.
MODIFY INT_EVENTS FROM WS_EVENTS INDEX SY-TABIX.
ENDIF.
ENDFORM. " GET_EVENTS_ALV
*& Form TOP-OF-PAGE
text
FORM TOP.
*-- ALV Declarations
DATA: WS_HEADER TYPE SLIS_T_LISTHEADER,
WA_HEADER TYPE SLIS_LISTHEADER.
*-- Title
WA_HEADER-TYP = 'H'.
WA_HEADER-INFO = TEXT-009.
APPEND WA_HEADER TO WS_HEADER.
CLEAR WA_HEADER.
WA_HEADER-TYP = 'H'.
WA_HEADER-INFO = TITLE.
APPEND WA_HEADER TO WS_HEADER.
CLEAR WA_HEADER.
WA_HEADER-TYP = 'H'.
WA_HEADER-INFO = ' '.
APPEND WA_HEADER TO WS_HEADER.
CLEAR WA_HEADER.
WA_HEADER-TYP = 'H'.
WA_HEADER-INFO = ' '.
APPEND WA_HEADER TO WS_HEADER.
CLEAR WA_HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = WS_HEADER
I_LOGO = 'LOGO'.
ENDFORM. "TOP-OF-PAGE
HR deals with the INFOTYPES which are similar to Tables in General ABAP.
There are different ways of fetching data from these infotypes.
There are different areas in HR LIKE Personal Admn, Orgn Management, Benefits, Time amangement, Event Management, Payroll etc
Infotypes for these areas are different from one another area.
storing of records data in each type of area is different
LDBS like PNP are used in HR programing.
Instead of Select.. we use some ROUTINES and PROVIDE..ENDPROVIDE.. etc
and in the case of Pay roll we use Clusters and we Import and Export them for data fetching.
On the whole Normal ABAP is different from HR abap.
For Personal Admn the Infotypes start with PA0000 to PA1999
Time Related Infotypes start with PA2000 to PA2999.
Orgn related Infotypes start with HRP1000 to HRP1999.
All custom developed infotypes stsrat with PA9000 onwards.
In payroll processing we use Clusters like PCL1,2,3 and 4.
Instead of Select query we use PROVIDE and ENDPROVIDE..
You have to assign a Logical Database in the attributes PNP.
Go through the SAp doc for HR programming and start doing.
http://www.sapdevelopment.co.uk/hr/hrhome.htm
See:
http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
sites regarding hr-abap:
http://www.sapdevelopment.co.uk/hr/hrhome.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
http://www.atomhr.com/training/Technical_Topics_in_HR.htm
http://www.planetsap.com/hr_abap_main_page.htm
You can see some Standard Program examples in this one ...
http://www.sapdevelopment.co.uk/programs/programshr.htm
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
http://www.erpgenie.com/faq/hr.htm.
http://www.planetsap.com/hr_abap_main_page.htm
http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
These are the FAQ's that might helps you as well.
http://www.sap-img.com/human/hr-faq.htm
http://www.sapgenie.com/faq/hr.htm
http://www.planetsap.com/hr_abap_main_page.htm
http://www.atomhr.com/library_full.htm
HR Long texts Upload
Look at the below link
BDC - hr maintain text
Please refer to the following sample program for accessing PCH LDB.
For concept to start with refer url:
http://www.sap-press.de/download/dateien/860/sappress_mysap_hr_technical_principles2.pdf
It contains info regarding PCH Reporting.
REPORT zhsol010.
TABLES: objec, gdstr.
INFOTYPES: 0002, 0006, 1003.
DATA: stabs LIKE p1003-stabs,
name LIKE p0001-ename.
INITIALIZATION.
pchotype = 'O'.
pchwegid = 'O-S-P'.
GET objec.
IF objec-otype = 'S'.
CLEAR stabs.
LOOP AT p1003 WHERE begda LE pc-endda
AND endda GE pc-begda.
IF p1003-stabs = 'X'.
stabs = 'X'.
WRITE : / objec-objid, objec-short, objec-stext.
ENDIF.
ENDLOOP.
ENDIF.
IF objec-otype = 'P' AND stabs = 'X'.
PROVIDE vorna nachn FROM p0002
subty telnr FROM p0006
BETWEEN pc-begda and pc-endda
WHERE p0006-subty = '1'.
IF p0006_valid = 'X'.
CONCATENATE p0002-vorna p0002-nachn INTO name
SEPARATED BY space.
WRITE: / name, p0006-telnr.
SKIP.
ENDIF.
ENDPROVIDE.
ENDIF.
sample code:
REPORT zpwtest .
TABLES : t001 .
TYPE-POOLS slis .
DATA : t_t001 TYPE TABLE OF t001 ,
t_abaplist TYPE TABLE OF abaplist .
DATA : w_abaplist TYPE abaplist .
SELECT-OPTIONS : s_bukrs FOR t001-bukrs OBLIGATORY .
PARAMETERS : p_list TYPE c NO-DISPLAY .
START-OF-SELECTION .
IF sy-batch = 'X' AND p_list IS INITIAL .
Submit report and get list in memory
SUBMIT zpwtest EXPORTING LIST TO MEMORY
WITH s_bukrs IN s_bukrs
WITH p_list = 'X'
AND RETURN.
Get the list from memory.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = t_abaplist
EXCEPTIONS
not_found = 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.
Send report to mail receipent
PERFORM send_mail .
ELSE.
PERFORM select_data .
PERFORM display_data .
ENDIF.
*SO_NEW_DOCUMENT_SEND_API1
*& Form select_data
FORM select_data.
SELECT *
INTO TABLE t_t001
FROM t001
WHERE bukrs IN s_bukrs .
ENDFORM. " select_data
*& Form display_data
FORM display_data.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_structure_name = 'T001'
TABLES
t_outtab = t_t001
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 send_mail
FORM send_mail.
DATA: message_content LIKE soli OCCURS 10 WITH HEADER LINE,
receiver_list LIKE soos1 OCCURS 5 WITH HEADER LINE,
packing_list LIKE soxpl OCCURS 2 WITH HEADER LINE,
listobject LIKE abaplist OCCURS 10,
compressed_attachment LIKE soli OCCURS 100 WITH HEADER LINE,
w_object_hd_change LIKE sood1,
compressed_size LIKE sy-index.
Fot external email id
receiver_list-recextnam = '[email protected]'.
receiver_list-recesc = 'E'.
receiver_list-sndart = 'INT'.
receiver_list-sndpri = '1'.
FOr internal email id
receiver_list-recnam = sy-uname .
receiver_list-esc_des = 'B'.
APPEND receiver_list.
General data
w_object_hd_change-objla = sy-langu.
w_object_hd_change-objnam = 'Object name'.
w_object_hd_change-objsns = 'P'.
Mail subject
w_object_hd_change-objdes = 'Message subject'.
Mail body
APPEND 'Message content' TO message_content.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
compressed_size = compressed_size
TABLES
in = t_abaplist
out = compressed_attachment.
DESCRIBE TABLE compressed_attachment.
CLEAR packing_list.
packing_list-transf_bin = 'X'.
packing_list-head_start = 0.
packing_list-head_num = 0.
packing_list-body_start = 1.
packing_list-body_num = sy-tfill.
packing_list-objtp = 'ALI'.
packing_list-objnam = 'Object name'.
packing_list-objdes = 'Attachment description'.
packing_list-objlen = compressed_size.
APPEND packing_list.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = w_object_hd_change
object_type = 'RAW'
owner = sy-uname
TABLES
objcont = message_content
receivers = receiver_list
packing_list = packing_list
att_cont = compressed_attachment.
ENDFORM. " send_mail
Check this links,
https://forums.sdn.sap.com/click.jspa?searchID=4564732&messageID=3009173
https://forums.sdn.sap.com/click.jspa?searchID=4564732&messageID=2198920
https://forums.sdn.sap.com/click.jspa?searchID=4564732&messageID=1714842
https://forums.sdn.sap.com/click.jspa?searchID=4564732&messageID=2232979
Regards
vasu -
Hi all,
I am using a module pool program,
I want to ristrict the access of program to single user at a time.
can some one give me some clues about program locks.
Regards,
Gaurav Sood.Hi
Locking All Users
Sometimes it is useful to be able to lock all the users out of a client; for instance, during a client copy (you can also do this with tp locksys, but you have to issue that command from the OS level, and then you can only use DDIC or SAP* to log on). You can use this program to lock out all users except yourself.
This program (un)locks all the users in a client, except for the current user, and the SAP* user. You might want to add somthing like SELECT-OPTIONS EXEMPTUS FOR USR02-BNAME to allow a list of usernames not to be processed.
Un/Lock all users in a client
*& Report YUSRLOCK *
REPORT YUSRLOCK MESSAGE-ID Z1 .
TABLES: USR02.
PARAMETERS: LOCK AS CHECKBOX, LISTLOCK AS CHECKBOX.
DATA: UFLAGVAL TYPE I, LOCKSTRING(8) TYPE C.
---- Authorization check -
AUTHORITY-CHECK OBJECT 'ZPROG_RUN' ID 'PROGRAM' FIELD SY-CPROG.
IF SY-SUBRC <> 0.
IF SY-SUBRC = 4.
MESSAGE E000 WITH SY-CPROG. "some message about authorization check failure
ELSE.
MESSAGE E005 WITH SY-SUBRC. "some message about authorization check failure
ENDIF.
ENDIF.
IF LISTLOCK = 'X'.
WRITE:/ 'List all locked users: '.
SELECT * FROM USR02 WHERE UFLAG = 64.
WRITE: / USR02-BNAME.
ENDSELECT.
EXIT.
ENDIF.
IF LOCK = 'X'.
UFLAGVAL = 64. "lock all users
LOCKSTRING = 'locked'.
ELSE.
UFLAGVAL = 0. "unlock all users
LOCKSTRING = 'unlocked'.
ENDIF.
SELECT * FROM USR02 WHERE BNAME <> 'SAP*' AND BNAME <> SY-UNAME.
IF USR02-UFLAG <> 0 AND USR02-UFLAG <> 64.
WRITE: 'User', USR02-BNAME, 'untouched; please handle manually.'.
CONTINUE.
ENDIF.
check that user has authority to make these changes
AUTHORITY-CHECK OBJECT 'S_USER_GRP'
ID 'CLASS' FIELD USR02-CLASS
ID 'ACTVT' FIELD '05'.
IF SY-SUBRC <> 0.
IF SY-SUBRC = 4.
WRITE: /'You are not authorized to lock/unlock user ',
USR02-BNAME, USR02-CLASS.
ELSE.
WRITE: /'Authorization error checking user ',
USR02-BNAME, USR02-CLASS, '(return code', SY-SUBRC, ').'.
ENDIF.
ELSE. "has authority
UPDATE USR02 SET UFLAG = UFLAGVAL WHERE BNAME = USR02-BNAME.
WRITE: / 'User', USR02-BNAME, LOCKSTRING, '.'.
ENDIF.
The SAP Lock Concept
Reasons for Setting Locks
Suppose a travel agent want to book a flight. The customer wants to fly to a particular city with a certain airline on a certain day. The booking must only be possible if there are still free places on the flight. To avoid the possibility of overbooking, the database entry corresponding to the flight must be locked against access from other transactions. This ensures that one user can find out the number of free places, make the booking, and change the number of free places without the data being changed in the meantime by another transaction.
Lock Mechanisms in the Database System
The database system automatically sets database locks when it receives change statements (INSERT, UPDATE, MODIFY, DELETE) from a program. Database locks are physical locks on the database entries affected by these statements. You can only set a lock for an existing database entry, since the lock mechanism uses a lock flag in the entry. These flags are automatically deleted in each database commit. Database locks are therefore never available longer than for only one database LUW. That means that in ABAP application programming, database locks can no longer exist than the duration of one dialog step.
The physical lock mechanisms in the database system are therefore insufficient for the requirements of an ABAP transaction. The locks must remain set for the duration of a whole SAP LUW, that is, over several dialog steps. They must also be capable of being handled by different work processes and even different application servers. Consequently, each lock must not only apply on the application server that carries out the locking transaction, but on all installed servers of the SAP Web AS ABAP.
SAP Locks
To complement the SAP LUW concept, in which bundled database changes are made in a single database LUW, the SAP System also contains a lock mechanism, fully independent of database locks, that allows you to set a lock that spans several dialog steps. These locks are known as SAP locks.
The complete documentation on SAP locks can be found in The SAP Lock Concept. This is a short introduction within the environment of ABAP programming.
The SAP lock concept is based on lock objects. Lock objects allow you to set SAP locks for entire application objects. An application object consists of one or more entries in a database table, or entries from more than one database table that are linked using foreign key relationships.
Before you can set an SAP lock in an ABAP program, you must first create a lock object in the ABAP Dictionary. A lock object definition contains the database tables and their key fields on the basis of which you want to set a lock. When you create a lock object, the system automatically generates two function modules with the names ENQUEUE_Name and DEQUEUE_Name. You can then set and release SAP locks in your ABAP program by calling these function modules in a CALL FUNCTION statemenT.
Reward If Helpfull,
Naresh. -
Is it possible to call ms-dos command in abap program?
Hi,
is it possible to call ms-dos command in abap program?
Thanks.Hi Cemil,
You probably have your answer here:
[Re: DOS/Windows command in app server;
You create your external command with SM69 (you can test it with SM49).
Then you call this command with function module "SXPG_COMMAND_EXECUTE".
(See function group SXPT for all the calls to external commands).
Regards,
Thomas -
Can we use is null in our select statement in ABAP program
hi,
I want to use 'is nul' or 'not null' in select statement of my ABAP program for any field. I have written below query but I am getting sy-subrc = 4 and getting no data. Can anyone resolve this.Hi,
I think you've posted your question on the wrong forum. This is the SAP Business One development forum which is not part of ERP and doesn't include any ABAP or Netweaver programming.
For a list of forums please see here:
http://forums.sdn.sap.com/index.jspa
Kind Regards,
Owen
Maybe you are looking for
-
Hi, I have a Jpanel with BorderLayout which has two components. First one is a JScrollpane which sits at CENTER and another is JEditorPane which sits at south. JScrollPane itself is over a JEditorPane ..... PROBLEM is I can't see the component sittin
-
How to limit to enter a IP address in TextField?
Hello everyone, I have a PDF form which users need to enter a IP address. In order to get a correct IP address, I need to limit a TextField's pattern. What my boss want me to realize is like the picture below: It means when users fill 3 numbers of IP
-
What is the meaning of Recorded Status in SXMB_Moni ?
Hi Experts What is the meaning of Recorded Status in SXMB_Moni ? it showing green flag with recorded status Thank You G.Praveen Kumar Tecnics Integration Technology . PI Consultant
-
Hi, I'm new to Spry (DWCS4) and found that it is exactly what I'm looking for the job that has to be done (not really complicated !). Using the wizard and a single XML file, DW built for me the master region for a long list of records and also the de
-
Attachment of Docs in BOM---urgent
Hi, Is it possible to attach docs(Xcel,Word,pdf) in BOM or in Tcode CS62. I dont want DMS. I just want to know if by putting any parameter ID & value i can get the Document attachment Icon. Regards John