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

Internal table issue

Former Member
0 Likes
501

Hi All,

I have an internal table itab1 and in this I have the po numbers, now I need to maintain another internal table that will have the details of the PO's that are stored in itab2 such as material no, price, line item no. and po number.

so can you please tell me how to do this.

data: begin of it_tab2 occurs 0,

ebeln like ekko-ebeln,

end of it_tab2

Thanks

Rajeev

Message was edited by:

Rajeev Gupta

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
486

Hi,

Please try somthing like this.


data: begin of it_tab2 occurs 0,
        ebeln like ekpo-ebeln,
        ebelp like ekpo-ebelp,
        matnr like ekpo-matnr,
        netpr like ekpo-netpr.
data: end of it_tab2.

loop at it_tab1.
  select ebeln ebelp matnr netpr
  into (ekpo-ebeln, ekpo-ebelp, ekpo-matnr, ekpo-netpr)
  from ekpo
  where ebeln = it_tab1-ebeln.

    it_tab2-ebeln = ekpo-ebeln.
    it_tab2-ebelp = ekpo-ebelp.
    it_tab2-matnr = ekpo-matnr.
    it_tab2-netpr = ekpo-netpr.
    append it_tab2.

  endselect.
endloop.

Regards,

Ferry Lianto

5 REPLIES 5
Read only

Former Member
0 Likes
486

You'll have to add the material number to the second table and then retrieve the material number form EKPO.

Rob

Read only

0 Likes
486

Hi Rob,

Thanks for the reply,

But what I need is to retrieve the information of PO's in an internal table, so basically if in itab2 PO # is 12345, then I need to get the materials associated with that PO (12345), item no. and price of the materials in the PO in the other internal table.

If you get my point ...please try to explain in detail.

Thanks

Rajeev

Read only

0 Likes
486

Like I said - it's in EKPO.

Rob

Read only

ferry_lianto
Active Contributor
0 Likes
487

Hi,

Please try somthing like this.


data: begin of it_tab2 occurs 0,
        ebeln like ekpo-ebeln,
        ebelp like ekpo-ebelp,
        matnr like ekpo-matnr,
        netpr like ekpo-netpr.
data: end of it_tab2.

loop at it_tab1.
  select ebeln ebelp matnr netpr
  into (ekpo-ebeln, ekpo-ebelp, ekpo-matnr, ekpo-netpr)
  from ekpo
  where ebeln = it_tab1-ebeln.

    it_tab2-ebeln = ekpo-ebeln.
    it_tab2-ebelp = ekpo-ebelp.
    it_tab2-matnr = ekpo-matnr.
    it_tab2-netpr = ekpo-netpr.
    append it_tab2.

  endselect.
endloop.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
486

Hi,

Give the first select to select all PO Numbers from EKKO and store them in internal table I_EKKO

Then to get the details:

SELECT EBELN EBELP NETPR

FROM EKPO

INTO TABLE I_EKPO

FOR ALL ENTRIES IN I_EKKO

WHERE EBELN = EKKO-EBELN.

Hope it helps,

Reward if it is useful.

Thanks,

Srinivasa Rada