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: 

MM-Purchase requisition User Exit-MEREQ001,want to modify material description

Former Member
0 Kudos

Hi

i am trying to change the material description of Purchase requisiton in user exit.

i tried this code.but it gives me run time  error:field symbol not yet assigned.

table:im_t_eban is in import parameter of user exit.MEREQ001.

FM:EXIT_SAPLMEREQ_010

FIELD-SYMBOLS: <T_EBAN> type mereq_t_eban.

FIELD-SYMBOLS: <im_t_eban> type mereq_t_eban.

DATA: wa_eban LIKE eban.

""'ASSIGN ('(SAPLMEREQ)LT_EBAN[]') to  <T_EBAN> .

LOOP AT <im_t_eban> INTO wa_eban.

* => here you can change the value

   SELECT SINGLE matnr maktx into (mcode,mdesc)

         FROM makt

         WHERE matnr = wa_eban-matnr.

     if sy-subrc = 0 .

     move mdesc to wa_eban-txz01.

   MODIFY <im_t_eban> from wa_eban TRANSPORTING txz01.

     ENDIF.

ENDLOOP.

regards

gaurav-pcl

9 REPLIES 9

Former Member
0 Kudos

Hi Gaurav,

Not sure why you are using the LOOP AT <im_t_eban> INTO wa_eban. Why you are using a field symbol and if it is used you are not assigning the table contents of table IM_T_EBAN to <IM_T_EBAN>.

Write : LOOP AT IM_T_EBAN INTO WA_EBAN.

If the problem still persists let me know.

Thanks,

Tooshar Bendale

0 Kudos

hi Tooshar

actually im_t_eban is type mereq_t_eban. and it is not permitting us to modify any record.so i try filed symbol.

the statement u have given is working but not permitting me to modify any record of this table:IM_T_EBAN.

0 Kudos

hi tushar

i tried this.but it gives me error:this table cannot be changed.

data: wa_im_t_eban like line of im_t_eban  .

* LOOP AT im_t_eban  INTO wa_im_t_eban .

*      IF sy-subrc = 0   .

*        SELECT SINGLE matnr maktx into (mcode,mdesc)

*        FROM makt

*        WHERE matnr = wa_im_t_eban-matnr.

*        move mdesc to wa_im_t_eban-txz01.

*        MODIFY im_t_eban FROM wa_im_t_eban TRANSPORTING txz01.

*      ENDIF.

*    endloop.

0 Kudos

Hi Gaurav,

The table IM_T_EBAN is the importing parameter in the user exit that you specified. So it cannot be changed. You can change varaibles present in changing, tables tab. You will not be able to use the enhacement to change the material description.

However just a quick question what is your requirement ? Do you want to change the material description only in purchase requisition ?

Thanks,

Tooshar Bendale

0 Kudos

hi tushar

yes my requiremnt is to change the material description in PR only.

Former Member
0 Kudos

Hi Gaurav, try this:

FIELD-SYMBOLS: <T_EBAN> type mereq_t_eban.

FIELD-SYMBOLS: <im_t_eban> type mereq_t_eban.

DATA: wa_eban LIKE eban.

ASSIGN ('(SAPLMEREQ)LT_EBAN[]') to  <T_EBAN> .   <-Uncommet this line

LOOP AT <im_t_eban> INTO wa_eban.

* => here you can change the value

   SELECT SINGLE matnr maktx into (mcode,mdesc)

         FROM makt

         WHERE matnr = wa_eban-matnr.

     if sy-subrc = 0 .

     move mdesc to wa_eban-txz01.

   MODIFY <T_EBAN> from wa_eban TRANSPORTING txz01.   <-Change the field-symbol for the one that is referencing the standard table

     ENDIF.

ENDLOOP.

0 Kudos

i tried this

but this is giving run time error:Field symbol has not yet been assigned.

0 Kudos

Hi Gaurav,

I have the exact same problem.

Did u find any solution to this ??

Pls let me know.

Regards,

Vishal .

Former Member
0 Kudos

Hi Gaurav,

I think you are not assigning the field symbol im_t_eban. first assign the field symbol and use it.

assign im_t_eban[] to <im_t_eban>.

Regards,


Shashikanth