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: 

Badi ME_PROCESS_REQ_CUST Method SET_DATA not updating table

amrendra_tiwari
Explorer
0 Kudos

Hi Experts,

 

I am facing difficulty while trying to change BLCKD value on Purchase Requisition creation/change. In debugger value is getting changed but database table is not updating.

I have checked much thread but not found anything suitable.

Please help me on this.

 

Regards,

Amrendra

Below code is written on the methods PROCESS_ITEM, POST and CHECK.

------------------------------------------------------------------

DATA: I_ITEMS TYPE MMPUR_REQUISITION_ITEMS,
        WA_ITEM
LIKE LINE OF I_ITEMS,
        LV_IF_ITEM
TYPE REF TO IF_PURCHASE_REQUISITION_ITEM,
        LT_ITM_DATA
TYPE MEREQ_ITEM,
        LX_ITM_DATA
TYPE MEREQ_ITEMX.

 
CALL METHOD IM_HEADER->GET_ITEMS
    RECEIVING
      RE_ITEMS = I_ITEMS.


 
LOOP AT I_ITEMS INTO WA_ITEM.

      LV_IF_ITEM = WA_ITEM-ITEM.

     
CALL METHOD LV_IF_ITEM->GET_DATA
        RECEIVING
          RE_DATA = LT_ITM_DATA.

     
CALL METHOD LV_IF_ITEM->GET_DATAX
        RECEIVING
          RE_DATAX = LX_ITM_DATA.

     
IF LT_ITM_DATA-FRGGR IS INITIAL. " If release code is not available


        LX_ITM_DATA-BLCKD =
'X'.

       
CALL METHOD LV_IF_ITEM->SET_DATAX
         
EXPORTING
            IM_DATAX = LX_ITM_DATA.

        LT_ITM_DATA-BLCKD =
'1'.

       
CALL METHOD LV_IF_ITEM->SET_DATA
         
EXPORTING
            IM_DATA = LT_ITM_DATA.

    ENDIF.
  ENDLOOP.

----------------------------------------------------

8 REPLIES 8

Former Member
0 Kudos

hello,

Try your code in PROCESS_ITEM since the field is in Item line. Also the SET_DATAX needs to be called after SET_DATA.

Let me know if this helps.

best regards,

swanand

0 Kudos

Thanks Swanand,

But as I mentioned in first line that the code is already written in PROCESS_ITEM and tried with both the sequence of SET_DATA and SET_DATAX.

In debugger mode I can see that its updating the field value, but out of it, its not passing the updated value to the screen field somehow.

Can't find that point where its getting replaced by old value again.

0 Kudos

Hi Tiwari ,

Has this issue resolved for you ? Kindly share what are the steps you followed as I am facing the same issue.

Thanks,

G.Gowri Sankar

0 Kudos

Hi, Gowri, May I know if you have resolved this issue. I am also facing the same one. Please get me out of this issue as I got stuck

0 Kudos

Hi,

Did you solve this issue? We are also facing same problem. We are trying to update custom field.

looks like we need to enhance structure MEREQ_ITEM_S_CUST_ALLOWED. Only fields of this structure are updated via SET method.

 

rajpal_sehrawat
Explorer
0 Kudos

Hi,

Did you solve this issue? We are also facing same problem. We are trying to update custom field.

looks like we need to enhance structure MEREQ_ITEM_S_CUST_ALLOWED. Only fields of this structure are updated via SET method.

thanks

0 Kudos

Aren't CI_EBANDB and CI_EBANMEM already included in MEREQ_ITEM_S_CUST_ALLOWED, did you already read KBA 2542694 - Field changed via BAdi ME_PROCESS_REQ_CUST or user exits EXIT_SAPLMEREQ_* not saved 

rajpal_sehrawat
Explorer
0 Kudos

Hi,

Did you solve this issue? We are also facing same problem. We are trying to update custom field.

looks like we need to enhance structure MEREQ_ITEM_S_CUST_ALLOWED. Only fields of this structure are updated via SET method.