01-23-2013 10:15 AM
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
01-23-2013 10:48 AM
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
01-23-2013 10:58 AM
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.
01-23-2013 11:01 AM
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.
01-23-2013 11:48 AM
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
01-24-2013 9:57 AM
hi tushar
yes my requiremnt is to change the material description in PR only.
01-23-2013 12:05 PM
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.
01-24-2013 10:01 AM
i tried this
but this is giving run time error:Field symbol has not yet been assigned.
07-16-2014 12:25 PM
Hi Gaurav,
I have the exact same problem.
Did u find any solution to this ??
Pls let me know.
Regards,
Vishal .
07-21-2014 8:15 AM
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