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 function module 'VIEW_GET_DATA'

Former Member
0 Likes
2,037

Hi,

When I want to read from maintenance view with function module 'VIEW_GET_DATA', I get get an empty DATA internal table. I specify which records I want to read from my maintenance view using DBA_SELLIST, and I suspect I am not doing it correctly.

This is how I do it:

wa_DBA_SELLIST-VIEWFIELD = 'PERSK'.

wa_DBA_SELLIST-OPERATOR = 'EQ'.

wa_DBA_SELLIST-VALUE = 'SP'.

append wa_DBA_SELLIST to it_DBA_SELLIST.

So, I want to read only those records where PERSK field equals to 'SP'. Is there anything I am doing wrong in setting up it_dba_sellist?

Also, how do I make it so that I select only specific parameters rather than entire rows from maintenance view?

Thank you,

Jake Alexander

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,292

Check with SM30, is there a pop-up ?

NB: A field (e.g. MOLGA) may have been defined for subset and so became mandatory for accessing to the view. You could also use WITHOUT_SUBSET flag in the call.

Regards,

Raymond

3 REPLIES 3
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,293

Check with SM30, is there a pop-up ?

NB: A field (e.g. MOLGA) may have been defined for subset and so became mandatory for accessing to the view. You could also use WITHOUT_SUBSET flag in the call.

Regards,

Raymond

Read only

0 Likes
1,292

I have used a view v_t356 as an example and it worked me perfectly with the conditions. Please see the below code

wa_DBA_SELLIST-VIEWFIELD = 'ARTPR'.

wa_DBA_SELLIST-OPERATOR = 'EQ'.

wa_DBA_SELLIST-VALUE = 'CM'.

wa_DBA_SELLIST-TABIX = '2'.

append wa_DBA_SELLIST to it_DBA_SELLIST.

When ever we give the conditions the function module view_get_data tries to check the field numbering before checking . Here in view v_t356 the field number ARTPR is 2. So as per your check the field number in the view and pass the number in the TABIX area. So that you can achieve what you need.

If the issue resolves please provide the points.

Read only

0 Likes
1,292

It did work, thank you. Is there a resource online that gives a detailed explanation and possibly usage examples of all the function modules and data structures used in SAP?