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 in Inbound function module IDOC_INPUT_MATMAS01

Former Member
0 Likes
6,359

Hi all,

I have a requirement to code for inbound process and store the data in data base table from incoming segments for material master.For that i need to code in user exit available in inbound function module IDOC_INPUT_MATMAS01.Please suggest me a user exit.

Thank you.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,340

You can put your code inside INCLUDE ZXMGVU04

Hi all,

I have a requirement to code for inbound process and store the data in data base table from incoming segments for material master.For that i need to code in user exit available in inbound function module IDOC_INPUT_MATMAS01.Please suggest me a user exit.

Thank you.

16 REPLIES 16
Read only

Former Member
0 Likes
4,340

Go to se37.

Give the FM name IDOC_INPUT_MATMAS01 and press display.

Press Find on the main toolbar (Not in the abap editor)

Search for the string customer-function in the main program.

YO uwill find the statement at multiple locations.

Double click on the three digit customer-function number.

In your can the exit is : EXIT_SAPLMV02_002

Regards,

Ravi

Read only

Former Member
0 Likes
4,341

You can put your code inside INCLUDE ZXMGVU04

Read only

Former Member
0 Likes
4,340

Hi Sanu,


the below is the user exit for Material master for Inbound and outbound.

Read the control record before modifying..

use direction 1 for outbpund and 2 for inbound..


MATMAS- IO -MGV00001 Material master

 Exit- EXIT_SAPLMV02_002 

Regards,

Prabhudas

Edited by: Prabhu Das on Apr 17, 2009 7:37 PM

Read only

0 Likes
4,340

Will you please how did you find this user exit.also please tell me how to see if this is the right user exit by applying break-point.

Read only

0 Likes
4,340

go to this function module EXIT_SAPLMV02_002 and double click on the include ..and go to change mode and simply write any statement ....and put a break point ...check it by executing all.

Read only

0 Likes
4,340

Hi ,


