cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Query - Table for Batch, Char values & desc.

Former Member
0 Kudos

Hi Gurus,

Looking for a Table join for requirement to fetch Characteristic description, char values & Batch no in ABAP query.

Thanks.

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member186193
Active Contributor
0 Kudos

Hi,

Try table MSEG for batch

CABN for Characteristic and

CABNT for Characteristic Descriptions

Hope it helps you.

Regards,

Alok

sjeevan
Active Contributor
0 Kudos

As far as I know you cannot get your desired report just from ABAP query.

You only need data from two tables MCH1 (or MCHA depending on how your batch management is set plant level or client level)

and second table AUSP

From table MCH1 get the CUOBJ_BM (for example 21755)

and you need to join this with table AUSP field OBJEK ( will be 000000000000021755) and KLART = 023

but... the field length of CUOBJ_BM is 18 and OBJEK is 30 so join is impossible in ABAP query.

I would suggest you to go with ABAP programming.

You can use this function module : QC01_BATCH_VALUES_READ

gaurav_mehra2
Active Participant
0 Kudos

Hi,

Look for following tables:

Batches: MCH1, MCHA, MCHB and MCHBH (Batch history table)

Characteristics: CABN, CABNT, CAWN, AUSP

Regards,

Gaurav

Former Member
0 Kudos

Hi,

Call function module VB_BATCH_VALUES_FOR_OUTPUT in your report.

Regards.

former_member184701
Active Contributor
0 Kudos

dear friend,

look at tables: MCH1, MCHA, MCHB - batches

CABN, CABNT, CABNZ, CAWN, CAWN - chars

and of course MARA, MAKT, MARC,MARD -material/stocks

good luck!

Former Member
0 Kudos

Hi Gurus,

I tried this combination but unable to find 2 tables for join in ABAP Query.

If I select 3 tables, error occurs.

Request you for 2 tables wheren in Batch, Char, Char Values can be retrieved in report.

Thanks

former_member184701
Active Contributor
0 Kudos

dear,

it depends on which table you selected first (Table join using basis table) and how do you insert next tables.

i am talking about the info-set creation step.

let's do a simple query.

run SQ02. type new infoset name and hit Create.

type name and type MARA for "Table join using basis table" radio button. Hit Continue.

now insert (add) tables: MARC, MCHA, CABN, CAWN

think about Inner Join or Left Outer Join !!'

say, if you need to display all materials (even if not exist on plant) set Left Outer Join. if you're after materials existing on plant keep default Inner Join.

friend, my example above is only the example.

make sure you undertsand how to build a sap query in general.

never set many tables at once. insert 2-3 tables, return to your query (SQ01) or create it, adjust it and test. step by step - table by table. add the new table in infoset, add the fields, generate it and come back to your query. adjust it and test.

good luck!

Former Member
0 Kudos

Hi Guru,

Thanks for your reply.

I have created 'Indfoset' using SQ02 T-Code. MCHA, CABN & CAWN Tables are inserted.

When I am trying to user this in Query using SQVI --> Data Source: SAP Query Info Set. However on F4, I am not able to find it in the list. Am I missing any step? I have not used any join while creation of Infoset.

Tried creating Query using T-Code: SQVI, MCHA, CABN & CAWN Tables are inserted in it.

MCHA - MATNR

MCHA - WERKS

MCHA - CHARG (Batch)

CABN - ATNAM

CAWN - ADZHL

Above fields are used to form query, not showing any errors when checked. However on execution F8, not retrieving any data in the report.

sjeevan
Active Contributor
0 Kudos

What fields did you join between MCHA and CABN ;

CABN and CAWN?

Former Member
0 Kudos

Hi Gurus,

MCHA - WERKS

CABN - WERKS

This join is default pop up on slection of 2 tables.

However no explicit join is made.

Thanks

Former Member
0 Kudos

Hi Guys,

Any further inputs...?

Please suggest steps how to create 'Infoset'.

Thanks.