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

PBO

Former Member
0 Likes
1,009

Hi,

In the PBO event i use an select query, the data present in the internal table will be concatenated into variable fetch into the screen(9000) of text element. how i code it?

1 ACCEPTED SOLUTION
Read only

former_member196299
Active Contributor
0 Likes
979

Hi Chaitanya,

code it using this logic ....

after you get your data into the itab , call a FM VRM_SET_VALUES and pass the values there ...

This sample code will solve your problem ...

add these two in the top include or declaration part along with other declarations of itables ..

type-pools vrm.

data: name type vrm_id.

data: l_wa_mat_descr type vrm_value,

l_tab_mat_descr type vrm_values.

select matnr from mara

into table l_tab_mara_matnr

where matkl = 'ZPMBMAT'.

if not l_tab_mara_matnr[] is initial.

select maktx from makt

into l_tab_collect_maktx_frm_db-material_descr

for all entries in l_tab_mara_matnr

where matnr = l_tab_mara_matnr-material_no.

append l_tab_collect_maktx_frm_db.

endselect.

endif.

loop at l_tab_collect_maktx_frm_db into l_wa_collect_maktx_frm_db.

l_wa_mat_descr-key = l_wa_collect_maktx_frm_db-material_descr.

append l_wa_mat_descr to l_tab_mat_descr.

endloop.

name = 'ZCOT_PPT_DTLS-MATERIAL_DESCR'. " screen field name

call function 'VRM_SET_VALUES'

exporting

id = name

values = l_tab_mat_descr

exceptions

id_illegal_name = 1

others = 2.

Reward if helpful !

Regards,

Ranjita

Hi,

In the PBO event i use an select query, the data present in the internal table will be concatenated into variable fetch into the screen(9000) of text element. how i code it?

6 REPLIES 6
Read only

Former Member
0 Likes
979

Write down code Like :

PBO.

Module mod.

module mod.

select * from vvv into vvvv..

concatenate fld1 fld2 into fld3.

leave to screen 9000.

endmodule .

reward points if it is useful

Thanks

Seshu

Read only

Former Member
0 Likes
979

Hi,

You can write the Select Query in the PBO event,

So loop that internal table, then catch the internal table value, then cancatinate that value and use the MOVE statment to move that value to that text element, and make sure that the Text element shoulb be the Screen field, then only it will appear in the Screen

Regards

Sudheer

Read only

0 Likes
979

HI Sudheer Junnuth,

iF I HAVE 5 Text elements on the screen ..hw to process it??

Read only

Former Member
0 Likes
979

Hi Chaitanya,

To make this thing work for 5 Text Elements.

Write a loop like this.

Loop at itab into wa.

if counter le 5.

concatenate text_element1 itab-f1 into text_element1.

endif.

if counter le 10 and counter > 5.

concatenate text_element2 itab-f1 into text_element2.

endif.

if counter le 15 and counter > 10.

concatenate text_element3 itab-f1 into text_element3.

endif.

counter = coutner + 1.

endloop.

Like this you can create for all text_elements.

Hope this will solve your query.

<b><i>** Pl. reward points and motivate us.</i></b>

Read only

former_member196299
Active Contributor
0 Likes
980

Hi Chaitanya,

code it using this logic ....

after you get your data into the itab , call a FM VRM_SET_VALUES and pass the values there ...

This sample code will solve your problem ...

add these two in the top include or declaration part along with other declarations of itables ..

type-pools vrm.

data: name type vrm_id.

data: l_wa_mat_descr type vrm_value,

l_tab_mat_descr type vrm_values.

select matnr from mara

into table l_tab_mara_matnr

where matkl = 'ZPMBMAT'.

if not l_tab_mara_matnr[] is initial.

select maktx from makt

into l_tab_collect_maktx_frm_db-material_descr

for all entries in l_tab_mara_matnr

where matnr = l_tab_mara_matnr-material_no.

append l_tab_collect_maktx_frm_db.

endselect.

endif.

loop at l_tab_collect_maktx_frm_db into l_wa_collect_maktx_frm_db.

l_wa_mat_descr-key = l_wa_collect_maktx_frm_db-material_descr.

append l_wa_mat_descr to l_tab_mat_descr.

endloop.

name = 'ZCOT_PPT_DTLS-MATERIAL_DESCR'. " screen field name

call function 'VRM_SET_VALUES'

exporting

id = name

values = l_tab_mat_descr

exceptions

id_illegal_name = 1

others = 2.

Reward if helpful !

Regards,

Ranjita

Read only

former_member196299
Active Contributor
0 Likes
979

Hi Chaitanya ,

If this question is answered then plese reward points and mark as answered ..

Regards,

Ranjita