2006 Nov 01 10:41 AM
how to display checkbox i have given in fieldcat as
ls_fieldcat-fieldname = 'CHK'.
ls_fieldcat-seltext_l = 'COMPLETE'.
ls_fieldcat-tabname = 'IT_DLTS'.
ls_fieldcat-edit = 'X'.
ls_fieldcat-checkbox = 'X'.
APPEND ls_fieldcat TO lt_fieldcat.
CLEAR ls_fieldcat.but giving rumtime error
2006 Nov 01 10:49 AM
DID YOU ADD the field "CHK" in your internal table definition.If you have not done that then this error will occur.
how to display checkbox i have given in fieldcat as
ls_fieldcat-fieldname = 'CHK'.
ls_fieldcat-seltext_l = 'COMPLETE'.
ls_fieldcat-tabname = 'IT_DLTS'.
ls_fieldcat-edit = 'X'.
ls_fieldcat-checkbox = 'X'.
APPEND ls_fieldcat TO lt_fieldcat.
CLEAR ls_fieldcat.but giving rumtime error
2006 Nov 01 10:44 AM
Hi Rakhee,
Refer program : <b>BCALV_EDIT_05</b>.
Reward points if this Helps.
Manish
2006 Nov 01 10:49 AM
DID YOU ADD the field "CHK" in your internal table definition.If you have not done that then this error will occur.
2006 Nov 01 10:54 AM
2006 Nov 01 11:10 AM
2006 Nov 01 11:11 AM
Hi,
Can you post your code. and what is the Dump analysis says?
Regards
vijay
2006 Nov 01 11:20 AM
2006 Nov 01 11:21 AM
Hi,
then the problem is with some thing else...
i feel the problem is with fieldcat . can you show your fieldcat population.
Regards
vijay
2006 Nov 01 11:22 AM
Where in your code error is coming. Post your code indicating where it is going in short dump.
2006 Nov 01 11:33 AM
Hi Rakhee,
this works both for alv grid and list as well.
check it.
REPORT ztest_alv_check MESSAGE-ID zz .
TYPE-POOLS: slis.
DATA: x_fieldcat TYPE slis_fieldcat_alv,
it_fieldcat TYPE slis_t_fieldcat_alv,
l_layout TYPE slis_layout_alv,
x_events TYPE slis_alv_event,
it_events TYPE slis_t_event.
DATA: BEGIN OF itab OCCURS 0,
vbeln LIKE vbak-vbeln,
posnr LIKE vbap-posnr,
chk(1),
END OF itab.
SELECT vbeln
posnr
FROM vbap
UP TO 20 ROWS
INTO TABLE itab.
x_fieldcat-fieldname = 'CHK'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 1.
x_fieldcat-input = 'X'.
x_fieldcat-edit = 'X'.
x_fieldcat-checkbox = 'X'.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
x_fieldcat-fieldname = 'VBELN'.
x_fieldcat-seltext_l = 'VBELN'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 2.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
x_fieldcat-fieldname = 'POSNR'.
x_fieldcat-seltext_l = 'POSNR'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 3.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = l_layout
it_fieldcat = it_fieldcat
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 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.Regards
vijay
2006 Nov 01 11:34 AM
Hi,
the above code is for Grid and below one is for LIST
REPORT ztest_alv_check MESSAGE-ID zz .
TYPE-POOLS: slis.
DATA: x_fieldcat TYPE slis_fieldcat_alv,
it_fieldcat TYPE slis_t_fieldcat_alv,
l_layout TYPE slis_layout_alv,
x_events TYPE slis_alv_event,
it_events TYPE slis_t_event.
DATA: BEGIN OF itab OCCURS 0,
vbeln LIKE vbak-vbeln,
posnr LIKE vbap-posnr,
chk(1),
END OF itab.
SELECT vbeln
posnr
FROM vbap
UP TO 20 ROWS
INTO TABLE itab.
x_fieldcat-fieldname = 'CHK'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 1.
x_fieldcat-input = 'X'.
x_fieldcat-edit = 'X'.
x_fieldcat-checkbox = 'X'.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
x_fieldcat-fieldname = 'VBELN'.
x_fieldcat-seltext_l = 'VBELN'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 2.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
x_fieldcat-fieldname = 'POSNR'.
x_fieldcat-seltext_l = 'POSNR'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 3.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = l_layout
it_fieldcat = it_fieldcat
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 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.Regards
vijay
2006 Nov 01 11:49 AM
plz tel me how i should loop along these values and need to send to another program
2006 Nov 01 11:52 AM
Hi Rakhee,
you mean selected values.., it can be done in user_command.
loop at itab where chk = 'X'.
move to another itab.
endloop.
"pass the slected records internal table to another program ..
Regards
vijay
2006 Nov 01 11:56 AM
2006 Nov 01 12:00 PM
Hi Rakhee,
is the submit program is standard one or Custom one.
and what values you want to pass between alv program to submit program , can you explain it .
Regards
vijay
2006 Nov 01 12:01 PM
to a zprogram values are like matnr clabs form the previous selected checkboxes.
so plz tel me after collecting the values in to an it how to send that it to that program
2006 Nov 01 12:05 PM
then you have only one option. that is import and export .
import the itab to memory and in submit program export it from memory.and then use the data.
regards
vijay
2006 Nov 01 12:10 PM
2006 Nov 01 12:21 PM
in the alv program...
REPORT zalvreport .
TABLES: kna1.
DATA: BEGIN OF itab OCCURS 0,
feilds....
END OF itab.
IF NOT itab IS INITIAL.
EXPORT itab = itab TO MEMORY ID 'itab'.
IF sy-subrc = 0.
WRITE:/ 'exported'.
ENDIF.
ENDIF.and in the submit program.., you need to declare the same internal table with same name
REPORT zsubmit .
DATA: BEGIN OF itab OCCURS 0,
same fields...with same names and order
END OF itab.
IMPORT itab = itab FROM MEMORY ID 'itab'.
LOOP AT itab.
WRITE:/ itab.
ENDLOOP.regards
vijay
2006 Nov 01 11:26 AM
Hi Rakhee,
May be you r u trying with ALV_GRID for grid it will not work. This will work only in ALV_LIST. Try out with ALV_LIST it will work.
WA_FIELDCAT-FIELDNAME = 'EBELN'.
WA_FIELDCAT-COL_POS = '1'.
WA_FIELDCAT-JUST = 'R'.
WA_FIELDCAT-SELTEXT_L = 'PO Number'.
WA_FIELDCAT-LOWERCASE = 'X'.
WA_FIELDCAT-DO_SUM = 'X'.
WA_FIELDCAT-EMPHASIZE = 'C410'.
WA_FIELDCAT-CHECKBOX = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
Thanks
Vikranth Khimavath
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |