Pages

Buy

Buy
Showing posts with label Reporting. Show all posts
Showing posts with label Reporting. Show all posts

How to Hide Parameters on Selection Screen

REPORT ZSACHIN_ALV_DEEP27.

*----------------------------------------------------------------------*
* T A B L E S *
*----------------------------------------------------------------------*

tables: mara, skb1, BSEG.

*----------------------------------------------------------------------*
* S E L E C T I O N S C R E E N *
*----------------------------------------------------------------------*

selection-screen: Begin of block b1 with frame title text-001.

parameters : R1 radiobutton group g1 default 'X' user-command AA.

select-options : s_bukrs for skb1-bukrs MODIF ID AA.
parameters : p_GJAHR type bseg-GJAHR MODIF ID AA.
parameters : p_MONAT type bkpf-MONAT MODIF ID AA.
select-options : s_SEG for BSEG-SEGMENT MODIF ID AA.

parameters : R2 radiobutton group g1.

select-options: s1_bukrs for skb1-bukrs MODIF ID CC.
parameters: p1_GJAHR type bseg-GJAHR MODIF ID CC.
parameters: p1_MONAT type bkpf-MONAT MODIF ID CC.
select-options: s1_SEG for bseg-SEGMENT MODIF ID CC.
select-options: s1_PRCTR for bseg-PRCTR MODIF ID CC.

selection-screen: end of block b1.


*----------------------------------------------------------------------*
* AT S E L E C T I O N S C R E E N O U T P U T *
*----------------------------------------------------------------------*

At selection-screen output.

If R1 = 'X'.

loop at screen.

if screen-group1 = 'AA'.
screen-input = '1'.
modify screen.
endif.

if screen-group1 = 'CC'.
screen-input = '0'.
modify screen.
endif.

endloop.

elseif R2 = 'X'.

loop at screen.

if screen-group1 = 'AA'.
screen-input = '0'.
modify screen.
endif.

if screen-group1 = 'CC'.
screen-input = '1'.
modify screen.
endif.

endloop.

endif.

Example of Report having all events

REPORT ZKA_REPORT MESSAGE-ID ZKA LINE-SIZE 255 LINE-COUNT 10(2).

TABLES: ZKA_EMP,ZKA_COM.

DATA: ITAB LIKE ZKA_EMP OCCURS 0 WITH HEADER LINE.

DATA: JTAB LIKE ZKA_COM OCCURS 0 WITH HEADER LINE.

SELECT-OPTIONS: EMP_NO FOR ZKA_EMP-EMPNO.

SET PF-STATUS 'ZKA_MENU'.

INITIALIZATION.


EMP_NO-LOW = '1'.

EMP_NO-HIGH = '10'.

EMP_NO-SIGN = 'I'.

EMP_NO-OPTION = 'BT'.

APPEND EMP_NO.

CLEAR EMP_NO.

AT SELECTION-SCREEN.

IF EMP_NO-LOW < '1'. MESSAGE S000(ZKA). ELSEIF EMP_NO-HIGH > '10'.

MESSAGE S001.

ENDIF.

START-OF-SELECTION.

SELECT * FROM ZKA_EMP INTO TABLE ITAB WHERE EMPNO IN EMP_NO.

LOOP AT ITAB.

WRITE:/5 SY-VLINE,6 ITAB-EMPNO,17 SY-VLINE,18 ITAB-EMPNAME,28 SY-VLINE,

29 ITAB-EMPPHONE,39 SY-VLINE.

HIDE: ITAB-EMPNO.

ENDLOOP.

WRITE:/5 SY-ULINE(35).

TOP-OF-PAGE.

WRITE:/5 SY-ULINE(35).

WRITE:/5 SY-VLINE,6 'EMPNO',17 SY-VLINE,18 'EMPNAME',28 SY-VLINE,

29 'EMPPHONE',39 SY-VLINE.

WRITE:/5 SY-ULINE(35).

END-OF-PAGE.

WRITE:/5 SY-ULINE(35).

WRITE:/ 'THE PAGE NO IS',SY-PAGNO.

END-OF-SELECTION.

WRITE:/ 'THE RECORD IS CLOSED'.

AT LINE-SELECTION.
IF SY-LSIND = 1.
SELECT * FROM ZKA_EMP INTO TABLE ITAB WHERE EMPNO = ITAB-EMPNO.

LOOP AT ITAB.

WRITE:/5 SY-VLINE,6 ITAB-EMPNO,17 SY-VLINE,18 ITAB-EMPNAME,28 SY-VLINE,

