Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

page splitting

Former Member
0 Likes
594

is it possible to split interactive report output page into two halfs?

as my requirement is to display some data on first half and based on click on that data i want to display alv list on second half keeping the upper data constant.please suggest.

Thanks,

Rahul

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
556

You can do so with an object ALV grid with two containers. See example below.

REPORT z1267 NO STANDARD PAGE HEADING

MESSAGE-ID zz

LINE-SIZE 132

LINE-COUNT 65.

*&----


*& Program Includes

*&----


INCLUDE z1267top.

INCLUDE z_gen_top.

INCLUDE z_gen_f01.

----


  • CLASS lcl_event_handler DEFINITION

----


*

----


CLASS lcl_event_handler DEFINITION.

PUBLIC SECTION.

CLASS-METHODS:

hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid

IMPORTING e_row_id e_column_id es_row_no,

user_command FOR EVENT user_command OF cl_gui_alv_grid

IMPORTING sender e_ucomm,

toolbar FOR EVENT toolbar OF cl_gui_alv_grid

IMPORTING e_object e_interactive.

ENDCLASS. "lcl_event_handler DEFINITION

----


  • CLASS lcl_event_handler IMPLEMENTATION

----


*

----


CLASS lcl_event_handler IMPLEMENTATION.

METHOD hotspot_click.

PERFORM process_hotspot USING e_row_id e_column_id es_row_no.

ENDMETHOD. "hotspot_click

METHOD user_command.

CASE e_ucomm.

WHEN 'BPCS'.

PERFORM move_bpcs.

WHEN 'SAP'.

PERFORM move_sap.

ENDCASE.

ENDMETHOD. "user_command

METHOD toolbar.

DATA: ls_toolbar TYPE stb_button.

CLEAR ls_toolbar.

MOVE 3 TO ls_toolbar-butn_type.

APPEND ls_toolbar TO e_object->mt_toolbar.

CLEAR ls_toolbar.

MOVE 'BPCS' TO ls_toolbar-function.

MOVE icon_move TO ls_toolbar-icon.

MOVE 'Move to BPCS' TO ls_toolbar-quickinfo.

ls_toolbar-text = 'BPCS'.

APPEND ls_toolbar TO e_object->mt_toolbar.

CLEAR ls_toolbar.

MOVE 'SAP' TO ls_toolbar-function.

MOVE icon_move TO ls_toolbar-icon.

MOVE 'Move to SAP' TO ls_toolbar-quickinfo.

ls_toolbar-text = 'SAP'.

APPEND ls_toolbar TO e_object->mt_toolbar.

ENDMETHOD. "toolbar

ENDCLASS. "lcl_event_handler IMPLEMENTATION

*&----


*& Event INITIALIZATION

*&----


INITIALIZATION.

CONCATENATE '/sapmnt/' sy-sysid+0(3) '/global/edi/in/' INTO g_dirn.

g_file = 'node*'.

*&----


*& Event START-OF-SELECTION

*&----


START-OF-SELECTION.

PERFORM build_input_table.

DESCRIBE TABLE t_id LINES g_rows.

IF g_rows = 0.

WRITE: / 'No items found'.

EXIT.

ENDIF.

*&----


*& Event END-OF-SELECTION

*&----


END-OF-SELECTION.

PERFORM build_report_table.

DESCRIBE TABLE t_rpt1 LINES g_rows.

IF g_rows <> 0.

CALL SCREEN '100'.

ELSE.

WRITE: / 'No items found'.

ENDIF.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE status_0100 OUTPUT.

SET PF-STATUS '100'.

SET TITLEBAR '100'.

PERFORM create_refresh_container1.

PERFORM create_refresh_container2.

ENDMODULE. "status_0100 OUTPUT

----


  • MODULE exit_0100 INPUT

----


*

----


MODULE exit_0100 INPUT.

CASE sy-ucomm.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

WHEN 'EXIT' OR 'CANC'.

LEAVE PROGRAM.

ENDCASE.

ENDMODULE. "exit_0100 INPUT

&----


*& Form create_refresh_container1

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM create_refresh_container1 .

REFRESH: t_fieldcat,

