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

regarding checkbox

Former Member
0 Likes
355

Hello experts,

in the below program i have some doubts..help me please.

TYPES: BEGIN OF ttab ,

check TYPE char1,

mandt TYPE t000-mandt,

mtext TYPE t000-mtext,

ort01 TYPE t000-ort01,

MWAER TYPE T000-MWAER,

END OF ttab.

DATA: itab TYPE TABLE OF ttab WITH HEADER LINE.

DATA: v_lines TYPE i.

DATA: v_cnt TYPE i.

DATA: v_counter TYPE i.

SELECT * INTO CORRESPONDING FIELDS OF TABLE itab FROM t000.

LOOP AT itab.

WRITE:/ itab-check AS CHECKBOX,

itab-mandt,

itab-mtext,

ITAB-MWAER.

ENDLOOP..

  • Press F8 after selecting the checkbox, this code

  • will tell you which records where selected.

AT PF8.

  • IF sy-lsind = 1.

DESCRIBE TABLE itab LINES v_lines.

v_cnt = 3. " Initiate value for Count 3 if you're including page header.

DO v_lines TIMES.

READ LINE v_cnt. " Above counter...

READ TABLE itab WITH KEY mandt = sy-lisel+2(3)..

itab-check = sy-lisel(1).

MODIFY itab INDEX sy-tabix.

v_counter = v_counter - 1.

v_cnt = v_cnt + 1.

ENDDO.

WRITE:/ 'SELECTED RECORDS:'.

LOOP AT itab WHERE check = 'X'.

WRITE:/ itab-check, itab-mandt, itab-mtext, itab-ort01.

ENDLOOP.

  • ENDIF.

in this why we use the

  • DESCRIBE TABLE itab LINES v_lines.

  • v_cnt = 3.

  • READ TABLE itab WITH KEY mandt = sy-lisel+2(3)..

  • itab-check = sy-lisel(1).

  • MODIFY itab INDEX sy-tabix.

Hello experts,

in the below program i have some doubts..help me please.

TYPES: BEGIN OF ttab ,

check TYPE char1,

mandt TYPE t000-mandt,

mtext TYPE t000-mtext,

ort01 TYPE t000-ort01,

MWAER TYPE T000-MWAER,

END OF ttab.

DATA: itab TYPE TABLE OF ttab WITH HEADER LINE.

DATA: v_lines TYPE i.

DATA: v_cnt TYPE i.

DATA: v_counter TYPE i.

SELECT * INTO CORRESPONDING FIELDS OF TABLE itab FROM t000.

LOOP AT itab.

WRITE:/ itab-check AS CHECKBOX,

itab-mandt,

itab-mtext,

ITAB-MWAER.

ENDLOOP..

  • Press F8 after selecting the checkbox, this code

  • will tell you which records where selected.

AT PF8.

  • IF sy-lsind = 1.

DESCRIBE TABLE itab LINES v_lines.

v_cnt = 3. " Initiate value for Count 3 if you're including page header.

DO v_lines TIMES.

READ LINE v_cnt. " Above counter...

READ TABLE itab WITH KEY mandt = sy-lisel+2(3)..

itab-check = sy-lisel(1).

MODIFY itab INDEX sy-tabix.

v_counter = v_counter - 1.

v_cnt = v_cnt + 1.

ENDDO.

WRITE:/ 'SELECTED RECORDS:'.

LOOP AT itab WHERE check = 'X'.

WRITE:/ itab-check, itab-mandt, itab-mtext, itab-ort01.

ENDLOOP.

  • ENDIF.

in this why we use the

  • DESCRIBE TABLE itab LINES v_lines.

  • v_cnt = 3.

  • READ TABLE itab WITH KEY mandt = sy-lisel+2(3)..

  • itab-check = sy-lisel(1).

  • MODIFY itab INDEX sy-tabix.

1 REPLY 1
Read only

Former Member
0 Likes
330

Hi

DESCRIBE TABLE itab LINES v_lines.

this will give the number of records in the internal table.

So the aim here is you have to change all these records with the read data from ITAB.

In the output first 2 lines there won't be data displayed, which are displayed top of page.so taking the count from 3rd line.

v_cnt = 3.

READ TABLE itab WITH KEY mandt = sy-lisel+2(3).

reading the internal table with the MANDT field which are displayed in 2,3,4 characterers.

and taking the first char field value which is nothing but check box and appending/modifing the itab for each line

this will be done for all records of internal table.

itab-check = sy-lisel(1).

MODIFY itab INDEX sy-tabix.

<b>

Reward points for useful Answers</b>

Regards

Anji