on 06-06-2008 12:35 PM
hi experts,
im my main program i have the print pushbutton.
when i give only one order to print the form output is fine..
but wheni give a range and select a few of them the last order that is selcted that gets printed for all the selcted orders..
can anyone tell me whats can be the sloution this..
its urgent..
rewrads will be given.
thnaks in advance.
Hi,
If you are using the grid display alv you have to call this under the buutton fct code.
Case sy-ucomm.
when 'PRINT'.
CALL METHOD g_grid->get_selected_rows
IMPORTING
et_index_rows = i_rows.
CALL METHOD cl_gui_cfw=>flush.
LOOP AT i_rows
INTO i_selected_line_s.
lf_row_index = i_selected_line_s-index.
CLEAR <fs_final>.
READ TABLE i_final
INTO <fs_final>
INDEX lf_row_index.
IF sy-subrc EQ 0.
MOVE c_x TO <fs_final>-check.
MODIFY i_final INDEX sy-tabix FROM <fs_final>
TRANSPORTING check .
ENDIF.
ENDLOOP.
-> If you are useing normal report do as follows
if your internal table is itab.
At user-command.
case sy-ucomm.
when 'PRINT'.
DO.
READ LINE sy-index FIELD VALUE itab INTO wa.
IF sy-subrc <> 0.
EXIT.
ELSEIF flag = 'X'.
append wa into itab1.
ENDIF.
ENDDO.
-> now you will get the data which is selected now loop itab1 and call the smartform inside the loop.
Thanks,
NN.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for the reply..
the thing is that i am alredy populating the orders which i have selcted in an internal table
and looping at that table and have called my form(script) inside it,but even after that
its taking the last order that i have selected on the screen and printing the same data
for all the orders that are selected.
what can be done?
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.