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

User Exit for batch classification

Former Member
0 Likes
8,367

Hello all,

I want to assign values to user-defined characteristics of a batch when posting goods issue against respective material. I found enhancement MBCFC004 which contains CFC which as given in documentation get called at time of a goods movement for a batch to be specified.

But when I tried posting Goods Receipt through MIGO it wont get called at all. Any body could tell me is this valid User Exit ? which other exit can be used for same purpose??

11 REPLIES 11
Read only

Former Member
0 Likes
3,610

Hi,

MBCFC004>EXIT_SAPMM07M_004> ZXMBCU04.

IF i_mseg-bwart = '101'.
*-- Data Declarations
  DATA : t_characters LIKE characters OCCURS 0 WITH HEADER LINE.
  DATA : t_attributes LIKE api_ch_att OCCURS 0 WITH HEADER LINE.
  DATA : t_values LIKE api_val_i OCCURS 0 WITH HEADER LINE.
**-------------------GOODS MOVEMENT DETAILS FOR THE ORDER ENTERED----------
  t_characters[] = characters[].
  t_attributes[] = attributes[].
  t_values[] = values[].


  IF  w_afpo-pwerk = 'PS01'.
*-- Raw Seed for order types PHYD , PKNL
    IF ( w_aufk-auart = 'PHYD' OR
         w_aufk-auart = 'PKNL' OR
         w_aufk-auart = 'POHD' OR
         w_aufk-auart = 'POKL') .
      IF ( w_mara-mtart = 'ZRSD' OR w_mara-mtart = 'ZWCB' ).
        CLEAR: v_season, v_year, v_season_year.
        CONCATENATE w_aufk-zzsaiso w_aufk-zzsaisj INTO v_season_year SEPARATED BY space.

        LOOP AT t_characters.
          CASE t_characters-atnam.
            WHEN 'PRODUCTION_YEAR'.
              v_year = w_aufk-zzsaisj.
              t_values-atinn = t_characters-atinn.
              t_values-atnam = t_characters-atnam.
              t_values-atwtb = w_aufk-zzsaisj.
              APPEND t_values TO values.
              CLEAR t_values.

            WHEN 'SEASON'.
              v_season = w_aufk-zzsaiso.
              t_values-atinn = t_characters-atinn.
              t_values-atnam = t_characters-atnam.
              t_values-atwtb = w_aufk-zzsaiso.
              APPEND t_values TO values.
              CLEAR t_values.

            WHEN 'GROWER_CODE'.
              t_values-atinn = t_characters-atinn.
              t_values-atnam = t_characters-atnam.
              t_values-atwtb = w_aufk-zzgrower.
              APPEND t_values TO values.
              CLEAR t_values.

            WHEN 'SEASON_YEAR'.
*              CONCATENATE V_SEASON V_YEAR INTO V_SEASON_YEAR SEPARATED BY SPACE.
              t_values-atinn = t_characters-atinn.
              t_values-atnam = t_characters-atnam.
              t_values-atwtb = v_season_year.
              APPEND t_values TO values.
              CLEAR t_values.
          ENDCASE.
        ENDLOOP.
      ENDIF.

This is the code which we did for userdefined characteristics....

Thanks,

Shailaja Ainala.

Read only

0 Likes
3,610

Hi Shailaja,

I tried using same enhancement but not working. Control is not going to that FM. I am using MIGO transaction for doing Goods Receit against PO. When click on Batch & click on classification button control wont go to this FM (EXIT_SAPMM07M_004).

For which transaction u used this enhancement??

Read only

0 Likes
3,610

Hi Abhijeet,

I am also facing same problem.

Did you get correct user exit or badi ?

Thanks,

Satendra

Read only

0 Likes
3,610

Sorry, I forgot to update the thread.

Yes, I solved the issue. Go to transaction 'OMCV',thr u will find in table third row checkbox for user ext. Enable it for your req movment type and ur problem would get solved.

Enjoy,

Abhijeet More.

Read only

0 Likes
3,610

Hi Abhijeet,

First of all thanku very much for promtly response.

I flaged the check box as you told.

Still control is not stopping at break point in user exit EXIT_SAPMM07M_004 .

Just wanted to double check you did the change in this user exit only to meet ur req?

Thanks,

satendra

Read only

0 Likes
3,610

Hi,

Yes I only did changes in UE "EXIT_SAPMM07M_004" . Make sure in that OMCV transaction your enabling checkbox for you required movement type. If in transaction Migo you are using movement type for which flag is not enabled it will not go to this user exit.

Regards,

Abhijeet more

Read only

0 Likes
3,610

Hi Abhijit,

Iam facing the problem to trigger EXIT_SAPMM07M_004 could you please elaborate on transaction OMCV.

Thanks

Jagadeesh

Read only

0 Likes
3,610

Hi Satendra,

I have problem in EXIT_SAPLV01Z_014 in triggering through MIGO.

Could you please tell me whether we can use EXIT_SAPMM07M_004 or EXIT_SAPLV01Z_014 in .

Thanks in advance

Regards

Jagadeeshwar B

Read only

stefan_weisenberger
Product and Topic Expert
Product and Topic Expert
0 Likes
3,610

There are actually 2 different exits.

You may try to use EXIT_SAPLV01Z_014 instead.

Read only

0 Likes
3,610

Hi Stefan,

yes this exit is getting triggered when i click on classification button.

Before assigning dynamic value for a char I have to do one more validation and it should be happened when user gives Batch number. i mean before pressing classification button.

The existing batch classification setup of country A system enforces the user to complete certain batch characteristic values at the time of goods receipt. These characteristic values are specific to country A and are not required during goods receipt of these materials outside the country A. The requirement is to ensure these characteristic values are not mandatory during the goods receipt process outside the country A, and also to ensure they remain mandatory within country A.

Appreicate your inputs .

Thanks,

satendra

Read only

Former Member
0 Likes
3,610

Hello A,

If you're using MB1A / MB1C / MB31 you can use EXIT_SAPMM07M_004.

If you're using MIGO you have to create an implementation for BADI MB_DOCUMENT_BADI.

Regards.

JC