How to create POPUP windows (from ALV report)
Hi there,
I have a ALV report which has a field where the user can click and view more details of the selected data. I would like to have a popup and then display the selected data...is that possible? Any function module which I can use to pop up a window and display selected data?
Thanks in advance!
Cheers,
MC
Hi MC,
Please follow the steps below for getting the result you desired.
1. In your field catalogue, move 'X' to the slis_fieldcat_alv-hotspot field. This will enable the user to select it.
2. Set slis_t_event_exit-ucomm = '&IC1' and slis_t_event_exit-before = 'X' and pass this internal table to the ALV function call. This will enable to code your own logic for that standard user command.
3. Pass your 'User command' routine name to the appropriate paramter of the function module.
4. Your 'User command' routine should have the following format.
* FORM USER_COMMAND *
* --> UCOMM *
* --> SELFIELD *
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
CASE ucomm.
WHEN '&IC1'.
PERFORM display_pop_up USING selfield.
WHEN OTHERS.
ENDCASE.
MOVE '&REFRESH' TO ucomm.
ENDFORM. " USER_COMMAND
5. Write your code for the pop-up in the routine 'DISPLAY_POP_UP'. Look at 'POPUP*' function modules to pick up the best suitable one for you.
Hope this helps,
Srinivas
Similar Messages
-
How to create check box in ALV Reports?
how to create check box in ALV Reports?
Hi
check the report BCALV_TEST_GRID_EDITABLE
or
check this report
REPORT ZRFC346_TST.
TABLES:SFLIGHT,RL034.
TYPE-POOLS:SLIS.
INCLUDE:<ICON>,<SYMBOL>.
DATA: G_REPID LIKE SY-REPID,
G_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
G_IT_SORT TYPE SLIS_T_SORTINFO_ALV,
G_LAYOUT TYPE SLIS_LAYOUT_ALV,
G_TABNAME_HEADER TYPE SLIS_TABNAME,
G_TABNAME_ITEM TYPE SLIS_TABNAME,
G_KEYINFO TYPE SLIS_KEYINFO_ALV,
G_VARIANT LIKE DISVARIANT,
G_EXTAB TYPE SLIS_T_EXTAB,
I_SLIS_EXIT_BY_USER TYPE SLIS_EXIT_BY_USER.
DATA: XEVENT TYPE SLIS_T_EVENT,
AEVENT TYPE SLIS_ALV_EVENT,
VARIANT LIKE DISVARIANT,
LAYOUT TYPE SLIS_LAYOUT_ALV,
ASP_GROUP TYPE SLIS_SP_GROUP_ALV,
GT_SP_GROUP TYPE SLIS_T_SP_GROUP_ALV,
EXTAB TYPE SLIS_T_EXTAB WITH HEADER LINE,
XFIELD TYPE SLIS_T_FIELDCAT_ALV,
AFIELD TYPE SLIS_FIELDCAT_ALV,
G_SUCOMM LIKE SY-UCOMM,
G_SELFLD TYPE SLIS_SELFIELD.
DATA: SAV_SY_REPID LIKE SY-REPID.
CONSTANTS: CON_SFLIGHT TYPE LVC_FNAME VALUE 'SFLIGHT',
CON_DISPLAY_FULL TYPE I VALUE 3.
Data to be displayed
DATA: BEGIN OF GT_SFLIGHT OCCURS 0.
INCLUDE STRUCTURE SFLIGHT.
DATA:ACTIVATE(1).
DATA: END OF GT_SFLIGHT.
INITIALIZATION.
*........Initialisierung...............................................
PERFORM INITIALIZATION_RL034.
*........Field cata....................................................
PERFORM FIELD_CAT.
*........SPECIAL GROUP.................................................
PERFORM E07_SP_GROUP_BUILD USING GT_SP_GROUP[].
START-OF-SELECTION.
Selection
SELECT * FROM SFLIGHT INTO TABLE GT_SFLIGHT.
*........ALV CALL.......................................................
PERFORM ALV_CALL.
PERFORM USER_COMMAND_LOCAL USING G_SUCOMM G_SELFLD.
FORM USER_COMMAND_LOCAL *
--> G_UCOMM *
--> G_SELFIELD *
FORM USER_COMMAND_LOCAL USING G_UCOMM LIKE SY-UCOMM
G_SELFIELD TYPE SLIS_SELFIELD.
CASE G_UCOMM.
WHEN 'ACT'.
ENDCASE.
ENDFORM.
FORM ALV_CALL *
FORM ALV_CALL.
Call ABAP List Viewer (ALV)
G_LAYOUT-BOX_FIELDNAME = 'ACTIVATE'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_BACKGROUND_ID = 'ALV_BACKGROUND'
I_BYPASSING_BUFFER = SPACE
I_BUFFER_ACTIVE = SPACE
I_CALLBACK_PROGRAM = SAV_SY_REPID
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND_LOCAL'
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME = 'SFLIGHT'
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = G_LAYOUT
IT_FIELDCAT = XFIELD[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS = GT_SP_GROUP[]
IT_SORT =
IT_FILTER =
IS_SEL_HIDE = 'X'
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS = XEVENT
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = GT_SFLIGHT
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.
FORM status *
--> EXTAB *
FORM STATUS USING EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STAT' EXCLUDING EXTAB.
ENDFORM. " STATUS
*& Form INITIALIZATION_RL034
text
--> p1 text
<-- p2 text
FORM INITIALIZATION_RL034.
SAV_SY_REPID = SY-REPID.
ENDFORM. " INITIALIZATION_RL034
*& Form DEFINE_EVENTS_RL034
text
--> p1 text
<-- p2 text
FORM DEFINE_EVENTS_RL034.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = XEVENT.
exceptions
list_type_wrong = 1
others = 2.
ENDFORM. " DEFINE_EVENTS_RL034
*& Form FIELD_CAT
text
--> p1 text
<-- p2 text
FORM FIELD_CAT.
DATA: LS_FCAT TYPE SLIS_FIELDCAT_ALV,
L_LIN TYPE I.
REFRESH XFIELD.
1. per Default eingeblendete Felder *
*........Ikone/Symbol..................................................
CLEAR AFIELD.
DATA: LS1_FCAT TYPE SLIS_FIELDCAT_ALV,
L_LIN1 TYPE I.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = CON_SFLIGHT
I_BYPASSING_BUFFER = SPACE
I_BUFFER_ACTIVE = SPACE
CHANGING
CT_FIELDCAT = XFIELD
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
DESCRIBE TABLE XFIELD LINES L_LIN1.
ADD 1 TO L_LIN1.
CLEAR LS_FCAT.
LS1_FCAT-FIELDNAME = 'ACTIVATE'.
LS1_FCAT-CHECKBOX = 'X'.
LS1_FCAT-KEY = 'X'.
LS1_FCAT-INPUT = 'X'.
LS1_FCAT-EDIT = 'X'.
LS1_FCAT-INTTYPE = 'C'.
LS1_FCAT-DATATYPE = 'CHAR'.
LS1_FCAT-INTLEN = 1.
LS1_FCAT-COL_POS = L_LIN1.
LS1_FCAT-SELTEXT_S = LS1_FCAT-FIELDNAME.
LS1_FCAT-SELTEXT_M = LS1_FCAT-FIELDNAME.
LS1_FCAT-SELTEXT_L = LS1_FCAT-FIELDNAME.
LS1_FCAT-SP_GROUP = 'A'.
APPEND LS1_FCAT TO XFIELD.
ADD 1 TO L_LIN.
ENDFORM. " FIELD_CAT
FORM E07_SP_GROUP_BUILD USING E07_LT_SP_GROUP TYPE SLIS_T_SP_GROUP_ALV.
DATA: LS_SP_GROUP TYPE SLIS_SP_GROUP_ALV.
CLEAR LS_SP_GROUP.
LS_SP_GROUP-SP_GROUP = 'A'.
LS_SP_GROUP-TEXT = 'SPECIAL'.
APPEND LS_SP_GROUP TO E07_LT_SP_GROUP.
ENDFORM.
Regards
Shiva -
How to create popup window with radio buttons and a input field
Hi Guys,
Can somebody give some directions to create a stand alone program to create a window popup with 2 radio button and an input field for getting text value. I need to update the text value in a custom table.
I will call this stand alone program from an user exit.
Please give me the guidance how go about it or please give any tutorial you have.
Thanks,
MiniHi,
There are multiple aspects of your requirements. So let's take them one at a time.
You can achieve it in the report program or you can use a combination of the both along.
You can create a standalone report program using the ABAP Editor (SE38). In the report program you can call the SAP Module pool program by CALL Screen <screen number>. And then in the module pool program you an create a subscreen and can handle the window popup with 2 radio button and an input field for getting the text.
For help - Module Pool programs you can search in ABAP Editor with DEMODYNPRO* and you will ge the entire demo code for all dialog related code.
For Report and other Module pool help you can have a look at the following:
http://help.sap.com/saphelp_nw70/helpdata/en/47/a1ff9b8d0c0986e10000000a42189c/frameset.htm
Hope this helps. Let me know if you need any more details.
Thanks,
Samantak. -
How to create popup Windows in WebDynpro
I am learning WebDynpro and have developed a sample application where i ask the user to login. In case of incorrect login I want to display a popup window which shows an error message and has an ok button on it. On click of the OK button i want to close the Window.
I have created a view for this popup... called errorView
On click of login button i perform validations n incase the validatins fail i have put in the following code
IWDWindowInfo myWinInfo = wdComponentAPI.getComponentInfo().findInWindows("Ra_ErrorView");
myPopupWindow = wdComponentAPI.getWindowManager().createWindow(myWinInfo,true);
myPopupWindow.setWindowPosition(300,150);
myPopupWindow.open();
How should i proceed?
Where should i write the myPopupWindow.close()
Kindly give a step-by-step solution.Hi Reema,
You want to close a window say window1 which you opened from a view.
create an attribute. select its type from java native settings to IWDWindow
wdContext.currentcontextElement().setWindowInstance(window);
1.create an event in component controller say event1
2.In order to trigger the event in component controller create a method in it
write this code in implementation of controller to trigger the event
wdThis.wdFireEventAddressSelectedEvent();
3.For catching whatever event that is responsible for closing the window create an event handler in view1 say eventhandler1.Choose the subscibed event to be event1
4.In that eventhandler1 write the code in implementation
IWDWindow window =
wdContext.currentcontextElement().getWindowInstance();
window.close();
Hope this helps you.Do revert back if you have more doubts
Regards
Rohit
Message was edited by: Rohit Radhakrishnan -
How to create .csv file from ABAP report
Hi
We have a requirement to generate .csv file from abap report.
Currently user saves data from abap report to spreadsheet(.xls format) in desktop. Then opens excel file and save as .csv format. Need option to save directly in .csv format instead of .xls format.
Please let me know, if there is any standard function module available to create .csv file.
Regards
UmaI tried with your code it's going to dump
REPORT ZTEMP101 message-id 00.
tables: lfa1.
types: begin of t_lfa1,
lifnr like lfa1-lifnr,
name1 like lfa1-name1,
end of t_lfa1.
data: i_lfa1 type standard table of t_lfa1,
wa_lfa1 type t_lfa1.
types truxs_t_text_data(4096) type c occurs 0.
data: csv_converted_table type table of TRUXS_T_TEXT_DATA.
select-options: s_lifnr for lfa1-lifnr.
select lifnr name1 from lfa1 into table i_lfa1
where lifnr in s_lifnr.
CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
EXPORTING
I_FIELD_SEPERATOR = ';'
I_LINE_HEADER =
I_FILENAME =
I_APPL_KEEP = ' '
TABLES
I_TAB_SAP_DATA = I_LFA1
CHANGING
I_TAB_CONVERTED_DATA = csv_converted_table
EXCEPTIONS
CONVERSION_FAILED = 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.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = ' '
CODEPAGE = ' '
FILENAME =
'C:\Documents and Settings\ps12\Desktop\Test folder\exl.cvs'
FILETYPE = 'DAT'
MODE = ' '
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
COL_SELECT = ' '
COL_SELECTMASK = ' '
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = csv_converted_table
FIELDNAMES =
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
my version is 4.6c -
How to open multiple windows from ALV?
I have a button on each line of ALV.
If the user clicks on the button on the first line, it shoud open a window in another session.
Now the user will be able to click on the button on the next line and another window should popu up.
Thus the user can compare the window contents and do the corrections.
How to achive this opening of windows simultaneously?
Thanks,
VenI tried the above function module and it does open anotehr session - but I am not able to pass values . I have to pass SAP Script texts and opent he window. but the above func mod calls t codes and allows bdcdata, messages or spa/gpa parameters only.
So I am back with my question - how to open the session with the text lines? -
How to handle interactive list in alv reports
hi experts.
how to handle interactive list in alv reports.
regards.
subhasisHI Subhasis,
below is the sample code for handling an interactive ALV report, hope this helps you ..
REPORT ZTEST_ALV123.
TYPE-POOLS:SLIS.
DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV.
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
END OF ITAB.
DATA: BEGIN OF ITAB1 OCCURS 0,
VBELN LIKE LIKP-VBELN,
POSNR LIKE LIPS-POSNR,
VGBEL LIKE LIPS-VGBEL,
VGPOS LIKE LIPS-VGPOS,
END OF ITAB1.
DATA: IT_LIPS LIKE ITAB1 OCCURS 0 WITH HEADER LINE.
SELECT VBELN
POSNR
FROM VBAP
INTO TABLE ITAB.
IF SY-SUBRC = 0.
SORT ITAB BY VBELN .
SELECT VBELN
POSNR
VGBEL
VGPOS
INTO TABLE ITAB1
FROM LIPS
FOR ALL ENTRIES IN ITAB
WHERE VGBEL = ITAB-VBELN
AND VGPOS = ITAB-POSNR.
ENDIF.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'PFSTATUS'
I_CALLBACK_USER_COMMAND = 'HANDLE_USER_COMMAND'
IT_FIELDCAT = IT_FIELDCAT
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC = 0.
ENDIF.
*& Form POPUP
text
-->P_EXTAB text
FORM POPUP USING P_EXTAB TYPE SLIS_T_EXTAB.
"here double click on PFSTATUS and create the status, "activate, before that set PICK for choose(F2).
*- Pf status
SET PF-STATUS 'PFSTATUS'.
ENDFORM. " POPUP
*& Form HANDLE_USER_COMMAND
text
-->R_UCOMM text
-->RS_SELFIELD text
FORM HANDLE_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
IF RS_SELFIELD-FIELDNAME = 'VBELN'.
READ TABLE ITAB INDEX RS_SELFIELD-TABINDEX.
LOOP AT ITAB1 WHERE VGBEL = ITAB-VBELN
AND VGPOS = ITAB-POSNR.
MOVE-CORRESPONDING ITAB1 TO IT_LIPS.
APPEND IT_LIPS.
ENDLOOP.
PERFORM INTERACTIVE_REPORT.
ENDIF.
ENDCASE.
ENDFORM. "HANDLE_USER_COMMAND
*& Form interactive_report
text
FORM INTERACTIVE_REPORT .
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-SELTEXT_L = 'VBELN'.
X_FIELDCAT-TABNAME = 'IT_LIPS'.
X_FIELDCAT-COL_POS = 1.
APPEND X_FIELDCAT TO IT_FIELDCAT1.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-SELTEXT_L = 'ITEM'.
X_FIELDCAT-TABNAME = 'IT_LIPS'.
X_FIELDCAT-COL_POS = 2.
APPEND X_FIELDCAT TO IT_FIELDCAT1.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'VGBEL'.
X_FIELDCAT-SELTEXT_M = 'SO #'.
X_FIELDCAT-TABNAME = 'IT_LIPS'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT1.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'VGPOS'.
X_FIELDCAT-SELTEXT_M = 'SO ITEM'.
X_FIELDCAT-TABNAME = 'IT_LIPS'.
X_FIELDCAT-COL_POS = 4.
APPEND X_FIELDCAT TO IT_FIELDCAT1.
CLEAR X_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IT_FIELDCAT = IT_FIELDCAT1
TABLES
T_OUTTAB = IT_LIPS
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC = 0.
ENDIF.
ENDFORM. " interactive_report
Regards,
Ranjita
null -
Jump from alv report to cor2 screen
Hi experts,
I develop one alv report ..i want to jump from alv report to COR2 screen when click on order number(field name is AUFNR).
i wrote code in this way.
FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD
CASE SELFIELD-FIELDNAME.
WHEN 'AUFNR'.
READ TABLE T_FINAL INDEX SELFIELD-TABINDEX.
SET PARAMETER ID 'AUF' FIELD T_FINAL-AUFNR.
CALL TRANSACTION 'COR2' AND SKIP FIRST SCREEN.
ENDCASE.
ENDFORM.
but it is not working properly,when u click on any order number it is going only the same order number(in cor2 screen).
what is the problem? set par id (AUF) EXIST IN TPARA table compulsalory or it is created automatically?
pls help me in this . If possible pls send the code.Hi,
I have already mentioned both ways, but ok, once again.
A. how I found parameter ID ANR:
1.) run transaction COR2
2.) set cursor to field "Process order"
3.) press F1 button
4.) performance assistant displays
5.) press "Technical Information"
6.) technical information displays
7.) in field "Parameter ID" you can see parameter ID assigned to a screen field
B. how I found parameter ID BR1:
1.) switch on debugger
2.) run transaction COR2
3.) put a breakpoint on "GET PARAMETER" statement
4.) debugger stops on every GET PARAMETER statement in PBO of COR2
5.) there you can see that BR1 is used for field AUFNR
Basically first mentioned way is sufficient, because system gets parameter value from parameter ID assigned to a screen element automatically. But in this case a value is overwritten by coding in PBO of COR2.
Hope it helps.
Regrds,
Adrian -
Excel sheet upload from alv report.
hi friends,
we created one report which will display about sales from vender,. we created it as hirarical alv report.
we all know when we downloaded the data which is shown on report to excel sheet standard report will run. but when i saw my excel file most of rows are exported finly but some of rows are clubed into another row colum. how it is happening. the data is passed to excel sheet by standard report how this prablem is happening.
plz guide me
thanq,
rajesh.khi
use code below to upload excel.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
EXPORTING
FILENAME = 'exccel Worksheet.txt'
FILETYPE = '.XLS'
HAS_FIELD_SEPARATOR = '#'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = SPACE
CODEPAGE = SPACE
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
VIRUS_SCAN_PROFILE =
IMPORTING
FILELENGTH =
HEADER =
CHANGING
DATA_TAB = <fs_dict>
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
NOT_SUPPORTED_BY_GUI = 17
ERROR_NO_GUI = 18
others = 19
*IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF. -
How to create multiple selection screens in reports
How to create multiple selection screens in reports
Thanks,
SridharEx: hope you will find an idea from the below example :
SELECTION-SCREEN BEGIN OF BLOCK SEL1 WITH FRAME TITLE TIT1.
PARAMETERS: CITYFR LIKE SPFLI-CITYFORM,
CITYTO LIKE SPFLI-CITYFORM.
SELECTION-SCREEN end OF BLOCK SEL1
SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
SELECTION-SCREEN INCLUDE BLOCKS SEL1.
SELECTION-SCREEN BEGIN OF BLOCK SEL2 WITH FRAME TITLE TIT2 .
PARAMETERS: AIRPFFR LIKE SPFLI-AIRPFROM,
AIRPTO LIKE SPFLI-AIRPTO.
SELECTION-SCREEN END OF BLOCK SEL2
SELECTION-SCREEN END OF SCREEN 5000.
INITIALIZATION.
TIT1 = 'ITIES'.
aT SELECTION-SCREEN.
CASE SY-DYNNR.
WHEN '0500'.
MESSAGE W159(at) WITH 'SCREEN 500'.
WHEN '1000'.
MESSAGE W159(at) WITH 'SCREEN 1000'.
ENDCASE.
START-OF-SELECTION.
TIT1 = 'CITIES FOR AIRPORTS'.
TIT2 = 'AIRPORTS'.
CALL SELECTION-SCREEN 500 STARTING AT 10 10.
TIT1 = 'CITIES AGAIN'.
CALL SELECTION-SCREEN 1000 STARTING AT 10 10. -
Can we call screen from ALV report
Hi All,
I am in the process of creating a stand alone application. However I have stuck up here.
Problem: Can we call any screen from ALV report? If yes then how??? Can anyone give some code snippet??
All your help appreciated.
Thanks,
JigneshHello Jignesh,
Here is an example, when you double click on a line, it pops with with another screen that holds details for the flight information.
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
METHODS:
handle_double_click FOR EVENT double_click
OF cl_gui_alv_grid
IMPORTING e_row
e_column.
ENDCLASS. "lcl_event_handler
CLASS lcl_event_handler IMPLEMENTATION.
METHOD handle_double_click.
READ TABLE it_flight INTO wa_flight INDEX e_row-index.
IF sy-subrc EQ 0.
SELECT * FROM sbook
INTO TABLE it_book
WHERE carrid EQ wa_flight-carrid AND
connid EQ wa_flight-connid.
CALL SCREEN 101 STARTING AT 10 10.
ENDIF.
ENDMETHOD. "HANDLE_DOUBLE_CLICK
ENDCLASS. "LCL_EVENT_HANDLER
MODULE status_0101 OUTPUT.
Variant to save the layout
gv_repid = sy-repid.
IF g_custom_container2 IS INITIAL.
Create an instance for Custom Container 'ALV_GRID'
CREATE OBJECT g_custom_container2
EXPORTING container_name = gs_container2.
Create an instance for ALV Grid
CREATE OBJECT g_grid2
EXPORTING i_parent = g_custom_container2.
Variant to save the layout
gs_layout-grid_title = 'Flight Bookings'.
CALL METHOD g_grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'SBOOK'
is_layout = gs_layout
CHANGING
it_outtab = it_book[].
ELSE.
CALL METHOD g_grid2->refresh_table_display.
ENDIF. "IF grid2 IS INITIAL.
Setting focus for created grid control
CALL METHOD cl_gui_control=>set_focus
EXPORTING
control = g_grid2.
CALL METHOD cl_gui_cfw=>flush.
ENDMODULE. " status_0101 OUTPUT
Refer to BC_ALV_GRID04 for ALV data declarations used in the above piece of code. -
How to create secondary lists in ALV
Hi all,
Can u plz explain me how to create Secondary lists usingl ALV and how many secondary lists we can create.
Thanks in advance
Venkatthis is the very very simple program in HR module to demonstrate interactive ALV report.
If u have HR module implemented...just copy and paste this code and debug it...you will easily get the flow of the report...this is the simplest program..
i hope it helps...here u go......
REPORT ztej_alv_interactive.
TABLES: pa0000, pa0001.
DATA : BEGIN OF it0001 OCCURS 0,
pernr LIKE pa0001-pernr,
ename LIKE pa0001-ename,
END OF it0001.
DATA : BEGIN OF it0000 OCCURS 0,
pernr LIKE pa0000-pernr,
begda LIKE pa0000-begda,
endda LIKE pa0000-endda,
massn LIKE pa0000-massn,
massg LIKE pa0000-massg,
aedtm LIKE pa0000-aedtm,
END OF it0000.
TYPE-POOLS: slis.
DATA: v_repid LIKE sy-repid .
DATA: i_fieldcat TYPE slis_t_fieldcat_alv.
DATA: i_fieldcat1 TYPE slis_t_fieldcat_alv.
DATA: it_listheader TYPE slis_t_listheader.
DATA: it_listheader1 TYPE slis_t_listheader.
DATA: v_events TYPE slis_t_event,
wa_event TYPE slis_alv_event.
DATA: alv_layout TYPE slis_layout_alv.
DATA: i_title_0001 TYPE lvc_title VALUE 'FIRST LIST DISPLAYED'.
DATA: i_title_0000 TYPE lvc_title.
DATA : temp_pernr LIKE pa0001-pernr.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
SELECTION-SCREEN SKIP.
SELECT-OPTIONS : s_pernr FOR pa0000-pernr DEFAULT '16240147'.
SELECTION-SCREEN END OF BLOCK b1.
INITIALIZATION.
v_repid = sy-repid.
PERFORM build_fieldcatlog USING i_fieldcat.
PERFORM event_call.
PERFORM populate_event.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM build_listheader USING it_listheader.
PERFORM display_alv_report.
*& Form BUILD_FIELDCATLOG
text
--> p1 text
<-- p2 text
FORM build_fieldcatlog USING temp_fieldcat TYPE slis_t_fieldcat_alv.
DATA : wa_temp_fieldcat TYPE slis_fieldcat_alv.
wa_temp_fieldcat-tabname = 'IT0001'.
wa_temp_fieldcat-fieldname = 'PERNR'.
wa_temp_fieldcat-seltext_m = 'Personnel Number'.
APPEND wa_temp_fieldcat TO temp_fieldcat.
CLEAR wa_temp_fieldcat.
wa_temp_fieldcat-tabname = 'IT0001'.
wa_temp_fieldcat-fieldname = 'ENAME'.
wa_temp_fieldcat-seltext_m = 'Name'.
APPEND wa_temp_fieldcat TO temp_fieldcat.
CLEAR wa_temp_fieldcat.
ENDFORM. " BUILD_FIELDCATLOG
*& Form EVENT_CALL
text
--> p1 text
<-- p2 text
FORM event_call.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = v_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.
ENDFORM. " EVENT_CALL
*& Form POPULATE_EVENT
text
--> p1 text
<-- p2 text
FORM populate_event.
READ TABLE v_events INTO wa_event WITH KEY name = 'TOP_OF_PAGE'.
IF sy-subrc EQ 0.
wa_event-form = 'TOP_OF_PAGE'.
MODIFY v_events FROM wa_event TRANSPORTING form WHERE name =
wa_event-form.
ENDIF.
READ TABLE v_events INTO wa_event WITH KEY name = 'USER_COMMAND'.
IF sy-subrc EQ 0.
wa_event-form = 'USER_COMMAND'.
MODIFY v_events FROM wa_event TRANSPORTING form WHERE name =
wa_event-name.
ENDIF.
ENDFORM. " POPULATE_EVENT
*& Form DATA_RETRIEVAL
text
--> p1 text
<-- p2 text
FORM data_retrieval.
SELECT pernr ename
FROM pa0001
INTO TABLE it0001
WHERE pernr IN s_pernr.
DELETE ADJACENT DUPLICATES FROM it0001.
ENDFORM. " DATA_RETRIEVAL
*& Form BUILD_LISTHEADER
text
-->P_IT_LISTHEADER text
FORM build_listheader USING i_listheader TYPE slis_t_listheader.
DATA hline TYPE slis_listheader.
hline-info = 'This is Interactive ALV Program.'.
hline-typ = 'H'.
APPEND hline TO i_listheader.
ENDFORM. " BUILD_LISTHEADER
*& Form DISPLAY_ALV_REPORT
text
--> p1 text
<-- p2 text
FORM display_alv_report.
v_repid = sy-repid.
alv_layout-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_grid_title = i_title_0001
I_GRID_SETTINGS =
is_layout = alv_layout
it_fieldcat = i_fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
i_default = 'ZLAY1'
i_save = 'A'
is_variant = i_variant
it_events = v_events
TABLES
t_outtab = it0001
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.
REFRESH i_fieldcat.
CLEAR i_fieldcat.
REFRESH it_listheader.
CLEAR it_listheader.
ENDFORM. " DISPLAY_ALV_REPORT
*& Form TOP_OF_PAGE
text
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader
i_logo =
I_END_OF_LIST_GRID =
ENDFORM. "TOP_OF_PAGE
*& Form USER_COMMAND
text
-->R_UCOMM text
-->, text
-->RS_SLEFIELDtext
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
REFRESH i_fieldcat1.
REFRESH it_listheader1.
CASE r_ucomm.
WHEN '&IC1'.
READ TABLE it0001 INDEX rs_selfield-tabindex.
IF sy-subrc = 0.
temp_pernr = it0001-pernr.
PERFORM build_fieldcatlog_0000 USING i_fieldcat1.
PERFORM event_call_0000.
PERFORM populate_event_0000.
PERFORM data_retrieval_0000.
PERFORM build_listheader_0000 USING it_listheader1.
PERFORM display_alv_0000.
ENDIF.
ENDCASE.
ENDFORM. "user_command
*& Form BUILD_FIELDCATLOG_0000
text
--> p1 text
<-- p2 text
FORM build_fieldcatlog_0000 USING temp_fieldcat TYPE slis_t_fieldcat_alv
DATA : wa_temp_fieldcat TYPE slis_fieldcat_alv.
wa_temp_fieldcat-tabname = 'IT0000'.
wa_temp_fieldcat-fieldname = 'BEGDA'.
wa_temp_fieldcat-seltext_m = 'From Date'.
APPEND wa_temp_fieldcat TO temp_fieldcat.
CLEAR wa_temp_fieldcat.
wa_temp_fieldcat-tabname = 'IT0000'.
wa_temp_fieldcat-fieldname = 'ENDDA'.
wa_temp_fieldcat-seltext_m = 'To Date'.
APPEND wa_temp_fieldcat TO temp_fieldcat.
CLEAR wa_temp_fieldcat.
wa_temp_fieldcat-tabname = 'IT0000'.
wa_temp_fieldcat-fieldname = 'MASSN'.
wa_temp_fieldcat-seltext_m = 'Action'.
APPEND wa_temp_fieldcat TO temp_fieldcat.
CLEAR wa_temp_fieldcat.
wa_temp_fieldcat-tabname = 'IT0000'.
wa_temp_fieldcat-fieldname = 'MASSG'.
wa_temp_fieldcat-seltext_m = 'Reason'.
APPEND wa_temp_fieldcat TO temp_fieldcat.
CLEAR wa_temp_fieldcat.
wa_temp_fieldcat-tabname = 'IT0000'.
wa_temp_fieldcat-fieldname = 'AEDTM'.
wa_temp_fieldcat-seltext_m = 'Action Run On'.
APPEND wa_temp_fieldcat TO temp_fieldcat.
CLEAR wa_temp_fieldcat.
ENDFORM. " BUILD_FIELDCATLOG
*& Form EVENT_CALL_0000
text
--> p1 text
<-- p2 text
FORM event_call_0000.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = v_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.
ENDFORM. " EVENT_CALL_0000
*& Form POPULATE_EVENT_0000
text
--> p1 text
<-- p2 text
FORM populate_event_0000.
READ TABLE v_events INTO wa_event WITH KEY name = 'TOP_OF_PAGE'.
IF sy-subrc EQ 0.
wa_event-form = 'F_TOP_OF_PAGE'.
MODIFY v_events FROM wa_event TRANSPORTING form WHERE name =
wa_event-form.
ENDIF.
ENDFORM. " POPULATE_EVENT_0000
*& Form TOP_OF_PAGE
text
FORM f_top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader1
i_logo =
I_END_OF_LIST_GRID =
ENDFORM. "TOP_OF_PAGE
*& Form USER_COMMAND
text
-->R_UCOMM text
-->, text
-->RS_SLEFIELDtext
*retreiving values from the database table ekko
FORM data_retrieval_0000.
SELECT pernr begda endda massn massg aedtm
FROM pa0000
INTO TABLE it0000
WHERE pernr = temp_pernr.
ENDFORM.
*& Form BUILD_LISTHEADER_0000
text
-->P_IT_LISTHEADER text
FORM build_listheader_0000 USING i_listheader1 TYPE slis_t_listheader.
DATA: hline1 TYPE slis_listheader.
hline1-typ = 'H'.
hline1-info = 'Actions Detail List'.
APPEND hline1 TO i_listheader1.
ENDFORM. " BUILD_LISTHEADER_0000
*& Form DISPLAY_ALV_0000
text
--> p1 text
<-- p2 text
FORM display_alv_0000.
CONCATENATE 'Actions For Personnel Number ' temp_pernr
INTO i_title_0000 SEPARATED BY ' '.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'F_USER_COMMAND'
i_callback_top_of_page = 'F_TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
i_grid_title = i_title_0000
I_GRID_SETTINGS =
is_layout = alv_layout
it_fieldcat = i_fieldcat1[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT =
i_save = 'A'
IS_VARIANT =
it_events = v_events
TABLES
t_outtab = it0000
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_ALV_0000
Regards,
Tejas -
How to create required field in alv?
hi friends^^
how to create required field in alv?
i don't find required option in fieldcatalog and others.
is it possible?Source code..
PLANETYPE is key_sel = 'X'.
But does't required field...
REPORT zs32editable1 .
TYPE-POOLS : slis.
DATA : gt_sflight TYPE TABLE OF sflight.
DATA : gt_fieldcat TYPE slis_t_fieldcat_alv,
gs_fieldcat LIKE LINE OF gt_fieldcat,
gs_layout TYPE slis_layout_alv.
START-OF-SELECTION.
SELECT *
INTO CORRESPONDING FIELDS OF TABLE gt_sflight
FROM sflight.
gs_layout-colwidth_optimize = 'X'.
gs_layout-edit = 'X'.
gs_fieldcat-fieldname = 'PLANETYPE'.
gs_fieldcat-key_sel = 'X'.
append gs_fieldcat to gt_fieldcat.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_STRUCTURE_NAME = 'SFLIGHT'
is_layout = gs_layout
IT_FIELDCAT = gt_fieldcat
TABLES
t_outtab = gt_sflight
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. -
Hi Gurus,
is der any way to download data from ALV report to excel sheet depending on layout set dyanmically.
I mean to say that if I choose a layout then data has to transfer to excel sheet according to layout fields automaticaly.I think this can be done by oops ALV , are u using reusealv F.M to call output in ALV ?
Try the below kind of ALV
IN PBO -
>
SET PF-STATUS 'PROJREP'.
SET TITLEBAR text-046.
DATA: g_container TYPE scrfname VALUE 'ALV',
g_grid1 TYPE REF TO cl_gui_alv_grid,
g_custom_container TYPE REF TO cl_gui_custom_container.
IF g_custom_container IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING container_name = g_container. (Name of the container )
CREATE OBJECT g_grid1
EXPORTING i_parent = g_custom_container.
PERFORM create_field_catalog_ce
CALL METHOD g_grid1->set_frontend_fieldcatalog
EXPORTING
it_fieldcatalog = t_fcat_ce.
ALL METHOD g_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'ST_DISPLAY'
CHANGING
it_outtab = t_display_io
it_fieldcatalog = t_fcat_ce.
->Create Object to receive events and link them to handler methods.
When the ALV Control raises the event for the specified instance
the corresponding method is automatically called.
CREATE OBJECT g_event_receiver.
SET HANDLER g_event_receiver->handle_double_click FOR g_grid1.
ENDIF.
CALL METHOD cl_gui_control=>set_focus
EXPORTING
control = g_grid1.
IN PAI -->
CALL METHOD cl_gui_cfw=>dispatch. -
Exporting data from ALV Report...
Dear All,
While I am exporting data from ALV report to any other Format (Excel, Txt, HTML) it only export the data of last column, but the heading is comming properly and also the column heading is displaying properly.
So how to rectify it. (the report is Object Oriented).
Regards,
DahrmeshHi Davabap,
Refer this sample program "BCALV_GRID_VERIFY" . I hope it is problem with structure mismatching.
Otherwise can you paste your code ?
Regards,
Vicky
PS: Award points if helpful
Maybe you are looking for
-
Unable to open my email messages on Firefox? How do I fix this?
I am not able to read my emails while I am in Firefox. This has happened about 8 days ago. I don't recall how this happened because I was able to use FF very well & never had any problems. I have been using Internet Explorer because most of my work h
-
Java and C++ interface via JNI
I am getting an "Runtime Error !" no other error message when I ran the C++ program creating JVM. Line in "m_env->CallStaticObjectMethod(clsABNLogger,midABNLogger,jstrLoggingLevel); " I have attached the code snippet. Anybody has experienced this err
-
In need of the schematics for the A5 board of the HP35670A DSA
Hi, I searched everywhere and have been unable to find schematics for the HP HP35670A DSA. It is a very old HP product that is no longer supported for any type of service from HP. Because of this, the only way to fix the product is to do it yourself
-
Hi Experts, Iam doing a Idoc to file scenario. Based on the sales organization(VKORG),i need to create the multiple records in the file. For example : E1MARAM 0..Unbounded | |E1MARMM 0..Unbounded | E1MARMM | E1MARMM | E1MARMM | E1MVKEM 0..Unbounded |
-
Library showing empty after upgrade to iPhoto 11
Hi all, Yesterday I decided to upgrade to iPhoto 11, basically because I eventually want to go to Aperture. Although I have been reading about all the problems around iPhoto 11, I decided to give it a try. For one of my libraries the upgrade caused a