cancel
Showing results for 
Search instead for 
Did you mean: 

Function module fetch batch records matching characteristic values

07-24-2023 10:50 AM
kalyan_18930 Explorer
3626 views 9 comments
0 Likes
SAP Managed Tags
Subscribe

Hi Experts

Pls. suggest any function modules or similar exist where we pass the characteristic values and fetch all batch records which matches the value.

I tried using the FM # CLAF_OBJECTS_OF_CLASS however it has only characteristic name but not its value for filter condition.

Appreciate any suggestion.

P.S: We are on SAP 2022 S4 HANA release

Thanks

Ravi K

0 Likes

Accepted Solutions (0)

Answers (4)

Answers (4)

Dominik_Tylczynski
SAP Champion
SAP Champion

Hello ravindharan

You can use BAPI_CLASS_SELECT_OBJECTS to select objects including batches by their classification, i.e. characteristics values.

Best regards

Dominik Tylczynski

kalyan_18930
Explorer
0 Likes

Thanks for all your response.

Let me try the mentioned BAPI & keep posted.

Regards

Ravi K

0 Likes

Hello

You can use select.

DATA lv_type TYPE atinn .
CALL FUNCTION 'CONVERSION_EXIT_ATINN_INPUT'
   EXPORTING
   input = 'TYPE' " name of charecter that you want search base on it
   IMPORTING
   output = lv_type.

SELECT mch1~charg,
    FROM mch1
    JOIN ausp ON mch1~cuobj_bm EQ ausp~objek AND ausp~atinn = @lv_type
    WHERE
    ausp~atwrt = 'val' and "for characteristic
    ausp~atflv = 123 and "for numeric
    lvorm = ''
    INTO TABLE @DATA(it_batch).
Dominik_Tylczynski
SAP Champion
SAP Champion

Classification data should not be read directly from DB tables. That by passes classification statistics generated with CLST and ignores LO-VC dependencies. Instead SAP provided BAPIs and APIs should be used.

0 Likes

Yes you are right.

I use this select for specific report and only use it when 100% certainty of that characteristic.

TarunTakshak6
Participant
0 Likes

Hi ravindharan,

Use these FM

VB_BATCH_GET_DETAIL

BAPI_MATERIAL_GETBATCHES

Thanks

Tarun

Dominik_Tylczynski
SAP Champion
SAP Champion
0 Likes

BAPI_MATERIAL_GETBATCHES selects batches for a material, but it doesn't select by batch classification or return classification data.

RAHEEL_BABAR
Active Contributor
0 Likes

Hi,

Please try this FM VB_BATCH_GET_DETAIL.

BAPI_BATCH_GET_DETAIL

Regards

Dominik_Tylczynski
SAP Champion
SAP Champion
0 Likes

I think the question is about searching for batches with characteristic values, not about reading classification data of a single batch. Also BAPI_BATCH_GET_DETAIL doesn't return a batch classification.