<?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: get data with module function BAPI_PO_GETDETA in odata service. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-module-function-bapi-po-getdeta-in-odata-service/m-p/12604749#M2011279</link>
    <description>&lt;P&gt;You should use TYPES to declare your data type, not DATA.&lt;/P&gt;&lt;P&gt;DATA is used to declare variables...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES:
    BEGIN OF ty_po_item,
      ebeln TYPE eben,
      ebelp TYPE ebelp,
*     ...
    END OF ty_po_item.
TYPES: tt_po_item TYPE STANDARD TABLE OF ty_po_item.

DATA:
  lt_po_item TYPE tt_po_item,
  ls_po_item TYPE ty_po_item.

* OR

DATA:
  lt_po_item TYPE STANDARD TABLE OF ty_po_item.


* Process internal table
LOOP AT lt_po_item INTO ls_po_item.
  WRITE:/ ls_po_item-ebeln, ls_po_item-ebelp.
ENDLOOP.

* OR with inline declaration
LOOP AT lt_po_item INTO DATA(s_po_item).
  WRITE:/ s_po_item-ebeln, s_po_item-ebelp.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You should practice this in order to write good code.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Sep 2022 17:41:55 GMT</pubDate>
    <dc:creator>thkolz</dc:creator>
    <dc:date>2022-09-14T17:41:55Z</dc:date>
    <item>
      <title>get data with module function BAPI_PO_GETDETA in odata service.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-module-function-bapi-po-getdeta-in-odata-service/m-p/12604747#M2011277</link>
      <description>&lt;P&gt;I'm trying to pick up the value from a field which is in a table line. But I cannot access it because my table has no header line.&lt;/P&gt;
  &lt;P&gt;error =====&amp;gt; tables with headers are no longer supported in the oo context .&lt;/P&gt;
  &lt;P&gt;any solution pls.&lt;/P&gt;
  &lt;P&gt; I have the following code:&lt;/P&gt;
  &lt;P&gt; method ZPOSTS_STRUCTURE_GET_ENTITY.&lt;BR /&gt;**TRY.&lt;BR /&gt;*CALL METHOD SUPER-&amp;gt;ZPOSTS_STRUCTURE_GET_ENTITY&lt;BR /&gt;* EXPORTING&lt;BR /&gt;* IV_ENTITY_NAME =&lt;BR /&gt;* IV_ENTITY_SET_NAME =&lt;BR /&gt;* IV_SOURCE_NAME =&lt;BR /&gt;* IT_KEY_TAB =&lt;BR /&gt;** IO_REQUEST_OBJECT =&lt;BR /&gt;** IO_TECH_REQUEST_CONTEXT =&lt;BR /&gt;* IT_NAVIGATION_PATH =&lt;BR /&gt;** IMPORTING&lt;BR /&gt;** ER_ENTITY =&lt;BR /&gt;** ES_RESPONSE_CONTEXT =&lt;BR /&gt;* .&lt;BR /&gt;** CATCH /IWBEP/CX_MGW_BUSI_EXCEPTION .&lt;BR /&gt;** CATCH /IWBEP/CX_MGW_TECH_EXCEPTION .&lt;BR /&gt;**ENDTRY.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; "-----------------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Data: BEGIN OF t_itab1,&lt;BR /&gt;po_number TYPE ebeln,&lt;BR /&gt;po_item TYPE ebelp,&lt;BR /&gt;short_text TYPE txz01,&lt;BR /&gt;material TYPE matnr,&lt;BR /&gt;co_code TYPE bukrs,&lt;BR /&gt;plant TYPE ewerk,&lt;BR /&gt;store_loc type lgort_d,&lt;BR /&gt;mat_grp TYPE matkl,&lt;BR /&gt;target_qty TYPE ktmng,&lt;BR /&gt;net_price TYPE bpreibapi,&lt;BR /&gt;net_value TYPE nwertbapi,&lt;BR /&gt;END OF t_itab1,&lt;BR /&gt;"tt_itab LIKE TABLE OF ts_itab,&lt;BR /&gt;"wa_itab LIKE LINE OF tt_itab.&lt;BR /&gt;&lt;BR /&gt;i_itab1 LIKE TABLE OF t_itab1,&lt;BR /&gt;wa_itab1 LIKE LINE OF i_itab1.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; " data: po_itemsd type standard table of t_itab1.&lt;BR /&gt;&lt;BR /&gt;"parameters: p_ebeln type ekko-ebeln.&lt;BR /&gt;DATA: wa_key LIKE LINE OF it_key_tab,&lt;BR /&gt; lv_PO_NUMBER type ZPOSTS_STRUCTURE-PO_NUMBER,&lt;BR /&gt; wa_itab TYPE ZPOSTS_STRUCTURE.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; READ TABLE it_key_tab INTO wa_key WITH KEY name = 'PO_NUMBER'.&lt;BR /&gt; IF sy-subrc = 0.&lt;BR /&gt; lv_PO_NUMBER = wa_key-value.&lt;BR /&gt; ENDIF.&lt;BR /&gt;call function 'BAPI_PO_GETDETAIL'&lt;BR /&gt; exporting&lt;BR /&gt; purchaseorder = lv_PO_NUMBER&lt;BR /&gt; ITEMS = 'X'&lt;BR /&gt;* ACCOUNT_ASSIGNMENT = ' '&lt;BR /&gt;* SCHEDULES = ' '&lt;BR /&gt;* HISTORY = ' '&lt;BR /&gt;* ITEM_TEXTS = ' '&lt;BR /&gt;* HEADER_TEXTS = ' '&lt;BR /&gt;* SERVICES = ' '&lt;BR /&gt;* CONFIRMATIONS = ' '&lt;BR /&gt;* SERVICE_TEXTS = ' '&lt;BR /&gt;* EXTENSIONS = ' '&lt;BR /&gt;* IMPORTING&lt;BR /&gt;* PO_HEADER =&lt;BR /&gt;* PO_ADDRESS =&lt;BR /&gt; tables&lt;BR /&gt;* PO_HEADER_TEXTS =&lt;BR /&gt; po_items = i_itab1&lt;BR /&gt;* PO_ITEM_ACCOUNT_ASSIGNMENT =&lt;BR /&gt;* PO_ITEM_SCHEDULES =&lt;BR /&gt;* PO_ITEM_CONFIRMATIONS =&lt;BR /&gt;* PO_ITEM_TEXTS =&lt;BR /&gt;* PO_ITEM_HISTORY =&lt;BR /&gt;* PO_ITEM_HISTORY_TOTALS =&lt;BR /&gt;* PO_ITEM_LIMITS =&lt;BR /&gt;* PO_ITEM_CONTRACT_LIMITS =&lt;BR /&gt;* PO_ITEM_SERVICES =&lt;BR /&gt;* PO_ITEM_SRV_ACCASS_VALUES =&lt;BR /&gt;* RETURN =&lt;BR /&gt;* PO_SERVICES_TEXTS =&lt;BR /&gt;* EXTENSIONOUT =&lt;BR /&gt; .&lt;BR /&gt;"INSERT INTO scarr VALUES scarr_wa.&lt;BR /&gt;check sy-subrc = 0.&lt;BR /&gt;"move : wa_itab-PO_NUMBER TO po_itemsd-PO_NUMBER.&lt;BR /&gt;append wa_itab-po_number to i_itab1.&lt;BR /&gt;"write :i_itab1-po_number.&lt;BR /&gt; "wa_itab-PO_ITEM ER_ENTITY-SHORT_TEXT ER_ENTITY-MATERIAL ER_ENTITY-CO_CODE ER_ENTITY-PLANT&lt;BR /&gt; "ER_ENTITY-STORE_LOC&lt;BR /&gt;"ER_ENTITY-STORE_LOC ER_ENTITY-TARGET_QTY ER_ENTITY-NET_PRICE ER_ENTITY-NET_VALUE&lt;BR /&gt;&lt;BR /&gt;"VALUES po_items-PO_NUMBER po_items-PO_ITEM po_items-SHORT_TEXT po_items-MATERIAL po_items-CO_CODE po_items-PLANT&lt;BR /&gt; " po_items-STORE_LOC po_items-MAT_GRP po_items-TARGET_QTY po_items-NET_PRICE po_items-NET_VALUE.&lt;BR /&gt;&lt;BR /&gt; "po_items-MATERIAL,&lt;BR /&gt;ENDMETHOD.&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;Regards,&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 16:31:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-module-function-bapi-po-getdeta-in-odata-service/m-p/12604747#M2011277</guid>
      <dc:creator>trabelsioussa</dc:creator>
      <dc:date>2022-09-14T16:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: get data with module function BAPI_PO_GETDETA in odata service.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-module-function-bapi-po-getdeta-in-odata-service/m-p/12604748#M2011278</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Data: lt_poitems TYPE STANDARD TABLE OF bapiekpo.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Sep 2022 17:32:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-module-function-bapi-po-getdeta-in-odata-service/m-p/12604748#M2011278</guid>
      <dc:creator>thkolz</dc:creator>
      <dc:date>2022-09-14T17:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: get data with module function BAPI_PO_GETDETA in odata service.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-module-function-bapi-po-getdeta-in-odata-service/m-p/12604749#M2011279</link>
      <description>&lt;P&gt;You should use TYPES to declare your data type, not DATA.&lt;/P&gt;&lt;P&gt;DATA is used to declare variables...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES:
    BEGIN OF ty_po_item,
      ebeln TYPE eben,
      ebelp TYPE ebelp,
