To display variable date in the ALV field header
HI all,
I have an ALV list and one of the field headers is "Total received till 14.03.2008".
Now the date field here is variable. it is being fetched from an internal table and displayed in thee field header of an ALV list.
cud y'all pls tell me how to display this variable date.
thanx,
pk
Hi,
Just have a look on the following code,i hope this is enough to
meet your requirement.
type-pools: slis.
data: x_fieldcat type slis_fieldcat_alv,
it_fieldcat type slis_t_fieldcat_alv,
l_layout type slis_layout_alv,
x_events type slis_alv_event,
it_events type slis_t_event.
data: begin of itab occurs 0,
vbeln like vbak-vbeln,
posnr like vbap-posnr,
male type i,
female type i,
end of itab.
select vbeln
posnr
from vbap
up to 20 rows
into table itab.
x_fieldcat-fieldname = 'VBELN'.
x_fieldcat-seltext_l = '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-seltext_l = 'POSNR'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 2.
append x_fieldcat to it_fieldcat.
clear x_fieldcat.
x_fieldcat-fieldname = 'MALE'.
x_fieldcat-seltext_l = 'MALE'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 3.
append x_fieldcat to it_fieldcat.
clear x_fieldcat.
x_fieldcat-fieldname = 'FEMALE'.
x_fieldcat-seltext_l = 'FEMALE'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 3.
append x_fieldcat to it_fieldcat.
clear x_fieldcat.
x_events-name = slis_ev_top_of_page.
x_events-form = 'TOP_OF_PAGE'.
append x_events to it_events.
clear x_events .
l_layout-no_colhead = 'X'.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = sy-repid
is_layout = l_layout
it_fieldcat = it_fieldcat
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.
form top_of_page.
*-To display the headers for main list
format color col_heading.
write: / sy-uline(103).
write: / sy-vline,
(8) ' ' ,
sy-vline,
(8) ' ' ,
sy-vline,
(27) '***'(015) centered,
sy-vline.
write: / sy-vline,
(8) 'VBELN'(013) ,
sy-vline,
(8) 'POSNR'(014) ,
sy-vline,
(8) 'MALE'(016) ,
sy-vline,
(5) 'FMALE'(017) ,
(10) sy-datum,
sy-vline.
format color off.
endform.
Reward points,if it is useful.
Thanks,
Chandu.
Similar Messages
-
To display Last Date of the Month in Financial Reporting studio 9
Hi
I want to display last date of the month in header in Financial Reporting studio 9 . Is there any function which displays the last date of the month as per user selection .
for example
If user select month of Jan it should display Jan 31st, 2009
If user select month of Feb it should display Feb 28th 2009
ThanksUnless you name your Months like that you cannot do it. A large team from a major consulting firm told me for a year that it was not possible and convinced management that financial statements don't need dates.
Management decided that we do need dates (because all financials need dates, look at any text book). I figured out a pretty sweet solution that is simple and easy to use and maintain. The users love it. Management loves it.
I'm not giving it away though. -
Update the data into the ZTABLE fields thru program logic ..?
hi all,
i have ZTABLE1,ZTABLE2,ZTABLE3, and this tables like ALV grids using object methods.
in the same table fields now i wanted to update the data into the ZTABLE fields thru program logic .
could anyone please help me ....
please provide if anyone of have any program logic that would be helpfull to me.
thanks in advance...
srinivas....Hi Srinivas,
The following statements are used to upload the data into custom tables.
1. Modify
2. Update
3. Insert
if you are using OO ALV, you should enable the 'SAVE' button in the main toolbar. if the user press the save button, then you should upload the data to the custom table.
please find the example code, in this example 'PERFORM F_SAVE_DATA'(here i gave the message only, you write your own logic here) is used to save the data in custom table.
Report Program: ZB_ALVOOPS_TEST
Line:-----
REPORT ZB_ALVOOPS_TEST MESSAGE-ID ZCR_MESSAGES.
Top Include - Global Data Declaration *
INCLUDE ZB_ALVOOPS_TEST_TOP.
SEL Include - Selection Screen *
INCLUDE ZB_ALVOOPS_TEST_SEL.
AT SELECTION SCREEN *
Initialization Event *
INITIALIZATION.
Initialize Screen Number.
PERFORM F_INITIALIZE.
Initialize Field Catalog for ALV Grid.
PERFORM F_INITIALIZE_GRID.
END-OF-SELECTION.
Call Display Screen *
CALL SCREEN 9000.
Event Handler - Class Definition and Implementation *
INCLUDE ZB_ALVOOPS_TEST_CL01.
PBO Event - Module Implementation *
INCLUDE ZB_ALVOOPS_TEST_PBO.
PAI Event - Module Implementation *
INCLUDE ZB_ALVOOPS_TEST_PAI.
Subroutine Include *
INCLUDE ZB_ALVOOPS_TEST_F01.
Include: ZB_ALVOOPS_TEST_TOP
Line:-------
Type Declaration For Internal Tables *
Collection Data
TYPES: BEGIN OF TY_MARA ,
MATNR TYPE MATNR , " Material
VPSTA TYPE VPSTA , " Maintenance status of complete material
MTART TYPE MTART , " Material Type
MBRSH TYPE MBRSH , " Industry Sector
MATKL TYPE MATKL , " Material Group
BISMT TYPE BISMT , " Old material number
MEINS TYPE MEINS , " Base Unit of Measure
BSTME TYPE BSTME , " Order unit
BRGEW TYPE BRGEW , " Gross weight
MAKTX TYPE MAKTX , " Material Description
ROWCOLOR TYPE CHAR4 , " Row Color
END OF TY_MARA .
Flag *
DATA: FG_REFRESH TYPE XFLD , " Used to Refresh ALV
FG_SAVE TYPE XFLD . " Data Saved Or Not.
Internal Table Declaration *
DATA: IT_MARA TYPE STANDARD TABLE OF TY_MARA , " Internal table for Material
WA_MARA TYPE TY_MARA . " Workarea for Material
Variable Declaration For General Constants *
CONSTANTS: C_SCREEN_SELECT TYPE SYDYNNR VALUE '9001' , " Selection Screen Number
C_SCREEN_SELECT_NIL TYPE SYDYNNR VALUE '9002' , " Empty Screen Number
C_STATUS9000 TYPE CHAR10 VALUE 'STATUS9000' , " PF-Status
C_TITLEBAR TYPE CHAR4 VALUE '9000' , " Title Bar
C_ISSUE_CONTAINER TYPE SCRFNAME VALUE 'WORKCONTAINER', " Container Name (Screen Painter)
C_BUTTON_TYPE TYPE CHAR1 VALUE '3' , " Button Type
C_EXECUTE TYPE CHAR4 VALUE 'SELE' , " Functions 'SELE' -> Execute
C_BACK TYPE CHAR4 VALUE 'BACK' , " Functions 'BACK' -> Back to main screen
C_ENTER TYPE CHAR5 VALUE 'ENTER' , " Functions 'ENTER' -> No Action
C_SEL01 TYPE CHAR5 VALUE 'SEL01' , " Functions 'SEL01' -> Toggle Function
C_SAVE TYPE CHAR4 VALUE 'SAVE' , " Functions 'SAVE' -> Save Function
C_REFRESH TYPE CHAR7 VALUE 'REFRESH' , " Functions 'REFRESH' -> Clear and Fres All objects
C_ADD_MI TYPE CHAR6 VALUE 'ADD_MI' , " Functions 'ADD_MI' -> Add New Media Issue
C_TRUE TYPE CHAR1 VALUE 'X' , " Set X value
C_REQUIRED TYPE CHAR1 VALUE '1' , " Un-Confirmed Qty field obligatory or not.
C_INPUT TYPE CHAR1 VALUE '0' , " Reason field should not be input.
C_ALV_SAVE TYPE CHAR1 VALUE 'A' , " ALV
C_ERROR TYPE CHAR1 VALUE 'E' , " Error Type
C_SIGN TYPE CHAR1 VALUE 'I' , " Sign
C_OPTION TYPE CHAR2 VALUE 'EQ' , " Option.
C_COMMIT_WAIT TYPE CHAR1 VALUE '5' , " Waiting to update in DB
C_TABNAME TYPE CHAR1 VALUE '1' , " Parameter (ALV)
C_CANCEL TYPE CHAR1 VALUE 'N' , " Cancel
C_YES TYPE CHAR1 VALUE 'J' . " Yes.
Variable Declaration For Container and ALV Grid *
DATA: OBJ_CUST_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER , " Container Class
OBJ_CUST_GRID TYPE REF TO CL_GUI_ALV_GRID . " ALV Grid Class
Field Catalog Declaration For Container and ALV Grid *
DATA: IT_FIELDCAT TYPE LVC_T_FCAT , " Field Catalog
IT_EXCLUDE TYPE UI_FUNCTIONS , " Standard Function Exclude from ALV
WA_FIELDCAT TYPE LVC_S_FCAT , " For Field Catalog
WA_LAYOUT TYPE LVC_S_LAYO . " ALV Layout
Global Variable Declaration *
DATA: OK_CODE TYPE SY-UCOMM , " OK CODE ( Screen Attribute Don't Change the var.name)
G_SAVE_CODE TYPE SY-UCOMM , " OK CODE
G_ANSWER TYPE CHAR1 , " OK or Cancel.
G_SELECTION_DYNNR TYPE SYDYNNR , " Screen Number
G_ERROR_TEXT TYPE CHAR128 , " Error Text
G_SELECTION_TOGGLE_TEXT TYPE CHAR50 , " Toggle Text, Value: Hide Selection, Show Selection
G_MATNR TYPE MATNR , " Material
G_SMATNR TYPE MATNR , " Material
G_SMTART TYPE MTART . " Material Type
Include: ZB_ALVOOPS_TEST_SEL
Line:-------
Selection Screen
SELECTION-SCREEN BEGIN OF SCREEN 9001 AS SUBSCREEN .
SELECTION-SCREEN BEGIN OF BLOCK SELECTION WITH FRAME TITLE TEXT-001 .
SELECT-OPTIONS: S_MATNR FOR G_SMATNR , " Material
S_MTART FOR G_SMTART . " Material Type
SELECTION-SCREEN END OF BLOCK SELECTION .
SELECTION-SCREEN END OF SCREEN 9001 .
Empty Selection
SELECTION-SCREEN BEGIN OF SCREEN 9002 AS SUBSCREEN .
SELECTION-SCREEN BEGIN OF BLOCK SELECTION_NIL WITH FRAME TITLE TEXT-002 .
Nil
SELECTION-SCREEN END OF BLOCK SELECTION_NIL .
SELECTION-SCREEN END OF SCREEN 9002 .
Include: ZB_ALVOOPS_TEST_CL01
Line:-------
CLASS lcl_event_handler DEFINITION *
Event Handler Class Definition *
CLASS LCL_EVENT_HANDLER DEFINITION.
PUBLIC SECTION.
METHODS:
HANDLER_TOOLBAR FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
IMPORTING E_OBJECT E_INTERACTIVE ,
HANDLER_USER_COMMAND FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
IMPORTING E_UCOMM .
ENDCLASS. "lcl_event_handler DEFINITION
CLASS lcl_event_handler IMPLEMENTATION *
Event Class Implementation. *
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
Toolbar -----Create 'Add Issue' button
METHOD HANDLER_TOOLBAR.
DATA: L_WA_TOOLBAR TYPE STB_BUTTON. " Toolbar
CLEAR: L_WA_TOOLBAR.
Button Type
L_WA_TOOLBAR-BUTN_TYPE = C_BUTTON_TYPE . " 3.
APPEND L_WA_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
Add Issue Button.
CLEAR: L_WA_TOOLBAR.
L_WA_TOOLBAR-FUNCTION = 'ADD_MI' . " 'ADD_MI' .
L_WA_TOOLBAR-ICON = 'ICON_CREATE'.
L_WA_TOOLBAR-QUICKINFO = 'CREATE' . " 'Add Issue'.
L_WA_TOOLBAR-TEXT = 'CREATE' . " 'Add Issue'.
L_WA_TOOLBAR-DISABLED = ''.
APPEND L_WA_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
CLEAR: L_WA_TOOLBAR.
ENDMETHOD. "handler_toolbar
User Actions Events-- Handle 'Add Issue' Button Click.
METHOD HANDLER_USER_COMMAND.
CASE E_UCOMM.
Add Issue Button.
WHEN C_ADD_MI.
IF NOT G_MATNR IS INITIAL.
FG_REFRESH = C_TRUE.
PERFORM F_ADD_MEDIAISSUE.
ENDIF.
ENDCASE.
Refresh Control
CALL METHOD CL_GUI_CFW=>FLUSH
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
Handle Exceptions
IF SY-SUBRC <> 0.
CASE SY-SUBRC.
WHEN 1.
G_ERROR_TEXT = TEXT-026. " 'Control System Error'.
WHEN 2.
G_ERROR_TEXT = TEXT-027. " 'Control CL_GUI_CFW Has Raised Error'.
ENDCASE.
MESSAGE G_ERROR_TEXT TYPE 'E'.
ENDIF.
Refresh Alv Grid.
PERFORM F_REFRESH_GRID.
ENDMETHOD. "handler_user_command
ENDCLASS. "lcl_event_handler IMPLEMENTATION
Object Ref. Event Class.
DATA: OBJ_EVENT_HANDLER TYPE REF TO LCL_EVENT_HANDLER.
Include: ZB_ALVOOPS_TEST_PBO
Line:----
Module STATUS_9000 OUTPUT *
Set PF-Status *
MODULE STATUS_9000 OUTPUT.
PF Status
SET PF-STATUS C_STATUS9000 .
SET TITLEBAR C_TITLEBAR .
ENDMODULE. " STATUS_9000 OUTPUT
Module Create_Alvgrid OUTPUT *
Create Or Refresh ALV Grid *
MODULE CREATE_ALVGRID OUTPUT.
PERFORM F_PROCESS_ALV .
PERFORM F_REFRESH_GRID.
ENDMODULE. " create_alvgrid OUTPUT
Include: ZB_ALVOOPS_TEST_PAI
Line:----
Module exit_command INPUT *
Exit Command ( Cancel and Exit ) *
MODULE EXIT_COMMAND INPUT.
LEAVE PROGRAM.
ENDMODULE. " exit_command INPUT
Module user_command_9000 INPUT *
User Command - Process toolbar Events *
MODULE USER_COMMAND_9000 INPUT.
Take an Action based on user Input
G_SAVE_CODE = OK_CODE.
CLEAR OK_CODE.
CASE G_SAVE_CODE.
Back
WHEN C_BACK .
Raise the Confirmation Message When User not saved the data.
IF FG_SAVE = C_YES.
PERFORM F_EXITCHECK CHANGING G_ANSWER .
IF G_ANSWER = C_YES.
PERFORM F_SAVE_DATA.
ELSE.
CLEAR G_SAVE_CODE.
ENDIF.
CLEAR: FG_SAVE.
ENDIF.
LEAVE PROGRAM.
Enter
WHEN C_ENTER.
Execute ( F8 )
WHEN C_EXECUTE .
IF IT_MARA IS INITIAL.
PERFORM F_SELECTMATERIAL.
ENDIF.
Toggle Button
WHEN C_SEL01.
PERFORM F_TOGGLE_SELECTION_SCREEN. " USING ok_code.
SAVE ( CTRL+S )
WHEN C_SAVE.
IF NOT G_MATNR IS INITIAL.
PERFORM F_SAVE_DATA.
CLEAR: G_MATNR.
ENDIF.
New Entry ( CTRL+F1 )
WHEN C_REFRESH.
PERFORM F_REFRESH_DATA.
ENDCASE.
ENDMODULE. " user_command_9000 INPUT
Include: ZB_ALVOOPS_TEST_F01
Line:----
Form f_toggle_selection_screen *
Toggle Function - Hide Selection / Show Selection *
FORM F_TOGGLE_SELECTION_SCREEN.
Toggle Function
IF G_SELECTION_DYNNR = C_SCREEN_SELECT.
G_SELECTION_DYNNR = C_SCREEN_SELECT_NIL.
G_SELECTION_TOGGLE_TEXT = TEXT-902.
ELSE.
G_SELECTION_DYNNR = C_SCREEN_SELECT.
G_SELECTION_TOGGLE_TEXT = TEXT-901.
ENDIF.
ENDFORM. " f_toggle_selection_screen
Form f_initialize
Initialize Screen Number and Text
FORM F_INITIALIZE .
Initialize Screen Number
G_SELECTION_DYNNR = C_SCREEN_SELECT.
G_SELECTION_TOGGLE_TEXT = TEXT-901.
ENDFORM. "f_initialize
Form f_selectmaterial *
FORM F_SELECTMATERIAL .
Select the data from Mara Table
SELECT A~MATNR
A~VPSTA
A~MTART
A~MBRSH
A~MATKL
A~BISMT
A~MEINS
A~BSTME
A~BRGEW
B~MAKTX
INTO TABLE IT_MARA
FROM MARA AS A INNER JOIN MAKT AS B ON AMATNR = BMATNR
WHERE A~MATNR IN S_MATNR
AND A~MTART IN S_MTART
AND B~SPRAS = 'EN'.
IF SY-SUBRC = 0.
FG_REFRESH = C_TRUE.
FG_SAVE = C_YES .
G_MATNR = C_TRUE.
LOOP AT IT_MARA INTO WA_MARA WHERE BRGEW >= 200.
WA_MARA-ROWCOLOR = 'C310'.
MODIFY IT_MARA FROM WA_MARA.
ENDLOOP.
ELSE.
MESSAGE 'No data Found' TYPE 'E'.
ENDIF.
ENDFORM. " f_selectmaterial
Form f_initialize_grid *
Initialize Field Catalog. *
FORM F_INITIALIZE_GRID .
field catalog
PERFORM F_ATTRFCAT USING :
'MATNR' '1' '0' TEXT-005 '15' '0' 'X' ' ' ' ',
'VPSTA' '1' '1' TEXT-006 '15' '0' 'X' ' ' ' ',
'MTART' '1' '2' TEXT-007 '15' '0' ' ' ' ' ' ',
'MBRSH' '1' '3' TEXT-008 '15' '0' ' ' ' ' ' ',
'MATKL' '1' '4' TEXT-009 '15' '0' ' ' 'X' ' ',
'BISMT' '1' '5' TEXT-010 '15' '0' ' ' ' ' ' ',
'MEINS' '1' '6' TEXT-011 '15' '0' ' ' ' ' ' ',
'BSTME' '1' '7' TEXT-012 '15' '0' ' ' ' ' ' ',
'MAKTX' '1' '8' TEXT-013 '15' '0' ' ' ' ' 'C711',
'BRGEW' '1' '9' TEXT-014 '15' '0' ' ' ' ' ' '.
Set Editable Fields in ALV.
PERFORM F_SETEDIT_FIELDS CHANGING IT_FIELDCAT.
ENDFORM. "f_initialize_grid
Form f_setedit_fields *
Set Editable Fields in ALV *
C_IT_FIELDCAT <-- Field Catalog *
FORM F_SETEDIT_FIELDS CHANGING C_IT_FIELDCAT TYPE LVC_T_FCAT.
Local Variable Declaration.
DATA: LS_FIELDCAT LIKE LINE OF C_IT_FIELDCAT. " Field Catalog
Create Editable Fields.
LOOP AT C_IT_FIELDCAT INTO LS_FIELDCAT.
CASE LS_FIELDCAT-FIELDNAME.
WHEN 'BRGEW'.
LS_FIELDCAT-EDIT = C_TRUE.
WHEN 'MAKTX'.
LS_FIELDCAT-EDIT = C_TRUE.
ENDCASE.
MODIFY C_IT_FIELDCAT FROM LS_FIELDCAT.
ENDLOOP.
ENDFORM. " f_setedit_fields
Form f_attrfcat *
Update Field Catalog Internal Table *
U_FIELDNAME --> Field Name *
U_ROW_POS --> Row Position *
U_COL_POS --> Column Position *
U_SELTEXT_L --> Display Column Heading *
U_OUTPUTLEN --> Heading Output Length *
U_DECIMALS_OUT --> Number of decimal places in output *
U_KEY --> Key in ALV Display *
U_FIX --> Existence of fixed values *
FORM F_ATTRFCAT USING
U_FIELDNAME TYPE SLIS_FIELDNAME
U_ROW_POS TYPE SYCUROW
U_COL_POS TYPE SYCUCOL
U_SELTEXT_L TYPE SCRTEXT_L
U_OUTPUTLEN TYPE OUTPUTLEN
U_DECIMALS_OUT TYPE CHAR1
U_KEY TYPE CHAR1
U_FIX TYPE VALEXI
U_COL_COLOR TYPE LVC_EMPHSZ.
Update field catalog.
WA_FIELDCAT-FIELDNAME = U_FIELDNAME.
WA_FIELDCAT-ROW_POS = U_ROW_POS.
WA_FIELDCAT-COL_POS = U_COL_POS.
WA_FIELDCAT-COLTEXT = U_SELTEXT_L.
WA_FIELDCAT-SELTEXT = U_SELTEXT_L.
WA_FIELDCAT-OUTPUTLEN = U_OUTPUTLEN.
WA_FIELDCAT-DECIMALS_O = U_DECIMALS_OUT.
WA_FIELDCAT-KEY = U_KEY.
WA_FIELDCAT-VALEXI = U_FIX.
WA_FIELDCAT-EMPHASIZE = U_COL_COLOR.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. "ATTR_FCAT
Form f_refresh_data *
Clear All the objects used in the program ( Data Related ) *
FORM F_REFRESH_DATA .
Clear All the Objects Used in Our Program.
CLEAR: S_MATNR ,
S_MTART ,
IT_MARA ,
OK_CODE ,
FG_REFRESH ,
FG_SAVE ,
G_SAVE_CODE ,
G_MATNR .
FREE: S_MATNR ,
S_MTART ,
IT_MARA ,
OK_CODE ,
FG_REFRESH ,
FG_SAVE ,
G_SAVE_CODE ,
G_MATNR .
Refresh Alv.
FG_REFRESH = C_TRUE.
ENDFORM. " f_refresh_data
Form f_process_alv *
1. Create Custom Container *
2. Create ALV Grid *
3. Exclude Standard Functions *
4. Display the ALV *
5. Register the Events. *
FORM F_PROCESS_ALV .
Display ALV
Custom Container
IF OBJ_CUST_CONTAINER IS INITIAL.
CREATE OBJECT OBJ_CUST_CONTAINER
EXPORTING
CONTAINER_NAME = C_ISSUE_CONTAINER.
ALV Grid
IF OBJ_CUST_GRID IS INITIAL.
CREATE OBJECT OBJ_CUST_GRID
EXPORTING
I_PARENT = OBJ_CUST_CONTAINER.
ENDIF.
Exclude Standard Functions
PERFORM F_EXCLUDETOOLBAR USING OBJ_CUST_GRID
CHANGING IT_EXCLUDE.
Layout.
WA_LAYOUT-CWIDTH_OPT = C_TRUE.
WA_LAYOUT-INFO_FNAME = 'ROWCOLOR'.
ALV Grid Display
CALL METHOD OBJ_CUST_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = WA_LAYOUT
IT_TOOLBAR_EXCLUDING = IT_EXCLUDE
I_SAVE = C_ALV_SAVE
CHANGING
IT_FIELDCATALOG = IT_FIELDCAT[]
IT_OUTTAB = IT_MARA.
ENDIF.
Register Editable ALV Events
CALL METHOD OBJ_CUST_GRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED
EXCEPTIONS
ERROR = 1
OTHERS = 2.
*Create Object for Custom Event Handler Class if the ref. object is
*initial.
IF OBJ_EVENT_HANDLER IS INITIAL.
CREATE OBJECT OBJ_EVENT_HANDLER.
ENDIF.
Register Events
SET HANDLER: OBJ_EVENT_HANDLER->HANDLER_TOOLBAR FOR
OBJ_CUST_GRID,
OBJ_EVENT_HANDLER->HANDLER_USER_COMMAND FOR
OBJ_CUST_GRID.
Set Toolbar
CALL METHOD OBJ_CUST_GRID->SET_TOOLBAR_INTERACTIVE.
ENDFORM. " f_process_alv
Form f_excludetoolbar *
Exclude Standard Functions from ALV *
U_OBJ_CUST_GRID --> Instant for CL_GUI_ALV_GRID *
C_IT_EXCLUDE <-- Internal table for Exclude *
FORM F_EXCLUDETOOLBAR USING U_OBJ_CUST_GRID TYPE REF TO CL_GUI_ALV_GRID
CHANGING C_IT_EXCLUDE TYPE UI_FUNCTIONS.
Exclude Standard Functions
CLEAR: C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_CHECK TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_REFRESH TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_COPY TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_COPY_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_CUT TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_DELETE_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_APPEND_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_INSERT_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_MOVE_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_PASTE TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_PASTE_NEW_ROW TO C_IT_EXCLUDE.
APPEND U_OBJ_CUST_GRID->MC_FC_LOC_UNDO TO C_IT_EXCLUDE.
ENDFORM. " f_excludetoolbar
Form f_create_returnrequest *
Create Return Request based on the Work container ( ALV Grid Data) *
FORM F_CREATE_RETURNREQUEST.
Message to save
ENDFORM. " f_create_returnrequest
Form f_add_mediaissue *
Create New Media Issue if the user click 'ADD ISSUE' Button. *
1. Get the Input From User *
2. Get Total Delivery and Return Quantity *
3. Append to Final internal table *
FORM F_ADD_MEDIAISSUE .
Local Variable Declaration.
MESSAGE 'Add Button Clicked' TYPE 'I'.
ENDFORM. " f_add_mediaissue
Form f_refresh_grid *
Refresh ALV Grid *
FORM F_REFRESH_GRID .
Refresh ALV Grid.
IF FG_REFRESH IS NOT INITIAL.
CALL METHOD OBJ_CUST_GRID->REFRESH_TABLE_DISPLAY.
CLEAR: FG_REFRESH.
ENDIF.
ENDFORM. " f_refresh_grid
Form f_getcollectissue *
FORM F_GETCOLLECTISSUE .
Collection Plan Data
ENDFORM. " f_getcollectissue
Form f_perpare_final *
FORM F_PERPARE_FINAL .
Perpare Final Internal table
ENDFORM. " f_perpare_final
Form f_validate_data *
FORM F_VALIDATE_DATA.
Message if any data validation.
ENDFORM. " f_validate_data
Form f_modify_final *
Update Actual Delivery Qty and Return Qty in Final Internal table *
Form f_save_data *
Save the Data When User Click 'Save' Button *
FORM F_SAVE_DATA .
Message
MESSAGE 'Save Button Clicked' TYPE 'I'.
ENDFORM. "f_save_data
Form f_exitcheck *
When User Exit from the Transaction then Raise Confirmation message*
C_ANSWER <-- OK or Cancel. *
FORM F_EXITCHECK CHANGING C_ANSWER TYPE CHAR1.
Security Check.
C_ANSWER = C_CANCEL.
CALL FUNCTION 'POPUP_TO_CONFIRM_DATA_LOSS'
EXPORTING
TITEL = TEXT-039
IMPORTING
ANSWER = C_ANSWER.
ENDFORM. "f_exitcheck
Screen Numer : 9000
Line:------
PROCESS BEFORE OUTPUT.
MODULE STATUS_9000.
CALL SUBSCREEN: SELECTIONSCREEN INCLUDING SY-CPROG G_SELECTION_DYNNR.
MODULE CREATE_ALVGRID.
PROCESS AFTER INPUT.
MODULE EXIT_COMMAND AT EXIT-COMMAND.
CALL SUBSCREEN: SELECTIONSCREEN.
MODULE USER_COMMAND_9000.
pls reward if it is useful -
How to display table data without using ALV and table element.
Hi,
Its possible to display table data without using ALV and table element.
Every time i am fetching data based on (customer,status) fields and displaying these data in my output using alv
(every time i am fetching single row data ),
But problem is alv occupying more space in the output , i want to display data part only i dont want field names,
settings and header data etc..things.
Give solution to display data part..
Regards,
Rakhi.Hi,
Does you mean that you need ALV without default Function Toolbar...? If this is the case, the easy solution would have been to use Table Element rather. But, if you need to use ALV only without Function Toolbar, you can do away with that as well.
In that case, after calling GET_MODEL, you need to add few more lines of codes to achieve your goal. Those lines are --
DATA LV_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
LV_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(
* Standard Filter Function setting to FALSE
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_COMPLEX_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_COMPLEX_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_FILTERLINE_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_DISPLAY_SETTINGS_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_VIEW_LIST_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_HEADERCLICK_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_HIERARCHY_ALLOWED( ABAP_FALSE ).
* Standard Filter Function setting to FALSE Ends
Here as you can easily notice that LV_VALUE is instantiated on CL_SALV_WD_CONFIG_TABLE. Now, using this LV_VALUE, you set standard functions as False to dis-allow their display.
Hope this answers your query.
Thanks.
Kumar Saurav. -
Display leading zeros in the ALV
Hello All,
My requirement is to display leading zeros in the ALV. The leading zeros are not getting displayed. Please suggest how do I achieve this. I have tries NO_ZERO = ' ' and lzero = ' '.
Thanks in advance.
Regards,
AnjuHere is the Sample code for your ref
type-pools: slis.
data: begin of t_itab occurs 0,
col1 type matnr,
col2 type char10,
end of t_itab.
data: t_fieldcat type slis_t_fieldcat_alv,
w_fieldcat type slis_fieldcat_alv.
t_itab-col1 = 10.
t_itab-col2 = 'A'.
append t_itab.
clear t_itab.
t_itab-col1 = 11.
t_itab-col2 = 'B'.
append t_itab.
clear t_itab.
loop at t_itab.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = t_itab-col1
IMPORTING
OUTPUT = t_itab-col1 .
modify t_itab index sy-tabix.
endloop.
w_fieldcat-fieldname = 'COL1'.
w_fieldcat-lzero = 'X'.
append w_fieldcat to t_fieldcat.
clear w_fieldcat.
w_fieldcat-fieldname = 'COL2'.
append w_fieldcat to t_fieldcat.
clear w_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
IT_FIELDCAT = t_fieldcat
I_SAVE = 'X'
TABLES
t_outtab = t_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.
Regards,
Bhavana -
Is there any way to print the data inside the Notes field of MIR6 Report
Hello Gurús.
We need to include the data inside the Notes field in the report MIR6 - INVOICE OVERVIEW - report.
Is there any way to print the data inside (comments) the Notes field as well in the Report ?
We found that the only way is to open the Notes and print it, but it takes time, any idea ?
Rgds.
MCM.There's nothing built-in that does that. If you only have text fields and they don't have any formatting or other property that would prevent it (e.g., Date, character limit), you can run a simple script to populate each field with the field name, and then print. A more complicated approach would be a script that adds text annotations near/over each field that shows the field name. This would just be for documentation purposes, but it's possible. Post again if you'd like help with the first. You'll probably have to pay someone for the second approach if you don't want to do it yourself.
-
How to see variable Data at the time debugging procedure in oracle toad 9.1
Hi all,
I am not able to see variable Data at the time of debugging procedure in oracle toad 9.1 .
Any help would be appreciated .
Regards,
P Prakash
Edited by: prakash on May 30, 2011 1:37 AM
Edited by: prakash on May 30, 2011 1:37 AM
Edited by: prakash on May 30, 2011 1:37 AMYou might be aware Toad is not an Oracle product, so you need to post this at the forums of Quest, http://www.questsoftware.com
Sybrand Bakker
Senior Oracle DBA -
Is there a way to access the date in the XI message header
Hello,
Is there a way to access the date in the XI message header i.e. the date on which XI has received a particular message.
Regards,
Sylvesteryes you can.
ref: http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/content.htm -
Hi All,
I can able to display the data through the FM REUSE_ALV_GRID_DISPLAY in the out put screen.When I click on the Microsoft Excel (CtrlShiftF7) at the ALV toolbar to view the same data in excel sheet it does open the excel sheet WITHOUT ANY DATA. Please help me how to make the data visible in the excel sheet.
Can anyone help in this regard.
Thanks & Regards,
Seshadri GHi,
Check whether the tool bar export is disabled in the alv.
check in the alv->set_table_for_first_display FM the toolbar exclude export list.
If that is ok, then try download manually by providing abutton and clicking it. You can download data manually in this way.
refer the code below.
DATA: lv_path TYPE string,
lv_fullpath TYPE string,
lc_c TYPE string,
v_fnam TYPE string,
lc_date(15) TYPE c.
TYPES: BEGIN OF ts_fieldnames,
field_name(1000),
END OF ts_fieldnames.
lc_c = 'C:\'.
WRITE sy-datum TO lc_date.
DATA:lt_fieldnames TYPE STANDARD TABLE OF ts_fieldnames,
ls_fieldnames TYPE ts_fieldnames,
lt_fieldnames1 TYPE STANDARD TABLE OF ts_fieldnames,
ls_fieldnames1 TYPE ts_fieldnames,
lt_fieldnames2 TYPE STANDARD TABLE OF ts_fieldnames,
ls_fieldnames2 TYPE ts_fieldnames,
lt_fieldnames3 TYPE STANDARD TABLE OF ts_fieldnames,
ls_fieldnames3 TYPE ts_fieldnames,
lt_fieldnames5 TYPE STANDARD TABLE OF ts_fieldnames,
ls_fieldnames5 TYPE ts_fieldnames.
CONCATENATE 'ContractAccount'
'DocumentNumber'
'Reference/InvoiceDocumentNumber'
'ClearingDocumentNumber'
INTO ls_fieldnames-field_name SEPARATED BY
cl_abap_char_utilities=>horizontal_tab.
APPEND ls_fieldnames TO lt_fieldnames.
CONCATENATE '' ''
INTO ls_fieldnames5-field_name SEPARATED BY
cl_abap_char_utilities=>newline.
APPEND ls_fieldnames5 TO lt_fieldnames5.
DATA : ls_str1 TYPE string,
ls_str2 TYPE string.
ls_str1 = 'Invoice Clearing Posting'.
ls_str2 = 'Payment On Account Posting'.
CONCATENATE ls_str1 ' :: ' lc_date INTO ls_fieldnames2-field_name.
APPEND ls_fieldnames2 TO lt_fieldnames2.
CONCATENATE ls_str2 ' :: ' lc_date INTO ls_fieldnames3-field_name.
APPEND ls_fieldnames3 TO lt_fieldnames3.
CONCATENATE 'ContractAccount'
'Reference/InvoiceDocumentNumber'
'PostOnAccountDocumentNumber'
INTO ls_fieldnames1-field_name SEPARATED BY
cl_abap_char_utilities=>horizontal_tab.
APPEND ls_fieldnames1 TO lt_fieldnames1.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = 'Select file for download'
default_extension = '.xls'
default_file_name = lv_path
initial_directory = lc_c
CHANGING
filename = lv_path
path = lc_c
fullpath = lv_fullpath
EXCEPTIONS
cntl_error = 1
error_no_gui = 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.
ELSE.
v_fnam = lv_fullpath.
ENDIF.
IF v_fnam IS INITIAL.
RETURN.
ENDIF.
IF i_finalclear[] IS NOT INITIAL.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = v_fnam
filetype = 'DAT'
HEADER = header
append = 'X'
write_field_separator = 'X'
CHANGING
data_tab = lt_fieldnames2
EXCEPTIONS
OTHERS = 8.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = v_fnam
filetype = 'DAT'
HEADER = header
append = 'X'
write_field_separator = 'X'
CHANGING
data_tab = lt_fieldnames
EXCEPTIONS
OTHERS = 8.
REgards
sheron -
Display only part of the STRING field, but search ALL field
Hi all,
I have a field VARCHAR2(4000) that holds a lot of text.
When I make a report in APEX, it shows in each row, ALL text, so the report is very "ugly".
I want to limit the display of that column for only the first 60 characters.
I tried to use the SUBSTR function, that worked, but the search option will search for the text only in that 60 lenght characters, and will now search in the rest (not displayed) part of the field.
Is there a way to do this full search and display only part of the field?
ThanksYou can have the 'substring' column displayed to the user, but have another column which shows the full text lets say it has an ALIAS of "*SEARCH_LARGE_TEXT*" in the report definition(and is among the displayed columns).
You can hide the large text column(SEARCH_LARGE_TEXT) using JS as
$('th[id="SEARCH_LARGE_TEXT"],TD[headers^="SEARCH_LARGE_TEXT"]').hide()
Note: ^= syntax used to match data column even when break formatting used
You can make sure that the column stays hidden even after an IR filter or refresh by binding it to the refresh event of the IR by
$('#apexir_WORKSHEET_REGION').bind('apexafterrefresh', function(){
$('th[id="SEARCH_LARGE_TEXT"],TD[headers^="SEARCH_LARGE_TEXT"]').hide()
change the string "SEARCH_LARGE_TEXT" with your column's alias
Hope it helps -
How to find top n data from the alv report
hi abapers
i have alv report is displaying 2 columns material and rate.
i want to get only top 50 rate along with material on the same screen as we do similar thing in Tcode MC.5 pressing top n.
i m trying to find the solution for this for last 2 months
can u provide me the code how to do this as i m not able to understand mc.5 code for top n function.Hi Deepika,
if you want the top 50 in the same screen, you can try the below logic.
Here assume that it_tab is the tbale displayed through ALV and user command
TOP_50 is to get the top 50 rate.
FORM user_command USING
r_ucomm LIKE sy-ucomm.
DATA lit_grid TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lit_grid.
CASE r_ucomm.
WHEN 'TOP_50'.
it_tab1 = it_tab. "Copy to another tab
REFRESH it_tab. "Clear the original
SORT it_tab1 BY rate. "Sort by rate
DO 50 TIMES. "Only for top 50
READ TABLE it_tab INTO wa_tab INDEX sy-index.
APPEND wa_tab TO it_tab. "Fill the original tab
ENDDO.
"Refresh the ALV
CALL METHOD lit_grid->refresh_table_display.
ENDCASE.
ENDFORM.
Regards,
Manoj Kumar P
Edited by: Manoj Kumar on Mar 3, 2009 9:36 AM
Edited by: Manoj Kumar on Mar 3, 2009 9:39 AM -
How to display a date in the future?
Hello,
I play sport every Thursday. On my website I want to be able to display the date of the next Thursday that we are meeting. I want to be able to do this on an a continual basis. i.e. When someone looks at my site on Friday, it will display the actual date that the next Thursday falls on, and so on.
Can anyone help with how to code this?
Cheers
Mitchuse cal = Calendar.getInstance() to get the current date/time
use cal.get(Calendar.DAY_OF_WEEK) to get what today is
calculate n = days to next Thursday
advance the calendar with cal.add(Calendar.DATE, n). -
Current Date in the Text Field
Hi,
I have got a requirement where i have one text field and one data/time field. Once we select the date from the date field, the date selected in the date field should be reflected in text field in the format DD.MM.YY along with some other text.
for example,
if we select date as 03/02/2009 - Date Field, we should get it as
Today is (date with format DD.MM.YY)On the exit of the Date field write the javascript code:
TextField.rawValue = "Today is " + this.rawValue -
LX25 displays wrong data for the entered date range
System says "Inventory not executed" status for the bins even if Inventory is executed for the bins in the date range provided in the selection screen.
For e.g.
I execute report for Warehouse XYZ. I specify date range as 01.04.2014 to 31.03.2015.
I get some bins in the status "No Inventory executed".I presume that Inventory is not executed for these bins within this period.
But when I go to each bin in the status "No Inventory executed" I find that The bins are counted on the dates 24.09.2014 and then on 05.04.2015.
Then I changed the date in the selection screen to 01.04.2014 to 05.04.2015.
Those bins which were earlier in the status of "No inventory status executed" are now not present in this status.
Does this mean that LX25 report is based on the Last counted date? Or the report is not displayed correctly for the date range provided?
I want to know the criteria based on which the LX25 report works.
Thanks In Advance.Hi Jurgen,
Below information I found from the LX25 report info in SAP.
Inventory status
Description
This report provides information on the stock in the storagae bins and presents this on the screen. You can limit your selection by warehouse number, storage type and storage bin, or choose the following criteria:
Total number of bins
Number of inventoried bins in the selection period
Bins with active inventory
Bins with planned inventory
Bins without executed inventory
From this list, you can obtain a plan of the individual storage bins with further detail information within a storage type, by clicking on the relevant line total.
It clearly shows that the report should be able to show the number of inventoried bins in the selection period, which it doesn't. Does it mean that system is not working as expected?
Regards
Soumya -
Read Data from the dynamic Field Symbol with key ?
Dear All,
I've 2 dynamic internal tables in the form of field symbols.
Now,I want to loop the item field symbol, read the header field symbol content and then move the corresponding into a final field symbol.
How to read the field symbol with key ?
When I'm trying to give the key clause in the paranthesis it's giving a syntax error.
Any clues ?
FYI .....
* Get the Dynamic Field and Value for the Date/Year and convert it into Year value
LOOP AT <fs_t_son> ASSIGNING <wa_son>.
ASSIGN COMPONENT gwa_znrows_def-fieldname OF STRUCTURE <wa_son> TO <fs_year>.
IF sy-subrc = 0.
CLEAR gv_string.
MOVE <fs_year> TO gv_string.
CLEAR gv_year.
gv_year = gv_string.
<fs_year> = gv_year.
ELSE.
* When the Date/year Field is not in the Table then -->
* Get the Dynamic Field and Value
ASSIGN COMPONENT gwa_znrows_def-kfldname OF STRUCTURE <wa_rson> TO <fs_value>.
* Populate field for Dynamic Where condition
CLEAR gv_value.
CONCATENATE '''' <fs_value> '''' INTO gv_value.
CONCATENATE gwa_znrows_def-kfldname '=' gv_value INTO gt_where SEPARATED BY space.
APPEND gt_where.
CLEAR gt_where.
READ TABLE <fs_t_rson> ASSIGNING <wa_rson> ( gt_where ). "Key clause
ENDIF. " if sy-subrc = 0. "Assign
ENDLOOP.
Thanks & regards,
Deepu.KTYPES: BEGIN OF line,
col1 TYPE c,
col2 TYPE c,
END OF line.
DATA: wa TYPE line,
itab TYPE HASHED TABLE OF line WITH UNIQUE KEY col1,
key(4) TYPE c VALUE 'COL1'.
FIELD-SYMBOLS <fs> TYPE ANY TABLE.
ASSIGN itab TO <fs>.
READ TABLE <fs> WITH TABLE KEY (key) = 'X' INTO wa.
The internal table itab is assigned to the generic field symbol <fs>, after which it is possible to address the table key of the field symbol dynamically. However, the static address
READ TABLE <fs> WITH TABLE KEY col1 = 'X' INTO wa.
is not possible syntactically, since the field symbol does not adopt the key of table itab until runtime. In the program, the type specification ANY TABLE only indicates that <fs> is a table. If the type had been ANY (or no type had been specified at all), even the specific internal table statement READ TABLE <fs> would not have been possible from a syntax point of view.
Maybe you are looking for
-
[ABANDONED]No screens found with radeon driver
I had a working system that used the radeon driver, and then the drivers and x server updated. When I first booted my old xorg.conf sort of worked, but the keyboard and mouse were not detected properly and did not work at all, so I removed my xorg.co
-
Auto copy one pixel row from image....
Can someone help me write a script that: - from my selection (1 pixel row) - auto copy selected area to next row into new layer (up or down)... and so on (into the same second layer)... until it reaches the end of the image - the result is a photos w
-
Need to roll back to 3.6 from 4 RC1
Is there an easy way to uninstall Firefox 4 RC1 while rolling back to latest current stable release on Windows XP?
-
Deleted Photos appear again after iPhoto-Restart
Hi, I am using a large iPhoto-Library from a Samba-shared directory. This works fine for a long time. I just realised that deleting of photos and events seems to be buggy: 1. When tragging a Photo to iPhoto-trashbin in still appears as an events, but
-
Is this someone would have this function already? To finish a program I would have need of a function that controls what is introduced, if he/it is in the shape of one date as (04 07 2003, 4 7 03, 4.7.03, 4/7/2003,....) that accepts the separator spa