t_groupcat,

t_sortcat.

IF o_container1 IS INITIAL.

CREATE OBJECT o_container1

EXPORTING container_name = 'CONT1'.

CREATE OBJECT o_grid1

EXPORTING i_parent = o_container1.

CALL METHOD o_grid1->set_3d_border

EXPORTING

border = 1.

SET HANDLER lcl_event_handler=>hotspot_click FOR o_grid1.

SET HANDLER lcl_event_handler=>user_command FOR o_grid1.

SET HANDLER lcl_event_handler=>toolbar FOR o_grid1.

ENDIF.

h_layout-grid_title = 'Order Information'.

h_layout-smalltitle = 'X'.

h_layout-no_rowmark = space.

h_layout-cwidth_opt = 'X'.

h_layout-zebra = 'X'.

h_layout-sel_mode = 'D'.

h_variant-report = sy-cprog.

REFRESH: gt_exclude.

gs_exclude = cl_gui_alv_grid=>mc_fc_graph.

APPEND gs_exclude TO gt_exclude.

gs_exclude = cl_gui_alv_grid=>mc_fc_info.

APPEND gs_exclude TO gt_exclude.

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

EXPORTING

i_structure_name = 'Z1267_1'

CHANGING

ct_fieldcat = t_fieldcat.

LOOP AT t_fieldcat INTO h_fieldcat.

CASE h_fieldcat-fieldname.

WHEN 'PONO'.

h_fieldcat-hotspot = 'X'.

WHEN 'FILEN'.

h_fieldcat-no_out = 'X'.

ENDCASE.

MODIFY t_fieldcat FROM h_fieldcat.

CLEAR h_fieldcat.

ENDLOOP.

CALL METHOD o_grid1->set_table_for_first_display

EXPORTING

is_layout = h_layout

i_save = 'A'

is_variant = h_variant

it_toolbar_excluding = gt_exclude

CHANGING

it_fieldcatalog = t_fieldcat

it_sort = t_sortcat

it_outtab = t_rpt1.

ENDFORM. " create_refresh_container1

&----


*& Form create_refresh_container2

&----


  • text

----


FORM create_refresh_container2.

REFRESH: t_fieldcat,

t_groupcat,

t_sortcat.

IF o_container2 IS INITIAL.

CREATE OBJECT o_container2

EXPORTING container_name = 'CONT2'.

CREATE OBJECT o_grid2

EXPORTING i_parent = o_container2.

CALL METHOD o_grid2->set_3d_border

EXPORTING

border = 1.

ENDIF.

h_layout-grid_title = 'Item Information'.

h_layout-smalltitle = 'X'.

h_layout-no_rowmark = 'X'.

h_layout-cwidth_opt = 'X'.

h_layout-zebra = 'X'.

h_layout-sel_mode = ' '.

h_variant-report = sy-cprog.

REFRESH: gt_exclude.

gs_exclude = cl_gui_alv_grid=>mc_fc_graph.

APPEND gs_exclude TO gt_exclude.

gs_exclude = cl_gui_alv_grid=>mc_fc_info.

APPEND gs_exclude TO gt_exclude.

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

EXPORTING

i_structure_name = 'Z1267_2'

CHANGING

ct_fieldcat = t_fieldcat.

CALL METHOD o_grid2->set_table_for_first_display

EXPORTING

is_layout = h_layout

i_save = 'A'

is_variant = h_variant

it_toolbar_excluding = gt_exclude

CHANGING

it_fieldcatalog = t_fieldcat

it_sort = t_sortcat

it_outtab = t_rpt2.

ENDFORM. "create_refresh_container2

&----


*& Form build_input_table

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM build_input_table.

DATA: lt_dirlist TYPE TABLE OF epsfili,

lh_dirlist TYPE epsfili.

DATA: lh_id TYPE x_id.

DATA: l_rows TYPE i,

l_filename(100) TYPE c.

REFRESH t_id.

CALL FUNCTION 'Z_GET_DIRECTORY_LISTING'

EXPORTING

dir_name = g_dirn

file_mask = g_file

TABLES

dir_list = lt_dirlist

EXCEPTIONS

