Application Development 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: 

Reading deleted material from change pointer table...

Former Member
0 Kudos

hello everyone,

I am loading deltas using change pointer tables. Now although material is deleted, it is still marked as 'U' in the cdhdr table.

I am reading the changes and then selecting my material data from those changes.

LVORM is the flag for deletion, but how do I write my SELECT statement so that the material data in my change pointer table is selected and then from this data I select materials marked for deletion.

Thanks in advance.

Regards,

Fred.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Fred,

Although you are deleting the material, from a change pointer perspective the value of the field LVORM is being changed from SPACE to 'X'.

So, read the change the pointer table for LVORM field where the old value is initial and new value is 'X'.

From there you can read the material data.

Regards,

Ravi

Note : Please mark the helpful answers

10 REPLIES 10

Former Member
0 Kudos

Fred,

Although you are deleting the material, from a change pointer perspective the value of the field LVORM is being changed from SPACE to 'X'.

So, read the change the pointer table for LVORM field where the old value is initial and new value is 'X'.

From there you can read the material data.

Regards,

Ravi

Note : Please mark the helpful answers

0 Kudos

Ravikumar,

I think when you are talking about old value and new value, you are referring to cdpos. I am not reading changes at cdpos level, I am reading them at cdhdr level.

Am I right?

Regards,

Fred.

0 Kudos

Fred,

If you are not referring to CDPOS how would you know if the the material is being DELETED or UNDELETED.

Else you will have to look at MATERIAL class level and NOT at LVORM level

Regards,

Ravi

Note : Please mark all the helpful answers

former_member188685
Active Contributor
0 Kudos

Hi Fred,

select *
       from CDHDR
       into table IT_DELETE
       where OBJECTCLAS = 'MATERIAL'
        and  CHANGE_IND = 'D'.

D for deletion.

Regards

vijay

Former Member
0 Kudos

Hi,

I am little bit confused about your reference to CDHDR & CDPOS tables as change pointer tables. The actual change pointer table is BDCP and CDHDR & CDPOS are called Change document tables.

Could you please give more details on how you loading delta..

1. Are you using ALE Master data distribution to load your Delta changes?

2. What is actual requirement? Are trying to send only the items (Materials) that are marked for deletion or send only that are not marked for deletion?

If your answer is YES & YES, you can simply use the filtering in ALE and let the RBDMIDOC program generate the IDocs for delta changes using BDCP. (you need to activate the change pointers for material master in this case).

Regards,

Nagaraju Chidurupalli

0 Kudos

Hi,

I have the following:

select maramatnr marcmatnr

from mara

join marc on marcmatnr = maramatnr

into table matl_del

FOR ALL ENTRIES IN i_updtd_materials

where mara~matnr = i_updtd_materials-matnr

and mara~lvorm = 'X'

and marc~lvorm = 'X'.

'i_updtd_materials' is my table that holds all changed materials, meaing deltas.

In my deleted table, I want the materials that have been deleted at client and plant level, meaning mara and marc.

Is it the right way to do it?

Regards,

Fred.

0 Kudos

can anyone help out here please?

0 Kudos

Hi,

Wanted to add some changes to my issue. I want to select material that is deleted at Client level, Plant level or Storage location level.

Thanx in advance.

Regards,

Fred.

0 Kudos

Fred,

I guess what you are doing is right.

MARA will give the deletion indicator at client level and MARC at the plant level and I guess storage locations is also in MARC (I am not sure though).

regards,

Ravi

Note : Please mark the helpful answers

Former Member
0 Kudos

I understand that your requirement is to display all the materials which are marked for deletion at any of the three levels i.e. Global, Plant & Storage location level.

If that is the case you can use the following code..

data: Begin of Matl_del occurs 0,

matnr like mara-matnr,

werks like marc-werks,

LGORT like mard-LGORT,

Flag_mara(1),

flag_marc(1),

flag_mard(1),

End of matl_del.

Loop at i_updtd_materials.

select single matnr LVORM

from mara

into (Matl_del-matnr, matl_del-flag_mara)

where matnr eq i_updtd_materials-matnr

AND LVORM EQ 'X'.

if sy-subrc eq 0.

APPEND MATL_DEL.

CLEAR matl_del-flag_mara.

endif.

select werks LVORM

from marc

into (Matl_del-werks, matl_del-flag_marc)

where matnr eq i_updtd_materials-matnr.

IF matl_del-flag_marc EQ 'X'.

APPEND MATL_DEL.

CLEAR matl_del-flag_marc.

ENDIF.

select lgort LVORM

from mard

into (Matl_del-lgort, matl_del-flag_mard)

where matnr eq i_updtd_materials-matnr.

and werks eq matl_del-werks

and lvorm eq 'X'.

APPEND MATL_DEL.

endselect.

endselect.

Endloop.

  • at this time you will have your MATL_DEL filled with all the deleted levels of your materials in your delta table.

Hope this helps.

Regards,

Nagaraju Chidurupalli