메뉴 건너뛰기

SAP 한국 커뮤니티

How to read same field from D.Base into two fields of ITAB

sapjoy 2006.12.12 21:16 조회 수 : 3690 추천:44

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.

번호 제목 글쓴이 날짜 조회 수
107 sap 메뉴에서 표준 매뉴 전환 [1] selection장 2013.09.13 9448
106 TYPE-1 프로그램에서 실행버튼 없애기 [1] 아밥뽀 2013.09.23 9116
105 SAP GUI 730 ALV Grid 느림 현상(해결방법) [3] Dave 2013.09.27 8884
104 debug 시 문장 skip 요령 [36] 하마대왕 2013.10.04 6880
103 SAP 버퍼를 다시 설정하는 방법 Wise 멘토 2013.10.04 7490
102 TRY와 SQL [2] sapjoy 2013.12.05 5851
101 인터널 테이블 라인수 lines [8] sapjoy 2014.01.20 17272
100 숫자입력 체크(Numeric character check) [1] 양키(이경환) 2014.01.28 19636
99 자주 사용되는 String 조작 명령어 [4] 양키(이경환) 2014.01.28 3879
98 인터널 테이블의 사이즈의 의미 [4] 양키(이경환) 2014.02.12 5503
97 Progress Bar 표기 로직 [1] 양키(이경환) 2014.02.13 3600
96 Search Help 띄우기전 컬럼 정렬방법 양키(이경환) 2014.02.16 4687
95 GUI_DOWNLOAD 펑션(메소드) 사용시 Leading Zero현상 해결방법 [3] 양키(이경환) 2014.02.17 6880
94 전기기간 및 회계기간 오픈(MMPV, ob52) [4] sapjoy 2014.02.20 8209
93 User Parameter 조회 펑션 [3] 양키(이경환) 2014.03.04 3178
92 FTP File Tranfer 샘플 소스 [1] 양키(이경환) 2014.03.04 5014
91 SE16N 테이블 변경가능 모드로 전환하는방법 [8] 양키(이경환) 2014.03.12 10463
90 Email 전송 Sample [6] 양키(이경환) 2014.03.12 6787
89 report to PDF file 아밥뽀 2014.03.18 4707
88 ABAP Example sapjoy 2014.03.24 7109