invalid_eps_subdir = 1

sapgparam_failed = 2

build_directory_failed = 3

no_authorization = 4

read_directory_failed = 5

too_many_read_errors = 6

empty_directory_list = 7

OTHERS = 8.

DESCRIBE TABLE lt_dirlist LINES l_rows.

IF l_rows <> 0.

LOOP AT lt_dirlist INTO lh_dirlist.

CLEAR l_filename.

CONCATENATE g_dirn lh_dirlist-name INTO l_filename.

OPEN DATASET l_filename FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc = 0.

DO.

READ DATASET l_filename INTO lh_id-record.

IF sy-subrc <> 0.

EXIT.

ELSE.

MOVE lh_dirlist-name TO lh_id-filename.

APPEND lh_id TO t_id.

CLEAR lh_id.

ENDIF.

ENDDO.

CLOSE DATASET l_filename.

ENDIF.

CLEAR lh_dirlist.

ENDLOOP.

ENDIF.

ENDFORM. "build_input_table

&----


*& Form build_report_table

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM build_report_table .

DATA: lh_id TYPE x_id,

lh_rpt TYPE z1267,

lh_rpt1 TYPE z1267_1.

DATA: f1(90),

f2(90),

f3(90),

f4(90),

f5(90),

f6(90),

f7(90),

f8(90),

f9(90),

f10(90),

f11(90),

f12(90),

f13(90),

f14(90),

f15(90),

f16(90),

f17(90),

f18(90),

f19(90),

f20(90).

DATA: f_850(1) TYPE c VALUE 'N',

f_855(1) TYPE c VALUE 'N'.

REFRESH: t_rpt,

t_rpt1.

LOOP AT t_id INTO lh_id.

SPLIT lh_id-record AT '*'

INTO f1 f2 f3 f4 f5 f6 f7 f8 f9 f10

f11 f12 f13 f14 f15 f16 f17 f18 f19 f20.

CASE f1.

WHEN 'ST'.

CLEAR: lh_rpt,

lh_rpt1.

CASE f2.

WHEN '850'.

f_850 = 'Y'.

WHEN '855'.

f_855 = 'Y'.

ENDCASE.

WHEN 'BEG'.

CASE f3.

WHEN 'RL'.

lh_rpt-type = 'SHIPMENT ORDER'.

WHEN 'KN'.

lh_rpt-type = 'STOCK TRANSFER'.

ENDCASE.

lh_rpt-pono = f4.

WHEN 'DTM'.

CASE f2.

WHEN '010'.

lh_rpt-sdate = f3.

ENDCASE.

WHEN 'N1'.

CASE f2.

WHEN 'ST'.

lh_rpt-shipto = f3.

ENDCASE.

WHEN 'PO1'.

lh_rpt-item = f10.

lh_rpt-qty = f3.

lh_rpt-upc = f12.

WHEN 'PID'.

lh_rpt-title = f6.

lh_rpt-filen = lh_id-filename.

APPEND lh_rpt TO t_rpt.

MOVE-CORRESPONDING lh_rpt TO lh_rpt1.

COLLECT lh_rpt1 INTO t_rpt1.

ENDCASE.

CLEAR lh_id.

ENDLOOP.

SORT t_rpt1 BY type pono.

ENDFORM. " build_report_table

&----


*& Form process_hotspot

&----


  • text

----


  • -->P_E_ROW_ID text

  • -->P_E_COLUMN_ID text

  • -->P_ES_ROW_NO text

----


FORM process_hotspot USING p_row_id LIKE lvc_s_row p_column_id p_row_no.

DATA: lh_rpt TYPE z1267,

lh_rpt1 TYPE z1267_1,

lh_rpt2 TYPE z1267_2.

IF p_row_id CO '0123456789 '.

CASE p_column_id.

WHEN 'PONO'.

REFRESH t_rpt2.

READ TABLE t_rpt1 INTO lh_rpt1 INDEX p_row_id.

LOOP AT t_rpt INTO lh_rpt WHERE pono = lh_rpt1-pono.

MOVE-CORRESPONDING lh_rpt TO lh_rpt2.

