Set pf_status in REUSE_ALV_GRID_DISPLAY
Hi All,
I am using the 'i_callback_pf_status_set' from the FUNCTION 'REUSE_ALV_GRID_DISPLAY' and I see the output but the pf_status is not working. I donot see the buttin I created not even basic BACK and SAvE are working. When I activate the program I am getting the warning like '
when you pass SY-REPID DIRECTLY, "I_CALLBACK_PROGRAM" is set to the name ot the function group "REUSE_ALV_GRID_DISPLAY"'.
Please help me how to set the pf_status in the ALV.
Thanks,
Neelu.
REPORT zppprice1 .
TABLES: zppprice, kna1.
* ALV Type-Pools *
TYPE-POOLS: slis. "Global types
* ALV Structures *
* ALV layout catalog
DATA: s_alv_layout_cat TYPE slis_layout_alv.
* ALV Tables *
* ALV field catalog
DATA: it_alv_field_cat TYPE slis_t_fieldcat_alv,
*occurs 0 with header line,
i_fieldcat TYPE slis_fieldcat_alv OCCURS 0 WITH HEADER LINE,
w_fieldcat LIKE LINE OF i_fieldcat. "ALV FieldCat WorkArea
* ALV sort catalog
DATA: it_alv_sort_cat TYPE slis_sortinfo_alv OCCURS 0 WITH HEADER LINE.
* ALV event catalog
*data: it_alv_event_cat type slis_alv_event occurs 0 with header line.
DATA: it_alv_event_cat TYPE slis_t_event,
ls_alv_event TYPE slis_alv_event.
DATA: t_list_top_of_page TYPE slis_t_listheader.
TYPES: BEGIN OF slis_layout_alv.
INCLUDE TYPE slis_layout_main.
INCLUDE TYPE slis_layout_alv_spec.
TYPES: END OF slis_layout_alv.
DATA: gt_zprice TYPE TABLE OF zprice_struct,
gs_zprice TYPE zprice_struct.
DATA: chbox(1) TYPE c VALUE ' '.
*SET PF-STATUS 'LIST'.
*NEW-PAGE LINE-SIZE 158.
SELECT kunnr matnr crdate efdate sprice
eprice eohqty aohqty crmemo
FROM zppprice
INTO TABLE gt_zprice.
PERFORM field_catalog.
* Populate the layout catalog for alv
PERFORM alv_layout.
* Populate the event catalog for alv
PERFORM alv_events.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'PF_STATUS'
i_callback_user_command = 'HANDLE_USER_COMMAND'
is_layout = s_alv_layout_cat
it_fieldcat = it_alv_field_cat
i_default = 'X'
i_save = 'A'
it_events = it_alv_event_cat
TABLES
t_outtab = gt_zprice
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
FORM field_catalog.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
ls_fieldcat-fieldname = 'CHBOX'.
ls_fieldcat-checkbox = 'X'.
ls_fieldcat-input = 'X'.
ls_fieldcat-edit = 'X'.
ls_fieldcat-seltext_s = 'BOX'.
ls_fieldcat-seltext_l = 'BOX'.
APPEND ls_fieldcat TO it_alv_field_cat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'KUNNR'.
ls_fieldcat-seltext_s = 'Customer'.
ls_fieldcat-seltext_l = 'Customer'.
APPEND ls_fieldcat TO it_alv_field_cat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'MATNR'.
ls_fieldcat-seltext_s = 'Material'.
ls_fieldcat-seltext_l = 'Material'.
APPEND ls_fieldcat TO it_alv_field_cat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'CRDATE'.
ls_fieldcat-seltext_s = 'Creation date'.
ls_fieldcat-seltext_l = 'Creation date'.
APPEND ls_fieldcat TO it_alv_field_cat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'EFDATE'.
ls_fieldcat-seltext_s = 'Effective date'.
ls_fieldcat-seltext_l = 'Effective date'.
APPEND ls_fieldcat TO it_alv_field_cat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'SPRICE'.
ls_fieldcat-seltext_s = 'Old Price'.
ls_fieldcat-seltext_l = 'Old Price'.
APPEND ls_fieldcat TO it_alv_field_cat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'EPRICE'.
ls_fieldcat-seltext_s = 'New Price'.
ls_fieldcat-seltext_l = 'New Price'.
APPEND ls_fieldcat TO it_alv_field_cat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'EOHQTY'.
ls_fieldcat-seltext_s = 'Est. Qty'.
ls_fieldcat-seltext_l = 'Est. Qty'.
APPEND ls_fieldcat TO it_alv_field_cat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'AOHQTY'.
ls_fieldcat-seltext_s = 'Act. Qty'.
ls_fieldcat-seltext_l = 'Act. Qty'.
APPEND ls_fieldcat TO it_alv_field_cat.
CLEAR ls_fieldcat.
ENDFORM. " field_catalog
*& Form alv_layout
* text
* --> p1 text
* <-- p2 text
FORM alv_layout.
* Enable striped output display if user wants
s_alv_layout_cat-zebra = 'X'.
* Optimize column width if user wants
s_alv_layout_cat-colwidth_optimize = 'X'.
s_alv_layout_cat-box_fieldname = space.
s_alv_layout_cat-no_input = 'X'.
ENDFORM. " alv_layout
* FORM SET_PFSTATUS *
* --> EXTAB *
FORM pf_status USING extab TYPE slis_t_extab.
SET PF-STATUS 'LIST'.
ENDFORM.
* FORM HANDLE_USER_COMMAND *
* --> I_UCOM *
* --> IS_SELFIELD *
FORM handle_user_command USING i_ucom TYPE sy-ucomm
is_selfield TYPE slis_selfield.
CASE i_ucom.
WHEN 'CMEMO'.
LOOP AT gt_zprice INTO gs_zprice WHERE chbox = 'X'.
ENDLOOP.
ENDCASE.
ENDFORM.
*& Form alv_events
* text
* --> p1 text
* <-- p2 text
FORM alv_events.
* Declare event catalog for page headers
REFRESH: it_alv_event_cat.
CLEAR ls_alv_event.
ls_alv_event-name = 'PF_STATUS_SET'.
ls_alv_event-form = 'PF_STATUS'.
APPEND ls_alv_event TO it_alv_event_cat.
* Declare event catalog for report footers
CLEAR ls_alv_event.
ls_alv_event-name = 'USER_COMMAND'.
ls_alv_event-form = 'HANDLE_USER_COMMAND'.
APPEND ls_alv_event TO it_alv_event_cat.
ENDFORM. " alv_events
Yes, do not pass SY-REPID directly, first move to a variable.
data: repid type sy-repid.
repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = repid
i_callback_pf_status_set = 'PF_STATUS'
i_callback_user_command = 'HANDLE_USER_COMMAND'
is_layout = s_alv_layout_cat
it_fieldcat = it_alv_field_cat
i_default = 'X'
i_save = 'A'
it_events = it_alv_event_cat
TABLES
t_outtab = gt_zprice
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
Regards,
Rich Heilman
Similar Messages
-
Problem while setting PF_status in ALV Grid Display
Hi,
i have a final internal table with first field as a check box. I have delete button on application tool-bar, with usercommand and pf status defined for it.
Once the output is displayed i should have the option of checking the line (check box) and delete then records from the list.
problem here is once i check the box and click on delete button is not getting deleted. but instead if i check the box and double click on the line(ie f2 fuctionality) and then click on refresh, then the records are getting deleted.
i have not provided and pf status for f2 functionality, by default its getting activated before the delete fuctionality is called.
i have attached my code below.
DATA : fk_events TYPE slis_t_event,
f_user_command TYPE slis_formname VALUE 'USER_COMMAND',
f_status TYPE slis_formname VALUE 'STANDARD_SP01',
fieldnam(10) TYPE c.
DATA: gs_layout TYPE slis_layout_alv.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = fk_events.
READ TABLE fk_events INTO ls_event WITH KEY name = slis_ev_user_command
IF sy-subrc = 0.
MOVE f_user_command TO ls_event-form.
MODIFY fk_events FROM ls_event TRANSPORTING form WHERE name =
ls_event-name.
ENDIF.
READ TABLE fk_events INTO ls_event WITH KEY name =
slis_ev_pf_status_set
IF sy-subrc = 0.
MOVE f_status TO ls_event-form.
MODIFY fk_events FROM ls_event TRANSPORTING form WHERE name =
ls_event-name.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZWR_SECOND_TO_CREATION1'
i_callback_pf_status_set = f_status
i_callback_user_command = f_user_command
it_fieldcat = gt_fieldcat[]
it_events = fk_events[]
TABLES
t_outtab = gt_final[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
FORM user_command USING r_comm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
fieldnam = rs_selfield-fieldname.
CASE r_comm.
WHEN 'DELETE''.
LOOP AT gt_final INTO gk_final.
IF gk_final-del_sat = 'X'.
DELETE gt_final WHERE vbeln = gk_final-vbeln.
ENDIF.
rs_selfield-refresh = 'X'.
ENDLOOP.
WHEN OTHERS.
EXIT.
ENDCASE.
FORM standard_sp01 USING extab TYPE slis_t_extab.
SET PF-STATUS 'RAM' EXCLUDING extab. " For PF-Status
ENDFORM. "STANDARD_SP01
i wud be very thankful if someone cud help me
thanx
ramHi,
i have a final internal table with first field as a check box. I have delete button on application tool-bar, with usercommand and pf status defined for it.
Once the output is displayed i should have the option of checking the line (check box) and delete then records from the list.
problem here is once i check the box and click on delete button is not getting deleted. but instead if i check the box and double click on the line(ie f2 fuctionality) and then click on refresh, then the records are getting deleted.
i have not provided and pf status for f2 functionality, by default its getting activated before the delete fuctionality is called.
i have attached my code below.
DATA : fk_events TYPE slis_t_event,
f_user_command TYPE slis_formname VALUE 'USER_COMMAND',
f_status TYPE slis_formname VALUE 'STANDARD_SP01',
fieldnam(10) TYPE c.
DATA: gs_layout TYPE slis_layout_alv.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = fk_events.
READ TABLE fk_events INTO ls_event WITH KEY name = slis_ev_user_command
IF sy-subrc = 0.
MOVE f_user_command TO ls_event-form.
MODIFY fk_events FROM ls_event TRANSPORTING form WHERE name =
ls_event-name.
ENDIF.
READ TABLE fk_events INTO ls_event WITH KEY name =
slis_ev_pf_status_set
IF sy-subrc = 0.
MOVE f_status TO ls_event-form.
MODIFY fk_events FROM ls_event TRANSPORTING form WHERE name =
ls_event-name.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZWR_SECOND_TO_CREATION1'
i_callback_pf_status_set = f_status
i_callback_user_command = f_user_command
it_fieldcat = gt_fieldcat[]
it_events = fk_events[]
TABLES
t_outtab = gt_final[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
FORM user_command USING r_comm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
fieldnam = rs_selfield-fieldname.
CASE r_comm.
WHEN 'DELETE''.
LOOP AT gt_final INTO gk_final.
IF gk_final-del_sat = 'X'.
DELETE gt_final WHERE vbeln = gk_final-vbeln.
ENDIF.
rs_selfield-refresh = 'X'.
ENDLOOP.
WHEN OTHERS.
EXIT.
ENDCASE.
FORM standard_sp01 USING extab TYPE slis_t_extab.
SET PF-STATUS 'RAM' EXCLUDING extab. " For PF-Status
ENDFORM. "STANDARD_SP01
i wud be very thankful if someone cud help me
thanx
ram -
Button in ALV toolbar with REUSE_ALV_GRID_DISPLAY
Hello friends,
I am Displaying ALV using REUSE_ALV_GRID_IDSPLAY. i need to add a button in grid toolbar.
i am doing it by adding a new ZSTATUS in SET PF_STATUS. but the problem is that it is removing the standard buttons.
i want to add button without removing the standard butttons.
Please help.
thanx in advance.
Krishan Kumarhai friends.......
i had tried to add custom button to the reuse_alv_grid_display.please send the coding...
REPORT ZHAJI_SAMPLE.
tables:lfa1.
TYPE-POOLS : slis.
SELECT-OPTIONS: lifnr FOR lfa1-lifnr.
types:begin of fs,
flag type c,
lifnr type lfa1-lifnr,
land1 type lfa1-land1,
name1 type lfa1-name1,
end of fs.
data: itab type table of fs,
wa type fs.
data: fcat type slis_t_fieldcat_alv,
fcat1 type slis_fieldcat_alv.
data: rt_extab type slis_t_extab.
*CONSTANTS : c_check(1) VALUE 'X'.
select lifnr land1 name1 from lfa1 into corresponding FIELDS OF table
itab where lifnr IN
lifnr.
perform sub.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = 'sy-repid'
I_CALLBACK_PF_STATUS_SET = 'PF'
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 = 'vendor details'
I_GRID_SETTINGS =
IS_LAYOUT = LAYOUT
IT_FIELDCAT = fcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = I_EVENT
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_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
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 sub.
fcat1-fieldname = 'FLAG'.
fcat1-tabname = 'TAB'.
*fcat1-COL_POS = 1.
fcat1-checkbox = 'X'.
fcat1-edit = 'X'.
append fcat1 to fcat.
CLEAR FCAT1.
fcat1-fieldname = 'LIFNR'.
fcat1-ref_tabname = 'LFA1'.
fcat1-ref_fieldname = 'LIFNR'.
FCAT1-outputlen = 10.
append fcat1 to fcat.
CLEAR FCAT1.
fcat1-fieldname = 'NAME1'.
fcat1-ref_tabname = 'LFA1'.
fcat1-ref_fieldname = 'NAME1'.
append fcat1 to fcat.
CLEAR FCAT1.
fcat1-fieldname = 'LAND1'.
fcat1-ref_tabname = 'LFA1'.
fcat1-ref_fieldname = 'LAND1'.
append fcat1 to fcat.
CLEAR FCAT1.
endform.
form PF USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZHAJI_P1' .
ENDFORM.
just give the fine coding -
Problem with PF_STATUS in ALV
Hi
I have the following code written in my report to set PF_STATUS in ALV.But its not working
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = g_repid
i_callback_pf_status_set = 'PF_STATUS_SET'
I_CALLBACK_USER_COMMAND = ''
i_structure_name = 'I_BOLACT'
i_grid_title = 'BOL Action Report'(031)
is_layout = gs_layout
i_save = 'A'
it_fieldcat = gt_fieldcat[]
FORM PF_STATUS_SET USING rt_extab TYPE slis_t_extab.
set PF-STATUS 'ZPF_STAT'.
ENDFORM.
Please help where am I going wrong.
Regards
IshitaIf any of the above solution in not working, you can use EVENTS to handle it.
using
* TO Get all the ALV Events
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = it_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.
* FOR THE PF-STATUS EVENT
read table it_events into wa_event with key name = slis_ev_pf_status_set.
if sy-subrc eq 0.
wa_event-form = 'PF_STATUS_SET'.
modify it_events from wa_event
transporting form
where name = wa_event-name.
endif.
and then set your PF Status in Form 'PF_STATUS_SET'
hope this solves your problem.
Jinson. -
Hi All,
Here my Question is related to Set pf-status.
I had an ALV program where the output is in ALV grid display i need to show CONFIRM BUTTON on the toolbar and when i click on that it will navigate to one more ALV output with the values where i need to show " APPROVE button on the tool bar.
now here the problem is i am having only one pf-status and it contains both 'CONFIRM ' and APPROVE'.
If i try to write exclude statement its disappearing in both the ALV's.
I googled but couldn't find the accurate answer.Can anyone pls help me.Do i need to create two pf-status for my program? or Can one pf-status helps me.
Thanks,Hi,
You can use the EXCLUDING extension while setting the PF-STATUS.
CASE ok_code.
WHEN 'EXEC'. "While displaying the fisrt ALV
REFRESH fcode[].
MOVE 'APPROVE' TO wa_fcodes-fcode.
APPEND wa_fcodes TO fcodes.
SET PF_STATUS 'ZPF_STAT1' excluding fcodes.
Display ALV.
WHEN 'APPROVE'. "while displaying the second ALV
REFRESH fcode[].
MOVE 'CONFIRM' TO wa_fcodes-fcode.
APPEND wa_fcodes TO fcodes.
SET PF_STATUS 'ZPF_STAT1' excluding fcodes.
Display ALV.
ENDCASE.
Hope this helps.
Regards,
Satish Kanteti -
Using PF_STATUS and USER_COMMAND in ALV
Hi,
I have a requirement to place two buttons on the application toolbar of the output ALV list display screen.
I have to assign functionality for the two buttons.
How do we do it in ALV?
Is there any thing in ALV which performs the functionality of set pf_status and at user_command?Hi Sandeep,
Following code might be useful for you to achieve your goal.
REPORT ZSPRENH062.
TYPE-POOLS : SLIS. "Global Type for ALV
* D A T A *
* Types declarations
*ALV Header table type
TYPES: BEGIN OF TY_HFINAL,
WERKS TYPE EWERK, "Plant
MATKL TYPE MATKL, "Material Group
END OF TY_HFINAL,
*ALV Item table type
BEGIN OF TY_IFINAL,
WERKS TYPE EWERK, "Plant
MATKL TYPE MATKL, "Material Group
SELECT(1) TYPE C, "Check Box
MATNR TYPE MATNR, "Material No
LIFNR TYPE LIFNR, "Vendor Account No.
MAKTX TYPE MAKTX, "Material Desp.
BISMT TYPE BISMT, "Old material ID
CPRICE TYPE KBETR_KOND, "Contract Price
FINCONPRI(20) TYPE C,
INFOREC TYPE KBETR_KOND, "Purchase info rec.
FININFPRI(20) TYPE C,
MPRICE TYPE KBETR_KOND, "Market price
NREPCOST TYPE KBETR_KOND, "Total repl. cost
*----- Begin of Changes EXT-SAP-180 13APR2007 ------*
PRUOM TYPE BSTME, "Purchase Unit of Measure
TRC_BUOM TYPE KBETR_KOND, "Total Repl. Cost in Base UOM
BSUOM TYPE MEINS, "Base Unit of Measure
*----- End of Changes EXT-SAP-180 13APR2007 ------*
PREPCOST TYPE KBETR_KOND, "Previous repl cost
VALCHG TYPE KBETR_KOND, "Total value change
PERCHG TYPE P LENGTH 5 DECIMALS 2, "Percentage Change
END OF TY_IFINAL.
* Internal Table Declarations
*ALV Header Internal Table
DATA: T_HFINAL TYPE STANDARD TABLE OF TY_HFINAL INITIAL SIZE 0,
*ALV Item Internal Table
T_IFINAL TYPE STANDARD TABLE OF TY_IFINAL INITIAL SIZE 0,
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
* Work area Declarations
*ALV Header Work Area
W_HFINAL TYPE TY_HFINAL,
*ALV Item Work Area
W_IFINAL TYPE TY_IFINAL,
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
* Variable declarations
G_REPID TYPE SY-REPID, "Program Name
G_ANSWER TYPE C, "Optional Button
G_WERKS TYPE EWERK,
G_MATKL TYPE MATKL,
G_MATNR TYPE MATNR,
G_MTART TYPE MTART,
G_LIFNR TYPE ELIFN,
L_CPRICE_C(20) TYPE C,
L_CPRICE_I(20) TYPE C,
L_UNITPRICE_C(20) TYPE C,
L_UNITPRICE_I(20) TYPE C.
* Constant declarations
CONSTANTS: C_A(1) TYPE C VALUE 'A', "Constant Value A
C_E(1) TYPE C VALUE 'E', "Constant Value E
C_H(1) TYPE C VALUE 'H', "Constant Value H
C_M(1) TYPE C VALUE 'M', "Constant Value M
C_S(1) TYPE C VALUE 'S', "Constant Value S
C_X(1) TYPE C VALUE 'X', "Constant Value X
C_0(1) TYPE C VALUE '0', "Constant Value 0
C_R(1) TYPE C VALUE 'R', "Constant Value R
C_2(1) TYPE C VALUE '2', "Constant Value 2
C_LANG(2) TYPE C VALUE 'EN', "Language English
C_ZQTE(4) TYPE C VALUE 'ZQTE', "Condtion type ZQTE
C_HTNAME(10) TYPE C VALUE 'T_HFINAL', "Header table name
C_ITNAME(10) TYPE C VALUE 'T_IFINAL'. "Item table name
* 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. "Begin of Block1
PARAMETERS : P_EKORG TYPE EKORG OBLIGATORY. "Pur.Organization
SELECT-OPTIONS : S_WERKS FOR G_WERKS OBLIGATORY, "Plant
S_MATKL FOR G_MATKL, "Material Group
S_MATNR FOR G_MATNR, "Material No.
S_MTART FOR G_MTART, "Material Type
S_LIFNR FOR G_LIFNR. "Vendor
PARAMETERS : P_PERCHG(3) TYPE C. "Percentage Change
SELECTION-SCREEN END OF BLOCK BLK1. "End of Block 1
* Selection-screen Block 2
SELECTION-SCREEN BEGIN OF BLOCK BLK2
WITH FRAME TITLE TEXT-002. "Begin of Block2
PARAMETERS: P_VDATE TYPE DATAM DEFAULT SY-DATUM, "Valid on date
P_HDATE TYPE DATAM DEFAULT '29991231'."Horizon date
SELECTION-SCREEN END OF BLOCK BLK2. "End of Block 2
* 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.
* Validation for Change of Percentage
IF P_PERCHG LT 0 OR P_PERCHG GT 100.
MESSAGE E000(ZS) WITH TEXT-E01.
ENDIF.
* Validation for Horizon Date
IF P_HDATE LE P_VDATE.
MESSAGE E000(ZS) WITH TEXT-E02.
ENDIF.
* 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.
* E N D O F S E L E C T I O N *
END-OF-SELECTION.
* Build Header for Top-Of-Page
PERFORM BUILD_TOPOFPAGE.
* Display List
PERFORM DISPLAY_ALV_REPORT.
* F O R M S *
*& Form data_retrieval
* To fetch data from Database table into ALV final Internal table
FORM DATA_RETRIEVAL.
* Local Types declarations
*Types of EORD & EKPO table
TYPES : BEGIN OF TY_MAIN,
MATNR TYPE MATNR, "Material No.
WERKS TYPE EWERK, "Plant
ZEORD TYPE DZEORD, "No.Source List Rec
LIFNR TYPE ELIFN, "Vendor Account No.
EBELN TYPE EVRTN, "Agreement Number
EBELP TYPE EVRTP, "Agreement Item
EKORG TYPE EKORG, "Pur. Organization
AUTET TYPE AUTET, "S.L. in Mat.Planning
MATKL TYPE MATKL, "Material Group
MTART TYPE MTART, "Material Type
INFNR TYPE INFNR, "No.Pur.Info Record
* Begin of Changes CON-SAP-99 16/01/2007 *
NETPR TYPE BPREI, "Net Price
* End of Changes CON-SAP-99 16/01/2007 *
*----- Begin of Changes EXT-SAP-180 13APR2007 ------ *
MEINS TYPE BSTME, "Purchase Order Unit of Measure
*----- End of Changes EXT-SAP-180 13APR2007 ------ *
* begin 23APR2007 ------
PEINH TYPE EPEIN, "Price Unit
* end 23APR2007 ------
PSTYP TYPE PSTYP, "Item Category
KONNR TYPE KONNR, "No.Principal P.A.
KTPNR TYPE KTPNR, "Item No.Principal P.A.
END OF TY_MAIN,
*Types of MARA table
BEGIN OF TY_MARA,
MATNR TYPE MATNR, "Material No.
MEINS TYPE MEINS, "Base Unit of Measure " ext-sap-180 13APR2007
END OF TY_MARA,
*Types of MAKT table
BEGIN OF TY_MAKT,
MATNR TYPE MATNR, "Material No.
MAKTX TYPE MAKTX, "Material Desp.
END OF TY_MAKT,
*Types of MBEW table
BEGIN OF TY_MBEW,
MATNR TYPE MATNR, "Material No.
BWKEY TYPE BWKEY, "Valuation Area
*----- Begin of Changes EXT-SAP-180 13APR2007 ------ *
PEINH TYPE PEINH, "Price Unit
*----- End of Changes EXT-SAP-180 13APR2007 ------ *
ZPLP3 TYPE DZPLP3, "Future Planned Price
END OF TY_MBEW,
*Types of A016_C table
BEGIN OF TY_A016_C,
EVRTN TYPE EBELN, "Purchasing Doc. No.
EVRTP TYPE EBELP, "Item No.of Pur. Doc.
KNUMH TYPE KNUMH, "Condition rec.no.
END OF TY_A016_C,
*Types of A017_P table
BEGIN OF TY_A017_P,
LIFNR TYPE ELIFN, "Vendor Account No.
MATNR TYPE MATNR, "Material No.
EKORG TYPE EKORG, "Pur. Organization
WERKS TYPE WERKS_D, "Plant
KNUMH TYPE KNUMH, "Condition rec.no.
END OF TY_A017_P,
*Types of A054_M table
BEGIN OF TY_A054_M,
KSCHL TYPE KSCHA, "Condition type
EKORG TYPE EKORG, "Pur. Organization
MATKL TYPE MATKL, "Material Group
* Begin of Changes EXT-SAP-180 02APR2007 *
MATNR TYPE MATNR, "Material Number
DATBI TYPE KODATBI, " Validity end date of the condition record 04APR07
DATAB TYPE KODATAB, " Validity start date of the condition record 04APR0
* End of Changes EXT-SAP-180 02APR2007 *
KNUMH TYPE KNUMH, "Condition rec.no.
END OF TY_A054_M,
*Types of KONP_P table
BEGIN OF TY_KONP_P,
KNUMH TYPE KNUMH, "Condition rec.no.
KBETR TYPE KBETR_KOND, "Rate
KONWA TYPE KONWA, "Rate unit
KPEIN TYPE KPEIN, "Condition pricing unit
KMEIN TYPE KMEIN, "Condition Unit
END OF TY_KONP_P,
* Begin of Changes EXT-SAP-180 02APR2007 *
* Types of A049 table
BEGIN OF TY_A049,
KSCHL TYPE KSCHA, " Condition Type
EKORG TYPE EKORG, " Purchasing Organization
MATKL TYPE MATKL, " Material Group
MATNR TYPE MATNR, " Material Number
DATBI TYPE KODATBI, " Validity end date of the condition record 04APR07
DATAB TYPE KODATAB, " Validity start date of the condition record 04APR07
KNUMH TYPE KNUMH, " Condition Record Number
END OF TY_A049,
* Types of KONP_C table
BEGIN OF TY_KONP_C,
KNUMH TYPE KNUMH, "Condition rec.no.
KOPOS TYPE KOPOS,
KSCHL TYPE KSCHA, "Condition type
KBETR TYPE KBETR_KOND, "Rate
KONWA TYPE KONWA, "Rate unit
END OF TY_KONP_C,
*Types of KONM_C table
BEGIN OF TY_KONM_C,
KNUMH TYPE KNUMH, "Condition rec.no.
KOPOS TYPE KOPOS, "Seq. no. of the condition
KSTBM TYPE KSTBM, "Condition scale quan.
KBETR TYPE KBETR, "Rate
END OF TY_KONM_C,
*Types of KONM_P table
BEGIN OF TY_KONM_P,
KNUMH TYPE KNUMH, "Condition rec.no.
KSTBM TYPE KSTBM, "Condition scale quan.
KBETR TYPE KBETR, "Rate
END OF TY_KONM_P,
* End of Changes EXT-SAP-180 02APR2007 *
*----- Begin of Changes EXT-SAP-180 13APR2007 ------*
*Types of EINE table
BEGIN OF TY_EINE,
INFNR TYPE INFNR, " Number of Purchase Info Record
EKORG TYPE EKORG, " Purchasing Organization
WERKS TYPE EWERK, " Plant
PEINH TYPE EPEIN, " Price Unit
BPRME TYPE BBPRM, " Order Price Unit (Purchasing)
END OF TY_EINE,
*Types of MARM table
BEGIN OF TY_MARM,
MATNR TYPE MATNR, " Material Number
MEINH TYPE LRMEI, " Alternative Unit of Measure
UMREZ TYPE UMREZ, " Numerator for Conversion to Base UOM
UMREN TYPE UMREN, " Denominator for Conversion to Base UOM
END OF TY_MARM,
*----- End of Changes EXT-SAP-180 13APR2007 ------*
*Types of EKAB table
BEGIN OF TY_EKAB,
KONNR TYPE KONNR, "No of Principal P.A
KTPNR TYPE KTPNR, "Item of Principal P.A
EBELN TYPE EBELN, "Purchasing Doc. No.
MENGE TYPE BSTMG, "P.O. Quantity
END OF TY_EKAB,
*Types of EKPO table
BEGIN OF TY_EKPO,
INFNR TYPE INFNR, "No of Pur.Info Rec.
EBELN TYPE EBELN, "Purchasing Doc. No.
MENGE TYPE MENGE_D, "P.O. Quantity
END OF TY_EKPO.
* Local Internal table declarations
DATA: T_MAIN TYPE STANDARD TABLE OF TY_MAIN,
T_MAIN1 TYPE STANDARD TABLE OF TY_MAIN,
T_MARA TYPE STANDARD TABLE OF TY_MARA,
T_MBEW TYPE STANDARD TABLE OF TY_MBEW,
T_MAKT TYPE STANDARD TABLE OF TY_MAKT,
T_A016_C TYPE STANDARD TABLE OF TY_A016_C,
T_A017_P TYPE STANDARD TABLE OF TY_A017_P,
T_A054_M TYPE STANDARD TABLE OF TY_A054_M,
* Begin of Changes EXT-SAP-180 02APR2007 *
T_KONP_C TYPE STANDARD TABLE OF TY_KONP_C,
T_A049 TYPE STANDARD TABLE OF TY_A049,
* End of Changes EXT-SAP-180 02APR2007 *
*----- Begin of Changes EXT-SAP-180 13APR2007 ------*
T_EINE TYPE STANDARD TABLE OF TY_EINE,
T_MARM TYPE STANDARD TABLE OF TY_MARM,
*----- End of Changes EXT-SAP-180 13APR2007 ------*
T_KONP_P TYPE STANDARD TABLE OF TY_KONP_P,
T_KONP_M TYPE STANDARD TABLE OF TY_KONP_P,
* Begin of Changes EXT-SAP-180 02APR2007 *
T_KONM_C TYPE STANDARD TABLE OF TY_KONM_C,
T_KONM_P TYPE STANDARD TABLE OF TY_KONM_P,
* End of Changes EXT-SAP-180 02APR2007 *
T_EKAB TYPE STANDARD TABLE OF TY_EKAB,
T_EKPO TYPE STANDARD TABLE OF TY_EKPO,
* Local Work Area declarations
W_MAIN TYPE TY_MAIN,
W_MARA TYPE TY_MARA,
W_MBEW TYPE TY_MBEW,
W_A016_C TYPE TY_A016_C,
W_A017_P TYPE TY_A017_P,
W_A054_M TYPE TY_A054_M,
* Begin of Changes EXT-SAP-180 02APR2007 *
W_KONP_C TYPE TY_KONP_C,
W_MAIN1_T TYPE TY_MAIN,
W_A049_T TYPE TY_A049,
* End of Changes EXT-SAP-180 02APR2007 *
*----- Begin of Changes EXT-SAP-180 13APR2007 ------*
W_EINE TYPE TY_EINE,
W_MARM TYPE TY_MARM,
*----- End of Changes EXT-SAP-180 13APR2007 ------*
W_KONP_P TYPE TY_KONP_P,
W_KONP_M TYPE TY_KONP_P,
* Begin of Changes EXT-SAP-180 02APR2007 *
W_KONM_C TYPE TY_KONM_C,
W_KONM_P TYPE TY_KONM_P,
W_KONM1 TYPE TY_KONM_C,
W_KONM2 TYPE TY_KONM_P,
* End of Changes EXT-SAP-180 02APR2007 *
W_EKAB TYPE TY_EKAB,
W_EKPO TYPE TY_EKPO,
W_MAKT TYPE TY_MAKT,
* Local Variable declarations
L_PERPRICE TYPE KBETR_KOND, "Local Percentage price
L_PERUNIT TYPE KPEIN, "Condition Pricing Unit
L_MARPRICE TYPE KBETR_KOND, "Local Market price
* Begin of Changes EXT-SAP-180 02APR2007 *
L_KBETR TYPE KBETR,
L_INDEX TYPE SY-TABIX, "Tab Index
* End of Changes EXT-SAP-180 02APR2007 *
* Begin of Changes CON-SAP-99 11/12/2006 *
L_STR TYPE STRING.
* End of Changes CON-SAP-99 11/12/2006 *
* GET SOURCE LIST
SELECT A~MATNR "Material No.
A~WERKS "Plant
A~ZEORD "No.Source List Rec
A~LIFNR "Vendor Account No.
A~EBELN "Agreement Number
A~EBELP "Agreement Item
A~EKORG "Pur. Organization
A~AUTET "S.L. in Mat.Planning
B~MATKL "Material Group
B~MTART "Material Type
B~INFNR "No.Pur.Info Record
* Begin of Changes CON-SAP-99 16/01/2007 *
B~NETPR "Net price
* End of Changes CON-SAP-99 16/01/2007 *
*----- Begin of Changes EXT-SAP-180 13APR2007 ------ *
B~MEINS "Purchase Order Unit of Measure
*----- End of Changes EXT-SAP-180 13APR2007 ------ *
* begin 23APR2007 ------
B~PEINH "Price Unit
* end 23APR2007 ------
B~PSTYP "Pur. Doc. Category
B~KONNR "No.Principal P.A.
B~KTPNR "Item No.Principal P.A.
INTO TABLE T_MAIN
FROM EORD AS A INNER JOIN EKPO AS B
ON ( A~EBELN EQ B~EBELN
AND A~EBELP EQ B~EBELP )
WHERE A~MATNR IN S_MATNR
AND A~LIFNR IN S_LIFNR
AND A~WERKS IN S_WERKS
AND B~MATKL IN S_MATKL
AND B~MTART IN S_MTART
AND A~EKORG EQ P_EKORG
AND A~VDATU LE P_VDATE
AND A~BDATU GE P_VDATE
AND ( A~AUTET EQ 1
OR A~AUTET EQ 2 ).
IF SY-SUBRC = 0.
SORT T_MAIN BY MATNR WERKS.
DELETE ADJACENT DUPLICATES FROM T_MAIN
COMPARING MATNR
WERKS.
T_MAIN1[] = T_MAIN[].
DELETE ADJACENT DUPLICATES FROM T_MAIN1
COMPARING MATNR.
* GET MATERIAL DESCRIPTION
SELECT MATNR "Material No
MAKTX "Material Desp.
FROM MAKT
INTO TABLE T_MAKT
FOR ALL ENTRIES IN T_MAIN1
WHERE MATNR EQ T_MAIN1-MATNR
AND SPRAS EQ C_LANG.
IF SY-SUBRC = 0.
SORT T_MAKT BY MATNR.
ENDIF.
*----- Begin of Changes EXT-SAP-180 13APR2007 ------ *
* GET PURCHASE ORDER UNIT OF MEASURE FOR INFO RECORDS FROM EINE
SELECT INFNR " Number of Purchase Info Record
EKORG " Purchasing Organization
WERKS " Plant
PEINH " Price Unit
BPRME " Order Price Unit
FROM EINE
INTO TABLE T_EINE
FOR ALL ENTRIES IN T_MAIN1
WHERE INFNR EQ T_MAIN1-INFNR
AND EKORG EQ T_MAIN1-EKORG
AND ( ESOKZ EQ C_0 OR ESOKZ EQ C_2 ) "Purchasing Info Record Category = Standard
AND WERKS EQ T_MAIN1-WERKS.
IF SY-SUBRC = 0.
SORT T_EINE BY INFNR EKORG WERKS.
ENDIF.
SELECT MATNR " Material Number
MEINH " Alternate UOM
UMREZ " Numerator for conversion
UMREN " Denominator for conversion
FROM MARM
INTO TABLE T_MARM
FOR ALL ENTRIES IN T_MAIN1
WHERE MATNR EQ T_MAIN1-MATNR.
IF SY-SUBRC = 0.
SORT T_MARM BY MATNR MEINH.
ENDIF.
*----- End of Changes EXT-SAP-180 13APR2007 ------ *
* GET BASE UNIT OF MEASURE
SELECT MATNR "Material No.
MEINS "Base unit of measure " ext-sap-180 13APR2007
INTO TABLE T_MARA
FROM MARA
FOR ALL ENTRIES IN T_MAIN1
WHERE MATNR EQ T_MAIN1-MATNR.
IF SY-SUBRC = 0.
SORT T_MARA BY MATNR.
ENDIF.
* GET CONTRACT PRICE
REFRESH T_MAIN1[].
T_MAIN1[] = T_MAIN[].
SORT T_MAIN1 BY PSTYP.
DELETE T_MAIN1 WHERE PSTYP = 2.
IF T_MAIN1 IS NOT INITIAL.
SORT T_MAIN1 BY EBELN EBELP.
* Get Condition Record Number based on Purchasing Document Number
SELECT EVRTN "Purchasing Doc. No.
EVRTP "Item No.of Pur. Doc.
KNUMH "Condition rec.no.
FROM A016
INTO TABLE T_A016_C
FOR ALL ENTRIES IN T_MAIN1
WHERE KAPPL EQ C_M
AND EVRTN EQ T_MAIN1-EBELN
AND EVRTP EQ T_MAIN1-EBELP
AND DATBI GE P_VDATE
AND DATAB LE P_VDATE.
IF SY-SUBRC = 0.
SORT T_A016_C BY EVRTN EVRTP.
ENDIF.
SORT T_MAIN1 BY KONNR KTPNR.
*Get Condition Record No. based on Principal Purchasing Document No
SELECT EVRTN "Purchasing Doc. No.
EVRTP "Item No.of Pur. Doc.
KNUMH "Condition rec.no.
FROM A016
APPENDING TABLE T_A016_C
FOR ALL ENTRIES IN T_MAIN1
WHERE KAPPL EQ C_M
AND EVRTN EQ T_MAIN1-KONNR
AND EVRTP EQ T_MAIN1-KTPNR
AND DATBI GE P_VDATE
AND DATAB LE P_VDATE.
IF T_A016_C IS NOT INITIAL.
SORT T_A016_C BY EVRTN EVRTP.
*Get Rate & unit for all the Condition Record No.(Contract Price)
SELECT KNUMH "Condition rec.no.
* Begin of Changes EXT-SAP-180 02APR2007 *
KOPOS "Seq. No. of the condition
KSCHL "Condition Type
* End of Changes EXT-SAP-180 02APR2007 *
KBETR "Rate
KONWA "Rate unit
FROM KONP
INTO TABLE T_KONP_C
FOR ALL ENTRIES IN T_A016_C
WHERE KNUMH EQ T_A016_C-KNUMH
* Begin of Changes EXT-SAP-180 02APR2007 *
AND LOEVM_KO EQ SPACE.
* End of Changes EXT-SAP-180 02APR2007 *
IF SY-SUBRC = 0.
SORT T_KONP_C BY KNUMH.
ENDIF.
* Get Condition scale quantity & Rate for all the Condition Record No.
SELECT KNUMH "Condition rec.no.
* Begin of Changes EXT-SAP-180 02APR2007 *
KOPOS "Seq. No. of the condition
* End of Changes EXT-SAP-180 02APR2007 *
KSTBM "Condition scale quan.
KBETR "Rate
FROM KONM
INTO TABLE T_KONM_C
FOR ALL ENTRIES IN T_A016_C
WHERE KNUMH EQ T_A016_C-KNUMH.
IF SY-SUBRC = 0.
SORT T_KONM_C BY KNUMH
* Begin of Changes EXT-SAP-180 02APR2007 *
KOPOS
* End of Changes EXT-SAP-180 02APR2007 *
KSTBM
DESCENDING.
ENDIF.
* Get PO Doc. No. & Quantity based on Principal Purchasing Doc. No
SELECT KONNR "No of Principal P.A
KTPNR "Item of Principal P.A
EBELN "Purchasing Doc. No.
MENGE "P.O. Quantity
FROM EKAB
INTO TABLE T_EKAB
FOR ALL ENTRIES IN T_A016_C
WHERE KONNR EQ T_A016_C-EVRTN
AND KTPNR EQ T_A016_C-EVRTP.
IF SY-SUBRC = 0.
SORT T_EKAB BY KONNR KTPNR EBELN DESCENDING.
ENDIF.
ENDIF.
ENDIF.
* GET PURCHASING INFO RECORDS PRICE
REFRESH T_MAIN1[].
T_MAIN1[] = T_MAIN[].
DELETE T_MAIN1 WHERE PSTYP <> 2.
IF T_MAIN1 IS NOT INITIAL.
SORT T_MAIN1 BY LIFNR MATNR EKORG WERKS.
* Get Condition Record No based on Vendor,Material,Pur.org & Plant
SELECT LIFNR "Vendor Account No.
MATNR "Material No.
EKORG "Pur. Organization
WERKS "Plant
KNUMH "Condition rec.no.
FROM A017
INTO TABLE T_A017_P
FOR ALL ENTRIES IN T_MAIN1
WHERE LIFNR EQ T_MAIN1-LIFNR
AND MATNR EQ T_MAIN1-MATNR
AND EKORG EQ T_MAIN1-EKORG
AND WERKS EQ T_MAIN1-WERKS
AND DATBI GE P_VDATE
AND DATAB LE P_VDATE.
IF SY-SUBRC = 0.
SORT T_A017_P BY LIFNR MATNR EKORG WERKS.
*Get Rate & unit for all the Condition Rec.No.(Pur. info Rec Price)
SELECT KNUMH "Condition rec.no.
KBETR "Rate
KONWA "Rate unit
KPEIN "Condition pricing unit
KMEIN "Condition Unit
FROM KONP
INTO TABLE T_KONP_P
FOR ALL ENTRIES IN T_A017_P
WHERE KNUMH EQ T_A017_P-KNUMH.
IF SY-SUBRC = 0.
SORT T_KONP_P BY KNUMH.
ENDIF.
* Get Condition scale quantity & Rate for all the Condition Record No.
SELECT KNUMH "Condition rec.no.
KSTBM "Condition scale quan.
KBETR "Rate
FROM KONM
INTO TABLE T_KONM_P
FOR ALL ENTRIES IN T_A017_P
WHERE KNUMH EQ T_A017_P-KNUMH.
IF SY-SUBRC = 0.
SORT T_KONM_P BY KNUMH KSTBM DESCENDING.
ENDIF.
ENDIF.
* Get PO Doc. No. & Quantity based on Principal Purchasing Doc. No
SORT T_MAIN1 BY INFNR.
SELECT INFNR "No of Pur.Info Rec.
EBELN "Purchasing Doc. No.
MENGE "P.O. Quantity
FROM EKPO
INTO TABLE T_EKPO
FOR ALL ENTRIES IN T_MAIN1
WHERE INFNR EQ T_MAIN1-INFNR
AND WERKS EQ T_MAIN1-WERKS
AND BSTYP EQ 'F'.
IF SY-SUBRC = 0.
SORT T_EKPO BY INFNR EBELN DESCENDING.
ENDIF.
ENDIF.
* GET MARKET PRICE
REFRESH T_MAIN1[].
T_MAIN1[] = T_MAIN[].
DELETE ADJACENT DUPLICATES FROM T_MAIN1 COMPARING EKORG MATKL.
P_VDATE = P_VDATE + 1.
* Begin of Changes EXT-SAP-180 02APR2007 *
* Get Condition Record No based on Material Number
SELECT KSCHL
EKORG
MATNR
DATBI "EXT-SAP-180 04Apr07
DATAB "EXT-SAP-180 04Apr07
KNUMH
FROM A049
INTO CORRESPONDING FIELDS OF TABLE T_A049
FOR ALL ENTRIES IN T_MAIN
WHERE KSCHL EQ C_ZQTE
AND EKORG EQ T_MAIN-EKORG
AND MATNR EQ T_MAIN-MATNR
AND ESOKZ EQ C_0.
IF SY-SUBRC EQ 0. " if entries exists in t_a049
SORT T_A049 BY EKORG MATNR
DATBI DATAB. " EXT-SAP-180 04Apr07
CLEAR L_INDEX.
LOOP AT T_A049 INTO W_A049_T.
L_INDEX = SY-TABIX.
READ TABLE T_MAIN INTO W_MAIN1_T
WITH KEY EKORG = W_A049_T-EKORG
MATNR = W_A049_T-MATNR
BINARY SEARCH.
IF SY-SUBRC EQ 0.
W_A049_T-MATKL = W_MAIN1_T-MATKL.
MODIFY T_A049 FROM W_A049_T
INDEX L_INDEX
TRANSPORTING MATKL.
ENDIF.
CLEAR: W_A049_T,
W_MAIN1_T,
L_INDEX.
ENDLOOP.
* Get Rate & unit for all the Condition Record No. (Market price)
SELECT KNUMH "Condition rec.no.
KBETR "Rate
KONWA "Rate unit
KPEIN "Condition Pricing Unit
KMEIN "Condition Unit
FROM KONP
INTO TABLE T_KONP_M
FOR ALL ENTRIES IN T_A049
WHERE KNUMH EQ T_A049-KNUMH.
IF SY-SUBRC = 0.
SORT T_KONP_C BY KNUMH.
ENDIF.
ENDIF.
* End of Changes EXT-SAP-180 02APR2007 *
*Get Condition Record No based on Condition type, Pur.Org.,Mat. group
SELECT KSCHL "Condition type
EKORG "Pur. Organization
MATKL "Material Group
DATBI "Valid to date EXT-SAP-180 04Apr07
DATAB "Valid from date EXT-SAP-180 04Apr07
KNUMH "Condition rec.no.
FROM A054
INTO CORRESPONDING FIELDS OF TABLE T_A054_M
FOR ALL ENTRIES IN T_MAIN
WHERE KSCHL EQ C_ZQTE
AND EKORG EQ T_MAIN-EKORG
AND MATKL EQ T_MAIN-MATKL
AND ESOKZ EQ C_0.
IF SY-SUBRC = 0.
SORT T_A054_M BY EKORG MATKL
DATBI DATAB. " added by SAP-EXT-180 04Apr07
* Get Rate & unit for all the Condition Record No. (Market price)
SELECT KNUMH "Condition rec.no.
KBETR "Rate
KONWA "Rate unit
KPEIN "Condition Pricing Unit
KMEIN "Condition Unit
FROM KONP
APPENDING TABLE T_KONP_M
FOR ALL ENTRIES IN T_A054_M
WHERE KNUMH EQ T_A054_M-KNUMH.
IF SY-SUBRC = 0.
SORT T_KONP_C BY KNUMH KOPOS KSCHL.
* Begin of Changes EXT-SAP-180 02APR2007 *
SORT T_KONP_M BY KNUMH.
* End of Changes EXT-SAP-180 02APR2007 *
ENDIF.
ENDIF.
* GET PREVIOUS REPLACEMENT COST
SELECT MATNR "Material No.
BWKEY "Valuation Area
*----- Begin of Changes EXT-SAP-180 13APR2007 ------ *
PEINH "Price Unit
*----- End of Changes EXT-SAP-180 13APR2007 ------ *
ZPLP3 "Future Planned Price
FROM MBEW
INTO TABLE T_MBEW
FOR ALL ENTRIES IN T_MAIN
WHERE MATNR EQ T_MAIN-MATNR
AND BWKEY EQ T_MAIN-WERKS.
IF SY-SUBRC = 0.
SORT T_MBEW BY MATNR BWKEY.
ENDIF.
* TRANSFERING DATA INTO FINAL INTERNAL TABLE
CLEAR : W_MAIN.
LOOP AT T_MAIN INTO W_MAIN.
* Clear the Work area
CLEAR : W_MAKT,
W_MARA,
W_MBEW,
W_A016_C,
W_A017_P,
W_A054_M,
W_KONP_C,
W_KONP_P,
W_KONP_M,
W_KONM_C,
W_KONM_P,
W_KONM1,
* Begin of Changes EXT-SAP-180 02APR2007 *
W_KONM2,
W_A049_T,
* End of Changes EXT-SAP-180 02APR2007 *
W_EKAB,
W_EKPO.
CLEAR : W_HFINAL,
W_IFINAL.
* PLANT, MATERIAL GROUP
W_HFINAL-WERKS = W_MAIN-WERKS. "Plant(H)
W_HFINAL-MATKL = W_MAIN-MATKL. "Material Group(H)
W_IFINAL-WERKS = W_MAIN-WERKS. "Plant(I)
W_IFINAL-MATKL = W_MAIN-MATKL. "Material Group(I)
* MATERIAL NUMBER, VENDER NUMBER
W_IFINAL-MATNR = W_MAIN-MATNR. "Material No.
W_IFINAL-LIFNR = W_MAIN-LIFNR. "Vendor
* MATERIAL DESCRIPTION
READ TABLE T_MAKT INTO W_MAKT
WITH KEY MATNR = W_MAIN-MATNR
BINARY SEARCH.
IF SY-SUBRC = 0.
W_IFINAL-MAKTX = W_MAKT-MAKTX. "Material Desp.
ENDIF.
* BASE UNIT OF MEASURE
READ TABLE T_MARA INTO W_MARA
WITH KEY MATNR = W_MAIN-MATNR
BINARY SEARCH.
IF SY-SUBRC = 0.
*----- Begin of Changes EXT-SAP-180 13APR2007 ------*
W_IFINAL-BSUOM = W_MARA-MEINS.
*----- End of Changes EXT-SAP-180 13APR2007 ------*
ENDIF.
* CONTRACT PRICE
IF W_MAIN-PSTYP <> 2.
* Assigning Scheduling agreement reference no. into agreement no.
IF W_MAIN-AUTET EQ 2.
W_MAIN-EBELN = W_MAIN-KONNR.
W_MAIN-EBELP = W_MAIN-KTPNR.
ENDIF.
*----- Begin of Changes EXT-SAP-180 13APR2007 ------*
* Assigning Purchase Order Unit of Measure
W_IFINAL-PRUOM = W_MAIN-MEINS.
*----- Begin of Changes EXT-SAP-180 13APR2007 ------*
* Read conditon no. for agreement no.
READ TABLE T_A016_C INTO W_A016_C
WITH KEY EVRTN = W_MAIN-EBELN
EVRTP = W_MAIN-EBELP
BINARY SEARCH.
IF SY-SUBRC = 0.
* Begin of insertion EXT-SAP-180 02APR2007 *
LOOP AT T_KONP_C INTO W_KONP_C
WHERE KNUMH = W_A016_C-KNUMH.
* End of insertion EXT-SAP-180 02APR2007 *
* to check scales
READ TABLE T_KONM_C INTO W_KONM_C
WITH KEY KNUMH = W_A016_C-KNUMH
* Begin of Changes EXT-SAP-180 02APR2007 *
KOPOS = W_KONP_C-KOPOS
* End of Changes EXT-SAP-180 02APR2007 *
BINARY SEARCH.
IF SY-SUBRC = 0.
* Check Purchase order for Contract Price with scales
READ TABLE T_EKAB INTO W_EKAB
WITH KEY KONNR = W_A016_C-EVRTN
KTPNR = W_A016_C-EVRTP
BINARY SEARCH.
IF SY-SUBRC = 0.
SORT T_KONM_C BY KNUMH KSTBM.
* Get the Contract price, if Purchase order exist
LOOP AT T_KONM_C INTO W_KONM1
WHERE KNUMH EQ W_A016_C-KNUMH
AND KSTBM LE W_EKAB-MENGE.
CLEAR L_KBETR.
IF SY-SUBRC = 0.
L_KBETR = W_KONM1-KBETR.
CONTINUE.
ENDIF.
ENDLOOP.
* the above looping is done to get the right scale & stop, then add
* the scale amount to the existing contract price in the below step.
W_IFINAL-CPRICE = W_IFINAL-CPRICE + L_KBETR.
CLEAR : W_KONM1,
L_KBETR.
* Begin of Changes EXT-SAP-180 02APR2007 *
SORT T_KONM_C BY KNUMH
KOPOS
KSTBM
DESCENDING.
* End of Changes EXT-SAP-180 02APR2007 *
ELSE.
* Get the Contract price, if doesnot Purchase order exist
W_IFINAL-CPRICE = W_IFINAL-CPRICE + W_KONM_C-KBETR. "Changed EXT-SAP-180 02APR2007
ENDIF.
CLEAR W_EKAB.
ELSE.
* Contract Price with out scales
* Begin of Changes EXT-SAP-180 02APR2007 *
READ TABLE T_KONP_C INTO W_KONP_C
WITH KEY KNUMH = W_A016_C-KNUMH
KSCHL = W_KONP_C-KSCHL
BINARY SEARCH.
IF SY-SUBRC = 0.
W_IFINAL-CPRICE = W_IFINAL-CPRICE + W_KONP_C-KBETR.
ENDIF.
CLEAR W_KONP_C.
* End of Changes EXT-SAP-180 02APR2007 *
ENDIF.
CLEAR W_KONM_C.
* Begin of Changes EXT-SAP-180 02APR2007 *
ENDLOOP.
* End of Changes EXT-SAP-180 02APR2007 *
*----BEGIN OF CHANGE EXT-SAP-180 23rd April 2007
L_CPRICE_C = W_IFINAL-CPRICE.
CONDENSE L_CPRICE_C. "NO-GAPS.
IF W_MAIN-PEINH IS INITIAL.
W_IFINAL-FINCONPRI = L_CPRICE_C.
ELSE.
L_UNITPRICE_C = W_MAIN-PEINH.
CONDENSE L_UNITPRICE_C. " NO-GAPS.
CONCATENATE L_CPRICE_C '/' L_UNITPRICE_C W_MAIN-MEINS INTO W_IFINAL-FINCONPRI.
ENDIF.
CLEAR: L_CPRICE_C,
L_UNITPRICE_C.
*----END OF CHANGE EXT-SAP-180 23rd April 2007
ENDIF.
CLEAR W_A016_C.
ENDIF.
* PURCHASE INFO RECORD
IF W_MAIN-PSTYP = 2.
*----- Begin of Changes EXT-SAP-180 13APR2007 ------*
READ TABLE T_EINE INTO W_EINE
WITH KEY INFNR = W_MAIN-INFNR
EKORG = W_MAIN-EKORG
WERKS = W_MAIN-WERKS
BINARY SEARCH.
IF SY-SUBRC = 0.
W_IFINAL-PRUOM = W_EINE-BPRME.
ENDIF.
*----- End of Changes EXT-SAP-180 13APR2007 ------*
READ TABLE T_A017_P INTO W_A017_P
WITH KEY LIFNR = W_MAIN-LIFNR
MATNR = W_MAIN-MATNR
EKORG = W_MAIN-EKORG
WERKS = W_MAIN-WERKS
BINARY SEARCH.
IF SY-SUBRC = 0.
* To check scales
READ TABLE T_KONM_P INTO W_KONM_P
WITH KEY KNUMH = W_A017_P-KNUMH
BINARY SEARCH.
IF SY-SUBRC = 0.
* Check Purchase order for Purchase info record Price with scales
READ TABLE T_EKPO INTO W_EKPO
WITH KEY INFNR = W_MAIN-INFNR
BINARY SEARCH.
IF SY-SUBRC = 0.
SORT T_KONM_P BY KNUMH KSTBM.
* Get the Pur.info rec. , if Purchase order exist
LOOP AT T_KONM_P INTO W_KONM2
WHERE KNUMH EQ W_A017_P-KNUMH
AND KSTBM LE W_EKPO-MENGE.
W_IFINAL-INFOREC = W_KONM2-KBETR. "Pur.Info rec.
ENDLOOP.
ELSE.
* Get the Pur.info rec. price, if doesnot Purchase order exist
W_IFINAL-INFOREC = W_KONM_P-KBETR. "Pur.Info rec.
ENDIF.
ELSE.
* Get Pur.info rec. price,with out scales
READ TABLE T_KONP_P INTO W_KONP_P
WITH KEY KNUMH = W_A017_P-KNUMH
BINARY SEARCH.
IF SY-SUBRC = 0.
W_IFINAL-INFOREC = W_KONP_P-KBETR. "Pur.Info rec.
ENDIF.
ENDIF.
ENDIF.
*----BEGIN OF CHANGE EXT-SAP-180 23rd April 2007
L_CPRICE_I = W_IFINAL-INFOREC.
CONDENSE L_CPRICE_I.
IF W_EINE-PEINH IS INITIAL.
W_IFINAL-FININFPRI = L_CPRICE_I.
ELSE.
L_UNITPRICE_I = W_EINE-PEINH.
CONDENSE L_UNITPRICE_I. " NO-GAPS.
CONCATENATE L_CPRICE_I '/' L_UNITPRICE_I W_EINE-BPRME INTO W_IFINAL-FININFPRI.
ENDIF.
W_MAIN-PEINH = W_EINE-PEINH.
CLEAR: L_CPRICE_I,
L_UNITPRICE_I,
W_EINE,
W_KONM2,
W_KONP_P,
W_EKPO,
W_KONM_P,
W_A017_P.
*--------End of Change EXT-SAP-180 23rd April 2007
ENDIF.
* MARKET PRICE
* Begin of Changes CON-SAP-99 11/12/2006 *
*clear
CLEAR : L_PERPRICE.
* End of Changes CON-SAP-99 11/12/2006 *
IF W_IFINAL-CPRICE IS NOT INITIAL.
L_PERPRICE = W_IFINAL-CPRICE.
ELSE.
L_PERPRICE = W_IFINAL-INFOREC.
ENDIF.
L_PERUNIT = W_MAIN-PEINH. " fetching the unit at contract/inforecord price level
* Begin of Changes CON-SAP-99 11/12/2006 *
W_IFINAL-MPRICE = L_PERPRICE.
* Begin of Changes EXT-SAP-180 02APR2007 *
CLEAR W_A049_T.
SORT T_A049 BY EKORG MATNR.
READ TABLE T_A049 INTO W_A049_T
WITH KEY EKORG = W_MAIN-EKORG
MATNR = W_MAIN-MATNR
BINARY SEARCH.
IF SY-SUBRC EQ 0.
CLEAR: W_A049_T.
SORT T_KONP_M BY KNUMH.
LOOP AT T_A049 INTO W_A049_T "03APR07
WHERE EKORG = W_MAIN-EKORG
AND MATNR = W_MAIN-MATNR.
* Following IF condition is to check whether the dates given in the selection criteria
* are falling into the date ranges of the records of A049.
IF ( W_A049_T-DATBI GE P_VDATE -
ALV Output Screen ..........
Hi Experts,
In ALV report for FM we use PF_STATUS_SET.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_pf_status_set = 'PF_STATUS_SET'
For each time we have to go in se41 and copy the standard screen full screen for :
FORM pf_status_set USING extab TYPE slis_t_extab.
SET PF-STATUS 'STD' EXCLUDING extab.
ENDFORM. "pf_status_set
Is there any standard procedure to do this in ALV without copy screen in se41 each time?
YusufHi,
I think you want the program can use a default status bar with out creating threw se41
then use the syntax-
SET PF_STATUS SPACE.
here there is no need to create threw se41 i think.
Edited by: vijay Mekala on Jan 2, 2008 8:26 AM
Edited by: vijay Mekala on Jan 2, 2008 8:27 AM
Edited by: vijay Mekala on Jan 2, 2008 8:29 AM -
Hi,
How to use custom defines PF-STATUS in ALV Grid.
Please Give me suggestion this is very imprtant.Hi,
You can create a PF status, say ZPF3 which is an exact copy of STANDARD of program SAPLSALV through transaction SE41 (Menu Painter). You can exclude certain buttons that you do not want and add more also.
To set the PF status as say ZPF3 for your ALV grid and to handle user-command, you can use the following code piece.
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 = 'PF_STATUS_GRID1'
i_callback_user_command = 'USER_COMM'
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 = s_layout
it_fieldcat = t_fcat_grid1[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = t_sort_grid1
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
it_events = t_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_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
tables
t_outtab = t_report
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. " report_display
*& Form pf_status_grid1
Description: Set PF_STATUS for the 1st grid
form pf_status_grid1 using rt_extab type slis_t_extab.
set pf-status 'ZPF3'.
endform. "pf_status_grid1
*& Form USER_COMM
Description: Handling click on the button 'Grand Total'
form user_comm using ucomm like sy-ucomm ls_selfield type slis_selfield.
case ucomm.
when '&TOT'.
perform fieldcat_build_grid2.
perform sort_grid2.
perform display_grandtotal.
endcase.
endform. "USER_COMM
Reward points for useful answers. -
How to Handle PF Status in ALV report ?
Hi friends i wanna handle my own PF Status in my report how can i handle it ?
please help me?
regards
satishcall function module reuse_alv_grid_display.
exporting.
programname = gd_repid.
t_fieldcatalog = d_fieldcat.
set pf_status = 'SET_PF_STATUS'.
importing.
t_outtab = itab.
exceptions.
form set_pf_status using rt_extab type slis_t_extab.
SET PF_STATUS 'NEWSTATUS'.
endform.
double click on NEWSTATUS it will take u to new window where in u can select required icon's which u need to be displayed in output.
otherwise
please see the standard program bcalv_grid_05.
Reward with points if helpful. -
How to get the data in one internal table? with 3 different tables..
Hi,
i need to get the all the ff data to put in an internal table. I'm using these data to my ALV. Thanks
vkorg TYPE a005-vkorg,
vtweg TYPE a005-vtweg,
kschl TYPE a005-kschl,
kondm TYPE mvke-kondm,
matnr TYPE a005-matnr,
kdgrp TYPE knvv-kdgrp,
konda TYPE knvv-konda,
kunnr TYPE a005-kunnr,
datab TYPE a005-datab,hi,
try this
*& Report ZPROGRAM
REPORT ZPROGRAM.
table declaration.
tables : zemployee, zdepartment,zproject.
*type-pools declaration
type-pools : slis , icon.
type specification
types : begin of ty_emp,
empid type zempid,
empname type zempname,
empaddress type zempaddress,
city type zcity,
ponumber type zponumber,
detid type zdeptid,
end of ty_emp.
types : begin of ty_dept,
detid type zdeptid,
deptname type zdeptname,
designation type zdesignation,
projectid type zprojectid,
end of ty_dept.
types : begin of ty_project,
projectid type zprojectid,
technology type ztechnology,
clientname type zclientname,
end of ty_project.
types : begin of ty_final,
empid type zempid,
empname type zempname,
empaddress type zempaddress,
city type zcity,
ponumber type zponumber,
detid type zdeptid,
deptname type zdeptname,
designation type zdesignation,
projectid type zprojectid,
technology type ztechnology,
clientname type zclientname,
average type p decimals 2,
end of ty_final.
table type specification.
types : tt_emp type standard table of ty_emp,
tt_dept type standard table of ty_dept,
tt_project type standard table of ty_project,
tt_final type standard table of ty_final.
work area creation.
data : wa_emp type ty_emp,
wa_dept type ty_dept,
wa_project type ty_project,
wa_final type ty_final.
internal table declaration
data : itab_emp type tt_emp,
itab_dept type tt_dept,
itab_project type tt_project,
itab_final type tt_final.
layout declaration
data : gd_layout type slis_layout_alv.
assigning current program name.
data : gd_repid like sy-repid.
gd_repid = sy-repid.
fieldcatalog declaration.
data : d_fieldcat type slis_t_fieldcat_alv,
d_fieldcat_wa type slis_fieldcat_alv.
header declaration.
data : t_header type slis_t_listheader,
wa_header type slis_listheader,
linecount(10) type c,
line(10) type c.
selection-screen.
selection-screen : begin of block blk1 with frame title text-001.
select-options : s_empid for zemployee-empid.
parameters : p_dname like zdepartment-deptname.
parameters : p_proid like zproject-projectid.
selection-screen : begin of line.
parameters : p_rad1 radiobutton group r1.
selection-screen comment 3(10) text-002.
parameters : p_rad2 radiobutton group r1.
selection-screen comment 16(10) text-003.
selection-screen : end of line.
parameters : chk1 as checkbox.
selection-screen : end of block blk1.
end of selection screen.
start of selection.
select empid empname empaddress city ponumber detid from zemployee into corresponding fields of table itab_emp where empid in s_empid.
if not itab_emp is initial.
select detid deptname designation projectid from zdepartment into corresponding fields of table itab_dept for all entries in itab_emp where detid = itab_emp-detid .
if not itab_dept is initial.
select projectid technology clientname from zproject into corresponding fields of table itab_project for all entries in itab_dept where projectid = itab_dept-projectid.
endif.
endif.
*end of selection.
populating data into itab_final from itab_emp.
loop at itab_emp into wa_emp.
wa_final-empid = wa_emp-empid.
wa_final-empname = wa_emp-empname.
wa_final-empaddress = wa_emp-empaddress.
wa_final-ponumber = wa_emp-ponumber.
wa_final-city = wa_emp-city.
wa_final-detid = wa_emp-detid.
append wa_final to itab_final.
clear wa_final.
endloop.
*populating data into itab_final from itab_dept and itab_project
loop at itab_final into wa_final.
read table itab_dept into wa_dept with key detid = wa_final-detid.
if sy-subrc = 0.
wa_final-deptname = wa_dept-deptname.
wa_final-designation = wa_dept-designation.
wa_final-projectid = wa_dept-projectid.
modify itab_final from wa_final transporting deptname designation projectid .
endif.
read table itab_project into wa_project with key projectid = wa_final-projectid.
if sy-subrc = 0.
wa_final-technology = wa_project-technology.
wa_final-clientname = wa_project-clientname.
modify itab_final from wa_final transporting technology clientname.
endif.
endloop.
if p_rad1 = 'X' or chk1 = 'X'.
d_fieldcat_wa-fieldname = 'EMPID'.
d_fieldcat_wa-seltext_l = 'Employee Id'.
d_fieldcat_wa-emphasize = 'X'.
d_fieldcat_wa-col_pos = 1.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'EMPNAME'.
d_fieldcat_wa-seltext_l = 'Employee Name'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 2.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'EMPADDRESS'.
d_fieldcat_wa-seltext_l = 'Employee Address'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 3.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'CITY'.
d_fieldcat_wa-seltext_l = 'City'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 4.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'PONUMBER'.
d_fieldcat_wa-seltext_l = 'Postal Number'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 5.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'DETID'.
d_fieldcat_wa-seltext_l = 'Department Id'.
d_fieldcat_wa-emphasize = 'X'.
d_fieldcat_wa-col_pos = 6.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'DEPTNAME'.
d_fieldcat_wa-seltext_l = 'Department Name'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 7.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'DESIGNATION'.
d_fieldcat_wa-seltext_l = 'Designation'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 8.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'PROJECTID'.
d_fieldcat_wa-seltext_l = 'Project Id'.
d_fieldcat_wa-emphasize = 'X'.
d_fieldcat_wa-col_pos = 9.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'TECHNOLOGY'.
d_fieldcat_wa-seltext_l = 'technology'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 10.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'CLIENTNAME'.
d_fieldcat_wa-seltext_l = 'Client Name'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 11.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
endif.
if p_rad2 = 'X' or chk1 = 'X'.
refresh itab_emp.
d_fieldcat_wa-fieldname = 'DETID'.
d_fieldcat_wa-seltext_l = 'Department Id'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 6.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'DEPTNAME'.
d_fieldcat_wa-seltext_l = 'Department Name'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 7.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'DESIGNATION'.
d_fieldcat_wa-seltext_l = 'Designation'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 8.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'PROJECTID'.
d_fieldcat_wa-seltext_l = 'Project Id'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 9.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'TECHNOLOGY'.
d_fieldcat_wa-seltext_l = 'technology'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 10.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'CLIENTNAME'.
d_fieldcat_wa-seltext_l = 'Client Name'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 11.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
endif.
Grid display function module
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = gd_repid
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = 'EMPLOYEE DETAILS'
I_GRID_SETTINGS =
IS_LAYOUT = gd_layout
IT_FIELDCAT = d_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
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = itab_final
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.
set pf_status for creating client specified icons.
form set_pf_status using rt_extab type slis_t_extab.
set pf-status 'NEWSTATUS'.
endform.
populating data into header using top_of_page
form top_of_page.
wa_header-typ = 'H'.
wa_header-info = 'ALV REPORT'.
append wa_header to t_header.
clear wa_header.
wa_header-typ = 'S'.
wa_header-key = 'Date :'.
Concatenate sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) into wa_header-info.
append wa_header to t_header.
clear wa_header.
wa_header-typ = 'S'.
wa_header-key = 'Time :'.
Concatenate sy-Uzeit(2) '.'
sy-datum+2(2) '.'
sy-datum+4(2) into wa_header-info.
append wa_header to t_header.
clear wa_header.
describe table itab_final lines line.
wa_header-typ = 'A'.
linecount = line.
Concatenate 'Total number of records :' linecount into wa_header-info separated by space.
append wa_header to t_header.
clear wa_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = t_header
I_LOGO = 'VMCADMIN'
I_END_OF_LIST_GRID =
I_ALV_FORM =
endform.
*designing layout.
form gd_layout.
gd_layout-zebra = 'X'.
gd_layout-edit = 'X'.
gd_layout-no_hotspot = ''.
gd_layout-no_colhead = ''.
gd_layout-colwidth_optimize = 'X'.
endform.
Reward with points if helpful. -
Reg : export data from ALV to excel file
Hi All,
I am using REUSE_ALV_GRID_DISPLAY to display the output. I have total 73 columns getting displayed in output but when i export the data to the excel file using (ctrlshiftF9) I am getting only first 43 columns in the first row and from 44th column on wards the data is populated in the 1st column of second row.
Please let me know is there any particular setting by which I can get all the 73 columns in a single row.
Thanks in advance.
VIJAYHi vijay,
You can try setting your line width to 255 in your abap program.
Otherwise, you can try an alternative:
1. Put a customize button on the ALV toolbar.
2. Go to se41 to create th buttons
2. do i_callback_program in ALV function. or SET PF_STATUS
3. Then in sy-ucomm, use 'GUI_DOWNLOAD' to xls.
Hope this helps you.
Thanks
William Wilstroth
Edited by: william wilstroth on Dec 18, 2007 5:06 PM -
I have done coding for G/L interface . This report displays an ALV at the end after performnig validations on each record uploaded from a flat file. Once all records are checked , the ALV requires a PUSH BUTTON that when triggered will post the records.
My query is, how shud i add a push button in the ALV in the title bar.Hi,
You have to copy the standard pf status to a new one.
For this go to the ALV screen and take the menu System -> Status. (I do not access to the system now) then look for the standard pf status. Copy this to Z range and then add your new button.
Even you can do in this method
Create a GUI status.
Go to GUI Status->Application toolbar.
THen add the button by giving
Function text
Icon name
Icon text
Info. text
Fastpath
Then in PBO of the screen,
Just give in a module
set pf_status 'ZSTATUS'.
Here is an example for your question
TYPE-POOLS: slis.
DATA: i_qmel LIKE qmel OCCURS 0.
data v_repid type repid.
SELECT * FROM qmel INTO TABLE i_qmel.
v_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
i_structure_name = 'QMEL'
TABLES
t_outtab = i_qmel
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 set_pf_status using rt_extab type slis_t_extab.
set pf-status 'TEST'.
endform.
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
data lv_ucomm type sy-ucomm.
lv_ucomm
= sy-ucomm.
CASE lv_ucomm.
WHEN 'BUTTON'. "Double Click line Item
call transaction 'MM01'.
endcase.
endform.
To Click on the you have to do in the following way
i_callback_user_command = 'USER_COMMAND'
form user_command using i_ucomm like sy-ucomm
is_selfield type slis_selfield.
case i_ucomm.
when 'XXXX'. "XXXX is the function code for new button
endcase.
endform.
For More info please refer the below links
Please refer the following
https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/thread.jspa%3FthreadID%3D38170%26messageID%3D368851
http://www.sap-basis-abap.com/abap/add-button-to-alv-toolbar-with-reuse-alv-list-display.htm
Regards,
Chandru -
Regarding Reuse_alv_commentary_write
Hi all,
I am having this much of requirement in out put as Top-Of-page.
I did this thing like below given code in classical report.
Now I am dling this in ALV.
Is it possible to get like this out put in ALV.
If, possible meand send the code for below requirement.
ULINE.
New-line no-scrolling.
WRITE:/40 'PLANNER GROUP WISE TAT REPORT'.
uline.
New-line no-scrolling.
WRITE:/39 'FROM:', S_ERDAT-LOW,
58 'TO:' , S_ERDAT-HIGH.
ULINE.
New-line no-scrolling.
WRITE:/ 'UNIT:',p_iwerk.
uline.
case 'X'.
when p_ordno.
New-line no-scrolling.
write 45 'ALL ORDER NUMBERS.'.
WHEN P_PEND.
New-line no-scrolling.
WRITE 45 'CURRENT.'.
WHEN P_BFORD.
New-line no-scrolling.
WRITE 45 'BROUGHT FORWARD ORDERS.'.
WHEN P_COMPL.
New-line no-scrolling.
WRITE 45 'COMPLETED.'.
ENDCASE.
ULINE.
Regards,
sarathhi,
try this code,
*& Report ZPROGRAM
REPORT ZPROGRAM.
table declaration.
tables : zemployee, zdepartment,zproject.
*type-pools declaration
type-pools : slis , icon.
type specification
types : begin of ty_emp,
empid type zempid,
empname type zempname,
empaddress type zempaddress,
city type zcity,
ponumber type zponumber,
detid type zdeptid,
end of ty_emp.
types : begin of ty_dept,
detid type zdeptid,
deptname type zdeptname,
designation type zdesignation,
projectid type zprojectid,
end of ty_dept.
types : begin of ty_project,
projectid type zprojectid,
technology type ztechnology,
clientname type zclientname,
end of ty_project.
types : begin of ty_final,
empid type zempid,
empname type zempname,
empaddress type zempaddress,
city type zcity,
ponumber type zponumber,
detid type zdeptid,
deptname type zdeptname,
designation type zdesignation,
projectid type zprojectid,
technology type ztechnology,
clientname type zclientname,
average type p decimals 2,
end of ty_final.
table type specification.
types : tt_emp type standard table of ty_emp,
tt_dept type standard table of ty_dept,
tt_project type standard table of ty_project,
tt_final type standard table of ty_final.
work area creation.
data : wa_emp type ty_emp,
wa_dept type ty_dept,
wa_project type ty_project,
wa_final type ty_final.
internal table declaration
data : itab_emp type tt_emp,
itab_dept type tt_dept,
itab_project type tt_project,
itab_final type tt_final.
layout declaration
data : gd_layout type slis_layout_alv.
assigning current program name.
data : gd_repid like sy-repid.
gd_repid = sy-repid.
fieldcatalog declaration.
data : d_fieldcat type slis_t_fieldcat_alv,
d_fieldcat_wa type slis_fieldcat_alv.
header declaration.
data : t_header type slis_t_listheader,
wa_header type slis_listheader,
linecount(10) type c,
line(10) type c.
selection-screen.
selection-screen : begin of block blk1 with frame title text-001.
select-options : s_empid for zemployee-empid.
parameters : p_dname like zdepartment-deptname.
parameters : p_proid like zproject-projectid.
selection-screen : begin of line.
parameters : p_rad1 radiobutton group r1.
selection-screen comment 3(10) text-002.
parameters : p_rad2 radiobutton group r1.
selection-screen comment 16(10) text-003.
selection-screen : end of line.
parameters : chk1 as checkbox.
selection-screen : end of block blk1.
end of selection screen.
start of selection.
select empid empname empaddress city ponumber detid from zemployee into corresponding fields of table itab_emp where empid in s_empid.
if not itab_emp is initial.
select detid deptname designation projectid from zdepartment into corresponding fields of table itab_dept for all entries in itab_emp where detid = itab_emp-detid .
if not itab_dept is initial.
select projectid technology clientname from zproject into corresponding fields of table itab_project for all entries in itab_dept where projectid = itab_dept-projectid.
endif.
endif.
*end of selection.
populating data into itab_final from itab_emp.
loop at itab_emp into wa_emp.
wa_final-empid = wa_emp-empid.
wa_final-empname = wa_emp-empname.
wa_final-empaddress = wa_emp-empaddress.
wa_final-ponumber = wa_emp-ponumber.
wa_final-city = wa_emp-city.
wa_final-detid = wa_emp-detid.
append wa_final to itab_final.
clear wa_final.
endloop.
*populating data into itab_final from itab_dept and itab_project
loop at itab_final into wa_final.
read table itab_dept into wa_dept with key detid = wa_final-detid.
if sy-subrc = 0.
wa_final-deptname = wa_dept-deptname.
wa_final-designation = wa_dept-designation.
wa_final-projectid = wa_dept-projectid.
modify itab_final from wa_final transporting deptname designation projectid .
endif.
read table itab_project into wa_project with key projectid = wa_final-projectid.
if sy-subrc = 0.
wa_final-technology = wa_project-technology.
wa_final-clientname = wa_project-clientname.
modify itab_final from wa_final transporting technology clientname.
endif.
endloop.
if p_rad1 = 'X' or chk1 = 'X'.
d_fieldcat_wa-fieldname = 'EMPID'.
d_fieldcat_wa-seltext_l = 'Employee Id'.
d_fieldcat_wa-emphasize = 'X'.
d_fieldcat_wa-col_pos = 1.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'EMPNAME'.
d_fieldcat_wa-seltext_l = 'Employee Name'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 2.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'EMPADDRESS'.
d_fieldcat_wa-seltext_l = 'Employee Address'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 3.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'CITY'.
d_fieldcat_wa-seltext_l = 'City'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 4.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'PONUMBER'.
d_fieldcat_wa-seltext_l = 'Postal Number'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 5.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'DETID'.
d_fieldcat_wa-seltext_l = 'Department Id'.
d_fieldcat_wa-emphasize = 'X'.
d_fieldcat_wa-col_pos = 6.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'DEPTNAME'.
d_fieldcat_wa-seltext_l = 'Department Name'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 7.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'DESIGNATION'.
d_fieldcat_wa-seltext_l = 'Designation'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 8.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'PROJECTID'.
d_fieldcat_wa-seltext_l = 'Project Id'.
d_fieldcat_wa-emphasize = 'X'.
d_fieldcat_wa-col_pos = 9.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'TECHNOLOGY'.
d_fieldcat_wa-seltext_l = 'technology'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 10.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'CLIENTNAME'.
d_fieldcat_wa-seltext_l = 'Client Name'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 11.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
endif.
if p_rad2 = 'X' or chk1 = 'X'.
refresh itab_emp.
d_fieldcat_wa-fieldname = 'DETID'.
d_fieldcat_wa-seltext_l = 'Department Id'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 6.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'DEPTNAME'.
d_fieldcat_wa-seltext_l = 'Department Name'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 7.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'DESIGNATION'.
d_fieldcat_wa-seltext_l = 'Designation'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 8.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'PROJECTID'.
d_fieldcat_wa-seltext_l = 'Project Id'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 9.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'TECHNOLOGY'.
d_fieldcat_wa-seltext_l = 'technology'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 10.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
d_fieldcat_wa-fieldname = 'CLIENTNAME'.
d_fieldcat_wa-seltext_l = 'Client Name'.
d_fieldcat_wa-emphasize = 'C710'.
d_fieldcat_wa-col_pos = 11.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
endif.
Grid display function module
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = gd_repid
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = 'EMPLOYEE DETAILS'
I_GRID_SETTINGS =
IS_LAYOUT = gd_layout
IT_FIELDCAT = d_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
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = itab_final
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.
set pf_status for creating client specified icons.
form set_pf_status using rt_extab type slis_t_extab.
set pf-status 'NEWSTATUS'.
endform.
populating data into header using top_of_page
form top_of_page.
wa_header-typ = 'H'.
wa_header-info = 'ALV REPORT'.
append wa_header to t_header.
clear wa_header.
wa_header-typ = 'S'.
wa_header-key = 'Date :'.
Concatenate sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) into wa_header-info.
append wa_header to t_header.
clear wa_header.
wa_header-typ = 'S'.
wa_header-key = 'Time :'.
Concatenate sy-Uzeit(2) '.'
sy-datum+2(2) '.'
sy-datum+4(2) into wa_header-info.
append wa_header to t_header.
clear wa_header.
describe table itab_final lines line.
wa_header-typ = 'A'.
linecount = line.
Concatenate 'Total number of records :' linecount into wa_header-info separated by space.
append wa_header to t_header.
clear wa_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = t_header
I_LOGO = 'VMCADMIN'
I_END_OF_LIST_GRID =
I_ALV_FORM =
endform.
*designing layout.
form gd_layout.
gd_layout-zebra = 'X'.
gd_layout-edit = 'X'.
gd_layout-no_hotspot = ''.
gd_layout-no_colhead = ''.
gd_layout-colwidth_optimize = 'X'.
endform.
REward if useful. -
ALV List Display With a Pushbutton in the basic list
i have displayed the po details in teh basic list. I have used the double clicking functionality. It worked well. Now instead of double clicking, i will place the cursor on the po and click a push button. then it should show the other details.
Can anyone please guide me how to create the pushbuttons on the basic list ?Hi,
You create your own GUI status.Pass the name of GUI status to FM REUSE_ALV_GRID_DISPLAY.
e.g.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
CALLBACKPF_STATUS_SET = 'PF'
i_callback_user_command = 'USER_COMMAND'
i_grid_title = text-020
is_layout = wa_layout
it_fieldcat = it_fieldcat[]
TABLES
t_outtab = it_basic
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 PF.
SET PF_STATUS 'P1'.
ENDFORM.
On pressing that button go to secondary list. -
How to disable buttons in Search help screen ?
Hi All,
How do we disable Print button in customer search help ?
We want that nobody should be able to take a printout of Customers from Search help result. Hence we want to disable the print button which comes in Search help.
Any idea how do we go about it ?
Regards,
AshishHi there,
you should be able to do that with the search help exit. Try replacing the PF-STATUS for instance. I am not sure if this works though!
For instance:
IF call_control-step = 'PRESEL'.
SET PF_STATUS 'ZZ' OF PROGRAM 'ZZZ'
ENDIF.
Or you might call the existing PF-STATUS and use EXCLUDING.
Roy
Maybe you are looking for
-
Config certificate and log issues
I config certificate and use it to connect ipsec vpn , I just config jinan-neusoft(config)#ip domain-name neusoft.com jinan-neusoft(config)#crypto key generate rsa general-keys The name for the keys will be: jinan-neusoft.neusoft.com Choose the s
-
I have a a CP1525nw color laserjet. I had to replace my router. How do I tell the printer the new router's name and pass phrase?
-
Apper not working after recent update
Hi everyone, with today's update of pacman, apper stopped working, any solution to get it back and running? I get this in the terminal: QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave. QDBusConnect
-
Set inside a Set and powerset problem. Need help.
I've done other posts about this but I figured I'd start a new thread since I changed it so much. I understand the idea of power sets but not how it needs to be a Set inside a set and also how to get this thing to run. If anyone could show me a power
-
HT1925 Why can I not uninstall "apple mobile device support" from my computer?
I am unable to uninstall "apple mobile device support program" from my computer. The uninstall is necessary because an error message MSVC80.dll pops up.