Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- ole
- 스마트폼
- Java
- 가계부
- 오라클 함수
- Enhancement
- 머니플랜
- EUC-kr
- function
- KOSA
- UTF-8
- 이명박
- ALV
- 방화벽
- 동적 쿼리
- fi
- sapa
- 엑소버드
- selection screen
- SAP
- FI 용어정리
- EXIT
- List box
- alv 정형화
- ABAP
- Smart Forms
- Standard Function
- gimp
- 유닉스
- badi
Archives
- Today
- Total
Drunken Lion
loop at ... -> M1 본문
CLASS c1 DEFINITION.
PUBLIC SECTION.
METHODS M1 IMPORTING NAME TYPE S_CARRNAME
RETURNING VALUE(CARR) TYPE S_CARR_ID.
ENDCLASS.
CLASS c1 IMPLEMENTATION.
METHOD M1.
SELECT CARRID UP TO 1 ROWS
FROM SCARR
INTO CARR
WHERE CARRNAME = NAME.
ENDSELECT.
ENDMETHOD.
ENDCLASS.
DATA: JTAB TYPE STANDARD TABLE OF SPFLI,
LINE TYPE SPFLI.
DATA: OREF TYPE REF TO C1.
START-OF-SELECTION.
SELECT * FROM SPFLI INTO TABLE JTAB.
CREATE OBJECT oref TYPE c1.
LOOP AT JTAB INTO LINE
WHERE CARRID = OREF-> M1( 'Lufthansa' ).
WRITE: / LINE-CARRID, LINE-CONNID,
LINE-CITYFROM, LINE-CITYTO.
ENDLOOP.
PUBLIC SECTION.
METHODS M1 IMPORTING NAME TYPE S_CARRNAME
RETURNING VALUE(CARR) TYPE S_CARR_ID.
ENDCLASS.
CLASS c1 IMPLEMENTATION.
METHOD M1.
SELECT CARRID UP TO 1 ROWS
FROM SCARR
INTO CARR
WHERE CARRNAME = NAME.
ENDSELECT.
ENDMETHOD.
ENDCLASS.
DATA: JTAB TYPE STANDARD TABLE OF SPFLI,
LINE TYPE SPFLI.
DATA: OREF TYPE REF TO C1.
START-OF-SELECTION.
SELECT * FROM SPFLI INTO TABLE JTAB.
CREATE OBJECT oref TYPE c1.
LOOP AT JTAB INTO LINE
WHERE CARRID = OREF-> M1( 'Lufthansa' ).
WRITE: / LINE-CARRID, LINE-CONNID,
LINE-CITYFROM, LINE-CITYTO.
ENDLOOP.
The actual paraemters are passed to the IMPORTING parameters of the method as described under variants 2 and 3 of the CALL METHOD statement.
If the line type of the internal table contains object reference variables as components, or the entire line type is a reference variable, you can use the attributes of the object to which the reference in a line is pointing as the first field in a comparison.
loop 돌리면서 Parameter 를 이용해 call method 를 실행 할 수도 있다!
'SAP > ABAP' 카테고리의 다른 글
문자열 자를 때 자르는 위치에 2BYTE문자가 있는지를 체크하는 방법입니다. (0) | 2007.12.14 |
---|---|
질문:bseg테이블에 있는 wbs code값을 어떻게 가져올수있나요? (0) | 2007.11.22 |
List Box 만들기 (0) | 2007.11.09 |
Smart Forms (0) | 2007.11.08 |
효과적인 ABAP/4 프로그램 작성기법 (0) | 2007.11.08 |