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

Help with Selection

Former Member
0 Likes
508

Hello guys, I have a question regarding selecting data. I wrote a program for a user exit for BW which works fine. in that program there is a dialogue screen in which user puts its selection values. but the program totally ignores it. is there a standard code that I need to put in that some one can share with me please? thanks.

TYPE-POOLS: sbiwa.
FORM execute_user_exit
TABLES i_t_select TYPE sbiwa_t_select
i_t_fields TYPE sbiwa_t_fields
c_t_data STRUCTURE FAGLPOSBW
c_t_messages STRUCTURE balmi.
DATA: l_s_FAGLPOSBW LIKE FAGLPOSBW,
it_FAGLPOSBW TYPE FAGLPOSBW OCCURS 0.
DATA: l_tabix LIKE sy-tabix.


DATA: BEGIN OF it_BKPF OCCURS 0,
AWSYS TYPE BKPF-AWSYS,
AWTYP TYPE BKPF-AWTYP,
BELNR TYPE BKPF-BELNR,
BUKRS TYPE BKPF-BUKRS,
GJAHR TYPE BKPF-GJAHR.
DATA: END OF it_BKPF.

it_FAGLPOSBW[] = c_t_data[].

SELECT AWSYS AWTYP BELNR BUKRS GJAHR

INTO TABLE it_BKPF

FROM BKPF

FOR ALL ENTRIES IN it_FAGLPOSBW
WHERE BUKRS = it_FAGLPOSBW-BUKRS AND
BELNR = it_FAGLPOSBW-BELNR AND
GJAHR = it_FAGLPOSBW-GJAHR.

LOOP AT c_t_data INTO l_s_FAGLPOSBW.
l_tabix = sy-tabix.

Read TABLE it_BKPF with key BELNR = l_s_FAGLPOSBW-BELNR
BUKRS = l_s_FAGLPOSBW-BUKRS
GJAHR = l_s_FAGLPOSBW-GJAHR.
If SY-SUBRC = 0.


l_s_FAGLPOSBW-ZZAWSYS_BK = it_BKPF-AWSYS.
l_s_FAGLPOSBW-ZZAWTYP_BK = it_BKPF-AWTYP.
Endif.

MODIFY c_t_data FROM l_s_FAGLPOSBW.
IF SY-SUBRC = 0.
ENDIF.

ENDLOOP.
ENDFORM.

1 ACCEPTED SOLUTION
Read only

former_member186741
Active Contributor
0 Likes
474

Hi Vikram,

it's a little unclear what you mean. Are you saying that you have successfully added in a selection screen which now appears but after the user has entered criteria it does not then got through your pasted abap code? If so you need to show us your pai code from the screen painter. You would at least need to exectute your form 'execute_user_exit' in there.

3 REPLIES 3
Read only

former_member186741
Active Contributor
0 Likes
475

Hi Vikram,

it's a little unclear what you mean. Are you saying that you have successfully added in a selection screen which now appears but after the user has entered criteria it does not then got through your pasted abap code? If so you need to show us your pai code from the screen painter. You would at least need to exectute your form 'execute_user_exit' in there.

Read only

0 Likes
474

Thanks Neil, that is correct. BW has something called datasource which takes data from ECC to BW I enhanced the datasource and added some fields there. now when I or user types the selection in it gets ignored by the program.

Read only

0 Likes
474

from memory you have to take some steps to make the data source active. I can't recall exactly but you may have to run a standard program to get your data source coding picked up.