2022 Jun 01 7:28 AM
Hi all,
I am new to SAP. Please help me in resolving the below issue.
I want to find the changes in material master of particular fields and upload a file on application server using AL11.
I tried to find the material changes using CDHDR. But the problem is how can I upload a file only when particular required fields are changed but not all the fields.
Thanks in advance.
2022 Jun 01 1:46 PM
Hi
Use the following query to get the output of changes - (alter it according to your requirement )
DATA : it_cdpos type STANDARD TABLE OF cdpos WITH HEADER LINE,
wa_cdpos type cdpos.
Ranges: s_fields for cdpos-fname.
select * into it_cdpos from cdhdr as a INNER JOIN cdpos as b on ( a~changenr = b~changenr )
WHERE a~objectclas = 'MATERIAL' AND a~objectid = <your material no> and
b~fname in s_fields and b~changind = 'U'.
The above it_cdpos will gives you list of materials that are changed.
Customize the where clause of cdhdr according to your requirement
2022 Jun 01 10:23 AM
not clear. You are making an upload when the field on material master changes? Field change is your trigger?
2022 Jun 01 12:31 PM
Yes, a file has to be uploaded when there is a change in data ( description , colour, chromaticty , weight etc ). But there are some fields whose data change I don't want to consider.
2022 Jun 01 1:04 PM
Hi
Do you know what are all the fields you need to monitor. If so you can take them comparing CDHDR and CDPOS table
2022 Jun 01 1:22 PM
Yes. There are about 25 to 27 fields.
May I know how can it be compared?
2022 Jun 01 1:46 PM
Hi
Use the following query to get the output of changes - (alter it according to your requirement )
DATA : it_cdpos type STANDARD TABLE OF cdpos WITH HEADER LINE,
wa_cdpos type cdpos.
Ranges: s_fields for cdpos-fname.
select * into it_cdpos from cdhdr as a INNER JOIN cdpos as b on ( a~changenr = b~changenr )
WHERE a~objectclas = 'MATERIAL' AND a~objectid = <your material no> and
b~fname in s_fields and b~changind = 'U'.
The above it_cdpos will gives you list of materials that are changed.
Customize the where clause of cdhdr according to your requirement