29 ITAB-EMPPHONE,39 SY-VLINE.

ENDLOOP.

WRITE:/5 SY-ULINE(35).

ELSEIF SY-LSIND = 2.

SELECT * FROM ZKA_COM INTO TABLE JTAB WHERE EMPNO = ITAB-EMPNO.

LOOP AT JTAB.

WRITE:/5 SY-VLINE,6 JTAB-COMNO,17 SY-VLINE,18 JTAB-COMNAME,28 SY-VLINE,

29 JTAB-COMPHONE,39 SY-VLINE.

ENDLOOP.

WRITE:/5 SY-ULINE(35).

ENDIF.

AT PF7.

IF SY-LSIND = 1.

SELECT * FROM ZKA_EMP INTO TABLE ITAB WHERE EMPNO = ITAB-EMPNO.

LOOP AT ITAB.

WRITE:/5 SY-VLINE,6 ITAB-EMPNO,17 SY-VLINE,18 ITAB-EMPNAME,28 SY-VLINE,

29 ITAB-EMPPHONE,39 SY-VLINE.

ENDLOOP.

WRITE:/5 SY-ULINE(35).

ELSEIF SY-LSIND = 2.

SELECT * FROM ZKA_COM INTO TABLE JTAB WHERE EMPNO = ITAB-EMPNO.

LOOP AT JTAB.

WRITE:/5 SY-VLINE,6 JTAB-COMNO,17 SY-VLINE,18 JTAB-COMNAME,28 SY-VLINE,

29 JTAB-COMPHONE,39 SY-VLINE.

ENDLOOP.

WRITE:/5 SY-ULINE(35).

ENDIF.

AT USER-COMMAND.

IF SY-UCOMM = '0001'.

IF SY-LSIND = 1.

SELECT * FROM ZKA_EMP INTO TABLE ITAB WHERE EMPNO = ITAB-EMPNO.

LOOP AT ITAB.

WRITE:/5 SY-VLINE,6 ITAB-EMPNO,17 SY-VLINE,18 ITAB-EMPNAME,28 SY-VLINE,

29 ITAB-EMPPHONE,39 SY-VLINE.

ENDLOOP.

WRITE:/5 SY-ULINE(35).

ELSEIF SY-LSIND = 2.

SELECT * FROM ZKA_COM INTO TABLE JTAB WHERE EMPNO = ITAB-EMPNO.

LOOP AT JTAB.

WRITE:/5 SY-VLINE,6 JTAB-COMNO,17 SY-VLINE,18 JTAB-COMNAME,28 SY-VLINE,

29 JTAB-COMPHONE,39 SY-VLINE.

ENDLOOP.

WRITE:/5 SY-ULINE(35).

ENDIF.

ENDIF.

Output is Given Below : 



Assign Variable Type at Runtime in ABAP report

Dynamic programing can save a lot of 'superfluous' coding.

To assign a variable a type at runtime, use the ABAP statement ASSIGN with the option TYPE. For instance:


DATA: D_TYPE,
D_FIELD(35).
DATA: D_TEST TYPE P.
FIELD-SYMBOLS: .
D_FIELD = 'D_TEST'.
D_TYPE = 'P'.
ASSIGN (D_FIELD) TO TYPE D_TYPE.


Additionally you can use the option DECIMALS of the ASSIGN statement if your type is 'P'. You can even change the type at runtime of previously assigned field symbol like

ASSIGN TO TYPE 'C'.

One more thing for dynamic programing. With the following coding you can access every DDIC table with the key you want:


SELECT SINGLE * FROM (DF_TNAME) INTO S_TMP WHERE (IF_KEY).
It is very powerful, isn't it !!!
[ Ingo-Willy Raddatz, posted to SAP listserver]



Example 1: Print page "n of x pages" on reports


The following code is just a function to loop total pages. To use from the beginning of your report, you will have to loop through your report once before display. ABAP does not provide
an easy "read-ahead" method of doing this, so this is the "cludgy" way of making it work if needed.



FORM GET_TOTAL_PAGENO.

WRITE SY-PAGNO TO NUM_PAGES_C LEFT-JUSTIFIED.

DO SY-PAGNO TIMES.
READ LINE 2 OF PAGE SY-INDEX.
REPLACE '*****' WITH NUM_PAGES_C INTO SY-LISEL.
MODIFY LINE 2 OF PAGE SY-INDEX.
ENDDO.

ENDFORM. " GET_TOTAL_PAGENO

System fields used in interactive Reporting

The SY-LSIND system field contains the index of the list currently created. While creating a basic list, SY-LSIND equals 0.

