ABAP-HR report using only OOPs...
Hi experts,
Can u please tell me is this possible to write a report with out using LDBs but only using OOPs.. are there any classes or methods works as macros in LDBs?
If yes, please guid me with proper hints.
Thanks & Regards,
Friendof all..
Hi Friendof mine...;)
LDB though a classic approach provides very flexible way of data extraction, authorization, screens etc. So in my opinion you should stick to using it in some part, in order to get that services provided by standard. I doubt there is an OO approach to substitute the same entirely.
Anyhow, if you want to transit to an OO HR, I would suggest to read about [Decoupling Infotype concept|http://help.sap.com/erp2005_ehp_04/helpdata/EN/4f/d52552575e11d189270000e8322f96/frameset.htm]. There is a separate framework available which you can use for master data reading/writing. It is a bit complex at first but serve an alternative to standard FMs like HR_READ_INFOTYPE , HR_INFOTYPE_OPERATION . For more refer a [Writing Infotype Records subsection|http://help.sap.com/saphelp_erp2005/helpdata/en/43/21d1014bba2bebe10000000a1553f7/frameset.htm] of above link.
To sum up. This framework won't provide you full range options which you have in place by means of LDB. You can however mix classic approach (with GET PERNR events, LDB selection screen etc) with new OO approach for data extraction. The latter becomes recommended by SAP, but is more complex and requires preety good understanding of basic OO concepts (you mostly work with interfaces so the actual code is not so transparent to you). Anyhow I think it's worth trying, even just for sport.
Furhter reading which might help to get the idea http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/14694. [original link is broken] [original link is broken] [original link is broken]
Regards
Marcin
Similar Messages
-
ABAP - Editable report using Excel view
hi friends
In my report i am using REUSE_ALV_GRID_DISPLAY
Function module to display the data in alv format. I am using the view in
Excel format.
My requirement is,
If i change the data in the
excel sheet that should reflect in the internal table.
I am able to do changes, but the data is not getting change in the internal
table.
The purpose of this is, the output of this report will be the
input of another program after changing the output in excel(only, bcoz in
excel they will change using some formulas).
Note:
I am
getting the changes to internal table if i use grid display not in excel
format.
Can anyone suggest me how to solve this problem?Hi u can esily do this using Object oriented ALVs. Heres the code :
*& ALV using objects : ADD, MODIFY RECORDS
Data Declaration
DATA : ITAB1 TYPE TABLE OF SFLIGHT,
G_CUST1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
G_GRID1 TYPE REF TO CL_GUI_ALV_GRID,
LT_FCAT1 TYPE LVC_T_FCAT,
LS_FCAT TYPE LVC_S_FCAT.
Start of selection
START-OF-SELECTION.
PERFORM POPULATE_TABLE.
END-OF-SELECTION.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
PBO module
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'ZSAB1'.
SET TITLEBAR 'xxx'.
IF G_CUST1 IS INITIAL.
CREATE OBJECT G_CUST1
EXPORTING
CONTAINER_NAME = 'CC1'.
CREATE OBJECT G_GRID1
EXPORTING
I_PARENT = G_CUST1.
ENDIF.
PERFORM FCAT_SFLIGHT.
to display the ALV Grid
CALL METHOD G_GRID1->SET_TABLE_FOR_FIRST_DISPLAY
CHANGING
IT_OUTTAB = ITAB1
IT_FIELDCATALOG = LT_FCAT1.
transfering the grid from display mode to editable mode
CALL METHOD G_GRID1->SET_READY_FOR_INPUT
EXPORTING
I_READY_FOR_INPUT = 1.
ENDMODULE. " STATUS_0100 OUTPUT
*& Form fcat_sflight
Filling Field Catalog
FORM FCAT_SFLIGHT.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = 'SFLIGHT'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER = 'X'
CHANGING
CT_FIELDCAT = LT_FCAT1.
LOOP AT LT_FCAT1 INTO LS_FCAT.
IF LS_FCAT-FIELDNAME EQ 'PRICE'
OR LS_FCAT-FIELDNAME EQ 'PLANETYPE'
OR LS_FCAT-FIELDNAME EQ 'FLDATE'.
LS_FCAT-EDIT = 'X'.
LS_FCAT-CHECKTABLE = '!'. "do not check foreign key relations
MODIFY LT_FCAT1 FROM LS_FCAT.
ENDIF.
ENDLOOP.
ENDFORM. " fcat_sflight
*& Module USER_COMMAND_0100 INPUT
PAI module
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'SAVE'.
PERFORM SAVE_DATA.
WHEN 'LEAV' OR 'CANC' OR 'BACK'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. "USER_COMMAND_0100 INPUT
*& Form save_data
checking the changed or added data is consistent
FORM SAVE_DATA.
DATA: L_VALID TYPE C.
CALL METHOD G_GRID1->CHECK_CHANGED_DATA
IMPORTING
E_VALID = L_VALID.
IF L_VALID IS NOT INITIAL.
PERFORM UPDATE_DATABASE.
MESSAGE S000(0K) WITH TEXT-S01.
ENDIF.
ENDFORM. "save_data
*& Form update_database
Update records to DB table
FORM UPDATE_DATABASE.
DATA: LS_SFLIGHT TYPE SFLIGHT,
LS_OUTTAB LIKE LINE OF ITAB1,
LT_INSTAB TYPE TABLE OF SFLIGHT.
LOOP AT ITAB1 INTO LS_OUTTAB.
MOVE-CORRESPONDING LS_OUTTAB TO LS_SFLIGHT.
APPEND LS_SFLIGHT TO LT_INSTAB.
ENDLOOP.
MODIFY SFLIGHT FROM TABLE LT_INSTAB.
ENDFORM. "update_database
*& Form POPULATE_TABLE
POPULATE TABLE I_KNA1
FORM POPULATE_TABLE .
SELECT * FROM SFLIGHT INTO TABLE ITAB1.
ENDFORM. " POPULATE_TABLE -
I need to create a report using only one record
I have all this records in my database but i would like to create a layout where it will automatically fill it up with the information of a record i would chose.
example:
i got a list of over 200 hundred products and i would like to see in a personalized layout the complete report and characteristics of only the record selected.Shaka,
assuming each record has a unique identifier (like an item number) you can use the function vlookup() to "pull" data out of the database table.
Beyond that it would be most efficient if you provided the firlds of your database and the layout of the report. -
Sort multiple Reports using only 1 reports columns
Hi there everyone,
I have been searching the forum to see there were any posts on this, but I haven't found one. I have a page with 3 reports. They all share a column which is the pk in the "main" report. I would like to be able to only show the sorting options on the main report, but have the others follow along on the pk column when any column is sorted.
Thanks,
NGWell, we can only guess. Try this:
DECLARE
v_query VARCHAR2 (4000);
BEGIN
v_query :=
' select TO_NUMBER(EVT_CODE),'
|| ' WST_COMMENTS'
|| ' from WLG_SESSION_TEMP, R5EVENTS'
|| ' where EVT_CODE=WST_NUM(+)'
|| ' AND EVT_STATUS=''COMP'''
|| ' AND EVT_TYPE=''JOB'''
|| ' AND EVT_ORG=:F101_USERORG'
|| CASE
WHEN :request = 'fsp_sort_3_desc'
THEN ' TO_NUMBER(EVT_CODE) DESC'
WHEN :request = 'fsp_sort_3'
THEN ' TO_NUMBER(EVT_CODE) ASC'
WHEN :request = 'fsp_sort_4_desc'
THEN ' EVT_DESC DESC'
WHEN :request = 'fsp_sort_4'
THEN ' EVT_DESC ASC'
WHEN :request = 'fsp_sort_5_desc'
THEN ' EVT_OBJECT DESC'
WHEN :request = 'fsp_sort_5'
THEN ' EVT_OBJECT ASC'
ELSE CASE
WHEN :p1_sort = 'fsp_sort_3'
THEN ' TO_NUMBER(EVT_CODE) DESC'
WHEN :p1_sort = 'fsp_sort_3_desc'
THEN ' TO_NUMBER(EVT_CODE) ASC'
WHEN :p1_sort = 'fsp_sort_4'
THEN ' EVT_DESC DESC'
WHEN :p1_sort = 'fsp_sort_4_desc'
THEN ' EVT_DESC ASC'
WHEN :p1_sort = 'fsp_sort_5'
THEN ' EVT_OBJECT DESC'
WHEN :p1_sort = 'fsp_sort_5_desc'
THEN ' EVT_OBJECT ASC'
ELSE ' TO_NUMBER(EVT_CODE) ASC'
END
END;
RETURN v_query;
END;Does it compile?
If yes, does it return any result?
If no, give me the error message as it appears.
Is there a chance for you to upload those two tables to htmldb.oracle.com?
Denes Kubicek -
hi friendz,
can any one of u give an example, how to build alv report using oops abap ?
thanks in advance.
points for sure
regards,
VijayaHi Vijaya,
I hope the following code upto your requirement.
*& Report ZMAT_ALV_GRID *
REPORT ZCL_CLASS1.
TYPES: BEGIN OF T_MARA,
MATNR TYPE MARA-MATNR,
MAKTX TYPE MAKT-MAKTX,
WERKS TYPE MARD-WERKS,
LGORT TYPE MARD-LGORT,
LABST TYPE MARD-LABST,
END OF T_MARA.
*DATA: IT_MARA TYPE STANDARD TABLE OF T_MARA.
DATA: IT_MARA TYPE T_MARA OCCURS 0.
DATA: O_CONT TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
O_GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA: X_FLDCAT TYPE LVC_S_FCAT.
DATA: IT_FLDCAT TYPE LVC_T_FCAT.
DATA: I_LAYOUT TYPE LVC_S_LAYO.
DATA: X_SORT TYPE LVC_S_SORT.
DATA: I_SORT TYPE LVC_T_SORT.
TABLES: MARA.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
PARAMETERS: P_CHK AS CHECKBOX.
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM GENERATE_FLDCAT.
PERFORM GENERATE_LAYOUT.
PERFORM DO_SORT.
SET SCREEN 100.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'MAIN'.
SET TITLEBAR 'xxx'.
PERFORM BUILD_ALV.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form BUILD_ALV
text
FORM BUILD_ALV .
CREATE OBJECT O_CONT
EXPORTING
CONTAINER_NAME = 'MAT_CONTAINER'
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6.
CREATE OBJECT O_GRID
EXPORTING
I_PARENT = O_CONT
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
others = 5.
CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
I_SAVE =
I_DEFAULT = ' '
IS_LAYOUT = I_LAYOUT
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = IT_MARA
IT_FIELDCATALOG = IT_FLDCAT[]
IT_SORT = I_SORT
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4.
ENDFORM. " BUILD_ALV
*& Form GET_DATA
text
FORM GET_DATA .
SELECT A~MATNR
B~MAKTX
C~WERKS
C~LGORT
C~LABST
INTO TABLE IT_MARA
FROM MARA AS A
INNER JOIN MAKT AS B
ON BMATNR = AMATNR
INNER JOIN MARD AS C
ON CMATNR = AMATNR
WHERE A~MATNR IN S_MATNR
AND B~SPRAS = SY-LANGU.
ENDFORM. " GET_DATA
*& Form GENERATE_FLDCAT
text
FORM GENERATE_FLDCAT .
*CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
I_STRUCTURE_NAME = 'ZSMARA'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME = ' '
CHANGING
CT_FIELDCAT = IT_FLDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
X_FLDCAT-COL_POS = 1.
X_FLDCAT-FIELDNAME = 'MATNR'.
X_FLDCAT-OUTPUTLEN = '18'.
X_FLDCAT-REPTEXT = 'Material No'.
APPEND X_FLDCAT TO IT_FLDCAT.
X_FLDCAT-COL_POS = 2.
X_FLDCAT-FIELDNAME = 'MAKTX'.
X_FLDCAT-OUTPUTLEN = '48'.
X_FLDCAT-REPTEXT = 'Material Desc'.
X_FLDCAT-TOOLTIP = 'Material Desc'.
APPEND X_FLDCAT TO IT_FLDCAT.
X_FLDCAT-COL_POS = 3.
X_FLDCAT-FIELDNAME = 'WERKS'.
X_FLDCAT-OUTPUTLEN = '5'.
X_FLDCAT-REPTEXT = 'Plant'.
X_FLDCAT-TOOLTIP = 'Plant'.
APPEND X_FLDCAT TO IT_FLDCAT.
X_FLDCAT-COL_POS = 4.
X_FLDCAT-FIELDNAME = 'LGORT'.
X_FLDCAT-OUTPUTLEN = '5'.
X_FLDCAT-REPTEXT = 'S.Loc'.
X_FLDCAT-TOOLTIP = 'S.Loc'.
APPEND X_FLDCAT TO IT_FLDCAT.
X_FLDCAT-COL_POS = 5.
X_FLDCAT-FIELDNAME = 'LABST'.
X_FLDCAT-OUTPUTLEN = '20'.
X_FLDCAT-REPTEXT = 'Quantity'.
X_FLDCAT-TOOLTIP = 'Quantity'.
X_FLDCAT-DO_SUM = 'X'.
APPEND X_FLDCAT TO IT_FLDCAT.
ENDFORM. " GENERATE_FLDCAT
*& Form GENERATE_LAYOUT
text
FORM GENERATE_LAYOUT .
I_LAYOUT-ZEBRA = 'X'.
I_LAYOUT-FRONTEND = 'X'.
I_LAYOUT-GRID_TITLE = 'ALV GRID USING OOPS'.
I_LAYOUT-NUMC_TOTAL = 'X'.
ENDFORM. " GENERATE_LAYOUT
*& Form DO_SORT
text
FORM DO_SORT .
X_SORT-FIELDNAME = 'MATNR'.
X_SORT-UP = 'X'.
X_SORT-SUBTOT = 'X'.
IF P_CHK = 'X'.
X_SORT-EXPA = SPACE.
ELSE.
X_SORT-EXPA = 'X'.
ENDIF.
APPEND X_SORT TO I_SORT.
ENDFORM. " DO_SORT
inorder to execute this code perfectly, do the following things.
1. Create a Graphical Screen 100.
2. Place a Custom Control on that screen and give name as MAT_CONTAINER.
3. activate the screen.
and execute the program.
if this suits requirement award points.
satish -
Want to have own selection screen in HR-ABAP report using LDB
Hi experts,
I am working on HR-ABAP report using LDB pnp and infotypes..But, here we get the built in selection criterion..but I want my own selection screen to be displayed..whats the solution for this??? Is it possible to create my own selection screen instead of default one..and how???
Please help me..its very urgent..Hi,
chk this out:
Create Report Categories
In this step, you define the report categories and determine the layout
of the standard selection screen for these report categories. You can
create report categories for programs or queries that are based on the
PNP or PNPCE logical databases.
The definition of report categories is divided into two sections:
o In the Change Report Category view, you define general attributes
such as sort order, input fields for date, and so on.
o In the Change Selection Criteria view, you define which selection
fields of the logical database should be avaliable on the selection
screen.
Example
You want to set up your system so that your employees can only start
evaluation reports for Payroll if they use a payroll area. Within a
payroll area, you should be able to select according to personnel
number. Additional selection criteria should not be possible and you
should not be allowed to enter a sort sequence.
Standard settings
The standard system already contains report categories. You can find the
attributes of the report categories in the table.
Note the following five report categories in particular:
o Report category ' ' is the SAP default report category for
programs that are based on the PNP logical database.
o Report category PNPCE is the SAP default category for programs that
are based on the PNPCE logical database.
o Report category '00000000' is the customer-specific default category
for programs that are based on the PNP logical database.
o Report category '0PNPCE' is the customer-specific default category
for programs that are based on the PNPCE logical database.
o Report category __X2001 is the default category for Queries that
are based on an InfoSet of the PNP LDB.
o Report category QUEPNPCE is the default category for queries that
are based on an InfoSet of the PNPCE LDB.
The default report categories are used when a report is called if
the report has not been assigned a report category.
Parameters and Options for Report Categories of the LDB PNP and PNPCE
Parameters and Options in Screen Area General Data
If you activate this parameter, you can only enter data on the data
selection period if you use reports that have been assigned. The
same date entries are then used for the person selection as for the
date selection.
o Matchcode allowed
If you activate this parameter, you have use of a Matchcode
pushbutton (search help) if you use reports that have been assigned.
This pushbutton enables you to perform the person selection.
o Sort allowed
If you activate this parameter, you have use of a Sort pushbutton if
you use report that have been assigned. This pushbutton enables you
to define a sort order before you execute the report.
o Organizational structure allowed
If you activate this parameter, you have use of an Org.Structure
pushbutton if you use reports that have been assigned. This
pushbutton enables you to perform the person selection.
Note:
For more information about these options, see the online
documentation under this path:
SAP Library -> Human Resources -> Reporting in Human Resources
Management -> Standard HR Reports -> Report Selection Screen in
Human Resources Management.
Parameters and Options in Screen Areas Data Selection Period/Person
Selection Period/Payroll Area/Period/Year
o Options for data selection period and person selection period (key
date and so on)
Here you define which options for date and person selection are
available for reports that have been assigned.
o Options for payroll area/period/year
Here you define which options for selection using payroll
area/period/year are available for reports that have been assigned.
Parameters and Options in Screen Area Selection View
o Type/Name
This parameter enables you to use selection views to define report
categories. You use the selection view selected here to determine
which fields are available in the Dynamic Selectionsy.
Note:
You create selection views for the PNP and PNPCE logical databases
in the Object Navigator (SE80):
1. Start the Object Navigator (SE80)
2. Choose Workbench -> Edit Object.
3. Choose the More... tab page and the Selection view on this tab
page.
4. Choose Create.
5. In the Create Selection View dialog box, choose the For any
tables option.
6. In the Name of view field, enter a name for your selection view.
7. In the Tables dialog box, enter the name of the table from which
you want to use fields.
Note:
When you enter the table name, observe the naming convention in
Personnel Administration:
Infotype number: nnnn -> table name: PAnnnn
8. Choose Continue.
9. In the Functional groups area, define functional groups by
assigning a name and a number.
10. Assign fields from the selected tables to the functional groups
by entering the number of the desired functional group in front of
each field.
11. Save your entries.
For more information about adjusting the dynamic selections using
your own selection views, see the online documentation under the
following menu path:
SAP Library -> Human Resources -> Reporting in Human Resources
Management -> HR Standard Reports -> Report Selection Screen in
Human Resources Management -> Enhancing the Selection Screen -
Dynamic Selections.
If you do not want to offer dynamic selections, make the following
settings:
- LDB PNP: In the Selection view field, enter PNP_NO_FREE_SEL.
- LDB PNPCE: Leave the Selection view field empty.
Parameters and Options in Screen Area Data Selection Period/Person
Selection Period/Payroll Area/Period/Year
o Available input parameters, date or period entry (today, key date,
all, and so on), and standard value.
Using the Standard value option, you define which of the selected
options is shown.
Parameters and Options in Screen Area CE Selection Fields
o CE selection fields (external person ID, grouping reason, grouping
value)
Using the options in this area, you define whether the external
person Id, grouping reason, or grouping value are available on the
selection screen.
Note:
These parameters are only relevant for you if you implement
Concurrent Employment (see also note 517071).
Parameters and Options in Screen Area Selection view
o Dynamic selections as dialog box
If this switch is set, you can call the dynamic selections as a
dialog box.
o Dynamic selections active
If this switch is set, the dynamic selections of the logical
database are active at the start of the report.
Note that the following combinations are possible for the last two
options mentioned:
Dyn.Sel. as dialog box/Dyn.Sel. active: inactive/inactive
Dyn.Sel. as dialog box/Dyn.Sel. active: inactive/active
Dyn.Sel. as dialog box/Dyn.Sel. active: active/inactive
Activities
1. Choose Edit -> New entries.
2. Enter an abbreviation and a long text for the report category.
The customer name range for report categories is 0-9.
3. Select the For the PNPCE logical database checkbox, if you want to
create a report category for a program or for queries of the PNPCE
logical database.
4. In the General Data screen area, choose the desired options.
If you want to use selection IDs, you must have first created and
grouped selection Ids. The IMG path to do this is given in the
parameter description section.
5. In the Data selection period/person selection period or Selection
period screen area, choose the desired options.
6. In the Selection view screen area, choose the desired options.
7. In the CE selection fields screen area, choose the desired (only
possible for report categories of the LDB PNPCE).
8. Save your entries.
9. Choose the subactivity Permitted selection criteria.
10. Choose Edit -> New entries.
11. In the Select option field, use the input help to select each field
that should be available on the selection screen.
12. Select the checkbox in the 1.page column, if you want this selection
field to be available directly when you call the selection screen.
Further notes
13. If you want to copy entries, you still have to enter the selection
parameters again in the subsequent screen.
o If you create the report category '000000000', a selection screen is
generated according to report category '00000000'for all reports for
which a report category has not explicitly been assigned.
Assign Report Categories
In this step, you assign a report category to your reports.
Example
You have created your own report, for example ZPCTEST1, and would like
it to have the selection screen that corresponds to that of the
evaluation report for Payroll, which is assigned to report category
'__M00001'.
Assign report category '__M00001' to the report.
Requirements
You must have defined the Report Categories.
Standard settings
SAP Standard Reports:
In the standard system, reports are assigned a report category. If you
want to override these assignments, perform the activities described
here. If you want to assign report categories to standard reports using
SE38, this represents a modification.
Customer-Specific Reports:
For reports you have developed yourself, you can either assign report
categories by performing the activities described here or directly in SE38.
Recommendation
Only assign a report category if you have created your own reports or if
the selection screens in the standard system do not meet your
requirements.
Activities
1. Choose Edit -> New entries.
2. Perform the required assignment using the Program name and Report
category fields.
3. Save your entries.
reward if helpful
regards,
madhumitha -
How to send mail with out attachment in a report using oops concept
Hi Abap Experts,
My requirement is i have to send a mail with out attaching any documents this is a report using oops conceopt how can i acheive it .Hi Saeed,
Please search SDN before posting. There are so may threads for the same.
Check out the standard reports--
bcs_example_1, bcs_example_2, .. bcs_example_7
Howard -
Crystal report using ABAP from SAP ECC6.0 EHP 3.0
Hi Gurus,
Can i create crystal report using ABAP in SAP ECC 6.0 EHP 3 . as i am not able to see this link in SPRO.
IMG > SAP NetWeaver > Application Server > SAP List Viewer > Maintain SAP GUI Specific Settings.
Kindly guide me urgently.http://help.sap.com/saphelp_slc/helpdata/en/27/c9ee1951fc4fb9ac322ac7e6fa7372/content.htm
If I understood your question correctly.
Have a look in the link above.
It is possible to use Crystal Reports from ALV.
Tammy Powlas also has some good guides on how to do this.
The ABAP however is not covered that much.
Best Regards
Ingrid -
How do we track back the ABAP queries/report painter used to custom report?
Hi Experts,
I only have some ideas about report painter and ABAP query. If a company has a number of different Z reports in production.
1. How do we identify if it's report painter/writer or ABAP query??
2. For ABAP query report, suppose that i can identify one. If i am given a Z tcode of that report and identify the program of that report behind it, How do i know what query that program belongs to?? What are the steps i go back in SQ03 to view that query??
3. For report painter, starting from ztcode of the report, where do i check and track the original painter of that report??
Please help clarify my doubts..
MonicaHi Monica,
For report painter/writer, you can identified it by go to
Environment --> Technical information when you execute your Z-tcode.
To refer back to the report painter/writer t-code you just need to double click oh the report group that you see by clicking the link above.
Thanks,
Victor. -
Perform setting OOP ALV for multiple reports using Field Symbols
Hi, Abapers ... i try to write a programme which using ONE oop ALV but 2 different structure internal table. the last result should be 2 radio button. first button is r_wbs and 2ns r_kpi. r_wbs will display 4 column answer and r_kpi will display 10 columns answer with different column name. i successfully implemented using FIELDS SYMBOLS but the problems i failed to perform customized setting forALV (report's tittle, column name, different layout etc) for 2 different reports. this is the programme. Please Give Opinion, simple example will be more helpful. Thanks You Very Much
*&this report experimental how to print into ONE alv
*&with 2 diffrent structure internal table
REPORT zfiroopalv.
SELECTION-SCREEN BEGIN OF BLOCK mode WITH FRAME TITLE text-002.
PARAMETERS r_wbs RADIOBUTTON GROUP mode DEFAULT 'X'.
PARAMETERS r_kpi RADIOBUTTON GROUP mode.
SELECTION-SCREEN END OF BLOCK mode.
CLASS lcl_main DEFINITION.
PUBLIC SECTION.
CLASS-DATA: md_wbs TYPE c LENGTH 1.
METHODS: process,
write.
DATA: mdo_data TYPE REF TO data.
TYPES: BEGIN OF st_wbs,
rsnum TYPE zmeime002a-rsnum,
rspos TYPE zmeime002a-rspos,
a TYPE zmmgitab01-menge,
b TYPE zmeime002a-bdmng,
c TYPE zmeime002a-bdmng,
d TYPE zmeime002a-bdmng,
e TYPE zmeime002a-bdmng,
f TYPE zmmgitab01-menge,
g TYPE zmmgitab01-menge,
END OF st_wbs.
TYPES: BEGIN OF st_kpi,
regio TYPE zmeime002a-regio,
gsber TYPE zmeime002a-gsber,
gtext TYPE zmeime002a-gtext,
x TYPE zmmgitab01-menge,
y TYPE zmmgitab01-menge,
z TYPE zmmgitab01-menge,
END OF st_kpi.
CLASS-DATA: it_wbs TYPE TABLE OF st_wbs,
wa_wbs LIKE LINE OF it_wbs.
CLASS-DATA: it_kpi TYPE TABLE OF st_kpi,
wa_kpi LIKE LINE OF it_kpi.
PRIVATE SECTION.
DATA: set_display_setting TYPE REF TO cl_salv_table.
DATA: display_settings TYPE REF TO cl_salv_display_settings.
DATA: salv_table TYPE REF TO cl_salv_table.
DATA: error TYPE REF TO cx_root.
DATA: errtext TYPE string.
ENDCLASS.
CLASS lcl_kpi DEFINITION INHERITING FROM lcl_main.
PUBLIC SECTION.
METHODS: process_kpi.
PRIVATE SECTION.
ENDCLASS.
* C.L.A.S.S lcl_main D.E.F.I.N.I.T.I.O.N
CLASS lcl_wbs DEFINITION INHERITING FROM lcl_main.
PUBLIC SECTION.
METHODS: process_wbs.
PRIVATE SECTION.
ENDCLASS.
* m.a.i.n. .p.r.o.g.r.a.m.
START-OF-SELECTION.
DATA: o_main TYPE REF TO lcl_main.
DATA: p_wbs TYPE c.
CREATE OBJECT o_main.
CASE 'X'.
WHEN r_wbs.
o_main->md_wbs = 'X'.
WHEN r_kpi.
o_main->md_wbs = ' '.
ENDCASE.
o_main->process( ).
o_main->write( ).
CLASS lcl_main IMPLEMENTATION.
*ENDMETHOD.
METHOD process. " NOTE: public method
DATA: o_main TYPE REF TO lcl_main,
o_wbs TYPE REF TO lcl_wbs,
o_kpi TYPE REF TO lcl_kpi.
CREATE OBJECT: o_wbs,o_kpi.
IF ( me->md_wbs = 'X' ).
CALL METHOD o_wbs->process_wbs( ). " NOTE: private method
GET REFERENCE OF me->it_wbs INTO me->mdo_data.
ELSE.
CALL METHOD o_kpi->process_kpi( ). " NOTE: private method
GET REFERENCE OF me->it_kpi INTO me->mdo_data.
ENDIF.
ENDMETHOD.
METHOD write.
FIELD-SYMBOLS:
<lt_outtab> TYPE table.
ASSIGN me->mdo_data->* TO <lt_outtab>.
cl_salv_table=>factory(
EXPORTING
list_display = if_salv_c_bool_sap=>false
IMPORTING
r_salv_table = salv_table
CHANGING
t_table = <lt_outtab>
salv_table->display( ).
ENDMETHOD.
ENDCLASS.
CLASS lcl_kpi IMPLEMENTATION.
METHOD process_kpi.
*********** run some select statement into it_kpi*******
ENDMETHOD.
ENDCLASS.
CLASS lcl_wbs IMPLEMENTATION.
METHOD process_wbs.
*********** run some select statement into it_wbs*******
ENDMETHOD.
ENDCLASS.Hi,
I had similar requirement wherein I was supposed to display different data using 2 different internal tables on a subscreen area.
The screen consists of two parts: 1) selection-screen with few input fields and two buttons 2) Subscreen area where the report need to be displayed. This report is displayed based on the button that the user is selecting. For this I have done the following things:
1. Capture the sy-ucomm when user is clicking on any of the two buttons in PAI. Then perform data fetch operation.
MODULE USER_COMMAND_9003 INPUT.
CASE OK_CODE.
WHEN 'DETAIL'.
GV_RPT = OK_CODE.
PERFORM F_GET_DETAIL_DATA.
WHEN 'REPORT'.
GV_RPT = OK_CODE.
PERFORM F_GET_REPT_DATA.
ENDCASE.
ENDMODULE. " USER_COMMAND_9003 INPUT
2. Declare two different ALV's with the fieldcat similar to 2 internal tables respectively. Use the above sy-ucomm PBO to call appropriate ALV.
MODULE DISPLAY_ALV OUTPUT.
IF GV_RPT EQ 'DETAIL'.
PERFORM F_FIELDCAT_DETAIL.
PERFORM F_LAYOUT_DETAIL.
PERFORM F_EXCLUDE_TOOLBAR_DETAIL.
PERFORM F_DISPLAY_ALV_DETAIL.
ELSEIF GV_RPT EQ 'REPORT'.
PERFORM F_FIELDCAT_REPT.
PERFORM F_LAYOUT_REPT.
PERFORM F_EXCLUDE_TOOLBAR_REPT.
PERFORM F_DISPLAY_ALV_REPT.
ENDIF.
ENDMODULE. " DISPLAY_ALV OUTPUT
3. Before displaying ALV you need to free the container and ALV.
FORM F_DISPLAY_ALV_DETAIL .
IF GC_CONTAINER_ES IS NOT INITIAL.
CALL METHOD GC_CONTAINER_ES->FREE
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
IF GC_ALV_GRID_ES IS NOT INITIAL.
CALL METHOD GC_ALV_GRID_ES->FREE
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
IF GC_CONTAINER_TB IS NOT INITIAL.
CALL METHOD GC_CONTAINER_TB->FREE
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
IF GC_ALV_GRID_TB IS NOT INITIAL.
CALL METHOD GC_ALV_GRID_TB->FREE
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
CREATE OBJECT GC_CONTAINER_ES
EXPORTING
CONTAINER_NAME = 'CC_9003'
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
OTHERS = 6.
CREATE OBJECT GC_ALV_GRID_ES
EXPORTING
I_PARENT = GC_CONTAINER_ES
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5.
CALL METHOD GC_ALV_GRID_ES->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = GS_LAYOUT_ES
IT_TOOLBAR_EXCLUDING = GT_TOOLBAR_ES
CHANGING
IT_OUTTAB = GT_ES_REPT
IT_FIELDCATALOG = GT_FIELDCAT_ES
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4.
ENDFORM. " F_DISPLAY_ALV_DETAIL
Similarly define the FORM F_DISPLAY_ALV_REPT.
Hope this will be useful for you. If you have any more queries let me know. -
Hoe top create summary and detail report using ABAP QUERY
Hi ,
Can any one suggest me how to create summary and detailed report using ABAP Quey.
Regards,
Raghu.Hi,
Table Declaration
tables:mara,mast.
*Declaring the internal table
data: begin of itab_new occurs 0,
matnr like mara-matnr, "Material No
ernam like mara-ernam, "Material Created by
mtart like mara-mtart, "Material Type
matkl like mara-matkl, "Material Desc
werks like mast-werks, "Plant
aenam like mast-aenam, "BOM created
stlal like mast-stlal, "Alternative BOM
end of itab_new.
select-options: p_matnr for mara-matnr.
CODE A : Retrieving the data from the database
select f~matnr f~ernam f~mtart f~matkl m~werks m~aenam m~stlal
into table itab_new
from mara as f inner join mast as m
on f~matnr = m~matnr
where f~matnr in p_matnr.
CODE B : Retrieving the data from the database.
SELECT FMATNR FERNAM FMTART FMATKL MWERKS MAENAM M~STLAL
INTO TABLE ITAB_NEW
FROM MARA AS F INNER JOIN MAST AS M
ON FMATNR = MMATNR
WHERE F~MATNR = P_MATNR.
SORT ITAB_NEW BY ERNAM.
loop at itab_new.
write:/5 itab_new-matnr,itab_new-ernam,itab_new-mtart,itab_new-matkl,itab_new-werks,itab_new-aenam,itab_new-stlal.
endloop.
*TABLES: MARA , MAST.
*DATA:BEGIN OF ITAB_NEW OCCURS 0,
MATNR LIKE MARA-MATNR,
ERNAM LIKE MARA-ERNAM,
MTART LIKE MARA-MTART,
MATKL LIKE MARA-MATKL,
END OF ITAB_NEW.
SELECT MATNR ERNAM MTART MATKL
INTO TABLE ITAB_NEW
FROM MARA
WHERE MTART = 'T'
ORDER BY MATNR ERNAM MTART MATKL.
*DATA: BEGIN OF ITAB OCCURS 0,
MATNR LIKE MARA-MATNR,
END OF ITAB.
Thank U,
Jay.... -
Hi experts,
I publish a CR report to BOE. Can I open that CR report using ABAP? If it can, How to do it ?
ThanksHi Henry,
There is an environment for report layout designing. For a list of possible data sources, take a look at http://support.businessobjects.com/library/kbase/articles/c2001031.asp.
Also you can refer to the following ling for all CR related implementation in SAP:
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/004aacbb-4983-2b10-8da7-cdff5dcbb948.
Hope it helps... -
Generating a report using ABAP query
Hi All,
I want to generate a anlytical report using ABAP query, There are 3 different transactions/steps have to be executed to get this data in an actionable form.
1. MB52 - Unrestricted Stock
2. ZCustomquery - Custom query in SAP R3
3. Combine above two in a single report.
Please suggest me how can i proceed,
1. Example i have created query name called Finalrepot
2. How can i call above zcustomquery and Transaction (MB52) in the Query.
Thanks for your help
PradeepHi,
Check below link to create ABAP query (SAP Query)
http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Create_The_Query.asp
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
Best regards,
Brijesh -
Development of Reports using ABAP Query
Hi
can anyone please tell me about 'Development of Reports using ABAP Query' and how to use it in real time
Thanks
jaylook here:
http://help.sap.com/saphelp_47x200/helpdata/en/b7/26ddebb1f311d295f40000e82de14a/frameset.htm
A. -
ALV report using OOPS concept.
Hi,
Please help me in writing ALV report using OOPS concept as i have never used this concept before.Please post a clear picture for this.
Thanks in advance.Hi
Refer this code:
REPORT zcls_alv_oops MESSAGE-ID z1.
TABLES : mara.
Types Declaration..\
TYPES :
BEGIN OF t_mara,
matnr TYPE matnr,
mtart TYPE mtart,
maktx TYPE maktx,
END OF t_mara,
BEGIN OF t_marc,
matnr TYPE matnr,
werks TYPE werks_d,
mtart TYPE mtart,
maktx TYPE maktx,
END OF t_marc.
Internal Tables Declaration..\
DATA :
i_mara TYPE TABLE OF t_mara,
i_marc TYPE TABLE OF t_marc,
i_fcat1 TYPE lvc_t_fcat,
i_fcat2 TYPE lvc_t_fcat.
Constants Declaration..\
CONSTANTS :
c_cont1 TYPE scrfname VALUE 'CONT1',
c_cont2 TYPE scrfname VALUE 'CONT2'.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
SELECT-OPTIONS:
s_matnr FOR mara-matnr NO INTERVALS.
SELECTION-SCREEN SKIP 1.
PARAMETERS :
p_hotspt RADIOBUTTON GROUP r1 DEFAULT 'X',
p_bttn RADIOBUTTON GROUP r1.
SELECTION-SCREEN END OF BLOCK b1.
\* Class forward referncing.
CLASS lcl_rcvr_class DEFINITION DEFERRED.
\* Pointers Declaration..
DATA :
lp_rcvr TYPE REF TO lcl_rcvr_class,
lp_cont1 TYPE REF TO cl_gui_custom_container,
lp_cont2 TYPE REF TO cl_gui_custom_container,
lp_grid1 TYPE REF TO cl_gui_alv_grid,
lp_grid2 TYPE REF TO cl_gui_alv_grid.
\* Local Class Definiton.
CLASS lcl_rcvr_class DEFINITION.
PUBLIC SECTION.
METHODS :
hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING e_row_id e_column_id es_row_no,
handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row e_column.
ENDCLASS.
\* Local Class Implementation.
CLASS lcl_rcvr_class IMPLEMENTATION.
METHOD hotspot_click.
DATA :
wa_mara TYPE t_mara,
wa_marc TYPE t_marc.
DATA :
l_index TYPE sy-tabix.
READ TABLE i_mara INTO wa_mara INDEX e_row_id-index.
IF sy-subrc EQ 0.
REFRESH i_marc.
SELECT matnr
werks
INTO TABLE i_marc
FROM marc
WHERE matnr EQ wa_mara-matnr.
IF sy-subrc EQ 0.
LOOP AT i_marc INTO wa_marc.
l_index = sy-tabix.
wa_marc-mtart = wa_mara-mtart.
wa_marc-maktx = wa_mara-maktx.
MODIFY i_marc FROM wa_marc INDEX l_index
TRANSPORTING mtart maktx.
ENDLOOP.
CALL SCREEN 200.
ELSE.
MESSAGE e121 WITH text-005 wa_mara-matnr.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD handle_double_click.
DATA :
wa_mara TYPE t_mara,
wa_marc TYPE t_marc.
DATA :
l_index TYPE sy-tabix.
READ TABLE i_mara INTO wa_mara INDEX e_row-index.
IF sy-subrc EQ 0.
REFRESH i_marc.
SELECT matnr
werks
INTO TABLE i_marc
FROM marc
WHERE matnr EQ wa_mara-matnr.
IF sy-subrc EQ 0.
LOOP AT i_marc INTO wa_marc.
l_index = sy-tabix.
wa_marc-mtart = wa_mara-mtart.
wa_marc-maktx = wa_mara-maktx.
MODIFY i_marc FROM wa_marc INDEX l_index
TRANSPORTING mtart maktx.
ENDLOOP.
CALL SCREEN 200.
ELSE.
MESSAGE e121 WITH text-005 wa_mara-matnr.
ENDIF.
ENDIF.
ENDMETHOD.
ENDCLASS.
\* Start of Selection
START-OF-SELECTION.
\* Extract the Material Master data for the Input Material.
SELECT a~matnr
a~mtart
b~maktx
INTO TABLE i_mara
FROM mara AS a
INNER JOIN makt AS b
ON a~matnr EQ b~matnr
WHERE a~matnr IN s_matnr
AND b~spras EQ sy-langu.
END-OF-SELECTION.
IF NOT i_mara\[\] IS INITIAL.
\* Call Screen to display the Material Master data.
CALL SCREEN 100.
ELSE.
MESSAGE s121 WITH text-006.
ENDIF.
\*& Module DISP_GRID OUTPUT
\* text
MODULE disp_grid OUTPUT.
\* Build the Field catelog for Material Master data.
PERFORM build_fcat.
\* Display the Material Master data using ALV.
PERFORM disp_alv.
ENDMODULE. " DISP_GRID OUTPUT
\*& Module USER_COMMAND_0100 INPUT
\* text
MODULE user_command_0100 INPUT.
\*when exit or cancel is clicked program has to come out
CASE sy-ucomm.
WHEN 'EXIT' OR 'CANC'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
\*& Form build_fcat
\* text
\* \--> p1 text
\* <-\- p2 text
FORM build_fcat.
DATA : ws_fcat TYPE lvc_s_fcat.
ws_fcat-fieldname = 'MATNR'.
ws_fcat-scrtext_m = text-001.
ws_fcat-tabname = 'I_MARA'.
IF p_hotspt EQ 'X'.
ws_fcat-hotspot = 'X'.
ENDIF.
APPEND ws_fcat TO i_fcat1.
CLEAR ws_fcat.
ws_fcat-fieldname = 'MTART'.
ws_fcat-scrtext_m = text-002.
ws_fcat-tabname = 'I_MARA'.
APPEND ws_fcat TO i_fcat1.
CLEAR ws_fcat.
ws_fcat-fieldname = 'MAKTX'.
ws_fcat-scrtext_m = text-003.
ws_fcat-tabname = 'I_MARA'.
APPEND ws_fcat TO i_fcat1.
CLEAR ws_fcat.
ENDFORM. " build_fcat
\*& Form disp_alv
\* text
\* \--> p1 text
\* <-\- p2 text
FORM disp_alv.
IF lp_cont1 IS INITIAL.
\* Create the Container Object of Material Master.
CREATE OBJECT lp_cont1
EXPORTING
container_name = c_cont1
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6 .
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
\* Create the Object for Grid of Material Master.
CREATE OBJECT lp_grid1
EXPORTING
i_parent = lp_cont1
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
others = 5.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
\* Dipslay Material Master data by calling method.
CALL METHOD lp_grid1->set_table_for_first_display
CHANGING
it_outtab = i_mara
it_fieldcatalog = i_fcat1
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
\* Set Handler for the Hot Spot Event.
CREATE OBJECT lp_rcvr.
IF p_hotspt EQ 'X'.
SET HANDLER lp_rcvr->hotspot_click FOR lp_grid1.
ELSE.
SET HANDLER lp_rcvr->handle_double_click FOR lp_grid1.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " disp_alv
\*& Module STATUS_0100 OUTPUT
\* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'MAIN_STAT'.
SET TITLEBAR 'T_100'.
ENDMODULE. " STATUS_0100 OUTPUT
\*& Module STATUS_0200 OUTPUT
\* text
MODULE status_0200 OUTPUT.
SET PF-STATUS 'PLANT_STAT'.
SET TITLEBAR 'T_200'.
ENDMODULE. " STATUS_0200 OUTPUT
\*& Module DISP_GRID_plant OUTPUT
\* text
MODULE disp_grid_plant OUTPUT.
\* Build the Field catelog for Material Plant data.
PERFORM build_fcat_plant.
\* Display the Material Master Plant data using ALV.
PERFORM disp_alv_plant.
ENDMODULE. " DISP_GRID_plant OUTPUT
\*& Module USER_COMMAND_0200 INPUT
\* text
MODULE user_command_0200 INPUT.
\*when exit or cancel is clicked program has to come out
CASE sy-ucomm.
WHEN 'EXIT' OR 'CANC'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0200 INPUT
\*& Form build_fcat_plant
\* text
\* \--> p1 text
\* <-\- p2 text
FORM build_fcat_plant.
DATA : ws_fcat TYPE lvc_s_fcat.
ws_fcat-fieldname = 'MATNR'.
ws_fcat-scrtext_m = text-001.
ws_fcat-tabname = 'I_MARC'.
APPEND ws_fcat TO i_fcat2.
CLEAR ws_fcat.
ws_fcat-fieldname = 'WERKS'.
ws_fcat-scrtext_m = text-004.
ws_fcat-tabname = 'I_MARC'.
APPEND ws_fcat TO i_fcat2.
CLEAR ws_fcat.
ws_fcat-fieldname = 'MTART'.
ws_fcat-scrtext_m = text-002.
ws_fcat-tabname = 'I_MARC'.
APPEND ws_fcat TO i_fcat2.
CLEAR ws_fcat.
ws_fcat-fieldname = 'MAKTX'.
ws_fcat-scrtext_m = text-003.
ws_fcat-tabname = 'I_MARC'.
APPEND ws_fcat TO i_fcat2.
CLEAR ws_fcat.
ENDFORM. " build_fcat_plant
\*& Form disp_alv_plant
\* text
\* \--> p1 text
\* <-\- p2 text
FORM disp_alv_plant.
IF lp_cont2 IS INITIAL.
\* Create the Container Object of Material Plant data.
CREATE OBJECT lp_cont2
EXPORTING
container_name = c_cont2
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
\* Create the Object for Grid of Material Plant data.
CREATE OBJECT lp_grid2
EXPORTING
i_parent = lp_cont2
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
others = 5.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
\* Dipslay Material Plant data by calling method.
CALL METHOD lp_grid2->set_table_for_first_display
CHANGING
it_outtab = i_marc
it_fieldcatalog = i_fcat2
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDIF.
ELSE.
\* Call method 'REFRESH_TABLE_DISPLAY' to refresh the grid data.
CALL METHOD lp_grid2->refresh_table_display.
ENDIF.
ENDFORM. " disp_alv_plant
Thanks
Vasudha
Maybe you are looking for
-
Size limitation that can be passed to Java stored procedure
Hello! I enjoy using Oracle8i these days. But I have some questions about Java stored procedure. I want to pass the XML data to Java stored procedure as IN parameter. But I got some errors when the data size is long. Is there any limitation in the da
-
"An error occurred while trying to Adobe ExportPDF online"
When I try to convert a file I get the following message: "An error occurred while trying to Adobe ExportPDF online. What does this mean?
-
Can someone please give me a link to the documents that tells me all the differences between 8i and 9i Thnx...
-
Multiple row update; CEV business rule parameters are not refreshed
During a multiple row update, a business rule is fired for each row. This change event business rule must update the value of another column in the same table (and same row). Unfortunately, the parameters of the BR are keeping the values of the first
-
Additional Menu Templates for elements 12.1
Are there any additional templates available for Premiere Elements 12.?