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: 

How will i show the out put based on diffrent category in single column in ALV Report.

Former Member
0 Kudos

Hi, In ALV report I have to show the out put like for categore 'c' I have show 'j' document no and for 'T' I have to shoe' H' document no. in  a single column how will I show that please share ur knowledge.. Find the bellow attachment... Thanks Abhay Manna.

1 ACCEPTED SOLUTION

arivazhagan_sivasamy
Active Contributor
0 Kudos

Hi Abhay,

You can achieve thro conditions.

If category = 'C'.

docno = 'J document'.

elseif category = 'T'.

docno = 'H docment'.

endif.

Arivazhagan S

8 REPLIES 8

arivazhagan_sivasamy
Active Contributor
0 Kudos

Hi Abhay,

You can achieve thro conditions.

If category = 'C'.

docno = 'J document'.

elseif category = 'T'.

docno = 'H docment'.

endif.

Arivazhagan S

0 Kudos

THanks for shairing your knowledge...

Former Member
0 Kudos

Hi Abhay ,

Use condition like --

loop at it_vbfa.

if vbtyp_n = 'C' and vbtyp_v = 'J' .

add line to output table.

elseif  vbtyp_n = 'T' and vbtyp_v = 'H'.

add line to output table.

endloop .   

GirieshM
Active Contributor
0 Kudos

Hi Abhay,

It will be better if you give your scenario with examples.

With Regards,

Giriesh M

Former Member
0 Kudos

Hello Experts,

My requirement is modification in existing report, from VBFA table I have to show VBELV in report as extra column, in report I am already getting value of VBELN, but requirement is like based on 'vbtyp_n' and 'vbtyp_v' both I have to show the VBELV in a single column and vbtyp_n and vbtyp_v is not any where in the report,and also if 'vbtyp_v' = c then it should fetch

'vbtyp_n' = j category type VBELV and also when 'vbtyp_v' = H then it should fetch 'vbtyp_n' = T category type VBELV. both the type of VBELV I have to show in single column.

Please share your knowledge.

find the attachment which I already attach before.

Thanks

Abhay Manna.  

0 Kudos

Hi Abhay,

In the output data table say it_data, I assume you will be having the field vbelv, vbtyp_n, vbtyp_v.

Option 1.

First you will get the records in it_data from vbfa table.

loop at it_data into wa_data.

   if wa_data-vbtyp_n = 'J' and wa_data-vbtyp_v = 'C'.

* Do nothing 

   elseif wa_data-vbtyp_n = 'T' and wa_data-vbtyp_v = 'H'.

* Do nothing 

   else.

       delete it_data index sy-tabix.

   endif.

  clear wa_data.

endloop.

Now you will have only the required data in your output table.

Option 2

Or you can do the filtering when you are selecting the records from the database table itself.

Use the following select statement.

Select * from vbfa into table i_vbfa where vbtyp_n = 'J' and vbtyp_v = 'C' or vbtyp_n = 'T' and vbtyp_v = 'H'.


You may also want to delete adjacent duplicates after getting the data if you want to get rid of repeating vbelv.


sort i_vbfa by vbelv.
delete ADJACENT DUPLICATES FROM i_vbfa COMPARING vbelv.

0 Kudos

Thanks Experts,

My problem solved.

Former Member
0 Kudos

Hi Abhay,

If you observe your screen shot! You are looking to identify the subsequent document number for the sales order. Position ( item number ) is important to identify the correct delivery also.

for example: for one sales order you have raised the quantity 100. but this quantity can be delivery in the multiple deliveries.

it is very important how the current program is getting the order number or delivery number? please share some more information or selects?