APPEND lh_rpt2 TO t_rpt2.

CLEAR lh_rpt2.

CLEAR lh_rpt.

ENDLOOP.

PERFORM create_refresh_container2.

ENDCASE.

ENDIF.

ENDFORM. "process_hotspot

&----


*& Form move_bpcs

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM move_bpcs .

DATA: lt_rpt1 TYPE TABLE OF z1267_1,

lh_rpt1 TYPE z1267_1.

DATA: lt_rows TYPE lvc_t_row,

lt_rowno TYPE lvc_t_roid,

lh_rowno TYPE lvc_s_roid.

DATA: l_rows TYPE i.

DATA unixcmd(200) TYPE c.

DATA: unixcomm LIKE unixcmd.

lt_rpt1 = t_rpt1.

CALL METHOD o_grid1->get_selected_rows

IMPORTING

et_index_rows = lt_rows

et_row_no = lt_rowno.

DESCRIBE TABLE lt_rowno LINES l_rows.

IF l_rows <> 0.

LOOP AT lt_rowno INTO lh_rowno.

READ TABLE t_rpt1 INTO lh_rpt1 INDEX lh_rowno-row_id.

IF sy-subrc = 0.

CONCATENATE g_dirn lh_rpt1-filen INTO unixcomm.

CONCATENATE 'mv' unixcomm g_dirn INTO unixcomm SEPARATED BY space.

CONCATENATE unixcomm 'bpcs/' lh_rpt1-filen INTO unixcomm.

  • Executing the system commands witin ABAP.

CALL 'SYSTEM' ID 'COMMAND' FIELD unixcomm.

IF sy-subrc = 0.

DELETE lt_rpt1 WHERE filen = lh_rpt1-filen.

ENDIF.

CLEAR lh_rpt1.

ENDIF.

ENDLOOP.

t_rpt1 = lt_rpt1.

CALL METHOD o_grid1->refresh_table_display.

REFRESH t_rpt2.

CALL METHOD o_grid2->refresh_table_display.

ELSE.

MESSAGE ID 'Z1' TYPE 'S' NUMBER '007' DISPLAY LIKE 'E'

WITH 'Select one or more lines to move to BPCS'.

ENDIF.

ENDFORM. " move_bpcs

&----


*& Form move_sap

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM move_sap .

DATA: lt_rpt1 TYPE TABLE OF z1267_1,

lh_rpt1 TYPE z1267_1.

DATA: lt_rows TYPE lvc_t_row,

lt_rowno TYPE lvc_t_roid,

lh_rowno TYPE lvc_s_roid.

DATA: l_rows TYPE i.

DATA unixcmd(200) TYPE c.

DATA: unixcomm LIKE unixcmd.

lt_rpt1 = t_rpt1.

CALL METHOD o_grid1->get_selected_rows

IMPORTING

et_index_rows = lt_rows

et_row_no = lt_rowno.

DESCRIBE TABLE lt_rowno LINES l_rows.

IF l_rows <> 0.

LOOP AT lt_rowno INTO lh_rowno.

READ TABLE t_rpt1 INTO lh_rpt1 INDEX lh_rowno-row_id.

IF sy-subrc = 0.

CONCATENATE g_dirn lh_rpt1-filen INTO unixcomm.

CONCATENATE 'mv' unixcomm g_dirn INTO unixcomm SEPARATED BY space.

CONCATENATE unixcomm 'sap/' lh_rpt1-filen INTO unixcomm.

  • Executing the system commands witin ABAP.

CALL 'SYSTEM' ID 'COMMAND' FIELD unixcomm.

IF sy-subrc = 0.

DELETE lt_rpt1 WHERE filen = lh_rpt1-filen.

ENDIF.

CLEAR lh_rpt1.

ENDIF.

ENDLOOP.

t_rpt1 = lt_rpt1.

CALL METHOD o_grid1->refresh_table_display.

REFRESH t_rpt2.

CALL METHOD o_grid2->refresh_table_display.

ELSE.

MESSAGE ID 'Z1' TYPE 'S' NUMBER '007' DISPLAY LIKE 'E'

WITH 'Select one or more lines to move to SAP'.

