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

Multiple entries in the same row.

Former Member
0 Likes
2,580

Hi all,

I have a requirement wherein i have to display some columns in my output table.

These all values are fetched froma single table MSEG

Among them one of the column is material number and other is unit of entry.

For the same material number there clould be multiple entries conataining different

unit of entry. I want all these entries in single row for the same material number.

Is it possible by using field symbol or any other way.

Please respond as soon as possible.

Thanks in advance.

Hi all,

I have a requirement wherein i have to display some columns in my output table.

These all values are fetched froma single table MSEG

Among them one of the column is material number and other is unit of entry.

For the same material number there clould be multiple entries conataining different

unit of entry. I want all these entries in single row for the same material number.

Is it possible by using field symbol or any other way.

Please respond as soon as possible.

Thanks in advance.

10 REPLIES 10
Read only

Former Member
0 Likes
1,740

Hi,

Sort the internal table by MATNR.

Looping through the internal table, Use the control break statements AT NEW Matnr. you can write the same material number and different unit of entry in one row.

Regards

Sravan

Read only

0 Likes
1,740

Could you provide me a sample code for the same.

I don't know how to use the control break statement.

Read only

0 Likes
1,740

Hi, Sumit

The Sample code for the Control Break Statement is as follow,

loop at it1_eobi_ded into wa_it1_eobi_ded.
 
    at new year.
      check_year = 'X'.
      clear wa_year_total.
    endat.
 
    if check_year = 'X'.
      clear check_year.
    else.
      wa_it1_eobi_ded-year = ''.
    endif.
 
    add: wa_it1_eobi_ded-p_staff to wa_year_total-p_staff,
         wa_it1_eobi_ded-p_ded to wa_year_total-p_ded,
         wa_it1_eobi_ded-dw_staff to wa_year_total-dw_staff,
         wa_it1_eobi_ded-dw_ded to wa_year_total-dw_ded,
         wa_it1_eobi_ded-total_ded to wa_year_total-total_ded.
 
    append wa_it1_eobi_ded to it2_eobi_ded.
 
    at end of year.
      wa_year_total-month_name = 'Year T'.
      append wa_year_total to it2_eobi_ded.
    endat.
 
    at last.
      sum.
      wa_it1_eobi_ded-month_name = 'Grand T'.
      append wa_it1_eobi_ded to it2_eobi_ded.
    endat.
 
  endloop.

Please Replay if you need more help regarding Control Break Statement.

Kind Regards,

Faisal.

Read only

Former Member
0 Likes
1,740

check this thread on dynamic columns

or u can append all ur entries in a string and display

Edited by: kartik tarla on Jan 5, 2009 10:37 PM

Read only

Former Member
0 Likes
1,740

Hi,

If you want to display each unit of entry then you need to use Field Symbols or if you need to display it in one column separated by comma or colon etc the you can use Control break statement. As there could be different number of line items in each Material Document and not static.

Thanks,

Prashanth

Read only

0 Likes
1,740

Hi Prashanth,

I need this in the ALV format.

As of now I have completed in the most crude manner,

but still I want to know it for further use.

If you could provide me with some sample code it

would be a great help

Thanks.

Sumit

Read only

0 Likes
1,740

Hi,

can you give me the output layout i.e your ALV Report Structure, with one example record so i can see how could it be done as i have also not done it earlier but could help you with the logic or code if possible.

Thanks,

Prashanth

Read only

0 Likes
1,740

create an internal table of type tline and append ur all entries which u want in a single row to that internal table. like itab-tdlines = field1 + field2 .......

then dispaly it

Read only

0 Likes
1,740

Hi Prashanth,

I have got the sample code I was looking for through the answers of others.

In anycase your answer provided me with some help though its not the same

logic that I have used.

Thanks anyways.

Read only

Former Member
0 Likes
1,740

Sumit,

This can be done something like this.

Create an internal table with first filed as MATNR.


data : begin of itab occurs 0,
matnr like mseg-matnr,
uom like mseg-meins,
end of itab.
data : uom_str(100).
Then sort the itab - sort itab by matnr uom.

loop at itab.
concatenate uom_str itab-uom into uom_str.
at end of matnr.
write : /iatb-matnr,uom_str.
endat.
clear uom_str.

endloop.

Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 2:23 PM