PF Status Modification in Blacl ALV
Hi All,
In one of our requirements we need all the Standard Menus and Functions of the Output Status of an ALV.
But we want the Download to Local File to behave differently. Instead of an Usual Download we would like the EXcel with the Prepopulated data (Same as in Output Display of ALV) to OPEN up and then the User can SAVE it to any desired location.
I have copied the Status using the SE41 and the set the PF status in my Program.I have used the Parameter I_CALLBACK_PF_STATUS_SET in the FM - REUSE_ALV_BLOCK_LIST_INIT. The Routine sets the PF Status.
And the PF status is correct.But in the Menu I have Changed the FUnction Code of LOcal Downloa d'%PC' to '%PA' to point to my New USER_COMMAND (Subroutine).
But on execution of the Function Code in output the USER_COMMAND Form Routine is not getting Called.But the Other Codes (which were copied from the Standard PF Status) is working Fine.
How Do I make my NEW FUNCTION CODE WORK ?What are the steps I need to do?
Thanks in Advance.
Arunava
Hi,
First of all try removing '%' in your function code and see whether it works..normally function codes starting with '%' are system function codes..
If that does not work then check whether your callback program is properly filled while calling REUSE_ALV_BLOCK_LIST_INIT and make sure the GUI Status you see is really the one you created. Put a break-point in your callback_pf_status_set routine and check.
If it is fine till this point then check whether the events table that you are filling and passing to REUSE_ALV_BLOCK_LIST_APPEND fm calls is properly filled.
Like,
t_events-name = slis_ev_user_command.
t_events-form = 'USER_COMMAND'.
APPEND t_events.
Hope this helps..
Sri
Similar Messages
-
Work Order "Status Modification Denied" error
Dear Experts,
I tried to update a status in the Work Order, but I get the message below:
Status Modification Denied
Can anyone throw some light on this?
Warmest Regards,
ChinhoDear All,
Im sorry, this error message was due to an Addon validation. Not an issue I faced in SBO.
Thanks!
Warmest Regards,
Chinho -
How to get GUI Status(Push Buttons) in ALV Report
Hi Friends
I have a requirement in a way that:
Once selection-screen was processed,an ALV report has to come and above the ALV List,I need a custom GUI Status(4 Push Button) with Push Buttons Logic.
Once I had clicks on thesse push button,I need to display one more ALV List and above this List,again I need a custom GUI Status(2 Push Buttons) with Push Buttons Logic.
Can anyone throw some light how we can achieve this.
Thanks for your cooperation!
Regards,
Madisettydata: rt_extab type slis_t_extab,
g_ucomm like sy-ucomm ,
g_selfield type slis_selfield.
form alv_display .
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = g_repid
i_callback_pf_status_set = 'PF_STATUS'
i_callback_user_command = 'USER_COMM'
it_fieldcat = it_fldcat
tables
t_outtab = it_final1
perform pf_status using rt_extab.
perform user_comm using g_ucomm g_selfield .
endform.
form pf_status using p_rt_extab.
set pf-status 'PF_STATUS' excluding p_rt_extab.
endform.
form user_comm using p_ucomm like sy-ucomm
p_selfield type slis_selfield.
data: l_row type i.
case p_ucomm.
when 'DISPLAY_PO'.
loop at it_final1 into wa_final1.
if wa_final1-sel eq 'X' .
l_row = l_row + 1.
endif.
if l_row gt 1.
message e004.
endif.
clear wa_final1.
endloop.
p_selfield-fieldname = 'SEL'.
read table it_final1 into wa_final1 index p_selfield-tabindex .
set parameter id 'BES' field wa_final1-ebeln.
call transaction 'ME23N'.
endcase.
endform.
*create user interface for gui status by double clicking on 'PF_STATUS'.
*Check the above sample code . -
How to read modifed data in ALV List
Hi,
I have one input enabled field in my ALV list. User can modify the values of that field. How i can get what are all the records are modified by the user.
Thanks
stallinHi,
Try this code...
REPORT ZTEST_EDIT_ALV .
*Data Declaration
DATA: BEGIN OF T_EKKO,
EBELN TYPE EKPO-EBELN,
EBELP TYPE EKPO-EBELP,
* FLAG TYPE C,
* HANDLE_STYLE TYPE LVC_T_STYL,
END OF T_EKKO.
DATA: GD_REPID LIKE SY-REPID, "Exists
REF_GRID TYPE REF TO CL_GUI_ALV_GRID. "new
DATA: BEGIN OF IT_EKKO OCCURS 0.
INCLUDE STRUCTURE T_EKKO.
DATA: END OF IT_EKKO.
DATA: BEGIN OF IT_BACKUP OCCURS 0.
INCLUDE STRUCTURE T_EKKO.
DATA: END OF IT_BACKUP.
*ALV data declarations
TYPE-POOLS: SLIS. "ALV Declarations
DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
GD_LAYOUT TYPE SLIS_LAYOUT_ALV.
*Start-of-selection.
START-OF-SELECTION.
PERFORM DATA_RETRIEVAL.
PERFORM BUILD_FIELDCATALOG.
PERFORM BUILD_LAYOUT.
IT_BACKUP[] = IT_EKKO[].
PERFORM DISPLAY_ALV_REPORT.
*& Form build_fieldcatalog
* text
FORM BUILD_FIELDCATALOG.
REFRESH FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'EBELN'.
FIELDCATALOG-SELTEXT_M = 'Purchase Order'.
FIELDCATALOG-INPUT = 'X'.
FIELDCATALOG-EDIT = 'X'.
FIELDCATALOG-COL_POS = 2.
APPEND FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'EBELP'.
FIELDCATALOG-SELTEXT_M = 'PO Item'.
FIELDCATALOG-COL_POS = 3.
APPEND FIELDCATALOG.
CLEAR FIELDCATALOG.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
FORM BUILD_LAYOUT.
"Permet d'ajuster les colonnes au text
* gd_layout-colwidth_optimize = 'X'.
* GD_LAYOUT-TOTALS_TEXT = 'Totals'(201).
* gd_layout-box_fieldname = 'SELECT'.
* gd_layout-box_tabname = 'IT_EKKO'.
ENDFORM. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
* Display report using ALV grid
FORM DISPLAY_ALV_REPORT .
GD_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GD_REPID
* i_callback_top_of_page = 'TOP-OF-PAGE'
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
* i_grid_title = 'My Title'
IS_LAYOUT = GD_LAYOUT
IT_FIELDCAT = FIELDCATALOG[]
TABLES
T_OUTTAB = IT_EKKO
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
WRITE:/ SY-SUBRC.
ENDIF.
ENDFORM. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
FORM DATA_RETRIEVAL.
SELECT EBELN EBELP
UP TO 10 ROWS
FROM EKPO
INTO CORRESPONDING FIELDS OF TABLE IT_EKKO.
ENDFORM. " DATA_RETRIEVAL
* FORM SET_PF_STATUS *
FORM SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STANDARD_FULLSCREEN1' EXCLUDING RT_EXTAB.
ENDFORM. "set_pf_status
*& Form user_command
* text
* -->R_UCOMM text
* -->RS_SELFIELDtext
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
*then insert the following code in your USER_COMMAND routine...
<b> IF REF_GRID IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = REF_GRID.
ENDIF.
IF NOT REF_GRID IS INITIAL.
CALL METHOD REF_GRID->CHECK_CHANGED_DATA
ENDIF.</b>*modify
CASE R_UCOMM.
WHEN '&IC1'.
CHECK RS_SELFIELD-TABINDEX > 0.
IF RS_SELFIELD-VALUE EQ '6000000001'.
CALL TRANSACTION 'ZTEST'.
ENDIF.
WHEN 'REFRESH'.
READ TABLE IT_EKKO INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
READ TABLE IT_BACKUP INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
IF IT_EKKO <> IT_BACKUP.
* then do your check
ENDIF.
ENDIF.
ENDIF.
PERFORM DATA_RETRIEVAL.
RS_SELFIELD-REFRESH = 'X'.
ENDCASE.
ENDFORM. "user_command
Regards
vijay -
Message in Status Bar while using ALV Objects
Hi All,
If we use ALV in objects (Build in class and methods for ALV),is it possible to display a error message using Message statement in Status bar.
Thanks in advance.Hi,
Yes, it is possible. You can do it using the ALV Object Model (ALV OO methods) within an event handler method. For example, the event "added_function of cl_salv_events" can be used and you can add code similar to the following code within the event handler method:
CASE e_salv_function.
WHEN 'XYZ'.
MESSAGE w001(00) WITH 'Message text goes here...'.
ENDCASE.
The warning message will either show up as a popup or in the status bar depending on your user settings. Of course, you can also use other message types (e.g. I, E, S) or other message techniques besides the message statement.
Best Regards,
Jamie -
Pf status & user-command in alv grid
Hi Friends,
I have one query for ALV grid.
Actually my requirement is like that
Whenever the user double click on grid the control moves to transaction 'VA01' tcode.
I also wanted to set the gui status in ALV grid.
How to do it??
Plz tell me in detail.Very simple....
copy paste this code.... remember I have created a GUI Status called ZALV_STATUS.
So u will have to create this status to run ur program.
U can come back if u have any doubts...
*& Report Z_ALV_TRAINING_LIST_HOTSPOT
REPORT Z_ALV_TRAINING_LIST_HOTSPOT.
Type Pools Used **********
TYPE-POOLS : SLIS.
Internal Tables Declare ************
DATA : it_document type standard table of bkpf initial size 0 with header line,
IT_FIELD_CAT TYPE SLIS_T_FIELDCAT_ALV,
it_alv_event type SLIS_T_EVENT,
fl_layout type slis_layout_alv.
Select Data ***********
start-of-selection.
select * from bkpf into table it_document.
Make Field Catalog ******
PERFORM MAKE_FIELD_CATALOG.
Make Layout *********
perform sub_fill_layout.
Make Events Table *******
perform sub_Fill_alv_event.
Display ALV *********
PERFORM DISPLAY_ALV_LIST.
*& Form make_field_catalog
text
--> p1 text
<-- p2 text
FORM MAKE_FIELD_CATALOG .
data : wa type slis_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME =
I_INTERNAL_TABNAME =
I_STRUCTURE_NAME = 'bkpf'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = it_field_cat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_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.
read table it_field_cat into wa index 3.
wa-hotspot = 'X'.
modify it_field_cat index 3 from wa.
ENDFORM. " make_field_catalog
*& Form display_alv_list
text
--> p1 text
<-- p2 text
FORM DISPLAY_ALV_LIST .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_PF_STATUS_SET = 'SET_MY_PF_STATUS'
I_CALLBACK_USER_COMMAND = ' '
IS_LAYOUT = fl_layout
IT_FIELDCAT = it_field_cat[]
IT_SORT =
I_DEFAULT = 'X'
I_SAVE = 'X'
IS_VARIANT = '/TEST_VV'
IT_EVENTS = it_alv_event
TABLES
T_OUTTAB = it_document.
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_list
*& Form sub_my_pf_event
text
--> p1 text
<-- p2 text
FORM sub_my_pf_event using p_comm type sy-ucomm p_sEL_FIELD TYPE SLIS_SELFIELD.
read table it_document index p_sel_field-tabindex.
set parameter id 'BLN' field it_document-belnr.
set parameter id 'BUK' field it_document-bukrs.
set parameter id 'GJR' field it_document-gjahr.
case p_comm.
when 'PICK'.
call transaction 'FB03' and skip first screen.
endcase.
ENDFORM. " sub_my_pf_event
*& Form sub_Fill_alv_event
text
--> p1 text
<-- p2 text
FORM sub_Fill_alv_event .
data : wa type slis_alv_event.
wa-name = 'USER_COMMAND'.
wa-form = 'SUB_MY_PF_EVENT'.
append wa to it_alv_event.
ENDFORM. " sub_Fill_alv_event
*& Form sub_fill_layout
text
--> p1 text
<-- p2 text
FORM sub_fill_layout .
fl_layout-f2code = 'PICK'.
fl_layout-box_fieldname = 'BELNR'.
ENDFORM. " sub_fill_layout
*& Form SET_MY_PF_STATUS
text
--> p1 text
<-- p2 text
FORM SET_MY_PF_STATUS USING p_rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZALV_STATUS'.
ENDFORM. " SET_MY_PF_STATUS
Plz award points if it was helpful....
Message was edited by:
Varun Verma -
Hi Gurus,
Am developing the ALV report in OOPS. In that report am displaying 2 grids one after the other. My problem here is am getting the tool bar separately for the 2 grids. So i disabled the tool bar for two grids in layout. And i copied the standard gui status SLVC_FULLSCREEN into that report. Now am getting the tool bar. But i did nt get the button events. The buttons are clickable but the functionality is not doing. How to get the functionalites for the ZSLVC_FULLSCREEN. Please guide me some suggestions how to copy the functionalites for those.
Points will be awarded
Thanks
Ravicheck the all function codes of the buttons in ZSLVC_FULLSCREEN GUi status
and write u r functionality in your progrm in at user-command subroutine.
case sy-ucomm.
when 'xxx'
do something.
when 'yyy'
do something.
endcase. -
*& Report ZMM_STOCKDIFFERENCE
REPORT ZMM_STOCKDIFFERENCE.
Tables: marc,
mard. "Sales Document: Header Data
data : it_marc LIKE marc OCCURS 0 WITH HEADER LINE,
it_mard like mard OCCURS 0 WITH HEADER LINE.
type-pools: slis.
data:t_listheader type slis_t_listheader,
it_events type slis_t_event,
is_layout type slis_layout_alv,
is_layout1 type slis_layout_alv..
data:fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv ,
i_repid like sy-repid.
i_repid = sy-repid.
Data: begin of itab occurs 0,
matnr like marc-matnr,
labst like mard-labst,
EISBE like marc-eisbe,
eislo like marc-eislo,
a type i,
b type i,
end of itab.
data : matr like marc-matnr.
data : index(2).
****************************************************************************************************New Selection Screen
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : s_matnr type c RADIOBUTTON GROUP gp1 USER-COMMAND com DEFAULT 'X',
r_matnr TYPE c RADIOBUTTON GROUP gp1.
SELECT-OPTIONS : matr1 for marc-matnr MODIF ID g1 no INTERVALS no-EXTENSION..
SELECT-OPTIONS : matr2 FOR marc-matnr MODIF ID g2 .
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN OUTPUT.
IF s_matnr EQ 'X'.
LOOP AT SCREEN.
IF screen-group1 EQ 'G2'.
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSEIF r_matnr EQ 'X'.
LOOP AT SCREEN.
IF screen-group1 EQ 'G1'.
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
START-OF-SELECTION.
PERFORM clear.
PERFORM SELECT_DATA.
PERFORM display.
*& Form SELECT_DATA
FORM SELECT_DATA .
if s_matnr = 'X'.
SHIFT matr1 by 3 PLACES.
matr = matr1.
endif.
if r_matnr = 'X'.
SHIFT matr2 by 3 PLACES.
matr = matr2.
ENDIF.
if s_matnr = 'X'.
select * from marc into table it_marc where matnr = matr.
ELSEIF r_matnr = 'X'.
SELECT * from marc into table it_marc where matnr in matr2.
endif.
LOOP AT it_marc.
MOVE-CORRESPONDING it_marc to itab.
APPEND itab.
ENDLOOP.
Loop at itab.
select single labst
from mard
into itab-labst
where matnr = itab-matnr.
MODIFY itab.
Endloop.
LOOP AT itab.
itab-a = itab-labst - itab-eisbe.
itab-b = itab-labst - itab-eislo.
MODIFY itab.
ENDLOOP.
ENDFORM. " SELECT_DATA
FORM DISPLAY .
perform fill_layout.
perform list_header using t_listheader.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-outputlen = 15.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'LABST'.
fieldcatalog-seltext_m = 'Actual Stock'.
fieldcatalog-outputlen = 25.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'A'.
fieldcatalog-seltext_m = 'Difference to Safety Stock'.
fieldcatalog-outputlen = 38.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'B'.
fieldcatalog-seltext_m = 'Difference to Minimum Safety Stock'.
fieldcatalog-outputlen = 38.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
perform fill_events.
******************************************************************************CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = is_layout
it_fieldcat = fieldcatalog[]
i_default = 'X'
i_save = 'A'
it_events = it_events
TABLES
t_outtab = itab
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
form clear .
clear itab.
clear itab[].
endform. " CLEAR
form list_header using p_t_listheader type slis_t_listheader.
data : if_date TYPE string ,
ef_date TYPE string,
if_date1 type string,
ef_date1 type string.
IF s_matnr = 'X'.
if_date = matr.
ELSEIF r_matnr = 'X'.
shift matr2 by 3 PLACES.
if_date = matr2+0(18).
if_date1 = matr2+18(18).
shift if_date by 9 PLACES.
SHIFT if_date1 by 9 PLACES.
CONCATENATE if_date ' to ' if_date1 INTO if_date.
endif.
data : wa_listheader type slis_listheader.
clear wa_listheader.
wa_listheader-typ = 'H'.
wa_listheader-info = 'Stock Position'.
append wa_listheader to t_listheader.
clear wa_listheader.
wa_listheader-typ = 'S'.
wa_listheader-key = 'Material Code'.
wa_listheader-info = if_date .
append wa_listheader to t_listheader.
endform. " LIST_HEADER
form fill_events .
data : wa_event type slis_alv_event.
wa_event-name = 'TOP_OF_PAGE'.
wa_event-form = 'TOP_OF_PAGE'.
append wa_event to it_events.
clear wa_event.
endform. " FILL_EVENTS
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_listheader
endform. "TOP_OF_PAGE
form fill_layout .
is_layout-zebra = 'X'.
endform. "fill_layout
Modifications required are:
1.In Header - material number is coming with 3 extra suffix zeroes. i dont want this.
2.In the first column material numbers are coming with 9 prefix zeroes. i dont want this too.
3.last column negative numbers' minus sign is coming after the number. it should come before the number
4.header column is not coming completely. for example: last column i gave is difference to minimum safety stock. but it is showing only difference to minimu
pls help me...i am a fresher...thanks in advanceREPORT ZMM_STOCKDIFFERENCE.
TABLES: MARC,
MARD. "Sales Document: Header Data
DATA : IT_MARC LIKE MARC OCCURS 0 WITH HEADER LINE,
IT_MARD LIKE MARD OCCURS 0 WITH HEADER LINE.
TYPE-POOLS: SLIS.
DATA:T_LISTHEADER TYPE SLIS_T_LISTHEADER,
IT_EVENTS TYPE SLIS_T_EVENT,
IS_LAYOUT TYPE SLIS_LAYOUT_ALV,
IS_LAYOUT1 TYPE SLIS_LAYOUT_ALV..
DATA:FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
GD_LAYOUT TYPE SLIS_LAYOUT_ALV ,
I_REPID LIKE SY-REPID.
I_REPID = SY-REPID.
DATA: BEGIN OF ITAB OCCURS 0,
MATNR LIKE MARC-MATNR,
LABST LIKE MARD-LABST,
EISBE LIKE MARC-EISBE,
EISLO LIKE MARC-EISLO,
A TYPE I,
B TYPE I,
END OF ITAB.
DATA : MATR LIKE MARC-MATNR.
DATA : INDEX(2).
****************************************************************************************************New Selection Screen
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : S_MATNR TYPE C RADIOBUTTON GROUP GP1 USER-COMMAND COM DEFAULT 'X',
R_MATNR TYPE C RADIOBUTTON GROUP GP1.
SELECT-OPTIONS : MATR1 FOR MARC-MATNR MODIF ID G1 NO INTERVALS NO-EXTENSION..
SELECT-OPTIONS : MATR2 FOR MARC-MATNR MODIF ID G2 .
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN OUTPUT.
IF S_MATNR EQ 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 EQ 'G2'.
SCREEN-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSEIF R_MATNR EQ 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 EQ 'G1'.
SCREEN-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
START-OF-SELECTION.
PERFORM CLEAR.
PERFORM SELECT_DATA.
PERFORM DISPLAY.
*& Form SELECT_DATA
FORM SELECT_DATA .
IF S_MATNR = 'X'.
SHIFT MATR1 BY 3 PLACES.
MATR = MATR1.
ENDIF.
IF R_MATNR = 'X'.
SHIFT MATR2 BY 3 PLACES.
MATR = MATR2.
ENDIF.
IF S_MATNR = 'X'.
SELECT * FROM MARC INTO TABLE IT_MARC WHERE MATNR = MATR.
ELSEIF R_MATNR = 'X'.
SELECT * FROM MARC INTO TABLE IT_MARC WHERE MATNR IN MATR2.
ENDIF.
LOOP AT IT_MARC.
MOVE-CORRESPONDING IT_MARC TO ITAB.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = ITAB-MATNR
IMPORTING
OUTPUT = ITAB-MATNR.
APPEND ITAB.
ENDLOOP.
LOOP AT ITAB.
SELECT SINGLE LABST
FROM MARD
INTO ITAB-LABST
WHERE MATNR = ITAB-MATNR.
MODIFY ITAB.
ENDLOOP.
LOOP AT ITAB.
ITAB-A = ITAB-LABST - ITAB-EISBE.
ITAB-B = ITAB-LABST - ITAB-EISLO.
MODIFY ITAB.
ENDLOOP.
ENDFORM. " SELECT_DATA
*& Form DISPLAY
text
FORM DISPLAY .
PERFORM FILL_LAYOUT.
PERFORM LIST_HEADER USING T_LISTHEADER.
FIELDCATALOG-FIELDNAME = 'MATNR'.
FIELDCATALOG-SELTEXT_M = 'Material Number'.
FIELDCATALOG-OUTPUTLEN = 15.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'LABST'.
FIELDCATALOG-SELTEXT_M = 'Actual Stock'.
FIELDCATALOG-OUTPUTLEN = 25.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'A'.
FIELDCATALOG-SELTEXT_M = 'Difference to Safety Stock'.
FIELDCATALOG-OUTPUTLEN = 38.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'B'.
FIELDCATALOG-SELTEXT_L = 'Difference to Minimum Safety Stock'.
FIELDCATALOG-OUTPUTLEN = 38.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
PERFORM FILL_EVENTS.
******************************************************************************CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
IS_LAYOUT = IS_LAYOUT
IT_FIELDCAT = FIELDCATALOG[]
I_DEFAULT = 'X'
I_SAVE = 'A'
IT_EVENTS = IT_EVENTS
TABLES
T_OUTTAB = ITAB
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
*& Form clear
text
FORM CLEAR .
CLEAR ITAB.
CLEAR ITAB[].
ENDFORM. " CLEAR
*& Form list_header
text
-->P_T_LISTHEADER text
FORM LIST_HEADER USING P_T_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA : IF_DATE TYPE STRING ,
EF_DATE TYPE STRING,
IF_DATE1 TYPE STRING,
EF_DATE1 TYPE STRING.
IF S_MATNR = 'X'.
IF_DATE = MATR.
ELSEIF R_MATNR = 'X'.
SHIFT MATR2 BY 3 PLACES.
IF_DATE = MATR2+0(18).
IF_DATE1 = MATR2+18(18).
SHIFT IF_DATE BY 9 PLACES.
SHIFT IF_DATE1 BY 9 PLACES.
CONCATENATE IF_DATE ' to ' IF_DATE1 INTO IF_DATE.
ENDIF.
DATA : WA_LISTHEADER TYPE SLIS_LISTHEADER.
CLEAR WA_LISTHEADER.
WA_LISTHEADER-TYP = 'H'.
WA_LISTHEADER-INFO = 'Stock Position'.
APPEND WA_LISTHEADER TO T_LISTHEADER.
CLEAR WA_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'Material Code'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = IF_DATE
IMPORTING
OUTPUT = IF_DATE.
WA_LISTHEADER-INFO = IF_DATE .
APPEND WA_LISTHEADER TO T_LISTHEADER.
ENDFORM. " LIST_HEADER
*& Form fill_events
text
FORM FILL_EVENTS .
DATA : WA_EVENT TYPE SLIS_ALV_EVENT.
WA_EVENT-NAME = 'TOP_OF_PAGE'.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
APPEND WA_EVENT TO IT_EVENTS.
CLEAR WA_EVENT.
ENDFORM. " FILL_EVENTS
*& Form top_of_page
text
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_LISTHEADER.
ENDFORM. "TOP_OF_PAGE
*& Form fill_layout
text
FORM FILL_LAYOUT .
IS_LAYOUT-ZEBRA = 'X'.
ENDFORM. "fill_layout -
Changing PF status of Web dynpro ALV
Hi Experts,
In Web dynpro ALV there is a button called "EXPORT" with two menu items(Export to Microsoft Excel & Export to BOE).
I would like to add two more menu items to that button. Is it possible. If yes, how?
Thanks and regards,
Venkat.Never thought about such requirement..what exactly you want to add to the export other than standard ones...I donot see any way..still exploring...I guess standard is of type either a CL_SALV_WD_FE_BUTTON_CHOICE or CL_SALV_WD_FE_TOGGLE_BUTTON...
I think you can have it using a custom button.....adding a menu item to standard needs to be explored.... -
Print automaticly order production after an user status modification
Hi all,
I launch and print the order production with the user status 4, and I want to print it again when user modify the status to 8.
Do you have any idea ?
Thanks
Regards
PierrePierre,
Use program "PPPRBSEL" with a custom defined Selection Profile to select production orders if you want to pick the orders based on the required user status and also activate check box for "Reprinting", this program can also be scheduled to run in background to automatically print.
Regards,
Prasobh -
Changing the status of heading in ALV
HI Gurus,
I am creating a ALV report program. When I execute the statements (with select options and parameters only)
I get the output selection screen. But the header comes as the report program name like ZRR_ALV_LIST..
But I need to change this to some other text of my choice.
Please help me on this.
Thanks & Regards,
Gopinath GS.
Edited by: Gopigs on May 20, 2011 8:35 AM
Moderator Message: Basic Question.
Edited by: kishan P on May 20, 2011 12:31 PMThis is the simple code that I have done.
REPORT zrr_alv_list NO STANDARD PAGE HEADING.
TABLES:anla.
TYPE-POOLS: slis.
SELECTION-SCREEN BEGIN OF BLOCK b100 WITH FRAME TITLE text-bl0.
SELECT-OPTIONS: s_bukrs FOR anla-bukrs,
s_anln1 FOR anla-anln1,
s_anln2 for anla-anln2.
PARAMETERS: p_date LIKE anla-erdat.
SELECTION-SCREEN END OF BLOCK b100.
When I execute I get the selection screen. But the header of the selection screen gives the report program name 'zrr_alv_list'.
Instead i need to put up the header as 'ALV LIST DISPLAY'.
Also one more query I got just now.
How can I get the current fiscal year end date and default it to the Parameters field p_date??
Gs.
Edited by: Gopigs on May 20, 2011 9:00 AM -
Quotation approval Status Modification
Hi,
I need to do quotation approval based on some conditions, where i can write the code for quotation approval.
if possible tell me the code.
ThanksIf you looking for VA21
check this include MV45AFZZ.
write in below routine
USEREXIT_SAVE_DOCUMENT
to read the status of APPROVALS
CALL FUNCTION 'STATUS_READ'
EXPORTING
CLIENT = SY-MANDT
objnr = V_OBJNR
ONLY_ACTIVE = ' '
IMPORTING
OBTYP =
STSMA =
STONR = V_STONR
TABLES
STATUS =
EXCEPTIONS
OBJECT_NOT_FOUND = 1
OTHERS = 2.
change the status.
CALL FUNCTION 'STATUS_CHANGE_EXTERN'
EXPORTING
client = sy-mandt
objnr = V_OBJNR
user_status = 'E0001'
SET_CHGKZ = 'X'
EXCEPTIONS
OBJECT_NOT_FOUND = 1
STATUS_INCONSISTENT = 2
STATUS_NOT_ALLOWED = 3
OTHERS = 4.
IF SY-SUBRC = 0.
COMMIT WORK.
ENDIF.
I hope these two function module will work for your case -
hi all,
could any one answer what is fgroup 'salv' in the following piece of alv code and how can we
see it.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
i_callback_pf_status_set = 'SET_PF_STATUS' "see FORM
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
FORM SET_PF_STATUS *
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZNEWSTATUS'.
"Copy of 'STANDARD' pf_status from fgroup SALV
ENDFORM.
regards,
pavan.Hello Pavan
If you want to have a customer-specific GUI status which is similar to the standard GUI status then display function group SALV in the workbench editor (SE80), open the folder GUI status and copy the status STANDARD to your ALV report (e.g. as ZNEWSTATUS).
If you do not have function SALV available in your system you can use the STANDARD status of function group SLVC_FULLSCREEN instead.
You may also have a look at thread: [alv pf status|alv pf status;
Regards,
Uwe -
Hi all,
I have a selection screen in my report and the output has a primary ALV and one secondary ALV.
I have set PF status for the Primary ALV and on clicking a button in the application toolbar, the secondary ALV gets displayed.
Now my pbm is when i click the BACK button in secondary ALV, it SHOULD NOT go to the first ALV. Instead it should go to the Selection Screen.
For this case, i have set PF status and Uer Command for secondary ALV also. In this User command, ihave written the following coding.
FORM pf_status_set1 USING extab TYPE slis_t_extab.
SET PF-STATUS 'ALV' excluding 'CREATE'.
ENDFORM.
FORM user_command1 USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&F03'.
leave list-processing and return to screen 0.
when 'OTHERS'.
endcase.
endform.
But these 2 not gets triggered.
What could be the problem... Please anyone help me...
Regards,
ShanthiHi,
I have passed the 2 inputs
i_callback_pf_status_set = 'PF_STATUS_SET1'
i_callback_user_command = 'USER_COMMAND1'
inside the REUSE_ALV_GRID_DISPLAY. Even then, the corresponding FORM which i have given below are not get triggered.
FORM pf_status_set1 USING extab TYPE slis_t_extab. "#EC CALLED
SET PF-STATUS 'ALV' excluding 'CREATE'.
ENDFORM. "pf_status_set
FORM user_command1 USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield. "#EC CALLED
CASE r_ucomm.
WHEN '&F03'.
leave list-processing and return to screen 0.
when 'OTHERS'.
endcase.
endform. -
Alv status standard function codes
Hello,
I have developed an not OO ALV.
I want to put the sort standard button. Does anybody know the function code i have to put in the status?
ThanksHi,
Goto SE41, create a pf-status for your alv report program.
On the next screen, click menu EXTRAS --> click option ADJUST TEMPLATES and select radiobutton LIST VIEWER --> you will get all standard buttons of alv in the pf-status.
Delete the unwanted buttons and also you can add new buttons if reqd.
Activate pf-status --> and apply in alv program.
Hope this helps you.
Regards,
Tarun
Maybe you are looking for
-
Many of the apps that came with my MacBook Pro when I bought it direct from Apple last year now crash the moment the icon appears in the Dock since I installed Mavericks. These include Calendar, Pages, Contacts, Preview (all of these were updated aft
-
FM / BAPI Inbound delivery creation for a Purchase Order without material
Dear All, I have a requirement to create a Inbound Delivery for a Purchase order without material number. The Purchase Order has only Material text and no material number. Please let me know a BAPI or FM to create inbound delivery in this case where
-
So I have a daily Exchange Environment Report running that kicks the output to a public folder and I check this stuff daily. The script is found here: http://www.stevieg.org/2011/06/exchange-environment-report/ So what I'm concerned about is the amo
-
.band files not opening from previous version
I copied my .band files from another mac and cannot open them when copied to my imac running GB 11. Not sure of the version of the older GB software but but the O/S was Mac OSX10 and the previous version of GB. A GetInfo on the .band files says the
-
Worked on variations for a while and now seek some help. My Time Dimension Time --FY07 ----Qtr1-07 ------Jan-07 --------Wk1-07 ----------01/01/2007 ----------01/02/2007 --FY08 ----Qtr1-08 ------Jan-08 --------Wk1-08 ----------01/01/2008 etc. Forecast