With each interactive event, the system automatically sets the following system fields:

System field Information

SY-LINCT total line count of a list

SY-LINNO current line no where cursor is placed.

SY-LSIND Index of the list currently created during the current event (basic list = 0)

SY-LISTI Index of the list level from which the event was triggered

SY-LILLI Absolute number of the line from which the event was triggered

SY-LISEL Contents of the line from which the event was triggered

SY-CUROW Position of the line in the window from which the event was triggered (counting starts with 1)

SY-CUCOL Position of the column in the window from which the event was triggered (counting starts with 2)

SY-UCOMM Function code that triggered the event

SY-PFKEY Always contains the status of the current list.

Standard SAP Reports

RGUGBR00Substitution/Validation utility


RHGENZ0/HRGRENZ2 Notes RHGRENZ0/2 will abend if there are any inconsistencies between PD and PA (i.e. people in a different controlling area than the position they belong to).

RHGRENZ0 Delimit IT1000 and related 1001s. Program will delete any 1001 infotypes whose start date is after the delimit date.

RHGRENZ1 Extend the end date on delimited records. Very useful when you delimit a bunch of records incorrectly, and need to change the end date.

RHGRENZ2 Delimit IT1001 only.


RKCTSEAR Search source code for up to two strings. Also see RSRSCAN1 and RPR_ABAP_SOURCE_SCAN.

RPDTRA00 List all HR transactions.

RPR_ABAP_SOURCE_SCAN Search ABAP code for a string. Has many more options for selecting the ABAPs to search than RSRSCAN1 or RKCTSEAR.

RPUAUD00 HR Report to list all logged changes for an employee. Uses the PCL4 Audit Cluster.

RPUAUDDL HR Report to delete audit data from the PCL4 Audit Cluster.

RPUDELPN Delete all info for an employee number, including cluster data and infotypes

RPUP1D00/10 View/Delete data from PCL1 Cluster

RPUP2D00/10 View/Delete data from PCL2 Cluster

RPUP3D00/10 View/Delete data from PCL3 Cluster

RPUP4D00/10 View/Delete data from PCL4 Cluster

RSABAPIV Mass print/display of ABAP/4 help text

RSAVGL00 Table adjustment across clients

RSBDCBTC Submit a BDC job with an internal batch number and wait for the end of the batch input session.

RSBDCDRU Prints the contents of a Batch Input session. No options for error transactions only.

RSBDCOS0 Execute UNIX commands. Looks similar to the old SAPMSOS0 program that disappeared in 3.0

RSBDCSUB Release batch input sessions automatically

RSBTCDEL Clean the old background job records

RSCLTCOP Copy tables across clients


RSDBCREO Clean batch input session log

RSINCL00 Extended program list

RSORAREL Get the Oracle Release

RSPARAM Display all instance parameters

RSPO0041 Removing old spooling objects
RSRSCAN1 Search source code for a given string. Will also search includes. Also see RKCTSEAR and RPR_ABAP_SOURCE_SCAN.
RSSNAPDL Clean the old ABAP error dumps
RSTBSERV Compare a contents of a table between clients
RSTXFCON Converts SAPScript page formats
RSTXSCRP Save a SAPScript layout set to disk, and load it back into SAP.
RSTXSCRP
Transport SAPscript files across systems
RSTXSCRP Upload and download SAPScript layout sets
RSTXTRAN Add standard texts to a transport so they can be moved between systems.
RSUSR003 Check the passwords of users SAP* and DDIC in all clients
RSUSR006 List users last login
RSWBO052 Change development class of a sapscript (provided by Alan Cecchini)
RSWBO060 put objects into a request and transport it to any other system
RFSKPL00 Global chart of accounts(General data)+B106
RFSKVZ00 Local chart of accounts(Ccode specific)
RFBELJ00 transaction journal
RFSLD00 Trial balance
RFBILA00 balance sheet /P&L
RFHABU00 balance audit trail
RFSKTH00 Financial policy manual
RFBUSU00 Postings totla
RFSABL00 Changes to g/l account
RFEPOJ00 Line item journal
SAPMV45A Sales Order Processing
SAPMM06E Purchase Order Processing
SAPMF02K Vendor master
SAPMM03M Material master
SAPLF0180 Balance sheet readjustment
RSWBO052 Change Development Class
RSTXLDMC
RSTXFCON
 Converts page format
RSTXSCRP upload/Download layout sets
RSTXCHKO To Correct Inconsistencies in Copying Script
RAALTD11 Asset master upload