‎2010 Aug 31 7:22 AM
Hi ,
I created a report by submitting standard program RM06EF00 with the selection parameters and exported the list to ABAP Memory. I read the ABAP Memory list in the calling program using LIST_FROM_MEMORY and converted it into asci using LIST_TO_ASCI. I got the data in an internal table ( IT_ASCI). my requirement is to add a check box per PO number and need to display it using classical repot. When i select the checkbox, corresponding PO number need to be selected and sent for processing. Also I need to add SELECTALL and DESELECTALL buttons in the menu which will enable the selection of checkboxes accordingly.
I am a fresher and not aware of much of ABAP. can please anybody guide me how to proceed.
‎2010 Aug 31 7:28 AM
Hi ,
Please check this program : DEMO_LIST_READ_LINE
Regards,
Srini.
‎2010 Aug 31 7:34 AM
Hi ,
Welcome to SCN ..
Simple code to handle checkbox requirement in ur case its a PO.
DATA: date TYPE d,
flag(1) TYPE c,
wa(10) TYPE c.
START-OF-SELECTION.
date = sy-datum.
DO 10 TIMES.
date = date + sy-index.
WRITE: / flag AS CHECKBOX, (10) date.
ENDDO.
AT LINE-SELECTION.
DO.
READ LINE sy-index FIELD VALUE flag
date INTO wa.
IF sy-subrc <> 0.
EXIT.
ELSEIF flag = 'X'.
WRITE / wa.
ENDIF.
ENDDO.
For select all and deselect all the code is simple
Add two buttons in user command as select all and deselect all
modify cb in itab as 'X' for the entire list -> select all
clear the value of 'X' for the list -> delect all
infact suggest you to search in SCN and i think this was answered a lot no of times.
BR,
Vijay.
‎2010 Aug 31 10:06 AM
Hi Vijay,
Thank you for you help.
here i am sending you wat i have written. Here i am able to display checkbox on the screen, but when i check it, i am not able to read the corresponding line. please help me.
SUBMIT RM06EF00
WITH p_frgco = 1
WITH P_MITPOS = 'X'
WITH listu = 'BEST'
EXPORTING LIST TO MEMORY
AND RETURN.
START-OF-SELECTION.
set PF-STATUS 'FREI'.
call function 'LIST_FROM_MEMORY'
tables
listobject = zabaplist
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2 .
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function 'LIST_TO_ASCI'
EXPORTING
LIST_INDEX = -1
WITH_LINE_BREAK = ' '
IMPORTING
LIST_STRING_ASCII =
LIST_DYN_ASCII =
TABLES
LISTASCI = it_zasci
LISTOBJECT = zabaplist
EXCEPTIONS
EMPTY_LIST = 1
LIST_INDEX_INVALID = 2
OTHERS = 3 .
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
data n type i .
data checkpos type i value 8.
LOOP AT it_zasci INTO wa_asci.
if sy-tabix = checkpos.
checkpos = checkpos + 8 .
write: flag AS CHECKBOX.
n = sy-linno .
skip TO LINE n.
write: 3 wa_asci+1(78), 81 sy-vline.
else.
write wa_asci .
endif.
ENDLOOP.
at LINE-SELECTION.
READ LINE sy-index FIELD VALUE flag wa_asci INTO wa_disp.
IF flag = 'Y'.
EXIT.
ELSEIF flag = 'X'.
WRITE / wa_disp.
ENDIF.
AT USER-COMMAND.
PERFORM pf_status.
INCLUDE ZMMU_PO_MASS_RELEASE_PF_STAF01.
‎2010 Aug 31 10:29 AM
Hi,
I think UR missing DO .. ENDDO ...
at LINE-SELECTION.
DO.
READ LINE sy-index FIELD VALUE flag wa_asci INTO wa_disp.
IF flag = 'Y'.
EXIT.
ELSEIF flag = 'X'.
WRITE / wa_disp.
ENDIF.
ENDDO.
Regards,
Srini.