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

alv

Former Member
0 Likes
2,265

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,237

DID YOU ADD the field "CHK" in your internal table definition.If you have not done that then this error will occur.

Hi,

Can you post your code. and what is the Dump analysis says?

Regards

vijay

19 REPLIES 19
Read only

Former Member
0 Likes
2,237

Hi Rakhee,

Refer program : <b>BCALV_EDIT_05</b>.

Reward points if this Helps.

Manish

Read only

Former Member
0 Likes
2,238

DID YOU ADD the field "CHK" in your internal table definition.If you have not done that then this error will occur.

Read only

0 Likes
2,237

i defined

Read only

0 Likes
2,237

What is the error you are getting.

Read only

0 Likes
2,237

Hi,

Can you post your code. and what is the Dump analysis says?

Regards

vijay

Read only

0 Likes
2,237

field symbol has not been assigned

Read only

0 Likes
2,237

Hi,

then the problem is with some thing else...

i feel the problem is with fieldcat . can you show your fieldcat population.

Regards

vijay

Read only

0 Likes
2,237

Where in your code error is coming. Post your code indicating where it is going in short dump.

Read only

0 Likes
2,237

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

Read only

0 Likes
2,237

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

Read only

0 Likes
2,237

plz tel me how i should loop along these values and need to send to another program

Read only

0 Likes
2,237

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

Read only

0 Likes
2,237

like sumbit <> tell me plz code

Read only

0 Likes
2,237

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

Read only

0 Likes
2,237

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

Read only

0 Likes
2,237

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

Read only

0 Likes
2,237

how to do

Read only

0 Likes
2,237

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

Read only

Former Member
0 Likes
2,237

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