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

FIELDS IN SCREEN

Former Member
0 Likes
537

HI gurus,

I created three fields on screen.

now my requirement is to display the kna1 (say kunnr land1 ort01) data record by record.

if i click on some pushbutton next record should display on the fields .....like that all records ...

pls help me

Regards.

SV

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
513

In your main program, PAI section

do something like this.

get all the data from kna1 in your internal table.

module next.
case sy-ucomm.
when 'NEXT'.  " Assmuning that your function code for the button is NEXT
read table itab index count.
if sy-subrc = 0.
v_kunnr = itab-kunnr.
v_land1 = itab-land1.
v_ort01 = itab-ort01.
endif.
count = count + 1.
endcase.
endmodule.

3 REPLIES 3
Read only

Former Member
0 Likes
514

In your main program, PAI section

do something like this.

get all the data from kna1 in your internal table.

module next.
case sy-ucomm.
when 'NEXT'.  " Assmuning that your function code for the button is NEXT
read table itab index count.
if sy-subrc = 0.
v_kunnr = itab-kunnr.
v_land1 = itab-land1.
v_ort01 = itab-ort01.
endif.
count = count + 1.
endcase.
endmodule.

Read only

Former Member
0 Likes
513
SELECT *
    FROM kna1
    INTO TABLE gt_kna1
    UP TO 100 ROWS.

CALL SCREEN 100.

in screen 100.

PBO

module READ_KNA1 output.

  READ TABLE gt_kna1 INTO gs_kna1 INDEX gv_index.

endmodule.                 " READ_KNA1  OUTPUT

PAI

CASE sy-ucomm.

    WHEN 'NEXT'.
      ADD 1 TO gv_index.
    WHEN 'PREV'.
      SUBTRACT 1 FROM gv_index.
  ENDCASE.

Read only

Former Member
0 Likes
513

thanku Uygar Çiçek and Ravikanth