Steps:
- Go to transaction code SE38.
- Enter the program name Z or Y<program name>.
TABLES : VBRK.
DATA: IT_VBRK TYPE TABLE OF VBRK.
DATA : IT_VBRP TYPE TABLE OF VBRP.
DATA : IT_LIST TYPE SLIS_T_LISTHEADER,
WA_LIST LIKE LINE OF IT_LIST.
SELECT-OPTIONS : S_VBELN FOR VBRK-VBELN.
START-OF-SELECTION.
PERFORM FETCH_DATA USING S_VBELN[] CHANGING IT_VBRK.
PERFORM DISPLAY TABLES IT_VBRK.
*&---------------------------------------------------------------------*
*& Form FETCH_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_S_VBELN[] text
* <--P_IT_VBRK text
*----------------------------------------------------------------------*
form FETCH_DATA using p_s_vbeln LIKE S_VBELN[]
changing p_it_vbrk LIKE IT_VBRK.
SELECT * FROM VBRK INTO TABLE P_IT_VBRK WHERE VBELN IN p_s_vbeln .
endform. " FETCH_DATA
*&---------------------------------------------------------------------*
*& Form DISPLAY
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_IT_VBRK text
*----------------------------------------------------------------------*
form DISPLAY tables p_it_vbrk LIKE IT_VBRK.
"Insert correct name for <...>.
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 = ' '
I_CALLBACK_USER_COMMAND = 'INT1'
I_CALLBACK_TOP_OF_PAGE = 'TOP_PAGE'
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME = 'VBRK'
* 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 = p_it_vbrk
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
if sy-subrc <> 0.
* Implement suitable error handling here
endif.
endform. " DISPLAY
FORM TOP_PAGE .
WA_LIST-typ = 'H'.
WA_LIST-info = 'SALES ORDER REPORT'.
APPEND WA_LIST TO IT_LIST.
CLEAR WA_LIST.
WA_LIST-typ = 'S'.
CONCATENATE SY-DATUM+6(2) ':' SY-DATUM+4(2) ':' SY-DATUM(4)
INTO WA_LIST-info.
APPEND WA_LIST TO IT_LIST.
CLEAR WA_LIST.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = IT_LIST
I_LOGO = 'MYLOGO'
* I_END_OF_LIST_GRID =
* I_ALV_FORM =
.
CLEAR IT_LIST.
ENDFORM.
FORM INT1 USING RCOM TYPE SY-UCOMM
SEL TYPE SLIS_SELFIELD.
DATA : NUM(10) TYPE N.
NUM = SEL-VALUE.
SELECT * FROM VBRP INTO TABLE IT_VBRP WHERE VBELN = NUM .
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 = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME = 'VBRP'
* 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 = IT_VBRP
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
if sy-subrc <> 0.
* Implement suitable error handling here
endif.
ENDFORM.
DATA: IT_VBRK TYPE TABLE OF VBRK.
DATA : IT_VBRP TYPE TABLE OF VBRP.
DATA : IT_LIST TYPE SLIS_T_LISTHEADER,
WA_LIST LIKE LINE OF IT_LIST.
SELECT-OPTIONS : S_VBELN FOR VBRK-VBELN.
START-OF-SELECTION.
PERFORM FETCH_DATA USING S_VBELN[] CHANGING IT_VBRK.
PERFORM DISPLAY TABLES IT_VBRK.
*&---------------------------------------------------------------------*
*& Form FETCH_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_S_VBELN[] text
* <--P_IT_VBRK text
*----------------------------------------------------------------------*
form FETCH_DATA using p_s_vbeln LIKE S_VBELN[]
changing p_it_vbrk LIKE IT_VBRK.
SELECT * FROM VBRK INTO TABLE P_IT_VBRK WHERE VBELN IN p_s_vbeln .
endform. " FETCH_DATA
*&---------------------------------------------------------------------*
*& Form DISPLAY
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_IT_VBRK text
*----------------------------------------------------------------------*
form DISPLAY tables p_it_vbrk LIKE IT_VBRK.
"Insert correct name for <...>.
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 = ' '
I_CALLBACK_USER_COMMAND = 'INT1'
I_CALLBACK_TOP_OF_PAGE = 'TOP_PAGE'
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME = 'VBRK'
* 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 = p_it_vbrk
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
if sy-subrc <> 0.
* Implement suitable error handling here
endif.
FORM TOP_PAGE .
WA_LIST-typ = 'H'.
WA_LIST-info = 'SALES ORDER REPORT'.
APPEND WA_LIST TO IT_LIST.
CLEAR WA_LIST.
WA_LIST-typ = 'S'.
CONCATENATE SY-DATUM+6(2) ':' SY-DATUM+4(2) ':' SY-DATUM(4)
INTO WA_LIST-info.
APPEND WA_LIST TO IT_LIST.
CLEAR WA_LIST.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = IT_LIST
I_LOGO = 'MYLOGO'
* I_END_OF_LIST_GRID =
* I_ALV_FORM =
.
CLEAR IT_LIST.
ENDFORM.
FORM INT1 USING RCOM TYPE SY-UCOMM
SEL TYPE SLIS_SELFIELD.
DATA : NUM(10) TYPE N.
NUM = SEL-VALUE.
SELECT * FROM VBRP INTO TABLE IT_VBRP WHERE VBELN = NUM .
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 = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME = 'VBRP'
* 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 = IT_VBRP
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
if sy-subrc <> 0.
* Implement suitable error handling here
endif.
- Save -> Check -> Activate->Execute.
Input
Output
- Double Click any line , interactive report will appear( Displaying Sales order items based on sales order number).
No comments:
Post a Comment