Need pushbutton in ALV
Hi Friends,
I need to put a pushbutton in ALV List's every row. And then when user click this button, I will get the selected line of list. My application server is 4.6 and I want to implement this using the function call of CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY', not using object oriented programming. How can I put button in alv list and get the selected line when button is clicked?
Thanks.
U can not do it by 'Reuse_alv*'. You have to use class for that. Here is the example: I have created a pushbutton 'Download file'.
report z_82235_alv_oops_pustbutton .
tables: mara.
types: begin of t_mara,
matnr type matnr,
mtart type mtart,
matkl type matkl,
meins type meins,
end of t_mara.
data: gt_mara type standard table of t_mara,
gs_mara like line of gt_mara.
class lcl_event_receiver definition deferred.
*-- Global Data defenation for ALV
*---Alv Grid instance referance
data : gr_alvgrid type ref to cl_gui_alv_grid,
event_receiver type ref to lcl_event_receiver.
*---Name of the custom control added on the screen
data gc_custom_control_name type scrfname value 'CC_ALV'
*---Custom container instance referance
data: gr_ccontainer type ref to cl_gui_custom_container.
*---Field catalog table
data: gt_fieldcat type lvc_t_fcat,
gs_fieldcat type lvc_s_fcat.
*---Layout structure
data: gs_layout type lvc_s_layo.
data: g_repid like sy-repid.
select matnr
mtart
matkl
meins
from mara into table gt_mara
up to 25 rows.
g_repid = sy-repid.
include <icon>.
* Predefine a local class for event handling to allow the
* declaration of a reference variable before the class is defined.
* Set initial dynpro
set screen 100.
* LOCAL CLASSES: Definition
*===============================================================
* class lcl_event_receiver: local class to
* define and handle own functions.
* Definition:
* ~~~~~~~~~~~
class lcl_event_receiver definition.
public section.
methods:
handle_toolbar
for event toolbar of cl_gui_alv_grid
importing e_object e_interactive,
handle_user_command
for event user_command of cl_gui_alv_grid
importing e_ucomm.
private section.
endclass.
* lcl_event_receiver (Definition)
*===============================================================
* LOCAL CLASSES: Implementation
*===============================================================
* class lcl_event_receiver (Implementation)
class lcl_event_receiver implementation.
method handle_toolbar.
* § 2.In event handler method for event TOOLBAR: Append own functions
* by using event parameter E_OBJECT.
data: ls_toolbar type stb_button.
* E_OBJECT of event TOOLBAR is of type REF TO CL_ALV_EVENT_TOOLBAR_SET.
* This class has got one attribute, namly MT_TOOLBAR, which
* is a table of type TTB_BUTTON. One line of this table is
* defined by the Structure STB_BUTTON (see data deklaration above).
* A remark to the flag E_INTERACTIVE:
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* 'e_interactive' is set, if this event is raised due to
* the call of 'set_toolbar_interactive' by the user.
* You can distinguish this way if the event was raised
* by yourself or by ALV
* (e.g. in method 'refresh_table_display').
* An application of this feature is still unknown... :-)
* append a separator to normal toolbar
clear ls_toolbar.
move 3 to ls_toolbar-butn_type.
append ls_toolbar to e_object->mt_toolbar.
* append an icon to download
clear ls_toolbar.
ls_toolbar-function = 'DOWN'.
ls_toolbar-icon = 'icon_generate'.
ls_toolbar-quickinfo = 'DOWNLOAD FILE'.
ls_toolbar-text = 'DOWNLOAD FILE'.
* MOVE ' ' TO ls_toolbar-disabled.
append ls_toolbar to e_object->mt_toolbar.
endmethod.
method handle_user_command.
* § 3.In event handler method for event USER_COMMAND: Query your
* function codes defined in step 2 and react accordingly.
data: lt_rows type lvc_t_row.
case e_ucomm.
when 'DOWN'.
call function 'GUI_DOWNLOAD'
exporting
* BIN_FILESIZE =
filename = 'D:a.txt'
* FILETYPE = 'ASC'
* APPEND = ' '
* WRITE_FIELD_SEPARATOR = ' '
* HEADER = '00'
tables
data_tab = gt_mara
exceptions
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
others = 22
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endcase.
endmethod. "handle_user_command
endclass.
* lcl_event_receiver (Implementation)
*===================================================================
* S T A R T - O F - S E L E C T I O N.
start-of-selection.
set screen '100'.
*& Module display_alv OUTPUT
* text
module display_alv output.
if gr_alvgrid is initial.
*---Creating custom container instance
create object gr_ccontainer
exporting
container_name = gc_custom_control_name
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
*---Creating ALV gris instance
create object gr_alvgrid
exporting
i_parent = gr_ccontainer
i_appl_events = 'X'
exceptions
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
others = 5
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
*---Prepare field catalog
perform prepare_field_catalog tables gt_fieldcat.
*---Prepare layout
perform prepare_layout changing gs_layout.
*---Call ALV grid
call method gr_alvgrid->set_table_for_first_display
exporting
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
is_layout = gs_layout
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
changing
it_outtab = gt_mara[]
it_fieldcatalog = gt_fieldcat
* IT_SORT =
* IT_FILTER =
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
* ->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 event_receiver.
set handler event_receiver->handle_user_command for gr_alvgrid.
set handler event_receiver->handle_toolbar for gr_alvgrid.
* § 4.Call method 'set_toolbar_interactive' to raise event TOOLBAR.
call method gr_alvgrid->set_toolbar_interactive.
* endif. "IF grid1 IS INITIAL
* call method cl_gui_control=>set_focus exporting control = gr_alvgrid.
*--- the instance is present
else .
call method gr_alvgrid->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
exceptions
finished = 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.
endif.
endmodule. " display_alv OUTPUT
*& Form prepare_field_catalog
* text
* <--P_GT_FIELDCAT text
form prepare_field_catalog tables gt_fieldcat.
clear : gs_fieldcat.
gs_fieldcat-fieldname = 'MATNR'.
gs_fieldcat-col_pos = 1.
gs_fieldcat-emphasize = 'X'.
gs_fieldcat-outputlen = 10.
gs_fieldcat-coltext = 'Material No'.
gs_fieldcat-edit = 'X'.
append gs_fieldcat to gt_fieldcat.
clear : gs_fieldcat.
gs_fieldcat-fieldname = 'MTART'.
gs_fieldcat-col_pos = 2.
gs_fieldcat-outputlen = 6.
gs_fieldcat-coltext = 'Material Type'.
append gs_fieldcat to gt_fieldcat.
clear : gs_fieldcat.
gs_fieldcat-fieldname = 'MATKL'.
gs_fieldcat-col_pos = 3.
gs_fieldcat-outputlen = 5.
gs_fieldcat-coltext = 'Material Grp'.
append gs_fieldcat to gt_fieldcat.
clear : gs_fieldcat.
gs_fieldcat-fieldname = 'MEINS'.
gs_fieldcat-col_pos = 4.
gs_fieldcat-outputlen = 4.
gs_fieldcat-coltext = 'Unit'.
append gs_fieldcat to gt_fieldcat.
endform. " prepare_field_catalog
*& Form prepare_layout
* text
* <--P_GS_LAYOUT text
form prepare_layout changing p_gs_layout type lvc_s_layo.
p_gs_layout-zebra = 'X'.
p_gs_layout-grid_title = 'Material'.
p_gs_layout-smalltitle = 'X'.
endform. " prepare_layout
*& Module STATUS_0100 OUTPUT
* text
module status_0100 output.
set pf-status 'STATUS1'.
* SET TITLEBAR 'xxx'.
endmodule. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
module user_command_0100 input.
case sy-ucomm.
when 'BACK' or 'UP' or 'CANCEL'.
leave program.
when '&DETAIL'.
leave program.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
Similar Messages
-
How can I add a pushbutton inside ALV toolbar?
Hi,
This can be included into ALV by defining a GUI and setting that GUI using Set PF Status.
Check the below code for the same,
REPORT ZSPRENH069 NO STANDARD PAGE HEADING.
TYPE-POOLS : SLIS. "Global Type for ALV
T Y P E S *
TYPES:
BEGIN OF TY_VB_AKAP,
VBELN TYPE VBELN_VA, "Sales Document
KUNNR TYPE KUNAG, "Sold-to party
POSNR TYPE POSNR_VA, "Item Number
MATNR TYPE MATNR, "Material Number
PMATN TYPE PMATN, "Pricing Reference Material/Newly Created Material
KWMENG TYPE KWMENG, "Cumulative Order Qty. in Sales Units
VRKME TYPE VRKME, "Sales Unit
NETPR TYPE NETPR, "Net Price
KZWI1 TYPE KZWI1, "Sub Total 1 from pricing procedure for condition
VKAUS TYPE ABRVW, "Usage Indicator
END OF TY_VB_AKAP,
BEGIN OF TY_MARA,
MATNR TYPE MATNR, "Material Number
ZZTECHSPEC TYPE ZTECHSPEC, "Technical Specification
END OF TY_MARA,
BEGIN OF TY_MVKE,
MATNR TYPE MATNR, "Material Number
VKORG TYPE VKORG, "Sales Organization
VTWEG TYPE VTWEG, "Distribution Channel
KONDM TYPE KONDM, "Material Pricing Group
END OF TY_MVKE,
BEGIN OF TY_VBKD,
VBELN TYPE VBELN_VA, "Sales Document
POSNR TYPE POSNR_VA, "Item Number
BSTKD_E TYPE BSTKD_E, "Used to capture New Material Number
END OF TY_VBKD,
BEGIN OF TY_IHEADER,
SELECT(1) TYPE C, "Check Box
VBELN TYPE VBELN, "Sales Document
KUNNR TYPE KUNAG, "Sold-to Party
END OF TY_IHEADER,
BEGIN OF TY_MESSAGE1,
VKORG TYPE VKORG, "Sales Organization
VTWEG TYPE VTWEG, "Distribution Channel
KUNNR TYPE KUNAG, "Customer number
KONDM TYPE KONDM, "Material pricing group
ZCOUNT(2) TYPE N, "Zcount
MSGTYP(1) TYPE C, "Message type
TEXT(150) TYPE C, "Message text
END OF TY_MESSAGE1,
BEGIN OF TY_MESSAGE2,
VKORG TYPE VKORG, "Sales Organization
VTWEG TYPE VTWEG, "Distribution Channel
KUNNR TYPE KUNAG, "Customer number
MATNR TYPE MATNR, "Material Number
MSGTYP(1) TYPE C, "Message type
TEXT(150) TYPE C, "Message text
END OF TY_MESSAGE2,
BEGIN OF TY_IFINAL,
VBELN TYPE VBELN_VA, "Sales Document
KWMENG TYPE KWMENG, "Cumulative Order Qty. in Sales Units
POSNR TYPE POSNR_VA, "Item Number
KUNNR TYPE KUNAG, "Sold-to party
MATNR TYPE MATNR, "Material Number
VRKME TYPE VRKME, "Sales Unit
KZWI1 TYPE KZWI1, "Sub Total 1 from pricing procedure for condition
VKAUS TYPE ABRVW, "Usage Indicator
ZZTECHSPEC TYPE ZTECHSPEC, "Technical Specification
PMATN TYPE PMATN, "Pricing Reference Material/Newly Created Material
KONDM TYPE KONDM, "Material Pricing Group
END OF TY_IFINAL,
BEGIN OF TY_ACC1,
VBELN TYPE VBELN_VA, "Sales Document
KUNNR TYPE KUNAG, "Sold-to party
KONDM TYPE KONDM, "Material Pricing Group
ZCOUNT(2) TYPE N, "ZCount indicator
KSTBM TYPE KSTBM, "Quantity
VRKME TYPE VRKME, "Sales Unit
ZZTECHSPEC TYPE ZTECHSPEC, "Technical Specification
KZWI1 TYPE KZWI1, "Sub Total 1 from pricing procedure for condition
ERROR(1) TYPE N, "Error Field
END OF TY_ACC1,
BEGIN OF TY_ACC2,
VBELN TYPE VBELN_VA, "Sales Document
KUNNR TYPE KUNAG, "Sold-to party
MATNR TYPE MATNR, "Material Number
KSTBM TYPE KSTBM, "Cumulative Order Qty. in Sales Units
ZZTECHSPEC TYPE ZTECHSPEC, "Technical Specification
VRKME TYPE VRKME, "Sales Unit
KZWI1 TYPE KZWI1, "Sub Total 1 from pricing procedure for condition
ERROR(1) TYPE N, "Error field
END OF TY_ACC2.
D A T A *
Internal Table Declarations
DATA: T_FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV, "Fieldcatalog IT
T_EVENTS TYPE SLIS_T_EVENT, "Event IT
T_HEADER TYPE SLIS_T_LISTHEADER, "Header IT
T_VB_AKAP TYPE STANDARD TABLE OF TY_VB_AKAP, "To hold records from VBAK & VBAP Table
T_MARA TYPE STANDARD TABLE OF TY_MARA, "To hold records from MARA Table
T_MVKE TYPE STANDARD TABLE OF TY_MVKE, "To hold records from MVKE Table
T_VBKD TYPE STANDARD TABLE OF TY_VBKD, "To hold records from VBKD Table
T_IHEADER TYPE STANDARD TABLE OF TY_IHEADER, "To hold records from VBAK Table
T_IFINAL TYPE STANDARD TABLE OF TY_IFINAL, "To hold cumulative data for ALV
T_BDCDATA TYPE STANDARD TABLE OF BDCDATA, "IT for bdcdata
T_BDCMSGCOLL TYPE STANDARD TABLE OF BDCMSGCOLL, "IT for error messages
T_MESSAGE1 TYPE STANDARD TABLE OF TY_MESSAGE1, "IT for conditions1 messages
T_MESSAGE2 TYPE STANDARD TABLE OF TY_MESSAGE2, "IT for conditions2 messages
T_ACC2 TYPE STANDARD TABLE OF TY_ACC2, "IT for holding data for Second Access Sequence Processing
T_ACC1 TYPE STANDARD TABLE OF TY_ACC1, "IT for holding data for First Access Sequence Processing
T_SELECT TYPE STANDARD TABLE OF RSPARAMS, "IT for holding data related to the selection screen
Work area Declarations
W_FIELDCATALOG TYPE SLIS_FIELDCAT_ALV, "Fieldcatalog WA
W_EVENT TYPE SLIS_ALV_EVENT, "Event WA
W_HEADER TYPE SLIS_LISTHEADER, "Header WA
W_LAYOUT TYPE SLIS_LAYOUT_ALV, "Layout WA
W_KEYINFO TYPE SLIS_KEYINFO_ALV, "Key Information WA
W_VB_AKAP TYPE TY_VB_AKAP, "To hold records from T_VB_AKAP
W_MARA TYPE TY_MARA, "To hold records from T_MARA
W_MVKE TYPE TY_MVKE, "To hold records from T_MVKE
W_VBKD TYPE TY_VBKD, "To hold records from T_VBKD
W_IHEADER TYPE TY_IHEADER, "To hold records from T_IHEADER
W_IFINAL TYPE TY_IFINAL, "To hold records from T_IFINAL
W_PARAMS TYPE CTU_PARAMS, "CTU Params
W_BDCDATA TYPE BDCDATA, "Work Area for BDCDATA
W_BDCMSGCOLL TYPE BDCMSGCOLL, "Work Area to collect BDC Messages
W_MESSAGE1 TYPE TY_MESSAGE1, "WA for price conditions1 messages
W_MESSAGE2 TYPE TY_MESSAGE2, "WA for price conditions2 messages
W_ACC2 TYPE TY_ACC2, "WA for holding records from T_ACC2
W_ACC1 TYPE TY_ACC1, "WA for holding records from T_ACC1
Variable declarations
G_AUDAT TYPE AUDAT, "Document Date (Date Received/Sent)
G_VBELN TYPE VBELN_VA, "Sales Document
G_KUNNR TYPE KUNAG, "Sold-to party
G_MATNR TYPE MATNR, "Material Number
G_REPID TYPE SY-REPID, "Program Name
G_MESSAGE(73) TYPE C, "To Capture Message
G_FLAG1(1) TYPE C, "Flag
G_ANSWER(1) TYPE C. "Optional Button
Constant declarations
CONSTANTS:
C_A(1) TYPE C VALUE 'A', "Constant Value A
C_S(1) TYPE C VALUE 'S', "Constant Value S
C_U(1) TYPE C VALUE 'U', "Constant Value U
C_X(1) TYPE C VALUE 'X', "Constant Value X
C_E(1) TYPE C VALUE 'E', "Constant Value E
C_I(1) TYPE C VALUE 'I', "Constant Value I
C_R(1) TYPE C VALUE 'R', "Constant Value R
C_B(1) TYPE C VALUE 'B', "Document Category is Quotation
C_HTNAME(10) TYPE C VALUE 'T_IHEADER', "Internal table for Header Data
C_ITNAME(10) TYPE C VALUE 'T_IFINAL', "Internal Table with processed data
C_Q2(2) TYPE C VALUE 'Q2', "Constant Order Reason Q2
C_100(3) TYPE C VALUE '100', "Popup screen
C_046(3) TYPE C VALUE '046', "Value 046
C_047(3) TYPE C VALUE '047', "Value 047
C_25(2) TYPE C VALUE '25', "Popup screen
C_5(1) TYPE C VALUE '5', "Popup screen
C_1 TYPE I VALUE 1, "Value 1 for Error Denotion
C_2 TYPE I VALUE 2, "Value 2 for Error Denotion
C_3 TYPE I VALUE 3, "Value 3 for BDC Error Denotion
C_1000(4) TYPE N VALUE 1000, "Value 1000
C_01(2) TYPE N VALUE '01', "Value 01 for Zcount
C_VK11(4) TYPE C VALUE 'VK11', "Transaction VK11
C_DYNBEGIN(1) TYPE C VALUE 'X', "Indicator
C_UPDATE(1) TYPE C VALUE 'S', "Update
C_DISMODE(1) TYPE C VALUE 'N', "Display
C_ZBPR(4) TYPE C VALUE 'ZBPR', "Condition Type ZBPR
C_ERROR(5) TYPE C VALUE 'ERROR'. "Error screen title
S E L E C T O P T I O N S & P A R A M E T E R S *
Selection-screen Block 1
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
PARAMETERS: P_VKORG TYPE VKORG OBLIGATORY, "Sales Organization
P_VTWEG TYPE VTWEG OBLIGATORY, "Distribution Channel
P_SPART TYPE SPART DEFAULT '00'. "Division
SELECTION-SCREEN END OF BLOCK BLK1.
SELECTION-SCREEN BEGIN OF BLOCK BLK2 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS: S_AUDAT FOR G_AUDAT, "Document Date (Date Received/Sent)
S_VBELN FOR G_VBELN, "Sales Document
S_KUNNR FOR G_KUNNR, "Sold-to party
S_MATNR FOR G_MATNR. "Material Number
PARAMETERS: P_VKAUS(2) TYPE N. "Usage Indicator
SELECTION-SCREEN END OF BLOCK BLK2.
I N I T I A L I Z A T I O N *
INITIALIZATION.
CLEAR : G_REPID. "Program Name
G_REPID = SY-REPID. "Program Name
A T S E L E C T I O N S C R E E N *
AT SELECTION-SCREEN.
S T A R T O F S E L E C T I O N *
START-OF-SELECTION.
Data Selection
PERFORM DATA_RETRIEVAL.
Build Field Catalog
PERFORM BUILD_FIELDCATALOG.
Bulid layout
PERFORM BUILD_LAYOUT.
Build Events
PERFORM BUILD_EVENTS.
Captures the Values of Selection Screen
PERFORM CAPTURE_SCREEN.
E N D O F S E L E C T I O N *
END-OF-SELECTION.
Display List
PERFORM DISPLAY_ALV_REPORT.
F O R M S *
*& Form DATA_RETRIEVAL
Retrieves Data for ALV Display
FORM DATA_RETRIEVAL .
DATA : L_VKAUS TYPE VKAUS. "Variable to hold Usage Indicator
CLEAR L_VKAUS.
SELECT VBELN
KUNNR
INTO CORRESPONDING FIELDS OF TABLE T_IHEADER
FROM VBAK
WHERE VBELN IN S_VBELN
AND KUNNR IN S_KUNNR
AND VKORG EQ P_VKORG
AND AUDAT IN S_AUDAT
AND VTWEG EQ P_VTWEG
AND SPART EQ P_SPART
AND AUGRU EQ C_Q2
AND VBTYP EQ C_B.
IF NOT T_IHEADER IS INITIAL.
IF NOT P_VKAUS IS INITIAL OR P_VKAUS NE C_1.
CONCATENATE 'C' P_VKAUS INTO L_VKAUS.
SELECT A~VBELN
A~KUNNR
B~POSNR
B~MATNR
B~PMATN
B~KWMENG
B~VRKME
B~NETPR
B~KZWI1
B~VKAUS
INTO TABLE T_VB_AKAP
FROM VBAK AS A
JOIN VBAP AS B
ON A~VBELN EQ B~VBELN
FOR ALL ENTRIES IN T_IHEADER
WHERE A~VBELN EQ T_IHEADER-VBELN
AND B~MATNR IN S_MATNR
AND B~VKAUS EQ L_VKAUS.
ELSE.
SELECT A~VBELN
A~KUNNR
B~POSNR
B~MATNR
B~PMATN
B~KWMENG
B~VRKME
B~NETPR
B~KZWI1
B~VKAUS
INTO TABLE T_VB_AKAP
FROM VBAK AS A
JOIN VBAP AS B
ON A~VBELN EQ B~VBELN
FOR ALL ENTRIES IN T_IHEADER
WHERE A~VBELN EQ T_IHEADER-VBELN
AND B~MATNR IN S_MATNR.
ENDIF.
IF NOT T_VB_AKAP IS INITIAL.
SELECT VBELN
POSNR
BSTKD_E
INTO TABLE T_VBKD
FROM VBKD
FOR ALL ENTRIES IN T_VB_AKAP
WHERE VBELN EQ T_VB_AKAP-VBELN
AND POSNR EQ T_VB_AKAP-POSNR.
ENDIF.
SORT T_VBKD BY VBELN POSNR.
CLEAR W_VB_AKAP.
After much of coding was completed, Usage of PMATN was dropped and
the first eighteen characters of the field BSTKD was proposed for usage
Hence PMATN is overwritten by BSTKD value in the below loop
LOOP AT T_VB_AKAP INTO W_VB_AKAP.
CLEAR: W_VBKD,
W_VB_AKAP-PMATN.
READ TABLE T_VBKD INTO W_VBKD
WITH KEY VBELN = W_VB_AKAP-VBELN
POSNR = W_VB_AKAP-POSNR
BINARY SEARCH.
IF SY-SUBRC EQ 0.
W_VB_AKAP-PMATN = W_VBKD-BSTKD_E+0(18).
ENDIF.
MODIFY T_VB_AKAP FROM W_VB_AKAP TRANSPORTING PMATN.
CLEAR W_VB_AKAP.
ENDLOOP.
IF NOT T_VB_AKAP IS INITIAL.
SELECT MATNR
ZZTECHSPEC
INTO TABLE T_MARA
FROM MARA
FOR ALL ENTRIES IN T_VB_AKAP
WHERE MATNR EQ T_VB_AKAP-MATNR.
IF SY-SUBRC EQ 0.
SORT T_MARA BY MATNR.
ENDIF. "Checking SY-SUBRC for T_MARA
SELECT MATNR
ZZTECHSPEC
APPENDING TABLE T_MARA
FROM MARA
FOR ALL ENTRIES IN T_VB_AKAP
WHERE MATNR EQ T_VB_AKAP-PMATN.
IF SY-SUBRC EQ 0.
SORT T_MARA BY MATNR.
ENDIF. "Checking SY-SUBRC for T_MARA
SELECT MATNR
VKORG
VTWEG
KONDM
INTO TABLE T_MVKE
FROM MVKE
FOR ALL ENTRIES IN T_VB_AKAP
WHERE MATNR EQ T_VB_AKAP-PMATN.
IF SY-SUBRC EQ 0.
SORT T_MVKE BY MATNR VKORG VTWEG.
ENDIF. "Checking SY-SUBRC for T_MVKE
SELECT MATNR
VKORG
VTWEG
KONDM
APPENDING TABLE T_MVKE
FROM MVKE
FOR ALL ENTRIES IN T_VB_AKAP
WHERE MATNR EQ T_VB_AKAP-MATNR.
IF SY-SUBRC EQ 0.
SORT T_MVKE BY MATNR VKORG VTWEG.
ENDIF. "Checking SY-SUBRC for T_MVKE
ENDIF. " FOR T_VB_AKAP NOT INITIAL.
ENDIF. " FOR T_IHEADER NOT INITIAL.
CLEAR: W_VB_AKAP,
W_IFINAL.
LOOP AT T_VB_AKAP INTO W_VB_AKAP.
W_IFINAL-VBELN = W_VB_AKAP-VBELN.
W_IFINAL-KUNNR = W_VB_AKAP-KUNNR.
W_IFINAL-POSNR = W_VB_AKAP-POSNR.
W_IFINAL-MATNR = W_VB_AKAP-MATNR.
W_IFINAL-PMATN = W_VB_AKAP-PMATN.
W_IFINAL-KWMENG = W_VB_AKAP-KWMENG.
W_IFINAL-VRKME = W_VB_AKAP-VRKME.
W_IFINAL-NETPR = W_VB_AKAP-NETPR.
W_IFINAL-KZWI1 = ( W_VB_AKAP-KZWI1 / W_VB_AKAP-KWMENG ) * 1000.
W_IFINAL-VKAUS = W_VB_AKAP-VKAUS.
Populating Material Pricing Group from New Material Group, if such Group doesn't exist
Population of Material Pricing Group from Material Number is tried.
Similar condition does suit for Tech Spec too.
SORT: T_MVKE BY MATNR VKORG VTWEG,
T_MARA BY MATNR.
IF NOT W_VB_AKAP-PMATN IS INITIAL.
CLEAR W_MVKE.
READ TABLE T_MVKE
INTO W_MVKE
WITH KEY MATNR = W_VB_AKAP-PMATN
VKORG = P_VKORG
VTWEG = P_VTWEG
BINARY SEARCH.
IF SY-SUBRC EQ 0.
W_IFINAL-KONDM = W_MVKE-KONDM.
ENDIF.
READ TABLE T_MARA
INTO W_MARA
WITH KEY MATNR = W_VB_AKAP-PMATN
BINARY SEARCH.
IF SY-SUBRC EQ 0.
W_IFINAL-ZZTECHSPEC = W_MARA-ZZTECHSPEC.
ENDIF. " SY-SUBRC FOR READ TABLE T_MARA
IF W_MVKE-KONDM IS INITIAL.
ELSE.
SORT T_MVKE BY MATNR VKORG VTWEG.
CLEAR W_MVKE.
READ TABLE T_MVKE
INTO W_MVKE
WITH KEY MATNR = W_VB_AKAP-MATNR
VKORG = P_VKORG
VTWEG = P_VTWEG
BINARY SEARCH.
IF SY-SUBRC EQ 0.
W_IFINAL-KONDM = W_MVKE-KONDM.
ENDIF.
READ TABLE T_MARA
INTO W_MARA
WITH KEY MATNR = W_VB_AKAP-MATNR
BINARY SEARCH.
IF SY-SUBRC EQ 0.
W_IFINAL-ZZTECHSPEC = W_MARA-ZZTECHSPEC.
ENDIF. " SY-SUBRC FOR READ TABLE T_MARA
ELSE.
W_IFINAL-KONDM = W_MVKE-KONDM.
ENDIF. " IS INITIAL CHECK FOR W_MVKE-KONDM
APPEND W_IFINAL TO T_IFINAL.
CLEAR: W_VB_AKAP,
W_IFINAL.
ENDLOOP.
SORT T_IFINAL BY VBELN.
Checking whether if there are any header quotations which does not have items against them in item internal table
if such records exist then, ensuring that such records gets deleted from header too, so that inconsitency is removed.
CLEAR W_IHEADER.
LOOP AT T_IHEADER INTO W_IHEADER.
CLEAR W_IFINAL.
READ TABLE T_IFINAL INTO W_IFINAL WITH KEY VBELN = W_IHEADER-VBELN.
IF SY-SUBRC NE 0.
W_IHEADER-SELECT = C_X.
MODIFY T_IHEADER FROM W_IHEADER TRANSPORTING SELECT.
ENDIF.
ENDLOOP.
DELETE T_IHEADER WHERE SELECT = C_X.
SORT T_IFINAL BY VBELN.
ENDFORM. " DATA_RETRIEVAL
*& Form build_layout
To build ALV Layout
FORM BUILD_LAYOUT.
CLEAR : W_LAYOUT.
W_LAYOUT-COLWIDTH_OPTIMIZE = C_X.
W_LAYOUT-BOX_TABNAME = C_HTNAME. "tabname for checkbox
W_LAYOUT-BOX_FIELDNAME = 'SELECT'. "fieldname for checkbox
CLEAR : W_KEYINFO.
W_KEYINFO-HEADER01 = 'VBELN'. "Header1 key information
W_KEYINFO-ITEM01 = 'VBELN'. "Item1 key information
ENDFORM. "build_layout
*& Form build_events
To build ALV Events
FORM BUILD_EVENTS.
CONSTANTS: C_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 1
IMPORTING
ET_EVENTS = T_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2.
IF SY-SUBRC = 0.
READ TABLE T_EVENTS INTO W_EVENT
WITH KEY NAME = C_TOP_OF_PAGE.
IF SY-SUBRC = 0.
MOVE C_TOP_OF_PAGE TO W_EVENT-FORM.
MODIFY T_EVENTS INDEX SY-TABIX
FROM W_EVENT
TRANSPORTING FORM.
ENDIF.
ELSE.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "build_events
*& Form top_of_page
To display top of page in ALV Report
FORM TOP_OF_PAGE. "#EC CALLED
DATA :
L_VKORG(35) TYPE C, "Sales Organization
L_VTWEG(35) TYPE C, "Distribution Channel
L_SPART(35) TYPE C. "Division
Title
CLEAR W_HEADER.
W_HEADER-TYP = C_H.
W_HEADER-INFO = TEXT-003.
APPEND W_HEADER TO T_HEADER.
Sales Organization
CLEAR W_HEADER.
W_HEADER-TYP = C_S.
CONCATENATE TEXT-004 P_VKORG INTO L_VKORG.
W_HEADER-INFO = L_VKORG.
APPEND W_HEADER TO T_HEADER.
Distribution Channel
CLEAR W_HEADER.
W_HEADER-TYP = C_S.
CONCATENATE TEXT-005 P_VTWEG INTO L_VTWEG.
W_HEADER-INFO = L_VTWEG.
APPEND W_HEADER TO T_HEADER.
Division
CLEAR W_HEADER.
W_HEADER-TYP = C_S.
CONCATENATE TEXT-006 P_SPART INTO L_SPART.
W_HEADER-INFO = L_SPART.
APPEND W_HEADER TO T_HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_HEADER.
ENDFORM. "top_of_page
*& Form pf_status
To set PF-Status (user interface)
-->EXTAB The excluding table (function codes)
FORM PF_STATUS "#EC CALLED
USING T_EXTAB TYPE SLIS_T_EXTAB. "#EC NEEDED
SET PF-STATUS 'ZSTANDARD_FULLSCREEN'.
ENDFORM. "pf_status
*& Form display_alv_report
To display ALV report
FORM DISPLAY_ALV_REPORT.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = W_LAYOUT
IT_FIELDCAT = T_FIELDCATALOG
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_DEFAULT = C_X
I_SAVE = C_A
IS_VARIANT =
IT_EVENTS = T_EVENTS[]
IT_EVENT_EXIT =
I_TABNAME_HEADER = 'T_IHEADER'
I_TABNAME_ITEM = 'T_IFINAL'
I_STRUCTURE_NAME_HEADER =
I_STRUCTURE_NAME_ITEM =
IS_KEYINFO = W_KEYINFO
IS_PRINT =
IS_REPREP_ID =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
IR_SALV_HIERSEQ_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB_HEADER = T_IHEADER
T_OUTTAB_ITEM = T_IFINAL
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_report
*& Form BUILD_FIELDCATALOG
To build ALV Field Catalog
FORM BUILD_FIELDCATALOG .
DATA: L_COUNT TYPE I VALUE 0.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_HTNAME.
W_FIELDCATALOG-FIELDNAME = 'SELECT'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C01.
W_FIELDCATALOG-CHECKBOX = C_X.
W_FIELDCATALOG-EDIT = C_X.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_HTNAME.
W_FIELDCATALOG-FIELDNAME = 'VBELN'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C02.
W_FIELDCATALOG-KEY = C_X. "Fixes the column for no-scroll
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_HTNAME.
W_FIELDCATALOG-FIELDNAME = 'KUNNR'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C04.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR L_COUNT.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'POSNR'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C03.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'KWMENG'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C06.
W_FIELDCATALOG-EMPHASIZE = 'C400'.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'VRKME'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C07.
W_FIELDCATALOG-JUST = C_R.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'NETPR'.
W_FIELDCATALOG-FIELDNAME = 'KZWI1'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C08.
W_FIELDCATALOG-EMPHASIZE = 'C400'.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'VKAUS'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C12.
W_FIELDCATALOG-JUST = C_R.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'ZZTECHSPEC'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C09.
W_FIELDCATALOG-EMPHASIZE = 'C400'.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'MATNR'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C05.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'PMATN'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C10.
W_FIELDCATALOG-EMPHASIZE = 'C400'.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
L_COUNT = L_COUNT + 1.
W_FIELDCATALOG-COL_POS = L_COUNT.
W_FIELDCATALOG-TABNAME = C_ITNAME.
W_FIELDCATALOG-FIELDNAME = 'KONDM'.
W_FIELDCATALOG-SELTEXT_M = TEXT-C11.
APPEND W_FIELDCATALOG TO T_FIELDCATALOG.
ENDFORM. " BUILD_FIELDCATALOG
*& Form user_command
EXIT routine for command handling
-->L_UCOMM Function code that PAI triggered
-->W_SELFIELD Information cursor position ALV
FORM USER_COMMAND USING L_UCOMM LIKE SY-UCOMM "#EC CALLED
W_SELFIELD TYPE SLIS_SELFIELD. "#EC NEEDED
Check function code
CASE L_UCOMM.
WHEN 'CREATE'.
SORT T_IHEADER BY SELECT.
READ TABLE T_IHEADER INTO W_IHEADER
WITH KEY SELECT = C_X
BINARY SEARCH.
IF SY-SUBRC <> 0.
MESSAGE I000(ZS) WITH TEXT-M01.
ELSE.
CLEAR : G_ANSWER.
Dialog box for save prompts
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TEXT_QUESTION = TEXT-OP1
DISPLAY_CANCEL_BUTTON = ''
IMPORTING
ANSWER = G_ANSWER
EXCEPTIONS
TEXT_NOT_FOUND = 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.
ELSE.
IF G_ANSWER = 1.
SET PF-STATUS 'ZSTANDARD_SCREEN'.
PERFORM DATA_IDENTITY_4_ACCESS_SEQ.
PERFORM CREATE_CONDITIONS.
PERFORM DISPLAY_RESULT.
ENDIF.
ENDIF.
ENDIF.
WHEN '&REFRESH'.
SUBMIT ZSPRENH069 USING SELECTION-SCREEN 1000
WITH SELECTION-TABLE T_SELECT.
WHEN 'BACKTO'.
SUBMIT ZSPRENH069 USING SELECTION-SCREEN 1000
WITH SELECTION-TABLE T_SELECT.
ENDCASE.
ENDFORM. "user_command
*& Form DATA_IDENTITY_4_ACCESS_SEQ
Seperates the Available Data for processing for both Access Sequences
FORM DATA_IDENTITY_4_ACCESS_SEQ .
CLEAR : W_IFINAL,
W_ACC1,
W_ACC2.
SORT T_MVKE BY MATNR VKORG VTWEG.
LOOP AT T_IHEADER INTO W_IHEADER WHERE SELECT = C_X.
LOOP AT T_IFINAL INTO W -
Need to create alv report to show pan card number.
Hi,
I need to create alv report to show employee and vendor name , number , Pan card number .This is for hr module.
could any one tell me table and fields for this and how I can relate them with foriegn and primary key.
Regards,
Moderator Message: Do your own work
Edited by: kishan P on Oct 5, 2010 10:38 AMYes, but it only has one generic Date column, no start date and end date. I can't use that twice in the prompt. Although I can specify it to be 'between', but I'm not sure I can pass values to both variables like that.
Currently I have used Campaign Start Date and Campaign End Date to enter values in calender format to the variables. -
Need some sample alvs using merge
I need some sample alvs using merge
Hi!
data w_fieldcat type slis_fieldcat_alv.
type-pools : slis.
tables : sflight.
data : i_fieldcat type slis_T_fieldcat_alv.
data v_repid like sy-repid.
data : begin of i_sflight occurs 0,
carrid like sflight-carrid,
connid like sflight-connid,
fldate like sflight-fldate,
end of i_sflight.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = v_repid
i_internal_tabname = 'I_SFLIGHT'
i_inclname = v_repid
changing
ct_fieldcat = I_fieldcatalog_TYPE.
Check this link
http://help.sap.com/saphelp_nw04/helpdata/en/22/a3f5fed2fe11d2b467006094192fe3/frameset.htm
Regards
Tamá -
Hi all,
i want to know the moethod by which we can display a coulumn as pushbutton in alv when we are usingFM Reuse_alv_list_display.. to display ALV...
if possible then give me some sample code
Regards,
SyedCheck This example which shows button in a cell
REPORT ZTESTALV.
type-pools: slis.
*Fieldcatalog
data: it_fieldcat type lvc_t_fcat,
it_fieldcat1 type slis_t_fieldcat_alv..
*For Events
data:it_events type slis_t_event.
data: x_fieldcat type lvc_s_fcat,
x_fieldcat1 type slis_fieldcat_alv.
data:x_layout type lvc_s_layo.
data: begin of it_vbap occurs 0,
vbeln like vbap-vbeln,
posnr like vbap-posnr,
button(10),
end of it_vbap.
data: ls_outtab like line of it_vbap.
select vbeln
posnr
up to 10 rows
into corresponding fields of table it_vbap
from vbap.
data:l_pos type i value 1.
clear: l_pos.
l_pos = l_pos + 1.
x_fieldcat-seltext = 'Button'.
x_fieldcat-fieldname = 'BUTTON'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-icon = 'X'.
x_fieldcat-col_pos = l_pos.
x_fieldcat-outputlen = '10'.
x_fieldcat-style = x_fieldcat-style bit-xor
cl_gui_alv_grid=>mc_style_button bit-xor
cl_gui_alv_grid=>mc_style_enabled.
append x_fieldcat to it_fieldcat.
clear x_fieldcat.
l_pos = l_pos + 1.
x_fieldcat-seltext = 'VBELN'.
x_fieldcat-fieldname = 'VBELN'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = l_pos.
x_fieldcat-edit = 'X'.
x_fieldcat-outputlen = '10'.
x_fieldcat-ref_field = 'VBELN'.
x_fieldcat-ref_table = 'VBAK'.
append x_fieldcat to it_fieldcat.
clear x_fieldcat.
l_pos = l_pos + 1.
x_fieldcat-seltext = 'POSNR'.
x_fieldcat-fieldname = 'POSNR'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = l_pos.
x_fieldcat-outputlen = '5'.
append x_fieldcat to it_fieldcat.
clear x_fieldcat.
l_pos = l_pos + 1.
call function 'REUSE_ALV_GRID_DISPLAY_LVC'
exporting
i_callback_program = sy-repid
is_layout_lvc = x_layout
it_fieldcat_lvc = it_fieldcat
tables
t_outtab = it_vbap[]
exceptions
program_error = 1
others = 2.
if sy-subrc eq 0.
endif. -
I m in urgent need of sme alv reports in sd module so plz hlp me out.
i m in urgent need of sme alv reports in sd module so plz hlp me out.
if possible plz provide explanation so tht i can understand it fast and well.check with below standard reports :
Sales summary - VC/2
Display Customer Hierarchy - VDH2
Display Condition record report - V/I6
Pricing Report - V/LD
Create Net Price List - V_NL
List customer material info - VD59
List of sales order - VA05
List of Billing documents - VF05
Inquiries list - VA15
Quotation List - VA25
Incomplete Sales orders - V.02
Backorders - V.15
<b>Outbound Delivery Monitor - VL06o
Incomplete delivery - V_UC</b>Customer
Returns-Analysis - MC+A
Customer Analysis- Sales - MC+E
Customer Analysis- Cr. Memo - MC+I
Deliveries-Due list - VL04
Billing due list - VF04
Incomplete Billing documents - MCV9
Customer Analysis-Basic List - MCTA
Material Analysis(SIS) - MCTC
Sales org analysis - MCTE
Sales org analysis-Invoiced sales - MC+2
Material Analysis-Incoming orders - MC(E
General- List of Outbound deliveries - VL06f
Material Returns-Analysis - MC+M
Material Analysis- Invoiced Sales - MC+Q
Variant configuration Analysis - MC(B
Sales org analysis-Incoming orders - MC(I
Sales org analysis-Returns - MC+Y
Sales office Analysis- Invoiced Sales - MC-E
Sales office Analysis- Returns - MC-A
Shipping point Analysis - MC(U
Shipping point Analysis-Returns - MC-O
<b>Blocked orders - V.14</b>
Order Within time period - SD01
Duplicate Sales orders in period - SDD1
Display Delivery Changes - VL22
Simple example what i did - Monthly Sales Report
TYPE-POOLS
type-pools : slis.
Tables
tables : VBAK,
VBAP.
Internal table for VBAK Table
data : begin of i_vbak occurs 0,
vbeln like vbak-vbeln,
bstnk like vbak-bstnk,
vdatu like vbak-vdatu,
end of i_vbak.
Internal table for VBAP and MATNR
data : begin of i_vbap occurs 0,
vbeln like vbap-vbeln,
matnr like vbap-matnr,
kdmat like vbap-kdmat,
kwmeng like vbap-kwmeng,
netpr like vbap-netpr,
maktx like makt-maktx,
end of i_vbap.
Internal tables
data : begin of i_sales occurs 0,
vdatu like vbak-vdatu,
bstnk like vbak-bstnk,
matnr like vbap-matnr,
maktx like makt-maktx,
kdmat like vbap-kdmat,
kwmeng like vbap-kwmeng,
netpr like vbap-netpr,
end of i_sales.
Variable for ALV
data : v_repid like sy-repid,
gt_fieldcat type slis_t_fieldcat_alv.
Selection-screen
selection-screen : begin of block blk with frame title text-001.
select-options : s_vbeln for vbak-vbeln,
s_erdat for vbak-erdat,
s_ernam for vbak-ernam,
s_vdatu for vbak-vdatu obligatory,
s_BSTNK for vbak-BSTNK,
s_KUNNR for vbak-kunnr,
s_matnr for vbap-matnr,
s_KDMAT for vbap-KDMAT.
selection-screen : end of block blk.
Initilization
initialization.
v_repid = sy-repid.
S T A R T - O F - S E L E C T I O N ****************
start-of-selection.
Get the data from VBAK and VBAP Tables
perform get_vbak_vbap.
E N D - O F - S E L E C T I O N *****************
end-of-selection.
Display the data
perform dispolay_data.
*& Form get_vbak_vbap
Get the data from VBAK and VBAP Table
FORM get_vbak_vbap.
Get the data from VBAK Table
select vbeln bstnk vdatu from vbak into table i_vbak
where vbeln in s_vbeln
and bstnk in s_bstnk
and vdatu in s_vdatu
and kunnr in s_kunnr
and erdat in s_erdat
and ernam in s_ernam.
if sy-subrc ne 0.
message e000(zwave) with 'No data found for given selection'.
endif.
Get the data from VBAP Table
select avbeln amatnr akdmat akwmeng a~netpr
b~maktx into table i_vbap
from vbap as a inner join makt as b on bmatnr = amatnr
for all entries in i_vbak
where a~vbeln in s_vbeln
and a~kdmat in s_kdmat
and a~abgru = space
and a~matnr in s_matnr
and a~matnr ne '000000000000009999'
and a~matnr ne '000000000000004444'
and a~matnr ne '000000000000008888'
and a~matnr ne '000000000000001111'
and a~werks = '1000'
and b~spras = 'E'
and a~vbeln = i_vbak-vbeln.
if sy-subrc ne 0.
message e000(zwave) with 'No data found for given selection'.
endif.
sort i_vbak by vbeln.
sort i_vbap by vbeln matnr.
loop at i_vbap.
read table i_vbak with key vbeln = i_vbap-vbeln
binary search.
if sy-subrc eq 0.
i_sales-bstnk = i_vbak-bstnk.
i_sales-vdatu = i_vbak-vdatu.
i_sales-matnr = i_vbap-matnr.
i_sales-kdmat = i_vbap-kdmat.
i_sales-maktx = i_vbap-maktx.
i_sales-netpr = i_vbap-netpr.
i_sales-kwmeng = i_vbap-kwmeng.
append i_sales.
else.
continue.
endif.
clear : i_sales,
i_vbap,
i_vbak.
endloop.
sort i_sales by vdatu bstnk matnr.
refresh : i_vbap,
i_vbak.
ENDFORM. " get_vbak_vbap
*& Form dispolay_data
Display the data
FORM dispolay_data.
Fill the Fiedlcat
PERFORM fieldcat_init using gt_fieldcat[].
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 = ' '
I_CALLBACK_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_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = gt_fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
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 = i_sales
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
ENDFORM. " dispolay_data
*& Form fieldcat_init
text
-->P_GT_FIELDCAT[] text
FORM fieldcat_init USING e01_lt_fieldcat type slis_t_fieldcat_alv.
DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
Delivery Date
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'VDATU'.
LS_FIELDCAT-OUTPUTLEN = 12.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Delivery Date'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Purchase Order #Material Description
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'BSTNK'.
LS_FIELDCAT-OUTPUTLEN = 25.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Purchase Order #'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Material
CLEAR LS_FIELDCAT.
LS_FIELDCAT-REF_FIELDNAME = 'MATNR'.
LS_FIELDCAT-REF_TABNAME = 'MARA'.
LS_FIELDCAT-FIELDNAME = 'MATNR'.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Material #'.
ls_fieldcat-seltext_M = 'Material #'.
ls_fieldcat-seltext_S = 'Material #'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Material Description
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'MAKTX'.
LS_FIELDCAT-OUTPUTLEN = 40.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Material Description'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Customer Material #
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'KDMAT'.
LS_FIELDCAT-OUTPUTLEN = 35.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Customer material no.'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Quantity
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'KWMENG'.
LS_FIELDCAT-OUTPUTLEN = 15.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Quantity'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Net Price
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'NETPR'.
LS_FIELDCAT-OUTPUTLEN = 15.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Net Price'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
ENDFORM. " fieldcat_init
Thanks
Seshu -
Adding pushbutton in alv grid list
hai friends,
i have developed an alv grid list and i place a pushbutton called 'GETEXCEL'.when i click on 'GETEXCEL' it should generate an excel sheet and it should get placed in application server.
for the reference plz check my code also.
the issue is when i debug, the transfer statement is getting executed then it is going to the standard program(moduel pool) and then it is not going to application server.of course excel sheet is also getting generated.can anybody find the solution for this.
*& Form events_get
text
--> p1 text
<-- p2 text
FORM events_get .
*DATA t_event TYPE slis_t_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = tab_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.
READ TABLE tab_events INTO wa_events WITH KEY name = 'USER_COMMAND'.
wa_events-form = 'USER_COMMAND'.
MODIFY tab_events FROM wa_events TRANSPORTING form WHERE name =
wa_events-name.
READ TABLE tab_events INTO wa_events WITH KEY name = 'PF_STATUS_SET'.
wa_events-form = 'PF_STATUS_SET'.
MODIFY tab_events FROM wa_events TRANSPORTING form WHERE name =
wa_events-name.
ENDFORM. " events_get
**& Form pf_status_set
FORM pf_status_set USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STATUS'.
ENDFORM. " pf_status_set
**& Form user_command
FORM user_command
USING u_comm TYPE sy-ucomm
r_selfield TYPE slis_selfield.
CASE u_comm.
WHEN 'GETEXCEL'.
PERFORM f400_column_headings.
PERFORM f500_generate_excel_file.
PERFORM f600_transfer_excel_file.
ENDCASE.
ENDFORM. "user_command
then i am passing the parameters in grid fm also for user command and set pf status.Hi Mahesh,
1. No need to populate the EVENTS table in your case, just pass the Subroutine names for PF status and USER_COMMAND to GRId Display
I_CALLBACK_PFSTATUS = 'PF_STATUS_SET'.
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
2. make sure you pass SY-REPID/SY-CPROG to REUSE_ALV_GRID_DISPLAY FM -
New pushbuttons on ALV display
Hi
I am displaying ALV using REUSE_ALV_GRID_DISPLAY and now i want to add 2 new pushbuttons
on menu bar and one more thing i want to do is that when user select particular records and click on one of pushbutton, new screen should appear and the selected record get displayed .
How would i do it?
Is there any alternative to it?
Thanks
ParagHi
U need to implement the form to set a your own status gui as copy of the standard one: after creating it u need to add the new two pushbutton.
The implement the routine for the user-command where u need to manage your pushbutton.
U need to insert a flag field for the marker and check this field in order to know which records are selected.:
Call the alv grid:
.* Output table
DATA: BEGIN OF T_OUTPUT OCCURS 0,
MARK, "<-------- Field for selected record
* Set the report where the routines are defined
LT_REPORT = SY-REPID.
* Set the name for mark
LT_LAYOUT-BOX_FIELDNAME = 'MARK'.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = LT_REPORT
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS' "<--- Routine for the status
I_CALLBACK_USER_COMMAND = 'USER_COMMAND' "<--- Routine for user-command
IS_LAYOUT = LT_LAYOUT
TABLES
T_OUTTAB = T_OUTPUT.
Routine to set your status gui (the status has to be the copy of standard alv status STANDARD_FULLSCREEN of prgram SAPLKKBL)
FORM SET_PF_STATUS USING IT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'MY_BAR' EXCLUDING IT_EXTAB.
ENDFORM. " SET_PF_STATUS
Routine to manage user-command
FORM user_command USING R_ucomm LIKE sy-ucomm
is_selfield TYPE slis_selfield.
CASE R_UCOMM.
WHEN ....
LOOP AT T_OUTPUT WHERE MARK = 'X'
ENDFORM.
Max -
Block certain Pushbuttons from ALV display
Hi Experts,
I want to block a few of the pushbuttons(PB) in my ALV report such as the Graph PB or the ABC analysis PB.
I have used REUSE_ALV_GRID_DISPLAY. Can any one tell me the fcodes i need to pass to IT_EXCLUDING to exclude them.Hi,
Look at the below links
http://www.howforge.com/taxonomy/term/4?page=1
Re: Error when pressing the buttons in ALV
http://www.howforge.com/abap-4-example-code-alv-list-by-fm-reuse-alv-list-display
Regards
Sudheer -
How to add a pushbutton in ALV
Hi,
Can anybody tell me the step-by-step procedure to add a pushbutton in a ALV Report?Hi Sudheer,
Add Button to ALV Toolbar with REUSE_ALV_LIST_DISPLAY
How to add button to ALV toolbar using REUSE_ALV_LIST_DISPLAY?
In the program which calls ALV using REUSE_ALV_LIST_DISPLAY,
I have to add a new button.
I saw the demo program BCALV_GRID_08, which is written using ABAP-Controls.
In that example, the button is added using TOOLBAR event of cl_gui_alv_grid.
Could you help me to implement the same logic using REUSE_ALV_LIST_DISPLAY parameters.
you should copy the 'STANDARD' GUI status from program SAPLKKBL using transaction SE90 >Programming SubObjects> Gui Status.
Execute this transaction to get to next screen. select status using checkbox. click on GUI Status --> Copy.
Enter your Z program name and the name you what for this status - you can keep it as 'STANDARD' to be simple.
Then you can edit the new status to add or delete buttons. This will also bring in the standard SAP ALV functionality such as sorting/subtotaling etc...
When you call 'REUSE_ALV_GRID_DISPLAY' make sure you pass it the new status name.
an example of one of mine:
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZSDBOLST_REPORT'
i_callback_pf_status_set = 'STANDARD' <----
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'I_BOLACT'
i_grid_title = 'BOL Action Report'(031)
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
i_save = 'A'
is_variant = v_variant
TABLES
t_outtab = i_bolact
EXCEPTIONS
program_error = 1
others = 2.
I just tried the same procedure ,but my entire application toolbar disappeared and a lock icon appears next to the application toolbar in my copied pf-status.
Could you advice what might have gone wrong ?
As identified with the FM's help you can do the following.
1). Using SE80 (I think) you can copy a GUI status from one program to another. It mentions which one in the FM's help.
2). Create a form named like so:
Code:
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZSTANDARD'.
ENDFORM. "Set_pf_status
In the above case the GUI status copied was named ZSTANDARD and adjusted accordingly, adding and removing the desired buttons. A button was added called '%DELETE'.
3). Create the following report:
Code:
Form User_command
Notes: Called by FM REUSE_ALV_GRID_DISPLAY
Detects whether the icon/button for
'Return Tag Deletion' has been pressed. If it has then
detect whether any rows have been highlighted and then
set the delete flag.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA: li_count TYPE I.
IF r_ucomm EQ '%DELETE'.
LOOP AT %g00 WHERE mark EQ 'X'.
ADD 1 TO li_count.
ENDLOOP.
IF li_count GT 0.
gc_delete_flag = 'X'.
r_ucomm = '&F03'. "Back arraow
ELSE.
MESSAGE W000 WITH 'Please highlight the rows to be deleted!'.
ENDIF.
ENDIF.
ENDFORM. "User_command
As I've added an extra button to indicate which records should be deleted I need to identify a form to be called to process when this button is chosen.
Then when you call the ALV function you to specify the following extra details:
Code:
call function 'REUSE_ALV_GRID_DISPLAY'
exporting i_callback_program = gc_repid
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
i_grid_title = lc_grid_title
is_layout = lc_layout
it_fieldcat = gt_fieldcat
it_sort = sort
i_save = l_save
is_reprep_id = l_bbs_id
is_variant = l_variant
tables t_outtab = %g00
exceptions program_error = 1
others = 2.
The parameters in capitals are the extra ones that need to be added.
That should be it!
Make you sure that you also read the help against the ALV function.
Please chk the below link which is in PDF format
http://www.erpgenie.com/abaptips/index2.php?option=com_content&do_pdf=1&id=141
And also please chk the link
http://abapprogramming.blogspot.com/2007/07/alv-documentation-complete.html
https://www.sdn.sap.com/irj/sdn/advancedsearch?query=alv%20grid&cat=sdn_all&start=111
Reward if useful.
Regards,
Chandru -
hi Im working on an alv report,in the output list i have to get pushbutton for every row as a separate column.please help me out with some code,i had gone trough sap sample ALV programs but i did not find this type of programs.Thank you.
Regards
AnilHi Babita,
ok no need to worry, you can do that with the help of FM <b>REUSE_ALV_GRID_DISPLAY_LVC</b>, but New FM , i am not sure if you have this or not. if it is there you can very well do it. just check this code...
REPORT ZTESTALV.
TYPE-POOLS: SLIS.
*- Fieldcatalog
DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV..
*- For Events
DATA:IT_EVENTS TYPE SLIS_T_EVENT.
DATA: X_FIELDCAT TYPE LVC_S_FCAT,
X_FIELDCAT1 TYPE SLIS_FIELDCAT_ALV.
DATA:X_LAYOUT TYPE LVC_S_LAYO.
DATA: BEGIN OF IT_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
BUTTON(10),
END OF IT_VBAP.
DATA: LS_OUTTAB LIKE LINE OF IT_VBAP.
SELECT VBELN
POSNR
UP TO 10 ROWS
INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
FROM VBAP.
DATA:L_POS TYPE I VALUE 1.
CLEAR: L_POS.
L_POS = L_POS + 1.
X_FIELDCAT-SELTEXT = 'Button'.
x_fieldcat-fieldname = 'BUTTON'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '10'.
X_FIELDCAT-style = X_FIELDCAT-style bit-xor
cl_gui_alv_grid=>MC_STYLE_BUTTON bit-xor
cl_gui_alv_grid=>MC_STYLE_ENABLEd.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SELTEXT = 'VBELN'.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-OUTPUTLEN = '10'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SELTEXT = 'POSNR'.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '5'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT_LVC = X_LAYOUT
IT_FIELDCAT_LVC = IT_FIELDCAT
TABLES
T_OUTTAB = IT_VBAP[]
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
vijay -
hi,
i am new to ALV programming,i awant to generate the report with three teable mseg,mkpf,mard.
i need selection screen also.
in the selection screen following is the field names.
Matdoc number-mseg-mblnr
mat number - mseg-matnr
plant - mseg-werks
sloc mseg-lgort
movtype- mseg-bwart.
batch number- mseg-charg.
ordernumber -mseg-aufnr.
costcenter- mseg-kostl.
reservation number- mseg-rsnum.
storage bin - mard-lgpbe.
i want to fetch the data from three tables
mseg,mard,mkpf.
after featch report should disply in alv grid following items.
Matdoc number-mseg-mblnr
mat number - mseg-matnr
plant - mseg-werks
sloc mseg-lgort
movtype- mseg-bwart.
batch number- mseg-charg.
ordernumber -mseg-aufnr.
costcenter- mseg-kostl.
reservation number- mseg-rsnum.
storage bin - mard-lgpbe.
posting date - mkpf-budat.
if any body have the code kindly send it as early as posible.
Thanks,
Rammohan.here is a sample program i think almost containing the same tables and fields
*& Report ZSD_R_ENHANCEMENT2 *
*& REPORT PROGRAMMING FOR THE FURTHER ENHANCEMENT OF THE PRE-GENERATED
*& MB51. REQUIREMENT IS TO ADD FIVE MORE FIELDS.
*& OLD MATERIAL ON THE TOP LEFT CORNER OF THE HEADER AND
*& Batch number the right of material document.
*& Serial number if found should be placed to the right of the batch number.
*& Handling unit/ storage unit to the right of serial number.
*& Transaction description at the last of the report.
REPORT ZSD_R_ENHANCEMENT2 MESSAGE-ID ZB6T2 .
*& STRUCTURE CREATION FOR INTERNAL TABLES *
*STRUCUTRE CREATION FOR HEADER MATERIAL DOCMENT AND DOCUMENT SEGEMNT MATERIAL
TYPES: BEGIN OF TY_MKPF_MSEG,
MBLNR TYPE MBLNR, " NUMBER OF MATERIAL DOC
MJAHR TYPE MJAHR, " MATERIAL DOCUMENT YEAR
VGART TYPE VGART, " TRANSACTION EVENT TYPE
BLART TYPE BLART, " DOCUMENT TYPE
BUDAT TYPE BUDAT, " POSTING DATE INT THE DOC
USNAM TYPE USNAM, " USERNAME
XBLNR TYPE XBLNR1, " REFERENCE DOCUMENT NUMBER
MATNR TYPE MATNR, " MATERIAL NUMBER
WERKS TYPE WERKS_D, " PLANT
LGORT TYPE LGORT_D, " STORAGE LOCATION
CHARG TYPE CHARG_D, " BATCH NUM
LIFNR TYPE ELIFN, " ACC OF VENDOR
KUNNR TYPE EKUNN, " CUSTOMER NUM
SOBKZ TYPE SOBKZ, " SPECIAL STOKING
BWART TYPE BWART, " MOVEMENT TYPE
ZEILE TYPE MBLPO, " ITEM IN MATERIAL DOCUMENT
ERFMG TYPE ERFMG, " QUANTITY IN UNIT OF ENTERY
ERFME TYPE ERFME, " UNIT OF ENTRY
END OF TY_MKPF_MSEG,
*STRUCTURE FOR MATERIAL MASTER DATA
BEGIN OF TY_MARA,
MATNR TYPE MATNR, " MATERIAL TYPE
BISMT TYPE BISMT, " OLD MATERIAL NUMBER
END OF TY_MARA,
*STRUCTURE DECLARATION FOR MATERIAL DESCRIPTION
BEGIN OF TY_MAKT,
MATNR TYPE MATNR, " MATERIAL NUM
SPRAS TYPE SPRAS, " LANGUAGE KEY
MAKTX TYPE MAKTX, " MATERIAL DESC
END OF TY_MAKT,
*STRUCTURE DECLARATION FOR MOVEMENT TYPE TEXT
BEGIN OF TY_T156T,
BWART TYPE BWART, " MOVEMENT TYPE
BTEXT TYPE BTEXT, " MOVEMENT TYPE TEXT
SPRAS TYPE SPRAS, " LANGUAGE KEY
END OF TY_T156T,
*STRUCTURE CREATION FOR DOCUMENT HEADER FOR SERIALNUMBERS FOR GOOD MOVEMENTS
BEGIN OF TY_SER03,
MBLNR TYPE MBLNR, " NUMBER OF MATERIAL DOC
MJAHR TYPE MJAHR, " MATERIAL DOCU YEAR
ZEILE TYPE MBLPO, " OUTPUT IN MATERIAL DOC
OBKNR TYPE OBJKNR, " OBJECT LIST NUMBER
END OF TY_SER03,
*STRUCUTRE DECLARATION FOR PLANTS MAINTANENCE OBKECT LIST
BEGIN OF TY_OBJK,
OBKNR TYPE OBJKNR, " OBJECT LIST NUMBER
OBZAE TYPE OBJZA, " OBLECT LIST COUNTERS
SERNR TYPE GERNR, " SERIAL NUMBER
END OF TY_OBJK,
*STRUCUTRE DECLARATION FOR PLANTS/BRANCHES
BEGIN OF TY_T001W,
WERKS TYPE WERKS_D, " PLANT
NAME1 TYPE NAME1, " NAME
END OF TY_T001W,
*STRUCUTRE DECLARATION FOR OUTPUT TABLE
BEGIN OF TY_OUTPUT,
MATNR TYPE MATNR, " MATERIAL NUMBER
BISMT TYPE BISMT, " OLD MATERIAL NUMBER
MAKTX TYPE MAKTX, " MATERIAL DESC
WERKS TYPE WERKS_D, " PLANT
NAME1 TYPE NAME1, " NAME
LGORT TYPE LGORT_D, " Storage Location
BWART TYPE BWART, " Movement Type
MBLNR TYPE MBLNR, " NUMBER OF MATERIAL DOC
CHARG TYPE CHARG_D, " BATCH NUM
SERNR TYPE GERNR, " SERIAL NUMBER
ZEILE TYPE MBLPO, " OUTPUT IN MATERIAL DOC
BUDAT TYPE BUDAT, " POSTING DOCU DATE
ERFMG TYPE ERFMG, " QUANTITY IN UNIT OF ENTRY
ERFME TYPE ERFME, " UNINT OF ENTRY
BTEXT TYPE BTEXT, " MOVEMENT TYPE TEXT
MJAHR TYPE MJAHR, " MATEREIAL DOC YEAR
VGART TYPE VGART, " TRANSACTION EVENT TYPE
BLART TYPE BLART, " DOCUMENT TYPE
USNAM TYPE USNAM, " USERNAME
XBLNR TYPE XBLNR1, " REFERENCE DOCUMENT NUM
SOBKZ TYPE SOBKZ, " SPECIAL STOCKING
LIFNR TYPE ELIFN, " ACC OF VENDOR
KUNNR TYPE EKUNN, " CUSTOMER
OBKNR TYPE OBJKNR, " OBJECT LIST NUMBER
END OF TY_OUTPUT.
*&INTERNAL TABLE DECLARATION FOR STRUCUTRES *
INTERNAL TABLE DECLARATION FOR HEADER MATERIAL DOCMENT AND DOCUMENT SEGEMNT MATERIAL
DATA : T_MKPF_MSEG TYPE STANDARD TABLE OF TY_MKPF_MSEG INITIAL SIZE 0,
*INTERNAL TABLE DECLARATION FOR MATERIAL MASTER DAT
T_MARA TYPE STANDARD TABLE OF TY_MARA INITIAL SIZE 0,
*INTERNAL TABLE DECLARATION FOR MATERIAL TYPE DESC
T_MAKT TYPE STANDARD TABLE OF TY_MAKT INITIAL SIZE 0,
*INTERNAL TABLE DECLARATION FOR MOVEMENT TYPE TEXT
T_T156T TYPE STANDARD TABLE OF TY_T156T INITIAL SIZE 0,
*INTERNAL TABLE DECLARATION FOR Document Header for Serial Numbers for Goods Movements
T_SER03 TYPE STANDARD TABLE OF TY_SER03 INITIAL SIZE 0,
*INTERNAL TABLE DECLARATION FOR Plant Maintenance Object List
T_OBJK TYPE STANDARD TABLE OF TY_OBJK INITIAL SIZE 0,
*INTERNAL TABLE DECLARATION FOR Plants/Branches
T_T001W TYPE STANDARD TABLE OF TY_T001W INITIAL SIZE 0,
*INTERNAL TABLE DECLARATION FOR OUTPUT
T_OUTPUT TYPE STANDARD TABLE OF TY_OUTPUT INITIAL SIZE 0,
*&WORK AREA DECLARATIONS FOR INTERNAL TABLES *
*WORK AREA DECLARATION HEADER MATERIAL DOCMENT AND DOCUMENT SEGEMNT MATERIAL
W_MKPF_MSEG TYPE TY_MKPF_MSEG,
*WORK AREA DECLARATION MATERIAL MASTER DATA
W_MARA TYPE TY_MARA,
*WORK AREA DECLARATION MATERIAL TYPE DESC
W_MAKT TYPE TY_MAKT,
*WORK AREA DECLARATION MOVEMENT TYPE TEXT\
W_T156T TYPE TY_T156T,
*WORK AREA DECLARATION Document Header for Serial Numbers for Goods Movements
W_SER03 TYPE TY_SER03,
*WORK AREA DECLARATION PLANT MAINTENANCE OBJECT LIST
W_OBJK TYPE TY_OBJK,
*WORK AREA DECLARATION PLANTS AND BRANCHES
W_T001W TYPE TY_T001W,
*WORK AREA DECLARATION FOR OUTPUT TABLE.
W_OUTPUT TYPE TY_OUTPUT,
*& GLOBAL VARIABLE DECLARATIONS *
G_MATNR TYPE MSEG-MATNR,
G_WERKS TYPE MSEG-WERKS,
G_LGORT TYPE MSEG-LGORT,
G_CHARG TYPE MSEG-CHARG,
G_LIFNR TYPE MSEG-LIFNR,
G_KUNNR TYPE MSEG-KUNNR,
G_BWART TYPE MSEG-BWART,
G_SOBKZ TYPE MSEG-SOBKZ,
G_BUDAT TYPE MKPF-BUDAT,
G_USNAM TYPE MKPF-USNAM,
G_VGART TYPE MKPF-VGART,
G_XBLNR TYPE MKPF-XBLNR.
*& SELECTION SCREEN EVENT *
*SELECT OPTIONS EVENTS FOR ITEM DETAILS
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
SELECT-OPTIONS: S_MATNR FOR G_MATNR,
S_WERKS FOR G_WERKS,
S_LGORT FOR G_LGORT,
S_CHARG FOR G_CHARG,
S_LIFNR FOR G_LIFNR,
S_KUNNR FOR G_KUNNR,
S_BWART FOR G_BWART,
S_SOBKZ FOR G_SOBKZ.
SELECTION-SCREEN END OF BLOCK B1.
*SELECT OPTIONS EVENTS FOR HEADER DETAILS
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.
SELECT-OPTIONS: S_BUDAT FOR G_BUDAT,
S_USNAM FOR G_USNAM,
S_VGART FOR G_VGART,
S_XBLNR FOR G_XBLNR.
SELECTION-SCREEN END OF BLOCK B2.
*&INITIALIZATION EVENTS *
INITIALIZATION.
CLEAR: W_MKPF_MSEG,
W_MARA,
W_MAKT,
W_T156T,
W_SER03,
W_OBJK,
W_T001W,
W_OUTPUT.
REFRESH: T_MKPF_MSEG,
T_MARA,
T_MAKT,
T_T156T,
T_SER03,
T_OBJK,
T_T001W,
T_OUTPUT.
*& At Selection screen Event
AT SELECTION-SCREEN.
PERFORM SUB_VALID_MATNR.
PERFORM SUB_VALID_WERKS.
PERFORM SUB_VALID_LGORT.
PERFORM SUB_VALID_CHARG.
PERFORM SUB_VALID_LIFNR.
PERFORM SUB_VALID_KUNNR.
PERFORM SUB_VALID_BWART.
PERFORM SUB_VALID_SOBKZ.
PERFORM SUB_VALID_BUDAT.
PERFORM SUB_VALID_USNAM.
PERFORM SUB_VALID_VGART.
PERFORM SUB_VALID_XBLNR.
*& Start of selection event.
START-OF-SELECTION.
PERFORM SUB_GET_MKPF_MSEG.
PERFORM SUB_GET_MARA.
PERFORM SUB_GET_MAKT.
PERFORM SUB_GET_T156T.
PERFORM SUB_GET_SER03.
PERFORM SUB_GET_T001W.
PERFORM SUB_BSLIST_DISP.
*& Form SUB_VALID_MATNR
*VALIDATION FOR MATERIAL NUM
FORM SUB_VALID_MATNR .
DATA : L_MATNR TYPE MATNR.
SELECT SINGLE MATNR
FROM MARA
INTO L_MATNR
WHERE MATNR IN S_MATNR.
IF SY-SUBRC <> 0.
MESSAGE E001.
ENDIF.
ENDFORM. " SUB_VALID_MATNR
*& Form SUB_VALID_WERKS
text
FORM SUB_VALID_WERKS .
DATA L_WERKS TYPE WERKS_D.
SELECT SINGLE WERKS
FROM T001W
INTO L_WERKS
WHERE WERKS IN S_WERKS.
IF SY-SUBRC <> 0.
MESSAGE E002.
ENDIF.
ENDFORM. " SUB_VALID_WERKS
*& Form SUB_VALID_LGORT
text
FORM SUB_VALID_LGORT .
DATA L_LGORT TYPE LGORT_D.
SELECT SINGLE LGORT
FROM T001L
INTO L_LGORT
WHERE LGORT IN S_LGORT.
IF SY-SUBRC <> 0.
MESSAGE E003.
ENDIF.
ENDFORM. " SUB_VALID_LGORT
*& Form SUB_VALID_CHARG
text
FORM SUB_VALID_CHARG .
DATA L_CHARG TYPE CHARG_D.
SELECT SINGLE CHARG
FROM MCHA
INTO L_CHARG
WHERE CHARG IN S_CHARG.
IF SY-SUBRC <> 0.
MESSAGE E004.
ENDIF.
ENDFORM. " SUB_VALID_CHARG
*& Form SUB_VALID_LIFNR
text
FORM SUB_VALID_LIFNR .
DATA L_LIFNR TYPE LIFNR.
SELECT SINGLE LIFNR
FROM LFA1
INTO L_LIFNR
WHERE LIFNR IN S_LIFNR.
IF SY-SUBRC <> 0.
MESSAGE E005.
ENDIF.
ENDFORM. " SUB_VALID_LIFNR
*& Form SUB_VALID_KUNNR
text
FORM SUB_VALID_KUNNR .
DATA L_KUNNR TYPE KUNNR.
SELECT SINGLE KUNNR
FROM KNA1
INTO L_KUNNR
WHERE KUNNR IN S_KUNNR.
IF SY-SUBRC <> 0.
MESSAGE E006.
ENDIF.
ENDFORM. " SUB_VALID_KUNNR
*& Form SUB_VALID_BWART
text
FORM SUB_VALID_BWART .
DATA L_BWART TYPE BWART.
SELECT SINGLE BWART
FROM T156
INTO L_BWART
WHERE BWART IN S_BWART.
IF SY-SUBRC <> 0.
MESSAGE E007.
ENDIF.
ENDFORM. " SUB_VALID_BWART
*& Form SUB_VALID_SOBKZ
text
FORM SUB_VALID_SOBKZ .
DATA L_SOBKZ TYPE SOBKZ.
SELECT SINGLE SOBKZ
FROM T148
INTO L_SOBKZ
WHERE SOBKZ IN S_SOBKZ.
IF SY-SUBRC <> 0.
MESSAGE E008.
ENDIF.
ENDFORM. " SUB_VALID_SOBKZ
*& Form SUB_VALID_BUDAT
text
FORM SUB_VALID_BUDAT .
DATA L_BUDAT TYPE BUDAT.
SELECT SINGLE BUDAT
FROM MKPF
INTO L_BUDAT
WHERE BUDAT IN S_BUDAT.
IF SY-SUBRC <> 0.
MESSAGE E009.
ENDIF.
ENDFORM. " SUB_VALID_BUDAT
*& Form SUB_VALID_USNAM
text
FORM SUB_VALID_USNAM .
DATA L_USNAM TYPE USNAM.
SELECT SINGLE USNAM
FROM MKPF
INTO L_USNAM
WHERE USNAM IN S_USNAM.
IF SY-SUBRC <> 0.
MESSAGE E010.
ENDIF.
ENDFORM. " SUB_VALID_USNAM
*& Form SUB_VALID_VGART
text
FORM SUB_VALID_VGART .
DATA L_VGART TYPE VGART.
SELECT SINGLE VGART
FROM MKPF
INTO L_VGART
WHERE VGART IN S_VGART.
IF SY-SUBRC <> 0.
MESSAGE E011.
ENDIF.
ENDFORM. " SUB_VALID_VGART
*& Form SUB_VALID_XBLNR
text
FORM SUB_VALID_XBLNR .
DATA L_XBLNR TYPE XBLNR.
SELECT SINGLE XBLNR
FROM MKPF
INTO L_XBLNR
WHERE XBLNR IN S_XBLNR.
IF SY-SUBRC <> 0.
MESSAGE E012.
ENDIF.
ENDFORM. " SUB_VALID_XBLNR
*& Form SUB_GET_MKPF_MSEG
text
FORM SUB_GET_MKPF_MSEG .
REFRESH T_MKPF_MSEG.
SELECT KMBLNR KMJAHR K~VGART
KBLART KBUDAT K~USNAM
K~XBLNR
SMATNR SWERKS S~LGORT
SCHARG SLIFNR S~KUNNR
SSOBKZ SBWART S~ZEILE
SERFMG SERFME
INTO TABLE T_MKPF_MSEG
FROM MKPF AS K INNER JOIN MSEG AS S
ON KMBLNR = SMBLNR AND KMJAHR = SMJAHR
WHERE K~VGART IN S_VGART
AND K~BUDAT IN S_BUDAT
AND K~USNAM IN S_USNAM
AND K~XBLNR IN S_XBLNR
AND S~MATNR IN S_MATNR
AND S~WERKS IN S_WERKS
AND S~LGORT IN S_LGORT
AND S~CHARG IN S_CHARG
AND S~SOBKZ IN S_SOBKZ
AND S~LIFNR IN S_LIFNR
AND S~KUNNR IN S_KUNNR.
ENDFORM. " SUB_GET_MKPF_MSEG
*& Form SUB_GET_MARA
text
FORM SUB_GET_MARA .
IF T_MKPF_MSEG IS NOT INITIAL.
SORT T_MKPF_MSEG BY MATNR.
REFRESH T_MARA.
SELECT MATNR
BISMT
FROM MARA
INTO TABLE T_MARA
FOR ALL ENTRIES IN T_MKPF_MSEG
WHERE MATNR = T_MKPF_MSEG-MATNR.
ENDIF.
ENDFORM. " SUB_GET_MARA
*& Form SUB_GET_MAKT
text
FORM SUB_GET_MAKT .
REFRESH T_MAKT.
SELECT MATNR
SPRAS
MAKTX
FROM MAKT
INTO TABLE T_MAKT
FOR ALL ENTRIES IN T_MKPF_MSEG
WHERE SPRAS = SY-LANGU AND MATNR = T_MKPF_MSEG-MATNR.
ENDFORM. " SUB_GET_MAKT
*& Form SUB_GET_T156T
text
FORM SUB_GET_T156T .
SELECT BWART
BTEXT
SPRAS
FROM T156T
INTO TABLE T_T156T
FOR ALL ENTRIES IN T_MKPF_MSEG
WHERE SPRAS = SY-LANGU AND BWART = T_MKPF_MSEG-BWART.
ENDFORM. " SUB_GET_T156T
*& Form SUB_GET_SER03
text
FORM SUB_GET_SER03 .
SELECT MBLNR
MJAHR
ZEILE
OBKNR
FROM SER03
INTO TABLE T_SER03
FOR ALL ENTRIES IN T_MKPF_MSEG
WHERE MBLNR = T_MKPF_MSEG-MBLNR
AND MJAHR = T_MKPF_MSEG-MJAHR
AND ZEILE = T_MKPF_MSEG-ZEILE.
IF T_SER03 IS NOT INITIAL.
SELECT OBKNR
OBZAE
SERNR
FROM OBJK
INTO CORRESPONDING FIELDS OF TABLE T_OBJK
FOR ALL ENTRIES IN T_SER03
WHERE OBKNR = T_SER03-OBKNR.
ENDIF.
ENDFORM. " SUB_GET_SER03
*& Form SUB_GET_T001W
text
FORM SUB_GET_T001W .
SELECT WERKS
NAME1
FROM T001W
INTO TABLE T_T001W
FOR ALL ENTRIES IN T_MKPF_MSEG
WHERE WERKS = T_MKPF_MSEG-WERKS.
ENDFORM. " SUB_GET_T001W
*& Form SUB_BSLIST_DISP
FOR DISPLAY OUT
FORM SUB_BSLIST_DISP .
REFRESH T_OUTPUT.
CLEAR W_MKPF_MSEG.
SORT T_MKPF_MSEG BY MBLNR MJAHR ZEILE MATNR.
LOOP AT T_MKPF_MSEG INTO W_MKPF_MSEG.
W_OUTPUT-MBLNR = W_MKPF_MSEG-MBLNR .
W_OUTPUT-MJAHR = W_MKPF_MSEG-MJAHR.
W_OUTPUT-VGART = W_MKPF_MSEG-VGART.
W_OUTPUT-BLART = W_MKPF_MSEG-BLART.
W_OUTPUT-BUDAT = W_MKPF_MSEG-BUDAT.
W_OUTPUT-USNAM = W_MKPF_MSEG-USNAM.
W_OUTPUT-XBLNR = W_MKPF_MSEG-XBLNR.
W_OUTPUT-ZEILE = W_MKPF_MSEG-ZEILE.
W_OUTPUT-BWART = W_MKPF_MSEG-BWART.
W_OUTPUT-MATNR = W_MKPF_MSEG-MATNR.
W_OUTPUT-WERKS = W_MKPF_MSEG-WERKS.
W_OUTPUT-LGORT = W_MKPF_MSEG-LGORT.
W_OUTPUT-CHARG = W_MKPF_MSEG-CHARG.
W_OUTPUT-SOBKZ = W_MKPF_MSEG-SOBKZ.
W_OUTPUT-LIFNR = W_MKPF_MSEG-LIFNR.
W_OUTPUT-KUNNR = W_MKPF_MSEG-KUNNR.
W_OUTPUT-ERFMG = W_MKPF_MSEG-ERFMG.
W_OUTPUT-ERFME = W_MKPF_MSEG-ERFME.
CLEAR W_MARA.
READ TABLE T_MARA INTO W_MARA WITH KEY MATNR = W_OUTPUT-MATNR.
IF SY-SUBRC = 0.
W_OUTPUT-BISMT = W_MARA-BISMT.
ENDIF.
CLEAR W_MAKT.
READ TABLE T_MAKT INTO W_MAKT WITH KEY MATNR = W_OUTPUT-MATNR .
IF SY-SUBRC = 0.
W_OUTPUT-MAKTX = W_MAKT-MAKTX.
ENDIF.
CLEAR W_T156T.
READ TABLE T_T156T INTO W_T156T WITH KEY BWART = W_OUTPUT-BWART .
IF SY-SUBRC = 0.
W_OUTPUT-BTEXT = W_T156T-BTEXT.
ENDIF.
CLEAR W_T001W.
READ TABLE T_T001W INTO W_T001W WITH KEY WERKS = W_MKPF_MSEG-WERKS.
IF SY-SUBRC = 0.
W_OUTPUT-NAME1 = W_T001W-NAME1.
ENDIF.
CLEAR W_SER03.
READ TABLE T_SER03 INTO W_SER03 WITH KEY MBLNR = W_OUTPUT-MBLNR
MJAHR = W_OUTPUT-MJAHR
ZEILE = W_OUTPUT-ZEILE.
IF SY-SUBRC = 0.
W_OUTPUT-OBKNR = W_SER03-OBKNR.
ENDIF.
CLEAR W_OBJK.
READ TABLE T_OBJK INTO W_OBJK WITH KEY OBKNR = W_OUTPUT-OBKNR.
IF SY-SUBRC = 0.
W_OUTPUT-SERNR = W_OBJK-SERNR .
ENDIF.
APPEND W_OUTPUT TO T_OUTPUT.
CLEAR W_OUTPUT.
ENDLOOP.
PERFORM SUB_DISPLAY.
ENDFORM.
*& Form SUB_DISPLAY
HIERARICAL DISPLAY
FORM SUB_DISPLAY .
SORT T_OUTPUT BY MATNR BISMT MAKTX WERKS NAME1 LGORT BWART MBLNR CHARG SERNR ZEILE BUDAT ERFMG ERFME BTEXT.
CLEAR W_OUTPUT.
LOOP AT T_OUTPUT INTO W_OUTPUT.
AT NEW NAME1.
WRITE:/ W_OUTPUT-MATNR,
W_OUTPUT-BISMT,
W_OUTPUT-MAKTX,
W_OUTPUT-WERKS,
W_OUTPUT-NAME1.
ENDAT.
AT NEW BTEXT.
WRITE:/ W_OUTPUT-LGORT,
W_OUTPUT-BWART,
W_OUTPUT-MBLNR,
W_OUTPUT-CHARG,
W_OUTPUT-SERNR,
W_OUTPUT-ZEILE,
W_OUTPUT-BUDAT,
W_OUTPUT-ERFMG,
W_OUTPUT-ERFME,
W_OUTPUT-BTEXT.
ENDAT.
CLEAR W_OUTPUT.
ENDLOOP.
REFRESH T_OUTPUT.
ENDFORM. " SUB_DISPLAY -
Urgent... need help in alv.
hai all,
in an alv report i want a pushbutton in the application tool bar .
how can i get it.
and also i want to select multiple rows from the list and the first column as a button to select the rows.
please.. help me. its very urgent.
thanks in advance.
regards, selvi.Hi,
Following steps to copy standard status to zstatus
Goto T.Code SE41 & give program name SAPLSLVC then select
status as STANDARD then copy this status to zstatus in your program
open zstatus in T.Code SE41 and add push button and save & activate it.
then Call FM PF_STATUS.
see below,
I_CALLBACK_PF_STATUS_SET- 'PF_STATUS'
In module PF_STATUS
set pf-status 'ZSTATUS'
reward if useful. -
Need to use ALV instead of write:/ statement in this perform
How can I use ALV within this perform instead of using Write:/ in it.
Scroll the program. At the bottom there is use of write:/ statement.
How to use ALV in this perform?
FORM display_logfile .
TYPES: BEGIN OF lt_openbal,
bukrs TYPE bukrs,
hkont TYPE hkont,
augdt TYPE augdt,
augbl TYPE augbl,
zuonr TYPE dzuonr,
gjahr TYPE gjahr,
belnr TYPE belnr_d,
buzei TYPE buzei,
shkzg TYPE shkzg,
dmbtr TYPE dmbtr,
END OF lt_openbal,
BEGIN OF lt_log2,
hkont TYPE hkont,
opbal TYPE dmbtr,
exp TYPE dmbtr,
cap TYPE dmbtr,
err TYPE dmbtr,
END OF lt_log2,
BEGIN OF lt_zsct_record,
kongr TYPE ckml_kongr,
hkont TYPE hkont,
zcptp TYPE zdecptp,
zerrc TYPE zdeerrc,
END OF lt_zsct_record.
DATA: lw_zscs_record TYPE t_zscs_record,
lw_zsct_record TYPE lt_zsct_record,
li_zsct_record TYPE STANDARD TABLE OF lt_zsct_record,
li_zsct_record1 TYPE STANDARD TABLE OF lt_zsct_record,
lw_log1 TYPE t_zscs_record,
li_log1 TYPE STANDARD TABLE OF t_zscs_record,
li_temp TYPE STANDARD TABLE OF t_zsct_autoinv,
li_openbal TYPE STANDARD TABLE OF lt_openbal,
li_openbal_mod TYPE STANDARD TABLE OF lt_openbal,
li_log2 TYPE STANDARD TABLE OF lt_log2,
li_log2_t TYPE STANDARD TABLE OF lt_log2,
lw_log2 TYPE lt_log2,
lw_log2_t TYPE lt_log2,
lw_openbal_mod TYPE lt_openbal,
lw_openbal TYPE lt_openbal.
i_zscs_record1 = i_zscs_record.
DELETE i_zscs_record1 WHERE zerrf NE space.
SORT i_error_bapi BY recid.
SORT i_error_bdc BY recid.
SORT i_suc_bdc BY recid.
SORT i_suc_bapi BY recid.
SORT i_zscs_record1 BY recid.
LOOP AT i_zscs_record1 INTO lw_zscs_record.
lw_log1-recid = lw_zscs_record-recid.
lw_log1-kongr = lw_zscs_record-kongr.
lw_log1-hkont = lw_zscs_record-hkont.
CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT'
EXPORTING
input = lw_zscs_record-projk
IMPORTING
output = lw_log1-projk.
lw_log1-werks = lw_zscs_record-werks.
lw_log1-matnr = lw_zscs_record-matnr.
lw_log1-zcptp = lw_zscs_record-zcptp.
lw_log1-zerrf = lw_zscs_record-zerrf.
To Check if the KONGR value is is equal to 'E'
IF lw_zscs_record-kongr = c_e.
READ TABLE i_error_bapi INTO w_error_bapi WITH KEY recid = lw_zscs_record-recid BINARY SEARCH.
IF sy-subrc = 0.
lw_log1-zerrc = w_error_bapi-number.
lw_log1-zertx = w_error_bapi-message.
ENDIF.
ELSE.
READ TABLE i_error_bdc INTO w_error_bdc WITH KEY recid = lw_zscs_record-recid BINARY SEARCH.
IF sy-subrc = 0.
lw_log1-zerrc = w_error_bdc-number.
lw_log1-zertx = w_error_bdc-message.
ENDIF.
ENDIF.
*****To Check if the KONGR value is is equal to 'E'
IF lw_zscs_record-kongr = c_e.
READ TABLE i_suc_bapi INTO w_suc_bapi WITH KEY recid = lw_zscs_record-recid BINARY SEARCH.
IF sy-subrc = 0.
lw_log1-zerrf = c_x.
*******To check if lw_log1-zertx = w_error_bapi-message.
ENDIF.
ELSE.
READ TABLE i_suc_bdc INTO w_suc_bdc WITH KEY recid = lw_zscs_record-recid BINARY SEARCH.
IF sy-subrc = 0.
lw_log1-zerrf = c_x.
********To check if lw_log1-zertx = w_error_bdc-message.
ENDIF.
ENDIF.
APPEND lw_log1 TO li_log1.
*To clear work areas
CLEAR: lw_log1,
w_error_bapi,
w_suc_bdc,
w_suc_bapi,
w_error_bdc,
lw_zscs_record.
ENDLOOP.
IF NOT i_zscs_record1 IS INITIAL.
*To retrieve required data from the custom table ZSCT_AUTOINV
SELECT saknr
fipos
geber
saknr_off
fipos_off
FROM zsct_autoinv
INTO TABLE i_autoinv
FOR ALL ENTRIES IN i_zscs_record1
WHERE saknr = i_zscs_record1-hkont.
IF sy-subrc = 0.
SORT i_autoinv.
ENDIF.
ENDIF.
Assigning I_AUTOINV data into a local internal table for further processing
li_temp[] = i_autoinv[ ].
Sort LI_TEMP by SAKNR
SORT li_temp BY saknr.
Delete adjacent duplicates from LI_TEMP comparing SAKNR
DELETE ADJACENT DUPLICATES FROM li_temp COMPARING saknr.
Check if LI_TEMP is initial
IF NOT li_temp[] IS INITIAL.
Retrieve required data from table BSIS for all the G/L accounts
SELECT bukrs
hkont
augdt
augbl
zuonr
gjahr
belnr
buzei
shkzg
dmbtr
FROM bsis
INTO TABLE li_openbal_mod
FOR ALL ENTRIES IN li_temp
WHERE bukrs = c_wfp
AND hkont = li_temp-saknr.
IF sy-subrc = 0.
ENDIF.
ENDIF.
SORT li_openbal_mod BY hkont.
****Retrieve data from table ZSCT_RECORD for further processing for
****all entries where ZERRF is equal to space
IF p_prsall = c_x.
SELECT kongr
hkont
zcptp
zerrc
FROM zsct_record "#EC CI_NOFIRST
INTO TABLE li_zsct_record
WHERE zerrf = space.
IF sy-subrc = 0.
*****Delete records from LI_ZSCT_RECORD where HKONT value is equal to space
DELETE li_zsct_record WHERE hkont EQ space.
ENDIF.
ELSEIF p_cstcpt = c_x.
SELECT kongr
hkont
zcptp
zerrc
FROM zsct_record "#EC CI_NOFIRST
INTO TABLE li_zsct_record
WHERE zerrf = space
AND kongr NE c_e.
IF sy-subrc = 0.
******Delete records from LI_ZSCT_RECORD where HKONT value is equal to space
DELETE li_zsct_record WHERE hkont EQ space.
ENDIF.
ELSEIF p_cstexp = c_x.
SELECT kongr
hkont
zcptp
zerrc
FROM zsct_record "#EC CI_NOFIRST
INTO TABLE li_zsct_record
WHERE zerrf = space
AND kongr EQ c_e.
IF sy-subrc = 0.
******Delete records from LI_ZSCT_RECORD where HKONT value is equal to space
DELETE li_zsct_record WHERE hkont EQ space.
ENDIF.
ENDIF.
LOOP AT li_openbal_mod INTO lw_openbal.
IF lw_openbal-shkzg = c_shkzg1.
v_todmbtr = v_todmbtr + lw_openbal-dmbtr.
ELSEIF lw_openbal-shkzg = c_shkzg2.
v_todmbtr = v_todmbtr - lw_openbal-dmbtr.
ENDIF.
AT END OF hkont.
lw_log2-hkont = lw_openbal-hkont. "GL account
lw_log2-opbal = ABS( v_todmbtr ). "Open item balance
APPEND lw_log2 TO li_log2.
*log record appended with GL Account and account open item balance
CLEAR: v_todmbtr,
lw_openbal.
ENDAT .
ENDLOOP.
SORT li_log2 BY hkont.
LOOP AT li_log2 INTO lw_log2.
CLEAR v_totexppe.
CLEAR v_totcapit.
CLEAR v_toterror.
*Cost portion to be capitalised calculated
LOOP AT li_zsct_record INTO lw_zsct_record
WHERE hkont = lw_log2-hkont AND
kongr NE c_e AND zerrc IS INITIAL.
v_totcapit = v_totcapit + lw_zsct_record-zcptp. "CC calculated
ENDLOOP.
*Expensed cost portion calculated
LOOP AT li_zsct_record INTO lw_zsct_record WHERE
hkont = lw_log2-hkont AND
kongr = c_e AND zerrc IS INITIAL .
v_totexppe = v_totexppe + lw_zsct_record-zcptp. "ECP calculated
ENDLOOP.
*Errors calculated
LOOP AT li_zsct_record INTO lw_zsct_record WHERE
hkont = lw_log2-hkont AND
zerrc IS NOT INITIAL .
v_toterror = v_toterror + lw_zsct_record-zcptp. "Errors calculated
ENDLOOP.
lw_log2-exp = v_totexppe. "Expensed cost portion
lw_log2-cap = v_totcapit. "Cost capitalised
lw_log2-err = v_toterror. "Errors
*Cost portion capitalised expensed and errors in calculation are
*trans ported for related GL accont
MODIFY li_log2 FROM lw_log2
TRANSPORTING exp cap err.
ENDLOOP.
LOOP AT li_log2_t INTO lw_log2_t.
MODIFY li_log2 FROM lw_log2_t TRANSPORTING opbal WHERE hkont = lw_log2_t-hkont.
CLEAR : lw_log2_t.
ENDLOOP.
WRITE:/1(15) text-018,sy-datum. "SESSION DATE:
SKIP 2.
For printing the hear level of the output log
WRITE:/1(16) text-003, "Record ID number
20(11) text-004, "Reason Code
34(10) text-005, "GL Account
47(12) text-006, "Project Code
62(5) text-007, "Plant
70(9) text-008, "Commodity
82(25) text-009, "Cost portion To be posted
110(12) text-010, "Success Flag
125(10) text-011, "Error Code
138(50) text-012. "Error TXT
SKIP.
LOOP AT li_log1 INTO lw_log1.
WRITE:/1(16) lw_log1-recid,
20(11) lw_log1-kongr,
34(10) lw_log1-hkont,
47(12) lw_log1-projk,
62(5) lw_log1-werks,
70(9) lw_log1-matnr,
82(25) lw_log1-zcptp, "#EC UOM_IN_MES
110(12) lw_log1-zerrf,
125(10) lw_log1-zerrc,
138(80) lw_log1-zertx.
CLEAR:lw_log1.
ENDLOOP.
SKIP 2.
IF NOT li_log2 IS INITIAL.
ULINE.
WRITE:/1(16) text-013, "GL ACCOUNT CODE
20(17) text-014, "OPEN ITEM BALANCE
40(21) text-015, "EXPENSED COST PORTION
64(24) text-016, "CAPITALIZED COST PORTION
92(20) text-017. "ERRORS.
LOOP AT li_log2 INTO lw_log2.
WRITE:/1(16) lw_log2-hkont,
20(17) lw_log2-opbal,
40(21) lw_log2-exp,
64(24) lw_log2-cap,
92(20) lw_log2-err.
CLEAR:lw_log2.
ENDLOOP.
ENDIF.
ENDFORM. " DISPLAY_LOGFILEhi,
You need to use FM 'REUSE_ALV_LIST_DISPLAY' for this purpose. For using this FM, you need to create a field catlog which will contain all information about the coloumns you want to display for example their position, their text etc.
Below there is a small demo for achiving this.
TYPE-POOLS:slis.
DATA : i_fieldcat TYPE slis_t_fieldcat_alv.
TYPES: BEGIN OF ty_itab1,
vbeln LIKE vbap-vbeln,
posnr LIKE vbap-posnr,
werks LIKE vbap-werks,
lgort LIKE vbap-lgort,
END OF ty_itab1.
DATA: itab1 TYPE TABLE OF ty_itab1.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
PERFORM select_data.
END-OF-SELECTION.
PERFORM display.
FORM select_data .
SELECT vbeln
posnr
werks
lgort
INTO CORRESPONDING FIELDS OF TABLE itab1
FROM vbap
WHERE vbeln IN s_vbeln.
IF sy-subrc <> 0.
MESSAGE 'Enter The Valid Sales Document Number'(t04) TYPE 'I'.
EXIT.
ENDIF.
ENDFORM.
IF alv_list = 'X'.
PERFORM build_fieldcat TABLES i_fieldcat[]
USING :
*-Output-field Table Len Ref fld Ref tab Heading Col_pos
'VBELN' 'ITAB1' 10 'VBAP' 'VBELN' '' 1,
'POSNR' 'ITAB1' 6 'VBAP' 'POSNR' '' 2,
'WERKS' 'ITAB1' 4 'VBAP' 'WERKS' '' 3,
'LGORT' 'ITAB1' 4 'VBAP' 'LGORT' '' 4.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = c_pf_status
i_callback_user_command = 'USER_COMMAND '
it_events = t_alv_events[]
it_fieldcat = i_fieldcat[]
TABLES
t_outtab = itab1[]
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.
ENDIF.
FORM build_fieldcat TABLES fpt_fieldcat TYPE slis_t_fieldcat_alv
USING fp_field TYPE slis_fieldname
fp_table TYPE slis_tabname
fp_length TYPE dd03p-outputlen
fp_ref_tab TYPE dd03p-tabname
fp_ref_fld TYPE dd03p-fieldname
fp_seltext TYPE dd03p-scrtext_l
fp_col_pos TYPE sy-cucol.
*-- Local data declaration
DATA: wl_fieldcat TYPE slis_fieldcat_alv.
*-- Clear WorkArea
wl_fieldcat-fieldname = fp_field.
wl_fieldcat-tabname = fp_table.
wl_fieldcat-outputlen = fp_length.
wl_fieldcat-ref_tabname = fp_ref_tab.
wl_fieldcat-ref_fieldname = fp_ref_fld.
wl_fieldcat-seltext_l = fp_seltext.
wl_fieldcat-col_pos = fp_col_pos.
*-- Update Field Catalog Table
APPEND wl_fieldcat TO fpt_fieldcat.
ENDFORM. -
Hi All,
I am working on ALV report.I need one logic.
When Ever I executed report, The output should looks 'Selected Total data' like Yellow color. How can i do that.
The report out should show sthe ' All the data is selected'. Just like Ctrl+A.
regards,
AjayHi
if you wants to see the totals in separate color , you develop the I_SORT table with the respective fields and pass to the fun module
then that total field will be always displayed with yelloe color
or
See this sample code to color the ALV fields
and accordingly assign the color for your field
REPORT zsharad_test1.
TABLES: ekko.
TYPE-POOLS: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
line_color(4) TYPE c, "Used to store row color attributes
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
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,
gd_repid LIKE sy-repid.
*Start-of-selection.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM display_alv_report.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
FORM build_fieldcatalog.
There are a number of ways to create a fieldcat.
For the purpose of this example i will build the fieldcatalog manualy
by populating the internal table fields individually and then
appending the rows. This method can be the most time consuming but can
also allow you more control of the final product.
Beware though, you need to ensure that all fields required are
populated. When using some of functionality available via ALV, such as
total. You may need to provide more information than if you were
simply displaying the result
I.e. Field type may be required in-order for
the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-datatype = 'CURR'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
FORM build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
Set layout field for row attributes(i.e. color)
gd_layout-info_fieldname = 'LINE_COLOR'.
gd_layout-totals_only = 'X'.
gd_layout-f2code = 'DISP'. "Sets fcode for when double
"click(press f2)
gd_layout-zebra = 'X'.
gd_layout-group_change_edit = 'X'.
gd_layout-header_text = 'helllllo'.
ENDFORM. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
FORM display_alv_report.
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
IT_EVENTS = GT_XEVENTS
i_save = 'X'
is_variant = z_template
TABLES
t_outtab = it_ekko
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_REPORT
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
DATA: ld_color(1) TYPE c.
SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
UP TO 10 ROWS
FROM ekpo
INTO TABLE it_ekko.
*Populate field with color attributes
LOOP AT it_ekko INTO wa_ekko.
Populate color variable with colour properties
Char 1 = C (This is a color property)
Char 2 = 3 (Color codes: 1 - 7)
Char 3 = Intensified on/off ( 1 or 0 )
Char 4 = Inverse display on/off ( 1 or 0 )
i.e. wa_ekko-line_color = 'C410'
ld_color = ld_color + 1.
Only 7 colours so need to reset color value
IF ld_color = 8.
ld_color = 1.
ENDIF.
CONCATENATE 'C' ld_color '10' INTO wa_ekko-line_color.
wa_ekko-line_color = 'C410'.
MODIFY it_ekko FROM wa_ekko.
ENDLOOP.
ENDFORM. " DATA_RETRIEVAL
Regards
Anji
Maybe you are looking for
-
Can I share my iCloud storage with my wife? I'm interested in using the storage for both phones, hers and mine.
-
ERROR: -Type conflict when calling a function module
hi to all, when iam executing the program in browser Type conflict when calling a function module error is showing, i have bind all the attribute correctly still iam getting error, WHEN I CLICK ON THE SEARCH BUTTON DATA IS NOT COMING TO MY TABLE
-
Why can I not open a simple pdf file? It used to open with no problem. Not it is "garble".
-
Everything about Firefox is now going downhill. This forum has taken me an hour to logon to because its not been up and running or just slow. Firefox 8.01 has severe memory problems (which I have commented on another thread). The addons are not downl
-
Issue printing with Adobe CC after upgrading to Mavericks
After installing OS X Mavericks, when I try printing via Adobe Indesign CC or Adobe Acrobat Pro it seems to shrink the page I am printing. When I print via Preview if I export as a PDF it prints just fine. I've checked for Adobe updates, driver upd