<?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: select join query in AMDP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-query-in-amdp/m-p/12192584#M1980902</link>
    <description>&lt;P&gt;Hi Satish Kumar,&lt;/P&gt;&lt;P&gt;Thanks for your response, but this is not the answer which I am expecting here. &lt;/P&gt;</description>
    <pubDate>Fri, 26 Jun 2020 06:03:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2020-06-26T06:03:49Z</dc:date>
    <item>
      <title>select join query in AMDP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-query-in-amdp/m-p/12192582#M1980900</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
  &lt;P&gt; Can anyone help me to fix below query.&lt;/P&gt;
  &lt;P&gt;I am working on AMDP and I need to write a select query in AMDP using select join condition so I can get filtered values in internal table. Below is the code which I have written in old abap program. Please let me know how we can convert same code in AMDP. &lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;select vbeln, posnr, parvw, kunnr from vbrp into table @data(lt_vbrp1) 
for all entries in lt_itab 
where vbeln = lt_itab-aubel and posnr = lt_itab-aupos and parvw = 'WE'.


*-- get values from Header (here header values are stored on 000000 line item)
select vbeln, posnr, parvw, kunnr from vbrp into table @data(lt_vbrp2) for all entries in lt_itab
where vbeln = lt_itab-aubel and posnr = '000000' and parvw = 'WE'.

sort lt_vbrp1 by vbeln posnr.
sort lt_vbrp2 by vbeln posnr.

loop at lt_itab into data(ls_itab).
read table lt_vbrp1 into data(ls_vbrp) with key vbeln = ls_itab-aubel posnr = ls_itab-aupos binary search.
if sy-subrc eq 0.
* append data to itab_final.
else.
read table lt_vbrp2 into ls_vbrp with key vbeln = ls_itab-aubel posnr = '000000' binary search.
* append data to itab_final.
endif.

clear ls_vbrp.
endloop.


&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Thanks in Advance.&lt;/P&gt;
  &lt;P&gt;-- Vijendra&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 01:11:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-query-in-amdp/m-p/12192582#M1980900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-06-23T01:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: select join query in AMDP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-query-in-amdp/m-p/12192583#M1980901</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;vijendra07&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;To Answer your question you must have an understanding of AMDP methods first which will help in understanding the solution part.&lt;/P&gt;&lt;P&gt;Not all part of your code can be converted into AMDP, You have to understand and get to decide which part of the Logic should you push into the AMDP and which part you would like to handle at ABAP editor.&lt;/P&gt;&lt;P&gt;To be clear on the all the above concepts its imperative that you understand the concepts first and then you yourself would be able to reach the solution part.&lt;/P&gt;&lt;P&gt;To start with:&lt;/P&gt;&lt;P&gt;1) Understand the theoretical part of AMDP.&lt;/P&gt;&lt;P&gt;2) Start following simple examples.&lt;/P&gt;&lt;P&gt;3) Start coding few exercises.&lt;/P&gt;&lt;P&gt;There are lot of articles on the same in the FORUM, you can try searching.&lt;/P&gt;&lt;P&gt;All the Best!!&lt;/P&gt;&lt;P&gt;Cheers! &lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 04:32:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-query-in-amdp/m-p/12192583#M1980901</guid>
      <dc:creator>former_member1716</dc:creator>
      <dc:date>2020-06-23T04:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: select join query in AMDP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-query-in-amdp/m-p/12192584#M1980902</link>
      <description>&lt;P&gt;Hi Satish Kumar,&lt;/P&gt;&lt;P&gt;Thanks for your response, but this is not the answer which I am expecting here. &lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 06:03:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-query-in-amdp/m-p/12192584#M1980902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-06-26T06:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: select join query in AMDP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-query-in-amdp/m-p/12192585#M1980903</link>
      <description>&lt;P&gt;Hello  &lt;SPAN class="mention-scrubbed"&gt;vijendra07&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;First of all, VBRP table does not contain PARVW field. Did you mean VBPA?&lt;/P&gt;&lt;P&gt;Here's an idea, assuming you did mean VBPA and you're providing LT_ITAB as a parameter to the AMDP .&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT 
  CASE WHEN b~vbeln IS NOT NULL THEN b~vbeln ELSE c~vbeln END AS vbeln,
  CASE WHEN b~posnr IS NOT NULL THEN b~posnr ELSE c~posnr END AS posnr,
  CASE WHEN b~parvw IS NOT NULL THEN b~parvw ELSE c~parvw END AS parvw,
  CASE WHEN b~kunnr IS NOT NULL THEN b~kunnr ELSE c~kunnr END AS kunnr
  FROM :it_itab AS a
  LEFT OUTER JOIN vbpa AS b
    ON b~vbeln = a~aubel
    AND b~posnr = a~aupos
    AND parvw = 'WE'
  LEFT OUTER JOIN vbpa AS c
    ON b~vbeln = a~aubel
    AND b~posnr = 0
    AND parvw = 'WE'
  WHERE ( b~parvw IS NOT NULL OR ( b~parvw IS NULL and c~parvw IS NOT NULL ) ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Kind regards,&lt;/P&gt;Mateusz</description>
      <pubDate>Fri, 26 Jun 2020 07:26:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-join-query-in-amdp/m-p/12192585#M1980903</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-06-26T07:26:45Z</dc:date>
    </item>
  </channel>
</rss>

