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

loop

Former Member
0 Likes
554

CALL METHOD ref1->get_selected_rows

IMPORTING

et_index_rows = lv_row.

how can i make loop at <b>lv_row</b>

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
520

Rani,

I guess you have declared lv_row of type LVC_T_ROW.

DATA : wa_row type LVC_S_ROW.

LOOP AT LV_ROW INTO WA_ROW.

READ ITAB INDEX WA_ROW-INDEX.

  • This will give the row from the internal which is selected on the grid.

ENDLOOP.

Regards,

Ravi

4 REPLIES 4
Read only

Former Member
0 Likes
521

Rani,

I guess you have declared lv_row of type LVC_T_ROW.

DATA : wa_row type LVC_S_ROW.

LOOP AT LV_ROW INTO WA_ROW.

READ ITAB INDEX WA_ROW-INDEX.

  • This will give the row from the internal which is selected on the grid.

ENDLOOP.

Regards,

Ravi

Read only

Former Member
0 Likes
520

declare a line type lv_rwo

data: l_wa like line of lv_row.

loop at lv_row into lv_wa.

endloop.

If it doesn't work,make the highlighted change

CALL METHOD ref1->get_selected_rows

IMPORTING

et_index_rows = lv_row<b>[]</b>.

Regards,

ravi

Read only

Former Member
0 Likes
520

Hai Rani

Check the following Code

&----


*& Report ZABAP_OBJ_13424_01 *

*& *

&----


*& *

*& *

&----


report zabap_obj_13424_01 .

parameters : p_vbeln like vbap-vbeln obligatory,

p_matnr like mara-matnr.

types : begin of ty_vbap,

vbeln type vbap-vbeln,

matnr type vbap-matnr,

arktx type vbap-arktx,

end of ty_vbap.

----


  • CLASS sales_order DEFINITION

----


*

----


class sales_order definition.

public section.

data : v_matnr type mara-matnr,

v_vbeln type vbap-vbeln.

events : no_data_found.

methods : constructor importing vbeln type vbap-vbeln

matnr type mara-matnr optional,

get_vbap_details,

disp_vbap_details,

Handle_no_data_found

for event no_data_found of sales_order.

data : it_vbap type standard table of ty_vbap.

endclass. "sales_order DEFINITION

----


  • CLASS sales_order IMPLEMENTATION

----


*

----


class sales_order implementation.

method get_vbap_details.

clear : it_vbap.

refresh : it_vbap.

select vbeln

matnr

arktx

from vbap

into table it_vbap

where vbeln = p_vbeln.

if sy-subrc <> 0.

raise event no_data_found.

endif.

endmethod. "get_vbap_details

method constructor.

clear : v_vbeln,

v_matnr.

v_vbeln = vbeln.

v_matnr = matnr.

endmethod. "constructor

method Handle_no_data_found.

write : / 'No Data Found for the given selection Criteria'.

endmethod.

method disp_vbap_details.

data : wx_vbap like line of it_vbap.

loop at it_vbap into wx_vbap.

write 😕 wx_vbap-vbeln,

wx_vbap-matnr,

wx_vbap-arktx.

endloop.

clear : it_vbap.

endmethod. "disp_vbap_details

endclass. "sales_order IMPLEMENTATION

data : obj type ref to sales_order.

start-of-selection.

if not p_matnr is initial.

create object obj exporting vbeln = p_vbeln

matnr = p_matnr.

else.

create object obj exporting vbeln = p_vbeln.

endif.

set handler obj->Handle_no_data_found for obj.

call method obj->get_vbap_details.

call method obj->disp_vbap_details.

Thanks & regards

Sreenivasulu P

Read only

Former Member
0 Likes
520

Hi,

do lv_row times.

enddo.

Regards

Amole