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

Dmbtr value

Former Member
0 Likes
1,817

Hi,

iam new to sap abap...

My Requirement :

in plant analysis i got difference value of the matnr :5.19

i saw in mseg table but it is stored as lgort as blank in mard the only one location 39 for particular material

Exaample:

in mard select entries

Matnr-210004, lgort-39, pstat-D, lvorm=null, LFGJA=2012 ,LFMON=12, Labst,Umlme,insmeeinme,retme(All Field) =0.00

mseg table :

Matnr-210004, lgort-Blank, Bwart-303 ,DMBTR-5.19, SHKZA-S (This field i need to join)

MSEG-MJAHR = MARD-LFGJA

but mseg-mjahr not matched with mard LFGJA

how can i join the table,... is there any alternative table

please help me

5 REPLIES 5
Read only

developerone
Contributor
1,422

Can you please post your code? It helps us understand the problem.

Read only

Former Member
0 Likes
1,422

Hai sai,

I want to join mard table with mseg table to get dmbtr field value.

Key for two table is

MSEG-MJAHR = MARD-LFGJA

but for particular material number 
mseg and lfgja value not matched......


In mseg table
For Matnr-210004  mjahr is 2017 
dmbtr 14
In mard table 
For Matnr-210004  mjahr is 2015


How can I join the table to get dmbtr?
Pls help me
Read only

developerone
Contributor
0 Likes
1,422

SELECT SINGLE DMBTR FROM MSEG as G INTO DATA(lv_mseg) INNER JOIN MARD as D WHERE G~MJAHR = '2017' AND D~MJAHR = '2015' AND G~MATNR = D~MATNR AND G~WERKS = D~WERKS AND G~LGORT = D~LGORT ( All the fields that match ).

** Please excuse the syntax I do not have my computer with me. **

Use the comments button to respond. The answer button is only for providing answers.

Read only

Former Member
0 Likes
1,422

Hi sai,

Thank for ur reply. But Here plant is input. Year is not input. How can I match these table when year is different in both table.

The above year is just an example.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,422

Did you try not to only use MARD without period/year, but also MARDH for past period/year, MARD carry the last period/year when a movement occured.