*     ...
    END OF ty_po_item.
TYPES: tt_po_item TYPE STANDARD TABLE OF ty_po_item.

DATA:
  lt_po_item TYPE tt_po_item,
  ls_po_item TYPE ty_po_item.

* OR

DATA:
  lt_po_item TYPE STANDARD TABLE OF ty_po_item.


* Process internal table
LOOP AT lt_po_item INTO ls_po_item.
  WRITE:/ ls_po_item-ebeln, ls_po_item-ebelp.
ENDLOOP.

* OR with inline declaration
LOOP AT lt_po_item INTO DATA(s_po_item).
  WRITE:/ s_po_item-ebeln, s_po_item-ebelp.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You should practice this in order to write good code.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 17:41:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-module-function-bapi-po-getdeta-in-odata-service/m-p/12604749#M2011279</guid>
      <dc:creator>thkolz</dc:creator>
      <dc:date>2022-09-14T17:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: get data with module function BAPI_PO_GETDETA in odata service.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-module-function-bapi-po-getdeta-in-odata-service/m-p/12604750#M2011280</link>
      <description>&lt;P&gt;See also &lt;A href="https://answers.sap.com/questions/4096951/bapipogetdetail-sample-code.html" target="test_blank"&gt;https://answers.sap.com/questions/4096951/bapipogetdetail-sample-code.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 18:05:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-module-function-bapi-po-getdeta-in-odata-service/m-p/12604750#M2011280</guid>
      <dc:creator>thkolz</dc:creator>
      <dc:date>2022-09-14T18:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: get data with module function BAPI_PO_GETDETA in odata service.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-module-function-bapi-po-getdeta-in-odata-service/m-p/12604751#M2011281</link>
      <description>&lt;P&gt;thanks for response but i have other error ==&amp;gt; call of the function bapi_po_getdetail failed; a field should be assigned to the parameter PO_ITEMS - THE TYPES match, but not t .&lt;/P&gt;&lt;P&gt;do you have any idea how solve this error&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 13:57:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-module-function-bapi-po-getdeta-in-odata-service/m-p/12604751#M2011281</guid>
      <dc:creator>trabelsioussa</dc:creator>
      <dc:date>2022-09-15T13:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: get data with module function BAPI_PO_GETDETA in odata service.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-module-function-bapi-po-getdeta-in-odata-service/m-p/12604752#M2011282</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;c12b61ded10b4e18beae75c3b6218d2c&lt;/SPAN&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 13:58:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-module-function-bapi-po-getdeta-in-odata-service/m-p/12604752#M2011282</guid>
      <dc:creator>trabelsioussa</dc:creator>
      <dc:date>2022-09-15T13:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: get data with module function BAPI_PO_GETDETA in odata service.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-module-function-bapi-po-getdeta-in-odata-service/m-p/12604753#M2011283</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;REPORT ztest.&lt;BR /&gt;&lt;BR /&gt;PARAMETERS:&lt;BR /&gt;  p_ebeln TYPE ebeln DEFAULT '1234567890'.&lt;BR /&gt;&lt;BR /&gt; DATA:&lt;BR /&gt;  ls_po_header TYPE bapimepoheader,&lt;BR /&gt;  lt_po_item TYPE bapimepoitem_tp,&lt;BR /&gt;  lt_return TYPE bapiret2_t.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;  CALL FUNCTION 'BAPI_PO_GETDETAIL1'&lt;BR /&gt;    EXPORTING&lt;BR /&gt;      purchaseorder      = p_ebeln&lt;BR /&gt;    IMPORTING&lt;BR /&gt;      poheader           = ls_po_header&lt;BR /&gt;    TABLES&lt;BR /&gt;      return             = lt_return&lt;BR /&gt;      poitem             = lt_po_item.&lt;BR /&gt;&lt;BR /&gt;  LOOP AT lt_po_item INTO DATA(s_po_item).&lt;BR /&gt;    WRITE:/ s_po_item-po_item, s_po_item-short_text, s_po_item-material, s_po_item-quantity, s_po_item-po_unit.&lt;BR /&gt;  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Sep 2022 14:16:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-with-module-function-bapi-po-getdeta-in-odata-service/m-p/12604753#M2011283</guid>
      <dc:creator>thkolz</dc:creator>
      <dc:date>2022-09-15T14:16:51Z</dc:date>
    </item>
  </channel>
</rss>

