cancel
Showing results for 
Search instead for 
Did you mean: 

Pass multiple parameters to select query in stored procedure

former_member226419
Contributor
0 Kudos

Hello Everyone,

I have stored procedure in which I need to pass two parameters as below:

a.) IPMATERIAL(Material No) as single value
b.) IPBATCH(Batch) as multiple value

Suppose user will enter Material = 100 and batch = B1 , B2 and B3, So I have concatenate MATNR with each BATCH say 100 B1 , 100 B2 and 100 B3 and these concatenated values in my select query..

Existing Code: This is working for single value for material and batch

MSEG_TT = SELECT :IPBATCH||:IPMATERIAL AS "REC_BATCH" FROM DUMMY;

MSEG_TT1 = SELECT DISTINCT A.REC_BATCH FROM (SELECT DISTINCT REC_BATCH FROM :MSEG_TT WHERE SUBSTR(REC_BATCH,0,10) = '1000000000') AS A INNER JOIN "_SYS_BIC"."kgm.global_attributes.material/CA_DIM_MATERIAL_GRA_001" AS B ON SUBSTR(A.REC_BATCH,11,18) = B.MATERIAL WHERE B.MATL_TYPE NOT IN ('ZFRT', 'HALB');

Now in above code I need to pass concatenated single MATNR and multiple BATCHES in above query instead of single batch like 100 B1 , 100 B2 and 100 B3.

Can someone give me the right direction how to achieve this?

Br

sd

Accepted Solutions (0)

Answers (0)