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

move data to internal table

Former Member
0 Likes
427

hi all,

 {size:12}
I am having a internal table like this

prueflos       merknr	probenr	Original_input
L1	         10	       1	           0.8
L1	         10	       2	           0.9
L1	         20 	       1	           0.88

L1	         30	       1	            0.44

I want it in another internal table like this


prueflos	probenr	Qc_c (if merkrn 10)	Qc_s (if merknr 20)	Qc_ni (if merknr 30)
L1	1	0.8	0.88        0.44
L1	2		0.9	


if merknr is '10' the value of original_input should assigned to Qc_c and if merknr is '20' the value to be assigned to Qc_s & if '30' assinged to Qc_ni respectively.

how?

to Qc_c

3 REPLIES 3
Read only

Former Member
0 Likes
410

Hi...

in one loop move corresponding(only default fields)

and also check if values are 10..20..30 and den accordingly move the corresponding fields

regards

vivek

Read only

Former Member
0 Likes
410

Hi, Try this

LOOP AT ITAB INTO WA_TAB.

IF WA_TAB-MERKNR = 10.

WA_TAB1-PRUEFLOS = WA_TAB-PRUEFLOS.

WA_TAB1-PROBENR = WA_TAB-PROBENR.

WA_TAB1-QC_C = WA_TAB-ORIGINAL_INPUT.

ELSEIF WA_TAB-MERKNR = 20.

WA_TAB1-PRUEFLOS = WA_TAB-PRUEFLOS.

WA_TAB1-PROBENR = WA_TAB-PROBENR.

WA_TAB1-QC_S = WA_TAB-ORIGINAL_INPUT.

ELSEIF WA_TAB-MERKNR = 30.

WA_TAB1-PRUEFLOS = WA_TAB-PRUEFLOS.

WA_TAB1-PROBENR = WA_TAB-PROBENR.

WA_TAB1-QC_NI = WA_TAB-ORIGINAL_INPUT.

APPEND WA_TAB1 TO I_TAB1.

CLEAR: WA_TAB1, WA_TAB.

ENDLOOP.

Regards,

Viji.

Read only

Former Member
0 Likes
410

Try this.

Itab is first intrnal table and temp_tab is intrnal table in which u want to insert data in required format

Sort itab by prueflos probenr merknr.

loop at itab into wa.

on change of probenr.

append temp to temp_tab.

endon.

temp-prueflos = wa-prueflos.

temp-probenr = wa-probenr.

case merknr.

when '10'

temp-Qc_c = wa-original_input.

when '20'.

temp-Qc_S = wa-original_input.

.

.

.

.

.

.

.so on

endcase.

enloop.