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

Regarding idoc filter

Former Member
0 Likes
1,517

Hi All,

I have a requirement in Idoc.

I want to generate Idocs for selected plant only using MATMAS. here I am doin for change pointer also. I used filter in bd64 for single plant. when i run BD21 transaction it will generate idocs for all plants. So i donot process to all the plants. Please tell me is there any user exit or enhancemet regarding this issue.

Thanks & regards,

Chandra Mohan

1 ACCEPTED SOLUTION
Read only

former_member189779
Active Contributor
0 Likes
1,350

Badi IDOC_CREATION_CHECK

if idoc_control-mestyp = 'MATMAS'.

    types:begin of ty_marc,

            matnr type marc-matnr,

            werks(70), "TYPE marc-werks,

            mmsta type marc-mmsta,

          end of ty_marc.

    data: i_marc type table of ty_marc,

          i_tbd05 type table of tbd05.

    data: w_marc type table of ty_marc,

          w_tbd05 type tbd05,

          w_idoc_data type edidd,

          w_idoc_cont type edidc.

    data: lv_matnr type mara-matnr.

    read table idoc_data into w_idoc_data with key segnam = 'Your segment having plant'.

Clear:create_idoc. based on your plant.

Badi IDOC_CREATION_CHECK

if idoc_control-mestyp = 'MATMAS'.

    types:begin of ty_marc,

            matnr type marc-matnr,

            werks(70), "TYPE marc-werks,

            mmsta type marc-mmsta,

          end of ty_marc.

    data: i_marc type table of ty_marc,

          i_tbd05 type table of tbd05.

    data: w_marc type table of ty_marc,

          w_tbd05 type tbd05,

          w_idoc_data type edidd,

          w_idoc_cont type edidc.

    data: lv_matnr type mara-matnr.

    read table idoc_data into w_idoc_data with key segnam = 'Your segment having plant'.

Clear:create_idoc. based on your plant.

8 REPLIES 8
Read only

former_member189779
Active Contributor
0 Likes
1,351

Badi IDOC_CREATION_CHECK

if idoc_control-mestyp = 'MATMAS'.

    types:begin of ty_marc,

            matnr type marc-matnr,

            werks(70), "TYPE marc-werks,

            mmsta type marc-mmsta,

          end of ty_marc.

    data: i_marc type table of ty_marc,

          i_tbd05 type table of tbd05.

    data: w_marc type table of ty_marc,

          w_tbd05 type tbd05,

          w_idoc_data type edidd,

          w_idoc_cont type edidc.

    data: lv_matnr type mara-matnr.

    read table idoc_data into w_idoc_data with key segnam = 'Your segment having plant'.

Clear:create_idoc. based on your plant.

Read only

0 Likes
1,350

Please let know, do i need to implement in  IDOC_CREATION_CHECK. if i do so, when i run BD21, is it trigger this??

Read only

0 Likes
1,350

Yes Implement this BADI. It should trigger.

Read only

0 Likes
1,350

there is one method IDOC_DATA_CHECK, can we do coding in this or we can create new implemention method..?Please

Read only

0 Likes
1,350

Inside the BADI Interface you can Implement the method.

Call with Interface method as

Interface_name~Method with data you can check or block what you want to do.

Read only

0 Likes
1,350

Create new implementation and write you code in IDOC_DATA_CHECK method.

Read only

0 Likes
1,350

    in method IDOC_DATA_CHECK , CREATE_IDOC parameter set to X, do i need to set it as blank..??

Read only

0 Likes
1,350

CREATE_IDOC will be X for the plant you want to create Idoc for rest of plants make it blank.