How to read same field from D.Base into two fields of ITAB
Can any one help in how can we read data into 2 fields(like VBELN, VBELN1) in internal table from data base table(VBAK) of one field(VBELN)?
EX:
data: begin of itab occurs 0,
vbeln like vbak-vbeln,
vbeln1 like vbak-vbeln,
end of itab.
For this how can we write select statement.
----------------------------------------------------------------------------------------
You can write select statment as follows,
select single vbeln vbeln from vbak
into (itab-vbeln, itab-vbeln1 )
where <condition>.
----------------------------------------------------------------------------------------
Try the following code:
tables vbak.
data: begin of itab occurs 0,
vbeln like vbak-vbeln,
vbeln1 like vbak-vbeln,
end of itab.
select vbeln vbeln from vbak into (itab-vbeln,itab-vbeln1) .
append itab.
endselect.
loop at itab.
write : / itab-vbeln, itab-vbeln1.
endloop.
----------------------------------------------------------------------------------------
One of the possible way, try this:
data: begin of itab1,
banfn1 like eban-banfn,
banfn2 like eban-banfn,
rest(800),
end of itab1.
select * into itab1 from eban.
itab1-banfn2 = itab1-banfn1.
write:/ 'banfn 1', itab1-banfn1, ' banfn 2', itab1-banfn2.
endselect.
----------------------------------------------------------------------------------------
This should be better:
TABLES vbak.
DATA: BEGIN OF itab OCCURS 0,
vbeln LIKE vbak-vbeln,
vbeln1 LIKE vbak-vbeln,
END OF itab.
SELECT vbeln vbeln FROM vbak INTO table itab.
LOOP AT itab.
WRITE : / itab-vbeln, itab-vbeln1.
ENDLOOP.
Can any one help in how can we read data into 2 fields(like VBELN, VBELN1) in internal table from data base table(VBAK) of one field(VBELN)?
EX:
data: begin of itab occurs 0,
vbeln like vbak-vbeln,
vbeln1 like vbak-vbeln,
end of itab.
For this how can we write select statement.
----------------------------------------------------------------------------------------
You can write select statment as follows,
select single vbeln vbeln from vbak
into (itab-vbeln, itab-vbeln1 )
where <condition>.
----------------------------------------------------------------------------------------
Try the following code:
tables vbak.
data: begin of itab occurs 0,
vbeln like vbak-vbeln,
vbeln1 like vbak-vbeln,
end of itab.
select vbeln vbeln from vbak into (itab-vbeln,itab-vbeln1) .
append itab.
endselect.
loop at itab.
write : / itab-vbeln, itab-vbeln1.
endloop.
----------------------------------------------------------------------------------------
One of the possible way, try this:
data: begin of itab1,
banfn1 like eban-banfn,
banfn2 like eban-banfn,
rest(800),
end of itab1.
select * into itab1 from eban.
itab1-banfn2 = itab1-banfn1.
write:/ 'banfn 1', itab1-banfn1, ' banfn 2', itab1-banfn2.
endselect.
----------------------------------------------------------------------------------------
This should be better:
TABLES vbak.
DATA: BEGIN OF itab OCCURS 0,
vbeln LIKE vbak-vbeln,
vbeln1 LIKE vbak-vbeln,
END OF itab.
SELECT vbeln vbeln FROM vbak INTO table itab.
LOOP AT itab.
WRITE : / itab-vbeln, itab-vbeln1.
ENDLOOP.
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
107 | 색상 정리 파일. [15] | 공백 | 2012.03.08 | 7974 |
106 | Internal Table 알아보기 [15] | 양키 | 2010.12.20 | 8002 |
105 | 요약파일1 [7] | 밤의화신 | 2013.09.11 | 8043 |
104 | Dynamic Internal Table [5] | sapjoy | 2007.02.11 | 8092 |
103 | BAPI_PO_CHANGE [1] | 노름마치 | 2009.09.03 | 8149 |
102 | <img src=b.gif>계속 남아있는 Debugger창 없에기(New Debugger)[추천:e-abap][추천:보나][추천:버미!] [14] | 해처리 | 2011.01.07 | 8171 |
101 | Number Range Object 변경/삭제 [4] | MadMax | 2010.12.07 | 8176 |
100 | Breakpoints 알아보기 [4] | 양키 | 2010.12.14 | 8177 |
99 | 전기기간 및 회계기간 오픈(MMPV, ob52) [4] | sapjoy | 2014.02.20 | 8238 |
98 | <img src=d.gif>테이블 Lock & UnLock function[추천:e-abap] [1] | 양키 | 2011.01.18 | 8271 |
97 | Area 메뉴 일괄 다운로드 하기 [5] | 고담 | 2011.06.15 | 8277 |
96 | ABAP에서 웹브라우져 호출 | 홍성현 | 2007.08.09 | 8331 |
95 | SELECTION-SCREEN [4] | sapjoy | 2007.01.23 | 8349 |
94 | ABAP 교육 [13] | 밤의화신 | 2013.09.11 | 8367 |
93 | 바피사용이유 [18] | 꿀단지 | 2011.10.11 | 8391 |
92 | SCN에서 인기있는 Tutorial강좌들 입니다. [1] | 양키 | 2013.08.12 | 8425 |
91 | SAP Factory Calendar | sapjoy | 2006.12.12 | 8493 |
90 | ABAP 교육 [13] | 밤의화신 | 2013.09.11 | 8496 |
89 | ABAP 교육 [32] | 밤의화신 | 2013.09.11 | 8500 |
88 | 시분초를 가져오는 구문 [8] | 양키 | 2011.05.26 | 8559 |