Liine-size in ALV
Hi,
I want display more than 255 line-size in ALV Report in the Background job..
Can we do that??
Pls reply.....
Regards,
Rushikesh
It has already been discussed here just a few days ago and the answer was "no, we can not do that". Please use search if you need more details.
Sorry!
Similar Messages
-
He friends,
While I am printing report from alv it is printing in small font size , Please advise how to increase font size in alv printing .
Regards
S.SharmaHi,
http://help.sap.com/saphelp_nw04/helpdata/en/b6/e3eb40c4f8712ae10000000a155106/frameset.htm
For Fontsize also you have option in the ADD_TEXT method.
For Details check this program DD_STYLE_TABLE
Edited by: Neenu Jose on Oct 24, 2008 10:37 AM
Edited by: Neenu Jose on Oct 24, 2008 10:38 AM -
Bold chars & increase font size in ALV Top of Page - OOPS
Hi,
I am using ALV OOPs to display my data.
I am splitting the container and using top container to display headings in following way:
data: top TYPE REF TO cl_dd_document
CREATE OBJECT top
EXPORTING
style = 'ALV_GRID'.
lv_fontsize = cl_dd_document=>large.
lv_text = 'HEADING'.
CONDENSE lv_text.
CALL METHOD top->add_text
EXPORTING
text = lv_text
fix_lines = 'X'
sap_fontsize = lv_fontsize "cl_dd_document=>large
CHANGING
document = cv_top.
But the heaidng is not displayed with high font size and is similar to the text with cl_dd_document=>medium
How can I increase font size of heading.
Thanks!Hi Vasu,
Use SAP_STYLE parameter in the method.
Value will be HEADING or KEY.
Regards,
Amitava -
How to increase the column size of Alv tbale
Hi All,
I created an Alv table to display the content of my database table. In one of the column the entire data from my database are not displayed the last few characters are missing. The data type for that column in the database is char. Can any one help me how to increase the column size in my Alv table or any suggestions to resolve this issue.Hi Vadiv,
Try with this..
DATA: LR_IF_CONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE,
LR_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE,
LR_CMDL TYPE REF TO CL_SALV_WD_CONFIG_TABLE,
LR_TABLE_SETTING TYPE REF TO IF_SALV_WD_TABLE_SETTINGS.
LR_CMP_USAGE = WD_THIS->WD_CPUSE_ALV( ).
IF LR_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
LR_CMP_USAGE->CREATE_COMPONENT( ).
ENDIF.
" get reference to the ALV model
LR_IF_CONTROLLER = WD_THIS->WD_CPIFC_ALV( ).
LR_CMDL = LR_IF_CONTROLLER->GET_MODEL( ).
LR_TABLE_SETTING ?= LR_CMDL.
" Set column width
DATA LR_COL TYPE REF TO CL_SALV_WD_COLUMN.
LR_COL = LR_CMDL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'PERNR' ).
LR_COL->SET_WIDTH( '70' ) .
LR_COL = LR_CMDL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'ENAME' ).
LR_COL->SET_WIDTH( '100' ) .
LR_TABLE_SETTING->SET_FIXED_TABLE_LAYOUT( ABAP_TRUE ).
You can refer to webdynpro component SALV_WD_TEST_TABLE_PROPS. Go to the view TABLE and look inside the method SET_COLUMN_SETTINGS. I hope this will help you.
Cheers,
Kris. -
Hai,
How can i change the font size of top-of-list and end-of-list in ALV.hi,
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-CPROG
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = 'HTML_TOP_OF_PAGE'.
*& Form HTML_TOP_OF_PAGE
text
FORM HTML_TOP_OF_PAGE USING TOP TYPE REF TO CL_DD_DOCUMENT.
CALL METHOD TOP->ADD_TEXT
EXPORTING TEXT = V_COMPANYNAME
SAP_STYLE = 'HEADING'.
CALL METHOD TOP->NEW_LINE.
CASE 'X'.
WHEN P_DIVISN.
CALL METHOD TOP->ADD_TEXT
EXPORTING TEXT = 'Report Name : Contract Details Report Division Wise.'
SAP_STYLE = ''.
WHEN P_UNIT.
CALL METHOD TOP->ADD_TEXT
EXPORTING
TEXT = 'Report Name : Contract Details Report Unit Wise.'.
SAP_FONTSIZE = '10'
*SAP_FONTSTYLE
*SAP_EMPHASIS
ENDCASE.
CALL METHOD TOP->NEW_LINE.
CALL METHOD TOP->ADD_TEXT
EXPORTING TEXT = 'Report Criteria :'.
SAP_STYLE = ''.
CALL METHOD TOP->NEW_LINE.
WRITE SY-DATUM TO V_DATE.
CONCATENATE 'Report Run On -' V_DATE INTO V_STRING SEPARATED BY SPACE.
CALL METHOD TOP->ADD_TEXT
EXPORTING TEXT = V_STRING.
SAP_STYLE = ''.
SELECT SINGLE NAME_TEXTC FROM USER_ADDR INTO V_USER
WHERE BNAME = SY-UNAME.
CALL METHOD TOP->NEW_LINE.
CONCATENATE 'Report Run By -' V_USER INTO V_STRING SEPARATED BY SPACE.
CALL METHOD TOP->ADD_TEXT
EXPORTING TEXT = V_STRING.
SAP_STYLE = ''.
WRITE : S_PERIOD-LOW TO V_DATE,
S_PERIOD-HIGH TO V_DATE1.
CONCATENATE 'Report Period : From ' V_DATE 'To' V_DATE1 INTO V_STRING
SEPARATED BY SPACE
CALL METHOD TOP->NEW_LINE.
CALL METHOD TOP->ADD_TEXT
EXPORTING TEXT = V_STRING.
SAP_STYLE = ''.
CALL METHOD TOP->NEW_LINE.
IF P_DIVISN = 'X'.
CALL METHOD TOP->ADD_TEXT
EXPORTING TEXT = 'DIVISION :'.
SAP_STYLE = ''.
ELSEIF P_UNIT = 'X'.
CALL METHOD TOP->ADD_TEXT
EXPORTING TEXT = 'UNIT :'.
SAP_STYLE = ''.
ENDIF.
LOOP AT R_TABLE.
MOVE R_TABLE-LOW TO V_VAR.
CALL METHOD TOP->NEW_LINE.
CALL METHOD TOP->ADD_GAP
EXPORTING WIDTH = '20'.
CALL METHOD TOP->ADD_TEXT
EXPORTING TEXT = V_VAR.
SAP_STYLE = ''.
ENDLOOP.
CALL METHOD TOP->NEW_LINE.
ENDFORM. -
Can we change font size in ALV output?
Hi,
I would like to know if can change the font size of the output in ALV reports.
We did suggest the client to download into excel & change it but they would like to see the fontsize as 10 in ALV output itself. This allows them to fit more columns in a screen.
I appreciate your response.
Thanks,
RituHi Ritu,
In structure of type LVC_S_LAYO, there is a field called SMALLTITLE..
If this field is set, the title size in the grid control is set to the font size of the column header.
This s the only way i know you can have a control on the font size..
FORM prepare_layout CHANGING ps_layout TYPE lvc_s_layo.
ps_layout-zebra = 'X' .
ps_layout-grid_title = 'Flights' .
ps_layout-smalltitle = 'X' .
ENDFORM. " prepare_layout
hope this helps you..
regards
satesh -
Controlling Font size in alv grid using oops
Hi Experts,
I have a requirement where i want to change the font size of the grid title bar.
Is there any way of acheiving this.
I do see a method set_title size in the class cl_gui_alv_grid. However it is a protected method and i am not able implement it in my program.
Any pointers on this would be higly appreciated.
Thanks and Regards,
Jey sabith EbronHi
I tried and it worked with me.
The grid title was indeed changed from the the method Set_Title_Size.
To use the method you have to Create a Local Class Inheriting the Class CL_GUI_ALV_GRID.
CLASS ZCL_GUI_ALV_GRID DEFINITION INHERITING FROM CL_GUI_ALV_GRID.
PUBLIC SECTION.
METHODS TITLE_SIZE.
PRIVATE SECTION.
ENDCLASS. "ZCL_GUI_ALV_GRID DEFINITION
Then use the above method in the Implementation part as .
CLASS ZCL_GUI_ALV_GRID IMPLEMENTATION.
METHOD TITLE_size.
ME->SET_TITLE_SIZE( EXPORTING SIZE = 1
EXCEPTIONS ERROR = 1 ).
ENDMETHOD.
ENDCLASS.
Now when your reference variable should be
Data :GRID type ref to ZCL_GUI_ALV_GRID.
and Create the Object as
CREATE OBJECT GRID
EXPORTING I_PARENT = G_CUSTOM_CONTAINER1.
Before Calling Set_table_for_ first_display, Call the created method
CALL METHOD GRID->TITLE_SIZE. -
Hi,
How to change column size of ALV report during run time
Regards,Hi,
I think, you need to increase or decrease the width of the column.
It cannot be changed dynamically .....
but what we can do is
In your itab, check all the records for that field's length
take the highest size and pass it to the fieldcat.
and see the results.
So, if less width is there then the width of the column is less and if is very wide then the column will be wide
Regards,
Venkatesh -
Need to increase font size of header in ALV
Hi,
I have a requirement to increase the font-size of header in the output ALV report. Also, i need to remove some of the standard icons from the output ALV using IT_EXCLUDING ?...Could any of you help me with this ?Hi friend,
first, to increase font size of ALV header you can build a header manually as below:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
* EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
* I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET '
I_CALLBACK_USER_COMMAND = 'HTML_TOP_OF_PAGE'
* 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 =
* 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 =
* 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.
in your code, write 2 subroutines name: HTML_TOP_OF_PAGE and PF_STATUS_SET
FORM html_top_of_page USING r_top TYPE REF TO cl_dd_document.
DATA: text TYPE sdydo_text_element.
DATA: s_table TYPE REF TO cl_dd_table_element.
DATA: col_key TYPE REF TO cl_dd_area.
DATA: col_info TYPE REF TO cl_dd_area.
** split TOP-Document
CALL METHOD r_top->vertical_split
EXPORTING
split_area = r_top
split_width = '50%'.
* IMPORTING
* right_area = a_logo.
** fill TOP-Document
text = 'Example of a Heading'(201).
CALL METHOD r_top->add_text
EXPORTING
text = text
sap_style = 'HEADING'.
CALL METHOD r_top->new_line.
CALL METHOD r_top->new_line.
CALL METHOD r_top->new_line.
CALL METHOD r_top->new_line.
CALL METHOD r_top->add_table
EXPORTING
no_of_columns = 2
with_heading = ' '
border = '0'
IMPORTING
table = s_table.
CALL METHOD s_table->add_column
IMPORTING
column = col_key.
CALL METHOD s_table->add_column
IMPORTING
column = col_info.
text = 'A key value marked'(202).
CALL METHOD col_key->add_text
EXPORTING
text = text
sap_emphasis = 'Strong'.
CALL METHOD col_info->add_gap
EXPORTING
width = 6.
text = '600' .
CALL METHOD col_info->add_text
EXPORTING
text = text
sap_style = 'Key'.
CALL METHOD col_info->add_gap
EXPORTING
width = 3.
text = 'Test'.
CALL METHOD col_info->add_text
EXPORTING
sap_fontsize = cl_dd_area=>large "set font size
text = text.
endform.
*& Form pf_status_set
* Set pf status for alv list
* -->PT_EXTAB tab for excluding fcode
FORM pf_status_set USING pt_extab TYPE slis_t_extab.
DATA:
ls_extab TYPE slis_extab.
*-sort up
ls_extab-fcode = '&OUP'.
APPEND ls_extab TO pt_extab.
*-- sort down
ls_extab-fcode = '&ODN'.
APPEND ls_extab TO pt_extab.
SET PF-STATUS 'STANDARD' EXCLUDING pt_extab. "change standard as your status
ENDFORM. "pf_status_set
You can refer the set font size in report DD_STYLE_TABLE.
regards, -
How can we alv header font size increase
hi experts,
how can we increase the font size in alv report?
i am using html_top_of_page
regards
gunaMake use of the class - CL_DD_DOCUMENT
Code below may give you some help.
FORM HTML_TOP_OF_PAGE USING R_TOP TYPE REF TO CL_DD_DOCUMENT.
text = 'Test' .
CALL METHOD R_TOP->ADD_TEXT
EXPORTING
TEXT = TEXT
SAP_STYLE = 'HEADING'.
endform.
Thanks! -
ALV Lay out Font size to be increased by 1
Hi all
pls help me out .
how to increase the font size in ALV Layout after displaying.<b></b>
i hope there should be a solution...Hi Suma123 devi,
I am sorry to report that this is impossible. You cannot increase the font size in ALV layout.
Sorry,
Chester -
Hi all
Please help me to solve this problem.I want to display the size of the coloumn heading eqaul to the data element size in alv.I am using below code at this moment.Explain to me step by step to solve this problem.
layout-box_tabname = 'ALV_FIELDS'.
eventcat_ln-name = 'TOP_OF_PAGE'.
eventcat_ln-form = 'TOP_OF_PAGE'.
append eventcat_ln to eventcat.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-cprog
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND '
i_structure_name = 'FIELDCAT'
is_layout = layout
it_fieldcat = fieldcat
i_default = 'A'
i_save = 'A'
is_variant = dvariant
it_events = eventcat
tables
t_outtab = alv_fields
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.
Thanx in advance.
Regards,
Giri.while appending header fields to ALV, there is a field (length) wherein U can specify the length and it will be displayed accordingly. So, u can set the data element size to this field and use it.
-
ALV size should be adjustable to screen resolution automatically
Hi,
Is there in any way that the size of ALV grid should be adjustable to screen resolution automatically?
Thanks & Regards,
ReenaHello Reena
If your ALV list is the only element on your dynpro then you should not use a custom container on the dynpro. Instead use the following approach:
*& Report ZUS_SDN_ALVLIST_FULLSCREEN
REPORT zus_sdn_alvlist_fullscreen.
DATA:
gt_kna1 TYPE STANDARD TABLE OF kna1.
DATA:
go_docking TYPE REF TO cl_gui_docking_container,
go_alvgrid TYPE REF TO cl_gui_alv_grid.
START-OF-SELECTION.
* Select some data
SELECT * FROM kna1 INTO TABLE gt_kna1.
* Create docking container and dock at left side
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
* REPID =
* DYNNR =
side =
cl_gui_docking_container=>dock_at_left
* EXTENSION = 50
* STYLE =
* LIFETIME = lifetime_default
* CAPTION =
* METRIC = 0
ratio = 90 " 90% of screen
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.
* Set very high extension -> not overruled by screen resizing
CALL METHOD go_docking->set_extension
EXPORTING
extension = 99999
EXCEPTIONS
CNTL_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.
* Create ALV grid
CREATE OBJECT go_alvgrid
EXPORTING
i_parent = go_docking
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.
CALL METHOD go_alvgrid->set_table_for_first_display
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
i_structure_name = 'KNA1'
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
* IS_LAYOUT =
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
* IR_SALV_ADAPTER =
CHANGING
it_outtab = gt_kna1
* IT_FIELDCATALOG =
* 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.
* Empty dynpro without any elements
CALL SCREEN '0100'.
* NOTE: dynpro flow logic contains only the two modules shown below
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
* Link to current dynpro
CALL METHOD go_docking->link
EXPORTING
repid = syst-cprog
dynnr = syst-dynnr
* CONTAINER =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
lifetime_dynpro_dynpro_link = 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.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
SET SCREEN 0. LEAVE SCREEN.
ENDMODULE. " USER_COMMAND_0100 INPUT
Regards
Uwe -
ALV Subtotals calculation - Urgent
Hi All,
How can I caliculate subtotals in ALV ?
How to increase column size in alv?
RegardsHi,
Refer this code
*& Form sub_display_data
text
FORM sub_display_data .
*--To sort the output through material number
DATA : lwa_sort TYPE slis_sortinfo_alv.
DATA : lit_sort TYPE slis_t_sortinfo_alv.
*--Pass the values to the table
lwa_sort-fieldname = 'PERNR'. "Field name in o/p inttable
lwa_sort-tabname = 'it_final2'. "Output Internal table
lwa_sort-spos = '1'. "Sort sequence
lwa_sort-up = 'X'. "Sort in ascending order
lwa_sort-down = ' '. "Sort in descending order
lwa_sort-subtot = 'X'. "Subtotal
APPEND lwa_sort TO lit_sort.
*--Pass the values to the table
lwa_sort-fieldname = 'WORKDATE'. "Field name in o/p inttable
lwa_sort-tabname = 'it_final2'. "Output Internal table
lwa_sort-spos = '2'. "Sort sequence
lwa_sort-up = 'X'. "Sort in ascending order
lwa_sort-down = ' '. "Sort in descending order
lwa_sort-subtot = ' '. "Subtotal
APPEND lwa_sort TO lit_sort.
*--Pass the values to the table
lwa_sort-fieldname = 'WEKLY'. "Field name in o/p inttable
lwa_sort-tabname = 'it_final2'. "Output Internal table
lwa_sort-spos = '3'. "Sort sequence
lwa_sort-up = 'X'. "Sort in ascending order
lwa_sort-down = ' '. "Sort in descending order
lwa_sort-subtot = ' '. "Subtotal
APPEND lwa_sort TO lit_sort.
wa_layout-colwidth_optimize = 'X'. to increase collumn length
IF NOT it_final2[] IS INITIAL.
*--Call the function module to display the ALV report
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = wa_layout
i_callback_program = v_repid
it_fieldcat = it_fieldcat1[]
i_default = c_chk
i_save = c_save
it_sort = lit_sort
TABLES
t_outtab = it_final2
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.
ELSE.
*--Message No data found
MESSAGE i888 WITH text-017.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. " sub_display_data
Regards,
Prashant -
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
Maybe you are looking for
-
Self join to get related records in one row
I have a table that has individual records for each family member. tPerson.LastName, tPerson.FirstName, tPerson.RelationshipCode, tPerson.FamilyUnitCode, tPerson.JobCode Smith, John,HD, 1234, AD Smith, Jill, SP, 1234, TC Olson, Fred, HD, 2345, AV Ols
-
How to publish changes when using a personal domain
Hi, I am about to publish my first website using MobileMe but with a personal domain. I have learned how to publish the site for the first time using File>Set up personal domain but what do I use when I want to publish any changes ? Do I use the File
-
IPhoto-creating albums and sub-albums
is it possible to create an album with sub albums? For example, i travel to Italy and would like an album of italy but would like to organize specific tours into sub-albums.
-
Inserting processes in a JHeadstart application
Hi! I'm making an application using Oracle 9i JHeadstart and a connection with Acme1. I want to insert a delete confirmation page so that the application can display to the user a row delete confirmation. I made a new process ("ConfirmationPage") tha
-
I have iPhoto with all of my photos on it on Mac 1 in my house. Is it possible for Mac 2 and Mac 3 to share the same photos? I would like to view the photos on Mac 2 from Mac 1 without having to re-setup face/places/events etc all over again.