Skip to Content

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

Internal table data from one columns data into two columns

hi friends,

how to split one column data to two columns.

here in one column i have docment numbers i.e material doc and invoice document nos. so i want to split as material doc into material doc columns and invoice document no into invoice columns. here transaction type event for material doc is '1' and transaction type event for invoice doc is '2' .

So here material doc's are greater than or less than the invoice doc's numbers .I what basis i can split the records from one columns to two columns from an internal table.

internal table data:

po item transaction_event document

100000 1 1 560000001

100000 1 1 560000002

100000 1 2 620000004

100000 1 2 620000006

100000 1 2 620000007

so i want these into final table : itab as

po item mat_doc inv_doc

100000 1 560000001 620000004

100000 1 560000002 620000006

100000 1 620000007

Former Member
Former Member replied

Hi Prasad,

Declare one more internal table it_final_temp with all the fields fields.

sort it_final on material doc number.

Loop at it_final into wa_final.

v_tabix = sy_tabix + 1.

Read table it_final into wa_final1 index tabix.

if wa_final-mat_doc = wa_final1-mat_doc.

move: < required fields of wa_final and wa_final1 into wa_final_temp>.

Append wa_final_temp to it_final_temp.


move only fields of wa_final to wa_final_temp.

Append wa_final_temp to It_final_temp.





0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question