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

Problem with Selecting the Record

Former Member
0 Likes
366

Hi,

To select the records and create the orders to the selected records, it was working fine before adding the headings. But now after adding the headings, if I select(check box) record num 1 for creating order it is taking record num 4. How can I select this properly.

Thanks,

Veni.


When 'ORDER'.

      DESCRIBE TABLE gt_zprice LINES lv_cnt.
      DO lv_cnt TIMES.
        lv_index = sy-index + 1.
        READ LINE lv_index FIELD VALUE chbox.
        IF chbox = 'X'.
          READ TABLE gt_zprice INTO gs_zprice1 INDEX sy-index.
          IF sy-subrc EQ 0.
            gs_zprice1-index = sy-index.
            APPEND gs_zprice1 TO gt2_zprice.
            CLEAR gs_zprice1.
          ENDIF.
        ENDIF.
        CLEAR chbox.
      ENDDO.

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
345

Hello,

Add the number of lines occupied by the Header.

Like:

lv_index = sy-index + 3.

If you report ouput is like:

---------------------------------
| Header1 | header 2 |
--------------------------------
First record
........

regards,

Naimesh Patel

2 REPLIES 2
Read only

naimesh_patel
Active Contributor
0 Likes
346

Hello,

Add the number of lines occupied by the Header.

Like:

lv_index = sy-index + 3.

If you report ouput is like:

---------------------------------
| Header1 | header 2 |
--------------------------------
First record
........

regards,

Naimesh Patel

Read only

0 Likes
345

Thank you Naimesh,

The problem got solved by your logic.

Regards,

Veni.