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

simple qa:::select -option status

Former Member
0 Likes
1,409

i have itab, in itab i have field stat that have 3 status ( a,b,c)

in the select-option i put a , ineed to get all the lines that have a ( ab,ac,a,aa....)

i use delete itab not where stat co status but it's not work fine.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,305

Hi,

I hope the following code will helps you. You can write the code in at selection-screen event.

  • -- Retrieve all the domain values by calling FM

   CALL FUNCTION 'GET_DOMAIN_VALUES'
  EXPORTING
    domname              =  <domain name>
   TEXT                      = 'X'
   FILL_DD07L_TAB    = 'X'
 TABLES
   VALUES_TAB         = lt_values_tab <fixed value in domain>
   VALUES_DD07L     = <fixed values in DD07L Structure>
 EXCEPTIONS
   NO_VALUES_FOUND  = 1
   OTHERS                     = 2 .
IF sy-subrc <> 0.
Message 'Error ' type 'E'.
ENDIF.

* Read select-option values was supplied
if so_input is not initial.
read table so_input into wa_input index 1.

* Construct all the combination of in select-option parameter
loop at lt_values_tab into wa_values_tab.
 concatenate wa_input-low wa_values_tab-DOMVALUE_L into so_input-low.
 wa_input-sign = 'I'.
 wa_input-option = 'I'.
 append  wa_input into so_input.
Endloop.
endif.

i have itab, in itab i have field stat that have 3 status ( a,b,c)

in the select-option i put a , ineed to get all the lines that have a ( ab,ac,a,aa....)

i use delete itab not where stat co status but it's not work fine.

10 REPLIES 10
Read only

Former Member
0 Likes
1,305

In select options use <b>a*</b> It will give all combinations.

Regards

Kathirvel

Read only

0 Likes
1,305

no

i have a b c

a b

a a

b b c

c b c

a c in the itab.

i put in s.option a and i want all the lines that have a

( ihave space between the status)

Read only

Former Member
0 Likes
1,305

Then try<b> a</b>,

It will give all combination with or with out space and containing <b>a</b> in it.

Regards

Kathirvel

Read only

0 Likes
1,305

but what is the code

delete itab where stat in <b></b>status<b></b>?

Read only

0 Likes
1,305

select-options:

s_status for itab-status.

delete itab where stat not in s_status.

  • when a was entered in select-options

delete itab where stat not in s_status

  • equivalent to

delete itab where stat NA 'a'.

Regards,

Clemens

Read only

Former Member
0 Likes
1,305

In your select options just put <b>a</b>,

It will give all combination with or with out space and containing a in it say <b>( ab,ac,a,aa....)</b>.

Then you <b>need not use delete itab</b> because <b>a</b> will provide you details pnlt that has a in it, as required for you.

To be more clear please post your code, we will be in a better state to provide suggestion.

Regards

Kathirvel

Read only

0 Likes
1,305

delete itab NA not work....

i have in my itab, stat= <b>abc acb abb

abc

abc abb</b>

abb

acc

i insert in my s.option i_status: abc

i need to get all the three lines

what is rhe right statment delete???????????????

Read only

0 Likes
1,305

Hi,

Just try

delete from itab where not stat in s_stat.

Read only

Former Member
0 Likes
1,306

Hi,

I hope the following code will helps you. You can write the code in at selection-screen event.

  • -- Retrieve all the domain values by calling FM

   CALL FUNCTION 'GET_DOMAIN_VALUES'
  EXPORTING
    domname              =  <domain name>
   TEXT                      = 'X'
   FILL_DD07L_TAB    = 'X'
 TABLES
   VALUES_TAB         = lt_values_tab <fixed value in domain>
   VALUES_DD07L     = <fixed values in DD07L Structure>
 EXCEPTIONS
   NO_VALUES_FOUND  = 1
   OTHERS                     = 2 .
IF sy-subrc <> 0.
Message 'Error ' type 'E'.
ENDIF.

* Read select-option values was supplied
if so_input is not initial.
read table so_input into wa_input index 1.

* Construct all the combination of in select-option parameter
loop at lt_values_tab into wa_values_tab.
 concatenate wa_input-low wa_values_tab-DOMVALUE_L into so_input-low.
 wa_input-sign = 'I'.
 wa_input-option = 'I'.
 append  wa_input into so_input.
Endloop.
endif.

Read only

0 Likes
1,305

Hi,

wa_input-option = 'I'.

will cause a dump.

Regards,

Clemens