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

Select option :Problem in custom report

Former Member
0 Likes
714

Hi Experts,

I am working on a custom report and we have acount number field on selecton screen.Initially we had hardcoded the range on selection screen as :

     S_RACCT-LOW  = '0050000000'.
     S_RACCT-SIGN = 'E'.
    S_RACCT-OPTION = 'LT'.
    APPEND S_RACCT.
    S_RACCT-LOW  = '0059999999'. 

    S_RACCT-SIGN = 'E'.
    S_RACCT-OPTION = 'GT'.
    APPEND S_RACCT.

So when we select on above range we get data which is in range 0050000000 and 0059999999.

Now we are removing this hardcoding and instead selecting account no. from a table ITAB so i changed it like this:

   DELETE ITAB  WHERE accountno. NOT IN S_RACCT.
  S_RACCT-SIGN   = 'I'.
S_RACCT-OPTION = 'EQ'.
S_RACCT-HIGH   = ''.
Loop at itab

S_RACCT-low = itab-field

append S_RACCT.

But the probelm is even if user gives account no on selection screen which doesnt belong to data in itab i am getting incorrect data.

Any pointers on this ? How should i go about it so that only 5 series account no. are selected.

7 REPLIES 7
Read only

Former Member
0 Likes
661

At this risk of answering a post that will be locked for basic question....

Please read the available and well done ABAP help (F1) on the subject.  Doing so will often result in the answer you need and will result in no need to post a basic question.

Read only

mithun_shetty4
Contributor
0 Likes
661

Which event is used to fill internal table ITAB  ? I hope you are filling ITAB somewhere

and under which event is this code written ? It Should be in Initilisation !

Read only

ankit_doshi
Participant
0 Likes
661

Hi,

You can add validation for your selection screen. i.e. you can check if S_RACCT-low+0(3) EQ 5 if not you can throw an error message thus enforcing the user to enter your desired 5 number series

Read only

0 Likes
661

But if the user gives in selection screen something like a/c no NE 12345

that is also valid right

Read only

0 Likes
661

no that wont be valid,

on the event AT-SELECTION SCREEN.

you put your condition/check , this will ensure that the user enters what you expect him to enter on the selection screen and if user does not enter you directly throw an error message.

Read only

Former Member
0 Likes
661

hi,

It looks that you are not clearing Table S_RACCT. before appending entery from ITAB.

one more thing in you select statement which table you are using S_racct or Itab.

Raj

Read only

Private_Member_49934
Product and Topic Expert
Product and Topic Expert
0 Likes
661

BM .

1)It seems that code which you are trying to do may not be stable in future. Not select option has a memory limit when used in select statement. For our system it starts giving dump if a select option has around 10k lines .

2)where do you get the itab filled? Does it has all the 5* account number? if yes then simply put the validation at selection screen like the below. I am assuming the ITAB is getting filled in the INITIALIZATION event and

AT SELECTION-SCREEN ON S_RACCT.

L_ITAB[] = ITAB[]

DELETE L_ITAB WHERE FIELD NE S_RACCT.

IF L_ITAB IS INITIAL.

MESSAGE EXYZ. " INVALID ACCOUNT NUMBER.

ENDIF.

* FINALY GET THE FINAL ITAB in START-OF-SELECTION and use it in select

START-OF-SELECTION.

DELETE ITAB WHERE FIELD NE S_RACCT. " nOW USE ITAB in further selection