ENDIF.

ENDFORM. " move_sap

2 REPLIES 2
Read only

Former Member
0 Likes
557

You can do so with an object ALV grid with two containers. See example below.

REPORT z1267 NO STANDARD PAGE HEADING

MESSAGE-ID zz

LINE-SIZE 132

LINE-COUNT 65.

*&----


*& Program Includes

*&----


INCLUDE z1267top.

INCLUDE z_gen_top.

INCLUDE z_gen_f01.

----


  • CLASS lcl_event_handler DEFINITION

----


*

----


CLASS lcl_event_handler DEFINITION.

PUBLIC SECTION.

CLASS-METHODS:

hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid

IMPORTING e_row_id e_column_id es_row_no,

user_command FOR EVENT user_command OF cl_gui_alv_grid

IMPORTING sender e_ucomm,

toolbar FOR EVENT toolbar OF cl_gui_alv_grid

IMPORTING e_object e_interactive.

ENDCLASS. "lcl_event_handler DEFINITION

----


  • CLASS lcl_event_handler IMPLEMENTATION

----


*

----


CLASS lcl_event_handler IMPLEMENTATION.

METHOD hotspot_click.

PERFORM process_hotspot USING e_row_id e_column_id es_row_no.

ENDMETHOD. "hotspot_click

METHOD user_command.

CASE e_ucomm.

WHEN 'BPCS'.

PERFORM move_bpcs.

WHEN 'SAP'.

PERFORM move_sap.

ENDCASE.

ENDMETHOD. "user_command

METHOD toolbar.

DATA: ls_toolbar TYPE stb_button.

CLEAR ls_toolbar.

MOVE 3 TO ls_toolbar-butn_type.

APPEND ls_toolbar TO e_object->mt_toolbar.

CLEAR ls_toolbar.

MOVE 'BPCS' TO ls_toolbar-function.

MOVE icon_move TO ls_toolbar-icon.

MOVE 'Move to BPCS' TO ls_toolbar-quickinfo.

ls_toolbar-text = 'BPCS'.

APPEND ls_toolbar TO e_object->mt_toolbar.

CLEAR ls_toolbar.

MOVE 'SAP' TO ls_toolbar-function.

MOVE icon_move TO ls_toolbar-icon.

MOVE 'Move to SAP' TO ls_toolbar-quickinfo.

ls_toolbar-text = 'SAP'.

APPEND ls_toolbar TO e_object->mt_toolbar.

ENDMETHOD. "toolbar

ENDCLASS. "lcl_event_handler IMPLEMENTATION

*&----


*& Event INITIALIZATION

*&----


INITIALIZATION.

CONCATENATE '/sapmnt/' sy-sysid+0(3) '/global/edi/in/' INTO g_dirn.

g_file = 'node*'.

*&----


*& Event START-OF-SELECTION

*&----


START-OF-SELECTION.

PERFORM build_input_table.

DESCRIBE TABLE t_id LINES g_rows.

IF g_rows = 0.

WRITE: / 'No items found'.

EXIT.

ENDIF.

*&----


*& Event END-OF-SELECTION

*&----


END-OF-SELECTION.

PERFORM build_report_table.

DESCRIBE TABLE t_rpt1 LINES g_rows.

IF g_rows <> 0.

CALL SCREEN '100'.

ELSE.

WRITE: / 'No items found'.

ENDIF.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE status_0100 OUTPUT.

SET PF-STATUS '100'.

SET TITLEBAR '100'.

PERFORM create_refresh_container1.

PERFORM create_refresh_container2.

ENDMODULE. "status_0100 OUTPUT

----


  • MODULE exit_0100 INPUT

----


*

----


MODULE exit_0100 INPUT.

CASE sy-ucomm.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

WHEN 'EXIT' OR 'CANC'.

LEAVE PROGRAM.

ENDCASE.

ENDMODULE. "exit_0100 INPUT

&----


*& Form create_refresh_container1

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM create_refresh_container1 .

REFRESH: t_fieldcat,

t_groupcat,

t_sortcat.

IF o_container1 IS INITIAL.

CREATE OBJECT o_container1