go to se37-->    IDOC_INPUT_MATMAS01--> search( CALL CUSTOMER-FUNCTION '002' ) double click on the 002-->  next double click on (INCLUDE ZXMGVU04--> Put break point..By syntax.. Break-Point.

  • Description: This user exit for inbound material master IDoc *

  • is used to populate export control class data into MAEX*

  • *

  • *

see the sample code if it helps use..


DATA: w_z1maexm LIKE z1maexm,
      w_matnr LIKE mara_ueb-matnr,"w_e1maram LIKE STANDARD TABLE OF MARA_UEB WITH HEADER LINE,
      t_maex LIKE maex,
      t_maex1 LIKE STANDARD TABLE OF maex WITH HEADER LINE,
      segment_name LIKE edidd-segnam,
      w_flgmaex LIKE sy-marky.

*Get the material number.
MOVE f_mara_ueb-matnr TO w_matnr.
"APPEND W_E1MARAM.
*Check for the segment 'Z!MAEXM'
CASE f_cust_segment-segnam.
    "IF F_CUST_SEGMENT-segnam = 'Z1MAEXM'.
  WHEN 'Z1MAEXM'.
    w_z1maexm = f_cust_segment-sdata.
*Assign the default value for Grouping as 1
    MOVE-CORRESPONDING w_z1maexm TO t_maex.
    t_maex-embgr = '1'.
    t_maex-matnr = w_matnr."W_E1MARAM-MATNR.
    APPEND t_maex TO t_maex1.
*Check for the duplicate records in MAEX table
*    loop at t_maex1. " DV2K928158 code correction for readability
    READ TABLE t_maex1. "DV2K928158 - Used READ since T_MAEX1 will have only one record
    SELECT SINGLE * FROM maex WHERE matnr = t_maex1-matnr AND
                                    aland = t_maex1-aland.
    IF sy-subrc = 0.
      w_flgmaex = 'X'.
    ELSE.
      w_flgmaex = ' '.
    ENDIF.
*    endloop.
* Call FM MAEX_SAVE to Append the table MAEX with the segment data
    CALL FUNCTION 'MAEX_SAVE'
      EXPORTING
        flgmaex_exi       = w_flgmaex
        matnr             = w_matnr "W_E1MARAM-MATNR
        aland             = w_z1maexm-aland
      TABLES
        vmaex             = t_maex1
      EXCEPTIONS
        maex_delete_error = 1
        maex_insert_error = 2
        OTHERS            = 3.

    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

ENDCASE.

Regards,

Prabhduas

Read only

0 Likes
4,340

Hi,

Again after writing the code and Break-point..



Goto->t-code-->SMOD-->MGV00001 Material master-->componenets-->Activate other wise it will not trigger
 
 Exit- EXIT_SAPLMV02_002 


Regards,

Prabhudas

Read only

0 Likes
4,340

In my senario the segment has many entries in table.The issue is each time the entry is appende to table and control moves out of user exit and then comes in again ,the table is flushed with earlier seg value.Pleasee suggest how can i get entire table inside user exit.

What am trying to say is that,am passing table through idoc_data to function module but it takes only one record inside the user exit.Please help.

Edited by: sanu debu on Apr 17, 2009 5:39 PM

Read only

0 Likes
4,340

Hi,

After populating the internal table in the above sample code you need to loop at the internal table and pass all the records top idoc_data table. hope this will solve the problem

Thanks,

Ravi

Read only

0 Likes
4,340
  

LOOP AT it_edidd INTO idoc_data.             "By using this you can get all the records..
      CASE idoc_data-segnam.          
        WHEN 'Z1PROCORD'.              "Read segment under this
      ENDCASE.
    ENDLOOP.
Read only

0 Likes
4,340

how will i get this it_edidd table into user exit.Please guide.

Read only

0 Likes
4,340

Hi,

In the FM it is written

LOOP AT T_EDIDD INTO IDOC_DATA.

ENDLOOP.

so use same ..in the user exit..

Read only

0 Likes
4,340

i can fing d user exit as-

IMPORTING

*" VALUE(MESSAGE_TYPE) LIKE EDIDC-MESTYP

*" VALUE(F_CUST_SEGMENT) LIKE EDIDD STRUCTURE EDIDD

*" TABLES

*" RES_FIELDS STRUCTURE DELFIELDS

*" CHANGING

*" VALUE(F_MARA_UEB) LIKE MARA_UEB STRUCTURE MARA_UEB

*" OPTIONAL

*" VALUE(F_MAKT_UEB) LIKE MAKT_UEB STRUCTURE MAKT_UEB

*" OPTIONAL

*" VALUE(F_MARC_UEB) LIKE MARC_UEB STRUCTURE MARC_UEB

*" OPTIONAL

*" VALUE(F_MARD_UEB) LIKE MARD_UEB STRUCTURE MARD_UEB

*" OPTIONAL

*" VALUE(F_MFHM_UEB) LIKE MFHM_UEB STRUCTURE MFHM_UEB

*" OPTIONAL

*" VALUE(F_MPGD_UEB) LIKE MPGD_UEB STRUCTURE MPGD_UEB

*" OPTIONAL

*" VALUE(F_MPOP_UEB) LIKE MPOP_UEB STRUCTURE MPOP_UEB

*" OPTIONAL

*" VALUE(F_MPRW_UEB) LIKE MPRW_UEB STRUCTURE MPRW_UEB

*" OPTIONAL

*" VALUE(F_MVEG_UEB) LIKE MVEG_UEB STRUCTURE MVEG_UEB

*" OPTIONAL

*" VALUE(F_MVEU_UEB) LIKE MVEU_UEB STRUCTURE MVEU_UEB

*" OPTIONAL

*" VALUE(F_MARM_UEB) LIKE MARM_UEB STRUCTURE MARM_UEB

*" OPTIONAL

*" VALUE(F_MEAN_UEB) LIKE MEA1_UEB STRUCTURE MEA1_UEB

*" OPTIONAL

*" VALUE(F_MBEW_UEB) LIKE MBEW_UEB STRUCTURE MBEW_UEB

*" OPTIONAL

*" VALUE(F_MLGN_UEB) LIKE MLGN_UEB STRUCTURE MLGN_UEB

*" OPTIONAL

*" VALUE(F_MVKE_UEB) LIKE MVKE_UEB STRUCTURE MVKE_UEB

*" OPTIONAL

*" VALUE(F_MLGT_UEB) LIKE MLGT_UEB STRUCTURE MLGT_UEB

*" OPTIONAL

*" EXCEPTIONS

*" APPLICATION_ERROR

*"----


The table you told is not visible(T-Edidd)

Read only

0 Likes
4,340

Yes..

can you let me know in which segmnet or which field you wan to modify ..

so i can send the code

Read only

0 Likes
4,340

The fields i want to upload are Classification fields and inspection lot fields.

Classification fields-

SMBEZ

AUSP1

CLASS

STDCL

KLART

Inspection setup fields-

ART

KURZTEXT

APA

AKTIV

PPL

INSMK

APP

MER

STICHPRVER

HPZ

DYN

AVE

EIN

QKZVERF

CHG

EWFORM

MGFORM.

Read only

0 Likes
4,340

hi prabhu,

iam facing the same problem,,

here in exit i put a break point but iam unable to see when this is triggering