Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Hi

hi i m using fm 'ALSM_EXCEL_TO_INTERNAL_TABLE'

i am getting data in the format

ROW COL VALUE

0001 0001 178

0001 0002 12

0001 0003 PAC1

0001 0004 DESC

0001 0005 DIV1

0002 0001 178

0002 0002 15

0002 0003 PAC2

0002 0004 DESC

0002 0005 DIV2

and want to convert that data in internal table in this format

178 12 PAC1 DESC DIV1

178 15 PAC2 DESC DIV2

Thanks

Tags:
Former Member
replied

The following psuedo code logic should help you:

Say the table returned from the FM is called l_it_data.

Define a table with your required colulmns:

begin of l_it_result

col1,

col2,

col3,

col4,

col5,

end of l_it_result

sort l_it_data by ROW.

loop at l_it_data into l_wa_data.

case l_wa_data-col.

when '0001'

l_wa_result-col1 = l_wa_data-value.

when '0002'

l_wa_result-col2 = l_wa_data-value.

when '0003'

l_wa_result-col3 = l_wa_data-value.

when '0004'

l_wa_result-col4 = l_wa_data-value.

when '0005'

l_wa_result-col5 = l_wa_data-value.

endcase.

at end of row.

append l_wa_result to l_it_result.

endat.

endloop.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question