Quantcast
Channel: SCN : Document List - ABAP Development
Viewing all articles
Browse latest Browse all 935

Dynamic Search based on given input pattern if Exact input value is unknown

$
0
0

Hi,

This Document illustrates about how to search based on given input any two letters  using CP sql command (CP : Contains Pattern).

 

Scenario : when we enter any  number or any input like '00' in input field  , it should search all the material numbers which consists of '00' as shown below .

 

1.Enter any value in the input field whixh should be relavent to input field.

 

Capture.PNG

 

2.After click on F4 Help , result should be as shown below.

capture1.PNG

Program :

 

declare a range for BOM number and please use the below code for creating input help.

 

TYPES : BEGIN OF ty_range,

           sign TYPE char1,

           option TYPE char2,

           low TYPE stko-stlnr,

           high TYPE stko-stlnr,

     END OF ty_range.

 

TYPES : BEGIN OF ty_stko ,

         stlr TYPE stko-stlnr,

         END OF ty_stko.

 

DATA: lt_stko TYPE STANDARD TABLE OF ty_stko,

       lw_stko TYPE ty_stko,

 

       lt_range TYPE STANDARD TABLE OF ty_range,

       lw_range TYPE ty_range.

 

PARAMETERS bom TYPE stko-stlnr.

 

*---->Processing

 

******Check for BOM List for the given input value

 

lw_range-sign = 'I'.

lw_range-option = 'CP'.

CONCATENATE '*' bom  '*' INTO lw_range-low.

APPEND lw_range TO lt_range.

 

 

SELECT stlnr

   FROM stko

   INTO CORRESPONDING FIELDS OF TABLE lt_stko

   WHERE stlnr IN lt_range .

 

 

just change the table and field names it will work...

 

 

Thanks and Regards,

Lokeswar Reddy Byni.


 

 

 

 


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>