EXPORTING container_name = 'CONT1'.

CREATE OBJECT o_grid1

EXPORTING i_parent = o_container1.

CALL METHOD o_grid1->set_3d_border

EXPORTING

border = 1.

SET HANDLER lcl_event_handler=>hotspot_click FOR o_grid1.

SET HANDLER lcl_event_handler=>user_command FOR o_grid1.

SET HANDLER lcl_event_handler=>toolbar FOR o_grid1.

ENDIF.

h_layout-grid_title = 'Order Information'.

h_layout-smalltitle = 'X'.

h_layout-no_rowmark = space.

h_layout-cwidth_opt = 'X'.

h_layout-zebra = 'X'.

h_layout-sel_mode = 'D'.

h_variant-report = sy-cprog.

REFRESH: gt_exclude.

gs_exclude = cl_gui_alv_grid=>mc_fc_graph.

APPEND gs_exclude TO gt_exclude.

gs_exclude = cl_gui_alv_grid=>mc_fc_info.

APPEND gs_exclude TO gt_exclude.

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

EXPORTING

i_structure_name = 'Z1267_1'

CHANGING

ct_fieldcat = t_fieldcat.

LOOP AT t_fieldcat INTO h_fieldcat.

CASE h_fieldcat-fieldname.

WHEN 'PONO'.

h_fieldcat-hotspot = 'X'.

WHEN 'FILEN'.

h_fieldcat-no_out = 'X'.

ENDCASE.

MODIFY t_fieldcat FROM h_fieldcat.

CLEAR h_fieldcat.

ENDLOOP.

CALL METHOD o_grid1->set_table_for_first_display

EXPORTING

is_layout = h_layout

i_save = 'A'

is_variant = h_variant

it_toolbar_excluding = gt_exclude

CHANGING

it_fieldcatalog = t_fieldcat

it_sort = t_sortcat

it_outtab = t_rpt1.

ENDFORM. " create_refresh_container1

&----


*& Form create_refresh_container2

&----


  • text

----


FORM create_refresh_container2.

REFRESH: t_fieldcat,

t_groupcat,

t_sortcat.

IF o_container2 IS INITIAL.

CREATE OBJECT o_container2

EXPORTING container_name = 'CONT2'.

CREATE OBJECT o_grid2

EXPORTING i_parent = o_container2.

CALL METHOD o_grid2->set_3d_border

EXPORTING

border = 1.

ENDIF.

h_layout-grid_title = 'Item Information'.

h_layout-smalltitle = 'X'.

h_layout-no_rowmark = 'X'.

h_layout-cwidth_opt = 'X'.

h_layout-zebra = 'X'.

h_layout-sel_mode = ' '.

h_variant-report = sy-cprog.

REFRESH: gt_exclude.

gs_exclude = cl_gui_alv_grid=>mc_fc_graph.

APPEND gs_exclude TO gt_exclude.

gs_exclude = cl_gui_alv_grid=>mc_fc_info.

APPEND gs_exclude TO gt_exclude.

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

EXPORTING

i_structure_name = 'Z1267_2'

CHANGING

ct_fieldcat = t_fieldcat.

CALL METHOD o_grid2->set_table_for_first_display

EXPORTING

is_layout = h_layout

i_save = 'A'

is_variant = h_variant

it_toolbar_excluding = gt_exclude

CHANGING

it_fieldcatalog = t_fieldcat

it_sort = t_sortcat

it_outtab = t_rpt2.

ENDFORM. "create_refresh_container2

&----


*& Form build_input_table

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM build_input_table.

DATA: lt_dirlist TYPE TABLE OF epsfili,

lh_dirlist TYPE epsfili.

DATA: lh_id TYPE x_id.

DATA: l_rows TYPE i,

l_filename(100) TYPE c.

REFRESH t_id.

CALL FUNCTION 'Z_GET_DIRECTORY_LISTING'

EXPORTING

dir_name = g_dirn

file_mask = g_file

TABLES

dir_list = lt_dirlist

EXCEPTIONS

invalid_eps_subdir = 1

sapgparam_failed = 2

build_directory_failed = 3

no_authorization = 4

