<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: me_process_po_cust~process_header/  Determine Line being Processed? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-po-cust-process-header-determine-line-being-processed/m-p/8292837#M1634942</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do have logic in process_item as well. When I was finally able to figure out how to call it from the process_header the methods within it were abending with "NULL Object". So, I opted to use Process_Header. I am assuming when I called it, I didn't pass it enough information to it. Below are the first two methods that I use in process_item that do not wrk when calling it from process_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the correct way to call process_item from process_header? And what needs to be passed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Thank-You.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IN PROCESS_ITEM&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;call method im_item-&amp;gt;get_previous_data
    importing
      ex_data = ex_prev_data
    exceptions
      no_data = 1.

*get item data
  call method im_item-&amp;gt;get_data
    receiving
      re_data = lw_item.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Tom Matys on Oct 11, 2011 2:04 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Oct 2011 18:03:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-10-11T18:03:52Z</dc:date>
    <item>
      <title>me_process_po_cust~process_header/  Determine Line being Processed?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-po-cust-process-header-determine-line-being-processed/m-p/8292835#M1634940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code I have implemented below is working fine toi retrieve all of the PO header, line item, and accounting information. In the PROCESS_HEADER METHOD. For this particular scenario the logic only breaks into the PROCESS_HEADER method. This data is needed to compare to the line item that is being processed/.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I tell tell which line item is trying to be changed (or processed) at the time,so I have something to compare my data to below? Or a method to call that will check what these values were in the Purchase requisition? get_exkn? not sure how to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;METHOD if_ex_me_process_po_cust~process_header.
 
  DATA: rzcl_im_4ppi_glpo4 TYPE REF TO zcl_im_4ppi_glpo4.
  DATA : lt_items      TYPE purchase_order_items.
  DATA : ls_mepoheader TYPE mepoheader.
  DATA: ls_item       TYPE purchase_order_items.
  DATA: zcl_po        TYPE REF TO cl_po_header_handle_mm.
  DATA: ls_items      TYPE purchase_order_item.
  DATA: lt_mepoitem   TYPE STANDARD TABLE OF mepoitem.
  DATA: ls_mepoitem   TYPE mepoitem.
  DATA: lt_accounting TYPE purchase_order_accountings.
  DATA: ls_accounting TYPE purchase_order_accounting.
  DATA: lt_mepoacct   TYPE STANDARD TABLE OF mepoaccounting.
  DATA: ls_mepoacct   TYPE mepoaccounting.
 
*create the class instance from P.O. class interface
  CREATE OBJECT rzcl_im_4ppi_glpo4.
*get header and item data
  ls_mepoheader = im_header-&amp;gt;get_data( ).
*  ls_item       = im_header-&amp;gt;get_items( ).
 
*created a second instance from cl_po_header_handle_mm
  CREATE OBJECT zcl_po
    EXPORTING
      im_po_number = ls_mepoheader-ebeln.
 
*--------------------------------------------------**
* Extract PO Item Information **
*--------------------------------------------------**
  REFRESH : lt_items.
  lt_items = zcl_po-&amp;gt;if_purchase_order_mm~get_items( ).
  LOOP AT lt_items INTO ls_items.
    ls_mepoitem = ls_items-item-&amp;gt;get_data( ).
    APPEND ls_mepoitem TO lt_mepoitem.
  ENDLOOP.
 
* --------------------------------------------------**
** Extract PO Account Assignments
** --------------------------------------------------**
  REFRESH : lt_accounting.
  lt_accounting = ls_items-item-&amp;gt;get_accountings( ).
  LOOP AT lt_accounting INTO ls_accounting.
    ls_mepoacct = ls_accounting-accounting-&amp;gt;get_data( ).
    APPEND ls_mepoacct TO lt_mepoacct.
  ENDLOOP.
 
ENDMETHOD.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Tom Matys on Oct 11, 2011 1:37 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 17:36:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-po-cust-process-header-determine-line-being-processed/m-p/8292835#M1634940</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-11T17:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: me_process_po_cust~process_header/  Determine Line being Processed?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-po-cust-process-header-determine-line-being-processed/m-p/8292836#M1634941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't know which Item is being processed in the PROCESS_HEADER as Header BADI is being called with all items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to know which Item is being processed in your logic, you should move it to PROCESS_ITEM or CHECK.  CHECK gets triggered before saving.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 17:56:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-po-cust-process-header-determine-line-being-processed/m-p/8292836#M1634941</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2011-10-11T17:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: me_process_po_cust~process_header/  Determine Line being Processed?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-po-cust-process-header-determine-line-being-processed/m-p/8292837#M1634942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do have logic in process_item as well. When I was finally able to figure out how to call it from the process_header the methods within it were abending with "NULL Object". So, I opted to use Process_Header. I am assuming when I called it, I didn't pass it enough information to it. Below are the first two methods that I use in process_item that do not wrk when calling it from process_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the correct way to call process_item from process_header? And what needs to be passed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Thank-You.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IN PROCESS_ITEM&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;call method im_item-&amp;gt;get_previous_data
    importing
      ex_data = ex_prev_data
    exceptions
      no_data = 1.

*get item data
  call method im_item-&amp;gt;get_data
    receiving
      re_data = lw_item.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Tom Matys on Oct 11, 2011 2:04 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 18:03:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-po-cust-process-header-determine-line-being-processed/m-p/8292837#M1634942</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-11T18:03:52Z</dc:date>
    </item>
  </channel>
</rss>

