Skip to Content
author's profile photo Former Member
Former Member

Purchase requisition- Mat. description problem.

Hi Experts,

I am stuck with one problem regarding Purchase requisition material description. The scenario is as follows.

We have two types of PR creation. With or without material code.

Material description is set to display only. But if the user enters the material code and random description and then press Enter button then the system doesnt pick the description from MAKT and keep the random description and disabling it for input. As shown in below screen shot.

I want to restrict this, So I used the enhancement - MEREQ001 in CMOD and exit - EXIT_SAPLMEREQ_010 and INCLUDE ZXM02U12 , to compare the material description and change it to master data from table MAKT. But the problem here is the original PR data fetched in to the exit is not changing. I have written below code.

+++++++++++++++++++++++++++++++++++++++++++++

LOOP AT im_t_eban INTO l_s_eban.

IF l_s_eban-matnr <> ''.

SELECT SINGLE maktx FROM makt INTO mde

WHERE matnr = l_s_eban-matnr.

IF mde <> l_s_eban-txz01 .

MESSAGE w007(zm_msg) . " DISPLAY LIKE 'E'.

l_s_eban-txz01 = mde.

MODIFY im_t_eban FROM l_s_eban TRANSPORTING txz01. " THIS LINE IS GIVING SYNTAX ERROR THAT im_t_eban is not changeable

ENDIF.

ENDIF.

ENDLOOP.

++++++++++++++++++++++++++++++++++++++


So how to solve this problem??

Or is there any other way to restrict the user to change the material description ??



Thanks,

Vishal .


1.jpg (101.6 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Jul 16, 2014 at 11:37 AM

    Hi Vishal -

    Can you check the BADI - ME_PROCESS_REQ_CUST, Method- PROCESS_ITEM

    Sample Code -

    DATA: lw_req_item TYPE mereq_item,

    lv_maktx TYPE maktx.


    CLEAR: lw_req_item ,lv_maktx,lv.

    IF im_item IS NOT INITIAL.
    CALL METHOD im_item->get_data
    RECEIVING
    re_data = lw_req_item.
    ENDIF.
    IF lw_req_item IS NOT INITIAL.
    CLEAR lv_maktx.
    SELECT SINGLE maktx FROM makt
    INTO lv_maktx
    WHERE matnr = lw_req_item-matnr
    AND spras = sy-langu.
    IF ( lv_maktx IS NOT INITIAL AND lw_req_item-txz01 IS NOT INITIAL ).
    TRANSLATE lv_maktx TO LOWER CASE.
    TRANSLATE lw_req_item-txz01 TO LOWER CASE.
    IF lw_req_item-txz01 NE lv_maktx.
    * Error Handling if any

    * OR you set the value here

    lw_req_item-txz01 = lv_maktx

    CALL METHOD im_item->set_data
    EXPORTING
    im_data = lw_req_item.

    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 16, 2014 at 09:06 AM

    Hello Vishal.

    Did you try reading the screen field (Short Text) value using DYNP_VALUES_READ?

    Regards.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 16, 2014 at 09:59 AM

    Hi Vishal,

    If you couldn't found any suitable exits, you can do this using implicit enhancement.

    So that you can directly access all variable available at the position where implementing.

    Regards

    Sreekanth

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 16, 2014 at 10:04 AM

    hello abaper,

    have a look on this

    Hi Gaurav, try this:

    http://scn.sap.com/thread/3297154

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.