read_directory_failed = 5

too_many_read_errors = 6

empty_directory_list = 7

OTHERS = 8.

DESCRIBE TABLE lt_dirlist LINES l_rows.

IF l_rows <> 0.

LOOP AT lt_dirlist INTO lh_dirlist.

CLEAR l_filename.

CONCATENATE g_dirn lh_dirlist-name INTO l_filename.

OPEN DATASET l_filename FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc = 0.

DO.

READ DATASET l_filename INTO lh_id-record.

IF sy-subrc <> 0.

EXIT.

ELSE.

MOVE lh_dirlist-name TO lh_id-filename.

APPEND lh_id TO t_id.

CLEAR lh_id.

ENDIF.

ENDDO.

CLOSE DATASET l_filename.

ENDIF.

CLEAR lh_dirlist.

ENDLOOP.

ENDIF.

ENDFORM. "build_input_table

&----


*& Form build_report_table

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM build_report_table .

DATA: lh_id TYPE x_id,

lh_rpt TYPE z1267,

lh_rpt1 TYPE z1267_1.

DATA: f1(90),

f2(90),

f3(90),

f4(90),

f5(90),

f6(90),

f7(90),

f8(90),

f9(90),

f10(90),

f11(90),

f12(90),

f13(90),

f14(90),

f15(90),

f16(90),

f17(90),

f18(90),

f19(90),

f20(90).

DATA: f_850(1) TYPE c VALUE 'N',

f_855(1) TYPE c VALUE 'N'.

REFRESH: t_rpt,

t_rpt1.

LOOP AT t_id INTO lh_id.

SPLIT lh_id-record AT '*'

INTO f1 f2 f3 f4 f5 f6 f7 f8 f9 f10

f11 f12 f13 f14 f15 f16 f17 f18 f19 f20.

CASE f1.

WHEN 'ST'.

CLEAR: lh_rpt,

lh_rpt1.

CASE f2.

WHEN '850'.

f_850 = 'Y'.

WHEN '855'.

f_855 = 'Y'.

ENDCASE.

WHEN 'BEG'.

CASE f3.

WHEN 'RL'.

lh_rpt-type = 'SHIPMENT ORDER'.

WHEN 'KN'.

lh_rpt-type = 'STOCK TRANSFER'.

ENDCASE.

lh_rpt-pono = f4.

WHEN 'DTM'.

CASE f2.

WHEN '010'.

lh_rpt-sdate = f3.

ENDCASE.

WHEN 'N1'.

CASE f2.

WHEN 'ST'.

lh_rpt-shipto = f3.

ENDCASE.

WHEN 'PO1'.

lh_rpt-item = f10.

lh_rpt-qty = f3.

lh_rpt-upc = f12.

WHEN 'PID'.

lh_rpt-title = f6.

lh_rpt-filen = lh_id-filename.

APPEND lh_rpt TO t_rpt.

MOVE-CORRESPONDING lh_rpt TO lh_rpt1.

COLLECT lh_rpt1 INTO t_rpt1.

ENDCASE.

CLEAR lh_id.

ENDLOOP.

SORT t_rpt1 BY type pono.

ENDFORM. " build_report_table

&----


*& Form process_hotspot

&----


  • text

----


  • -->P_E_ROW_ID text

  • -->P_E_COLUMN_ID text

  • -->P_ES_ROW_NO text

----


FORM process_hotspot USING p_row_id LIKE lvc_s_row p_column_id p_row_no.

DATA: lh_rpt TYPE z1267,

lh_rpt1 TYPE z1267_1,

lh_rpt2 TYPE z1267_2.

IF p_row_id CO '0123456789 '.

CASE p_column_id.

WHEN 'PONO'.

REFRESH t_rpt2.

READ TABLE t_rpt1 INTO lh_rpt1 INDEX p_row_id.

LOOP AT t_rpt INTO lh_rpt WHERE pono = lh_rpt1-pono.

MOVE-CORRESPONDING lh_rpt TO lh_rpt2.

APPEND lh_rpt2 TO t_rpt2.

CLEAR lh_rpt2.

CLEAR lh_rpt.

