*&---------------------------------------------------------------------*
*& Include ZLOCAL_TEST0008_FORM
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form select_header
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM select_header .
CLEAR gr_input1. REFRESH gr_input1.
CLEAR gr_input2. REFRESH gr_input2.
CLEAR gr_input3. REFRESH gr_input3.
CLEAR gr_input4. REFRESH gr_input4.
CLEAR gr_input5. REFRESH gr_input5.
CLEAR gr_input6. REFRESH gr_input6.
CLEAR gr_input7. REFRESH gr_input7.
CLEAR gr_input8. REFRESH gr_input8.
CLEAR gr_input9. REFRESH gr_input9.
IF gv_input1 NE space.
gr_input1-sign = 'I'.
gr_input1-option = 'EQ'.
gr_input1-low = gv_input1.
gr_input1-high = space.
APPEND gr_input1. CLEAR gr_input1.
ENDIF.
IF gv_input2 NE space.
gr_input2-sign = 'I'.
gr_input2-option = 'EQ'.
gr_input2-low = gv_input2.
gr_input2-high = space.
APPEND gr_input2. CLEAR gr_input2.
ENDIF.
IF gv_input3 NE space.
gr_input3-sign = 'I'.
gr_input3-option = 'EQ'.
gr_input3-low = gv_input3.
gr_input3-high = space.
APPEND gr_input3. CLEAR gr_input3.
ENDIF.
IF gv_input4 NE space.
gr_input4-sign = 'I'.
gr_input4-option = 'EQ'.
gr_input4-low = gv_input4.
gr_input4-high = space.
APPEND gr_input4. CLEAR gr_input4.
ENDIF.
IF gv_input5 NE space.
gr_input5-sign = 'I'.
gr_input5-option = 'EQ'.
gr_input5-low = gv_input5.
gr_input5-high = space.
APPEND gr_input5. CLEAR gr_input5.
ENDIF.
IF gv_input6 NE space.
gr_input6-sign = 'I'.
gr_input6-option = 'EQ'.
gr_input6-low = gv_input6.
gr_input6-high = space.
APPEND gr_input6. CLEAR gr_input6.
ENDIF.
IF gv_input7 NE space.
gr_input7-sign = 'I'.
gr_input7-option = 'EQ'.
gr_input7-low = gv_input7.
gr_input7-high = space.
APPEND gr_input7. CLEAR gr_input7.
ENDIF.
IF gv_input8 NE space.
gr_input8-sign = 'I'.
gr_input8-option = 'EQ'.
gr_input8-low = gv_input8.
gr_input8-high = space.
APPEND gr_input8. CLEAR gr_input8.
ENDIF.
IF gv_input9 NE space.
gr_input9-sign = 'I'.
gr_input9-option = 'EQ'.
gr_input9-low = gv_input9.
gr_input9-high = space.
APPEND gr_input9. CLEAR gr_input9.
ENDIF.
CLEAR : gt_header. REFRESH : gt_header.
CLEAR : gs_header.
SELECT zh~z_vbeln AS vbeln ---->여기부터에러
zi~z_posnr AS posnr
zh~z_werks AS werks
zp~z_name1 AS name1
zc~z_kunnr AS kunnr
zc~z_name1 AS name2
zi~z_lfimg AS lfimg
zi~z_netwr AS netwr
zh~z_erdat AS erdat
FROM zheader AS zh INNER JOIN zitem AS zi
ON zh~mandt EQ zi~mandt
AND zh~z_vbeln EQ zi~z_vbeln
INNER JOIN zplant AS zp
ON zh~mandt EQ zp~mandt
AND zh~z_werks EQ zp~z_werks
INNER JOIN zcustomer AS zc
ON zh~mandt EQ zc~mandt
AND zh~z_kunnr EQ zc~z_kunnr
INTO CORRESPONDING FIELDS OF TABLE gt_header
WHERE zheader-z_vbeln IN gr_input1
zitem-z_posnr IN gr_input2
zheader-z_werks IN gr_input3
zplnat-z_name1 IN gr_input4
zheader-z_kunnr IN gr_input5
zcustomer-z_name1 IN gr_input6
zitem-z_lfimg IN gr_input7
zitem-z_netwr IN gr_input8
zheader-z_erdat IN gr_input9,
ENDFORM.
온라인 공부중에요 여러 테이블을 선언해서 스크린에 띄울려고 하는데요. 자꾸 에러가 납니다. ㅠㅠ
고수님들 어떤 문장이 문제인지 좀 알려주세요. ㅠㅠ
댓글 7
-
鵬의 날개
2007.11.23 20:32
-
지의
2007.11.23 20:46
날개님 말처럼 where 에는 조건 절이 추가 될 때마다 and 또는 or 로 연결해줍니다.
즉 쿼리 부분에 조건절에 where f1 in gr_field
and f2 ...
이 필요합니다.
수고하세요.
-
rain
2007.11.23 20:49
날개님 지의님 감사합니다.
-
SAP폐인
2007.11.23 21:52
어우 라인수가 많네요... if~endif부분은 매크로 돌리셔도 될것 같은데요..
-
bd
2007.11.23 21:58
sap페인님께 질문 드림니다. 위에 로직으로 메크로 로직 부탁 드려도 될까요???
매크로 관련 로직을 제대로 이해 하지 못해서요,,..
-
지의
2007.11.23 22:03
쿼리 부분 빼고는 전부 매크로로 돌리면 좋을 것도 같군요..
화면이 깔끔해질테니.. 하지만 항간에는 퍼포먼스 안 좋다는 말도 있던데요..
어떨까요?
-
GG
2007.11.24 06:10
오라클 SQL 문 부터 공부하세요..
where 에 and 로 결합하세요