Application Development and Automation 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: 
Read only

Request for Code for a report

Former Member
0 Likes
392

Dear Abapers,

Can anyone help in writing the report(code) to just display Purchase Orders without the Purchase Requisition Numbers.

Thanx,

Suruchi

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
374

This sample program will fetch purchase orders/line items for POs entered in the select-options that do not have a corresponding purchase req.




report zrich_0003 no standard page heading.

data: begin of itab occurs 0,
      ebeln type ekko-ebeln,
      ebelp type ekpo-ebelp,
      matnr type ekpo-matnr,
      txz01 type ekpo-txz01,
      menge type ekpo-menge,
      meins type ekpo-meins,
      end of itab.

select-options: s_ebeln for itab-ebeln.

start-of-selection.

  select * into corresponding fields of table itab
         from ekko
             inner join ekpo
                on ekko~ebeln = ekpo~ebeln
<b>                         where ekko~ebeln in s_ebeln
                           and ekpo~banfn = space.</b>


  loop at itab.

    write:/ itab-ebeln, itab-ebelp, itab-matnr,
            itab-txz01, itab-menge, itab-meins.

  endloop.

Please remember to award points for helpful answers. Thanks.

Regards,

Rich Heilman

Message was edited by: Rich Heilman

2 REPLIES 2
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
375

This sample program will fetch purchase orders/line items for POs entered in the select-options that do not have a corresponding purchase req.




report zrich_0003 no standard page heading.

data: begin of itab occurs 0,
      ebeln type ekko-ebeln,
      ebelp type ekpo-ebelp,
      matnr type ekpo-matnr,
      txz01 type ekpo-txz01,
      menge type ekpo-menge,
      meins type ekpo-meins,
      end of itab.

select-options: s_ebeln for itab-ebeln.

start-of-selection.

  select * into corresponding fields of table itab
         from ekko
             inner join ekpo
                on ekko~ebeln = ekpo~ebeln
<b>                         where ekko~ebeln in s_ebeln
                           and ekpo~banfn = space.</b>


  loop at itab.

    write:/ itab-ebeln, itab-ebelp, itab-matnr,
            itab-txz01, itab-menge, itab-meins.

  endloop.

Please remember to award points for helpful answers. Thanks.

Regards,

Rich Heilman

Message was edited by: Rich Heilman

Read only

0 Likes
374

<b>Please close your other post regarding the same</b>. Here is a small change to Rich's program, since you wanted only POs that don't refer to a requisition.


report zrich_0003 no standard page heading.
 
data: begin of itab occurs 0,
      ebeln type ekko-ebeln,
      ebelp type ekpo-ebelp,
      matnr type ekpo-matnr,
      txz01 type ekpo-txz01,
      menge type ekpo-menge,
      meins type ekpo-meins,
      end of itab.
 
select-options: s_ebeln for itab-ebeln.
 
start-of-selection.
 
  select * into corresponding fields of table itab
         from ekko
             inner join ekpo
                on ekko~ebeln = ekpo~ebeln
                         where ekko~ebeln in s_ebeln
                           <b>and ekpo~banfn = space</b>.<-- change
 
 
  loop at itab.
 
    write:/ itab-ebeln, itab-ebelp, itab-matnr,
            itab-txz01, itab-menge, itab-meins.
 
  endloop.