ENDLOOP.

PERFORM create_refresh_container2.

ENDCASE.

ENDIF.

ENDFORM. "process_hotspot

&----


*& Form move_bpcs

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM move_bpcs .

DATA: lt_rpt1 TYPE TABLE OF z1267_1,

lh_rpt1 TYPE z1267_1.

DATA: lt_rows TYPE lvc_t_row,

lt_rowno TYPE lvc_t_roid,

lh_rowno TYPE lvc_s_roid.

DATA: l_rows TYPE i.

DATA unixcmd(200) TYPE c.

DATA: unixcomm LIKE unixcmd.

lt_rpt1 = t_rpt1.

CALL METHOD o_grid1->get_selected_rows

IMPORTING

et_index_rows = lt_rows

et_row_no = lt_rowno.

DESCRIBE TABLE lt_rowno LINES l_rows.

IF l_rows <> 0.

LOOP AT lt_rowno INTO lh_rowno.

READ TABLE t_rpt1 INTO lh_rpt1 INDEX lh_rowno-row_id.

IF sy-subrc = 0.

CONCATENATE g_dirn lh_rpt1-filen INTO unixcomm.

CONCATENATE 'mv' unixcomm g_dirn INTO unixcomm SEPARATED BY space.

CONCATENATE unixcomm 'bpcs/' lh_rpt1-filen INTO unixcomm.

  • Executing the system commands witin ABAP.

CALL 'SYSTEM' ID 'COMMAND' FIELD unixcomm.

IF sy-subrc = 0.

DELETE lt_rpt1 WHERE filen = lh_rpt1-filen.

ENDIF.

CLEAR lh_rpt1.

ENDIF.

ENDLOOP.

t_rpt1 = lt_rpt1.

CALL METHOD o_grid1->refresh_table_display.

REFRESH t_rpt2.

CALL METHOD o_grid2->refresh_table_display.

ELSE.

MESSAGE ID 'Z1' TYPE 'S' NUMBER '007' DISPLAY LIKE 'E'

WITH 'Select one or more lines to move to BPCS'.

ENDIF.

ENDFORM. " move_bpcs

&----


*& Form move_sap

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM move_sap .

DATA: lt_rpt1 TYPE TABLE OF z1267_1,

lh_rpt1 TYPE z1267_1.

DATA: lt_rows TYPE lvc_t_row,

lt_rowno TYPE lvc_t_roid,

lh_rowno TYPE lvc_s_roid.

DATA: l_rows TYPE i.

DATA unixcmd(200) TYPE c.

DATA: unixcomm LIKE unixcmd.

lt_rpt1 = t_rpt1.

CALL METHOD o_grid1->get_selected_rows

IMPORTING

et_index_rows = lt_rows

et_row_no = lt_rowno.

DESCRIBE TABLE lt_rowno LINES l_rows.

IF l_rows <> 0.

LOOP AT lt_rowno INTO lh_rowno.

READ TABLE t_rpt1 INTO lh_rpt1 INDEX lh_rowno-row_id.

IF sy-subrc = 0.

CONCATENATE g_dirn lh_rpt1-filen INTO unixcomm.

CONCATENATE 'mv' unixcomm g_dirn INTO unixcomm SEPARATED BY space.

CONCATENATE unixcomm 'sap/' lh_rpt1-filen INTO unixcomm.

  • Executing the system commands witin ABAP.

CALL 'SYSTEM' ID 'COMMAND' FIELD unixcomm.

IF sy-subrc = 0.

DELETE lt_rpt1 WHERE filen = lh_rpt1-filen.

ENDIF.

CLEAR lh_rpt1.

ENDIF.

ENDLOOP.

t_rpt1 = lt_rpt1.

CALL METHOD o_grid1->refresh_table_display.

REFRESH t_rpt2.

CALL METHOD o_grid2->refresh_table_display.

ELSE.

MESSAGE ID 'Z1' TYPE 'S' NUMBER '007' DISPLAY LIKE 'E'

WITH 'Select one or more lines to move to SAP'.

ENDIF.

ENDFORM. " move_sap

Read only

0 Likes
556

it's not working....unable to execute....