2009 Feb 05 7:35 AM
hi,
I have a requiement in which i will get list display which contains certain no of records(let us say 10 records)...now the issue is *if i selet one record and if it is correct record* and if i hit the insert pushbutton it should go and insert into z-table which i hav created.....and if the record which i hav selected is error record.....it should throw an error message saying that it is the error record....as error record stops further process i hav used it as information message and i used 'display like 'E''....so that it wont affect further proceedings.....
and if i select the 2nd record and if i hit the pushbutton it is taking to the sap initial screen which i dont want .....
how to solve this issue?
can anyone plz help me in this issue....
hi,
I have a requiement in which i will get list display which contains certain no of records(let us say 10 records)...now the issue is *if i selet one record and if it is correct record* and if i hit the insert pushbutton it should go and insert into z-table which i hav created.....and if the record which i hav selected is error record.....it should throw an error message saying that it is the error record....as error record stops further process i hav used it as information message and i used 'display like 'E''....so that it wont affect further proceedings.....
and if i select the 2nd record and if i hit the pushbutton it is taking to the sap initial screen which i dont want .....
how to solve this issue?
can anyone plz help me in this issue....
2009 Feb 05 7:39 AM
hi,
copy the standard alv pf-status to z.
and create a push button in z pf status.
then write the logic in your code
CASE r_ucomm.
WHEN 'PUSH'.
your logic.
to copy standard alv pf status.
go to program
BCALV_TEST_FULLSCREEN
double click on pf status set pf-status 'STANDARD' excluding rt_extab. in to code
then choose other object button then copy button in the pop up
then give your program name and pf status name
Edited by: abap on Feb 5, 2009 8:39 AM
Edited by: abap on Feb 5, 2009 8:41 AM
2009 Feb 05 8:54 AM
Hi Needy ,
M giving you a sample code where you can set your pf-status and how to handle the check box etc .
This code shows you hoe to select and deselect the check boxes ..
All that you have to do is apply your logic...
set pf-status 'SELECT' .
at user-command .
describe table t_lpr lines w_lines .
case sy-ucomm .
when 'SELECTALL' .
set pf-status 'SELECT' excluding 'SELECTALL' immediately.
do w_lines times .
read line w_line field value w_check . " INTO W_CHECK .
if w_check = space .
w_check = 'X' .
modify line w_line field value w_check. "INTO W_CHECK .
add 1 to w_line .
endif . " IF W_CHECK = ' '
enddo . " DO W_LINES TIMES
clear w_line .
when 'DESELECT' .
set pf-status 'SELECT' excluding 'DESELECT' immediately.
do w_lines times .
read line w_line field value w_check .
if w_check = 'X' .
w_check = space .
modify line w_line field value w_check .
add 1 to w_line .
endif . " IF W_CHECK = 'X' .
enddo . " DO W_LINES TIMES
clear w_line .
Here w_line : Line that is being read
w_lines : Total number of lines in your table(or list if you use 'list number of lines w_lines)
w_check is my checkbox .
Hope your need will be done!!
Much Regards ,
Amuktha .
2009 Feb 05 9:03 AM
Hi,
Cretae a push button on the application tool bar.
in the alv output have a check box for each and every record.
when u check the check box and press the push button u write the belwo code
----
FORM USER_COMMAND *
----
--> R_UCOMM *
--> RS_SELFIELD *
----
FORM user_command USING lv_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
REFRESH : git_final2.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = gv_ref1.
CALL METHOD gv_ref1->check_changed_data.
Check function code
CASE lv_ucomm.
WHEN '&PUSH'.
LOOP AT ITAB INTO gwa_itab WHERE check = gc_x.
now insert ur record to the anothe internal table (itab1)having ur ztable structure..
endloop.
if itab1[] is not initial.
modify ztable from table itab1.
if sy-subrc eq 0.
commit work.
endif.
endif.
Regards,
Nagaraj
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |