ZSD Compartive Repot Ganesh
ZSD Compartive Repot Ganesh
ZSD Compartive Repot Ganesh
"Material Number
"Short text for sales order item
"Date on Which Record Was Created
"Net value of the order item in docume
"Material Number
"Short text for sales order item
"
"
"
"
"
date
ly_cur_m_ldate type sy-datum,
ate
cur_m_name type string,
last_m_name type string,
ly_cur_m_name type string,
ame
FORM SUB_POP .
data: lw_vbap type ty_vbap.
sort t_vbap1 by matnr erdat.
loop at t_vbap1 into w_vbap.
w_final-matnr = w_vbap-matnr.
w_final-arktx = w_vbap-arktx.
lw_vbap = w_vbap.
at new erdat.
w_vbap = lw_vbap.
if ( w_vbap-erdat >= cur_m_fdate and w_vbap-erdat <= cur_m_ldate ).
w_final-cur_mon = w_vbap-netwr.
elseif ( w_vbap-erdat >= ly_cur_m_fdate and w_vbap-erdat <= ly_cur_m_ldate
).
w_final-ly_cur_mon = w_vbap-netwr.
else.
w_final-last_mon = w_vbap-netwr.
endif.
endat.
at end of matnr.
append w_final to t_final.
clear : w_final,
w_vbap.
endat.
endloop.
ENDFORM.
" SUB_POP
*&---------------------------------------------------------------------*
*&
Form SUB_DISPLAY
*&---------------------------------------------------------------------*
*
This is to display the final internal table
*----------------------------------------------------------------------*
FORM SUB_DISPLAY .
perform sub_fieldcat using : '1'
'2'
'3'
'4'
'5'
perform sub_layout.
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
= ' '
* I_CALLBACK_USER_COMMAND
= ' '
*
*
*
*
*
*
*
I_CALLBACK_TOP_OF_PAGE
= ' '
I_CALLBACK_HTML_TOP_OF_PAGE
= ' '
I_CALLBACK_HTML_END_OF_LIST
= ' '
I_STRUCTURE_NAME
=
I_BACKGROUND_ID
= ' '
I_GRID_TITLE
=
I_GRID_SETTINGS
=
IS_LAYOUT
= w_layout
IT_FIELDCAT
= t_fcat
* 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
= t_final
* EXCEPTIONS
* PROGRAM_ERROR
= 1
* OTHERS
= 2
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
ENDFORM.
" SUB_DISPLAY
*&---------------------------------------------------------------------*
*&
Form SUB_FIELDCAT
*&---------------------------------------------------------------------*
*
This is to fill the fieldcat
*----------------------------------------------------------------------*
FORM SUB_FIELDCAT USING
w_fcat-col_pos =
w_fcat-fieldname
w_fcat-seltext_m
append w_fcat to
col.
= fname.
= seltxt.
t_fcat.
clear w_fcat.
ENDFORM.
" SUB_FIELDCAT
*&---------------------------------------------------------------------*
*&
Form SUB_LAYOUT
*&---------------------------------------------------------------------*
*
This is to fill layout
*----------------------------------------------------------------------*
FORM SUB_LAYOUT .
w_layout-colwidth_optimize = 'X'.
ENDFORM.
" SUB_LAYOUT