Application Development 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: 

Quantity field to be shown on 1ST line only for purchase order items in ALV

Former Member
0 Kudos

Dear All,

I am fetching data from purchase order history table (EKBE) where PO line items contains multiple times. User does not want to view fields that are repeating multiple times in all lines, but in the top line. By sorting the same in ALV , I can do the same with character type fields, but how to do the same with quantity fields. One way out is converting the same into character fields. Is there any other way. Please give me some solution. Also while sorting , the number which gets repeated (i.e Items in PO for different PO's ) does not gets displayed. I want my program to display them.

Thanks,

Debopriyo Mallick

1 ACCEPTED SOLUTION

former_member184657
Active Contributor
0 Kudos

Try this

loop at ist_mseg into wa_mseg.

  ON CHANGE OF wa_mseg-con.

    move '111' to wa_mseg-con1.
    modify ist_mseg from wa_mseg.

  ENDON.
endloop.

loop at ist_mseg into wa_mseg.
  if wa_mseg-con1 ne '111'.
    move 0 to wa_mseg-menge.
    move 0 to wa_mseg-netpr.
  endif.
  modify ist_mseg from wa_mseg.
endloop.

mseg-con is the concatenation of ebeln and ebelp values.

pk

2 REPLIES 2

former_member184657
Active Contributor
0 Kudos

Try this

loop at ist_mseg into wa_mseg.

  ON CHANGE OF wa_mseg-con.

    move '111' to wa_mseg-con1.
    modify ist_mseg from wa_mseg.

  ENDON.
endloop.

loop at ist_mseg into wa_mseg.
  if wa_mseg-con1 ne '111'.
    move 0 to wa_mseg-menge.
    move 0 to wa_mseg-netpr.
  endif.
  modify ist_mseg from wa_mseg.
endloop.

mseg-con is the concatenation of ebeln and ebelp values.

pk

former_member770121
Participant
0 Kudos

you should use:

on change of (filed name).

write select query under on change event

select quantity from .... etc.

endon.

it will give write output because we always require the qunatity one time in against each PO

SO JUST WRITE SELECT QUERY UNDER CHANGE ON EVENT

.