Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9164

Re: Accessing all the line items of Purchase requisition(ME51N)

$
0
0

Hi Qingda Niu,

 

Thank you for the information. My requirement is while creating PR the user will enter the field 'Desired Vendor' in first line item only. When save it the same vendor number will be copied to the rest line item. I have written the below code, in debugger mode I checked the structure is updating and set_data is calling successfully. But the database table 'EBAN' is not being updated.

 

Here is the code.

 

DATA : ls_item  TYPE  mmpur_requisition_items,"mereq_item,

lw_item  TYPE mmpur_requisition_item,

pr_item  TYPE  REF TO if_purchase_requisition_item,

lv_lifnr    TYPE wlief,

ls_req_item TYPE mereq_item,

ls_datax      TYPE mereq_itemx.

 

     CALL METHOD im_header->get_items

*  EXPORTING

*    im_auth_check = MMPUR_NO

*    im_release_op = MMPUR_NO

     RECEIVING

       re_items      = ls_item

       .

   LOOP AT ls_item INTO lw_item.

     pr_item = lw_item-item.

     CALL METHOD pr_item->get_data

       RECEIVING

         re_data = ls_req_item.

 

     IF ls_req_item-lifnr IS NOT INITIAL.

       lv_lifnr = ls_req_item-lifnr.

     ELSE.

       ls_req_item-lifnr lv_lifnr.

 

       CALL METHOD pr_item->set_data

         EXPORTING

           im_data = ls_req_item.

 

       MOVE: 'X' TO ls_datax-lifnr,

             'X' TO ls_datax-lifnr.

       pr_item->set_datax( ls_datax ) .

       pr_item->set_datax( im_datax = ls_datax ).

     ENDIF.

   ENDLOOP.

 

Could you please tell me what I missed?

 

Regards,

Jitendra


Viewing all articles
Browse latest Browse all 9164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>